| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | - use WPDeveloper\BetterDocs\Utils\Helper; | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 3 | + | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | +use WPDeveloper\BetterDocs\Utils\Helper; | |
| 3 | 8 | |
| 4 | 9 | $posts = betterdocs()->query->get_posts( $query_args, true ); |
| 5 | 10 | |
| 6 | 11 | if ( ! $posts->have_posts() ) { |
| @@ -36,9 +41,10 @@ | ||
| 36 | 41 | |
| 37 | 42 | echo wp_sprintf( |
| 38 | 43 | '<li><a %1$s>%2$s</a></li>', |
| 39 | 44 | $_link_attributes, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 40 | - betterdocs()->template_helper->kses( get_the_title() ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 45 | + // Same per-item filter as category-list.php (API method badges etc.). | |
| 46 | + apply_filters( 'betterdocs_docs_list_item_title', betterdocs()->template_helper->kses( get_the_title() ), get_the_ID() ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 41 | 47 | ); |
| 42 | 48 | endwhile; |
| 43 | 49 | |
| 44 | 50 | wp_reset_postdata(); |