Twenty Twenty: Use duplicate hook references for `page_css_class` and `page_menu_link_attributes` filters in `TwentyTwenty_Walker_Page`.
See #48303. Built from https://develop.svn.wordpress.org/trunk@46828 git-svn-id: http://core.svn.wordpress.org/trunk@46628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6677070a13
commit
f11d28a779
|
@ -61,19 +61,7 @@ if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {
|
||||||
$css_class[] = 'current_page_parent';
|
$css_class[] = 'current_page_parent';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** This filter is documented in wp-includes/class-walker-page.php */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
|
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
|
||||||
$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
|
$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['href'] = get_permalink( $page->ID );
|
||||||
$atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';
|
$atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';
|
||||||
|
|
||||||
/**
|
/** This filter is documented in wp-includes/class-walker-page.php */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );
|
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );
|
||||||
|
|
||||||
$attributes = '';
|
$attributes = '';
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-46827';
|
$wp_version = '5.4-alpha-46828';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue