Twenty Twenty: Use duplicate hook references for page_css_class
and page_menu_link_attributes
filters in TwentyTwenty_Walker_Page
.
See #48303. git-svn-id: https://develop.svn.wordpress.org/trunk@46828 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ac6dc8aa0c
commit
8b0feef2fe
@ -61,19 +61,7 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {
|
||||
$css_class[] = 'current_page_parent';
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the list of CSS classes to include with each page item in the list.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @see wp_list_pages()
|
||||
*
|
||||
* @param string[] $css_class An array of CSS classes to be applied to each list item.
|
||||
* @param WP_Post $page Page data object.
|
||||
* @param int $depth Depth of page, used for padding.
|
||||
* @param array $args An array of arguments.
|
||||
* @param int $current_page ID of the current page.
|
||||
*/
|
||||
/** This filter is documented in wp-includes/class-walker-page.php */
|
||||
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
|
||||
$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
|
||||
|
||||
@ -89,22 +77,7 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {
|
||||
$atts['href'] = get_permalink( $page->ID );
|
||||
$atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';
|
||||
|
||||
/**
|
||||
* Filters the HTML attributes applied to a page menu item's anchor element.
|
||||
*
|
||||
* @since 4.8.0
|
||||
*
|
||||
* @param array $atts {
|
||||
* The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
|
||||
*
|
||||
* @type string $href The href attribute.
|
||||
* @type string $aria_current The aria-current attribute.
|
||||
* }
|
||||
* @param WP_Post $page Page data object.
|
||||
* @param int $depth Depth of page, used for padding.
|
||||
* @param array $args An array of arguments.
|
||||
* @param int $current_page ID of the current page.
|
||||
*/
|
||||
/** This filter is documented in wp-includes/class-walker-page.php */
|
||||
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );
|
||||
|
||||
$attributes = '';
|
||||
|
Loading…
Reference in New Issue
Block a user