Changeset 51779
- Timestamp:
- 09/09/2021 12:38:36 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-walker-category-checklist.php
r51739 r51779 62 62 * 63 63 * @since 2.5.1 64 * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. 64 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` 65 * to match parent class for PHP 8 named parameter support. 65 66 * 66 * @param string $output Used to append additional content (passed by reference).67 * @param WP_Term $data_object The current term object.68 * @param int $depth Depth of the term in reference to parents. Default 0.69 * @param array $args An array of arguments. @see wp_terms_checklist()70 * @param int $ id ID of the current term.67 * @param string $output Used to append additional content (passed by reference). 68 * @param WP_Term $data_object The current term object. 69 * @param int $depth Depth of the term in reference to parents. Default 0. 70 * @param array $args An array of arguments. @see wp_terms_checklist() 71 * @param int $current_object_id Optional. ID of the current term. Default 0. 71 72 */ 72 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $ id = 0 ) {73 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 73 74 // Restores the more descriptive, specific name for use within this method. 74 75 $category = $data_object; -
trunk/src/wp-admin/includes/class-walker-nav-menu-checklist.php
r51739 r51779 62 62 * 63 63 * @since 3.0.0 64 * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. 64 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` 65 * to match parent class for PHP 8 named parameter support. 65 66 * 66 67 * @global int $_nav_menu_placeholder 67 68 * @global int|string $nav_menu_selected_id 68 69 * 69 * @param string $output Used to append additional content (passed by reference).70 * @param WP_Post $data_object Menu item data object.71 * @param int $depth Depth of menu item. Used for padding.72 * @param stdClass $args Not used.73 * @param int $ id Not used.70 * @param string $output Used to append additional content (passed by reference). 71 * @param WP_Post $data_object Menu item data object. 72 * @param int $depth Depth of menu item. Used for padding. 73 * @param stdClass $args Not used. 74 * @param int $current_object_id Optional. ID of the current menu item. Default 0. 74 75 */ 75 public function start_el( &$output, $data_object, $depth = 0, $args = null, $ id = 0 ) {76 public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { 76 77 global $_nav_menu_placeholder, $nav_menu_selected_id; 77 78 -
trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php
r51739 r51779 47 47 * @see Walker_Nav_Menu::start_el() 48 48 * @since 3.0.0 49 * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. 49 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` 50 * to match parent class for PHP 8 named parameter support. 50 51 * 51 52 * @global int $_wp_nav_menu_max_depth 52 53 * 53 * @param string $output Used to append additional content (passed by reference).54 * @param WP_Post $data_object Menu item data object.55 * @param int $depth Depth of menu item. Used for padding.56 * @param stdClass $args Not used.57 * @param int $ id Not used.54 * @param string $output Used to append additional content (passed by reference). 55 * @param WP_Post $data_object Menu item data object. 56 * @param int $depth Depth of menu item. Used for padding. 57 * @param stdClass $args Not used. 58 * @param int $current_object_id Optional. ID of the current menu item. Default 0. 58 59 */ 59 public function start_el( &$output, $data_object, $depth = 0, $args = null, $ id = 0 ) {60 public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { 60 61 global $_wp_nav_menu_max_depth; 61 62 … … 242 243 * @since 5.4.0 243 244 * 244 * @param int $item_id Menu item ID.245 * @param WP_Post $menu_item Menu item data object.246 * @param int $depth Depth of menu item. Used for padding.247 * @param stdClass $args An object of menu item arguments.248 * @param int $ idNav menu ID.245 * @param int $item_id Menu item ID. 246 * @param WP_Post $menu_item Menu item data object. 247 * @param int $depth Depth of menu item. Used for padding. 248 * @param stdClass $args An object of menu item arguments. 249 * @param int $current_object_id Nav menu ID. 249 250 */ 250 do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $ id );251 do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id ); 251 252 ?> 252 253 -
trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php
r51739 r51779 21 21 * 22 22 * @since Twenty Twenty 1.0 23 * @since Twenty Twenty 1.9 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. 23 * @since Twenty Twenty 1.9 Renamed `$page` to `$data_object` and `$current_page` to `$current_object_id` 24 * to match parent class for PHP 8 named parameter support. 24 25 * 25 26 * @see Walker::start_el() 26 27 * 27 * @param string $output Used to append additional content. Passed by reference.28 * @param WP_Post $data_object Page data object.29 * @param int $depth Optional. Depth of page. Used for padding. Default 0.30 * @param array $args Optional. Array of arguments. Default empty array.31 * @param int $current_ page Optional. Page ID. Default 0.28 * @param string $output Used to append additional content. Passed by reference. 29 * @param WP_Post $data_object Page data object. 30 * @param int $depth Optional. Depth of page. Used for padding. Default 0. 31 * @param array $args Optional. Array of arguments. Default empty array. 32 * @param int $current_object_id Optional. ID of the current page. Default 0. 32 33 */ 33 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_ page= 0 ) {34 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 34 35 // Restores the more descriptive, specific name for use within this method. 35 $page = $data_object; 36 $page = $data_object; 37 $current_page_id = $current_object_id; 36 38 37 39 if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) { … … 54 56 } 55 57 56 if ( ! empty( $current_page ) ) {57 $_current_page = get_post( $current_page );58 if ( ! empty( $current_page_id ) ) { 59 $_current_page = get_post( $current_page_id ); 58 60 if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) { 59 61 $css_class[] = 'current_page_ancestor'; 60 62 } 61 if ( $page->ID === $current_page ) {63 if ( $page->ID === $current_page_id ) { 62 64 $css_class[] = 'current_page_item'; 63 65 } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) { … … 69 71 70 72 /** This filter is documented in wp-includes/class-walker-page.php */ 71 $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );73 $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page_id ) ); 72 74 $css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : ''; 73 75 … … 82 84 $atts = array(); 83 85 $atts['href'] = get_permalink( $page->ID ); 84 $atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';86 $atts['aria-current'] = ( $page->ID === $current_page_id ) ? 'page' : ''; 85 87 86 88 /** This filter is documented in wp-includes/class-walker-page.php */ 87 $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );89 $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page_id ); 88 90 89 91 $attributes = ''; -
trunk/src/wp-includes/class-walker-category-dropdown.php
r51739 r51779 45 45 * 46 46 * @since 2.1.0 47 * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. 47 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` 48 * to match parent class for PHP 8 named parameter support. 48 49 * 49 50 * @see Walker::start_el() 50 51 * 51 * @param string $output Used to append additional content (passed by reference).52 * @param WP_Term $data_object Category data object.53 * @param int $depth Depth of category. Used for padding.54 * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist.55 * See wp_dropdown_categories().56 * @param int $ id Optional. ID of the current category. Default 0 (unused).52 * @param string $output Used to append additional content (passed by reference). 53 * @param WP_Term $data_object Category data object. 54 * @param int $depth Depth of category. Used for padding. 55 * @param array $args Uses 'selected', 'show_count', and 'value_field' keys, if they exist. 56 * See wp_dropdown_categories(). 57 * @param int $current_object_id Optional. ID of the current category. Default 0. 57 58 */ 58 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $ id = 0 ) {59 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 59 60 // Restores the more descriptive, specific name for use within this method. 60 61 $category = $data_object; -
trunk/src/wp-includes/class-walker-category.php
r51739 r51779 87 87 * 88 88 * @since 2.1.0 89 * @since 5.9.0 Renamed `$category` to `$data_object` to match parent class for PHP 8 named parameter support. 89 * @since 5.9.0 Renamed `$category` to `$data_object` and `$id` to `$current_object_id` 90 * to match parent class for PHP 8 named parameter support. 90 91 * 91 92 * @see Walker::start_el() 92 93 * 93 * @param string $output Used to append additional content (passed by reference).94 * @param WP_Term $data_object Category data object.95 * @param int $depth Optional. Depth of category in reference to parents. Default 0.96 * @param array $args Optional. An array of arguments. See wp_list_categories().97 * Default empty array.98 * @param int $ idOptional. ID of the current category. Default 0.99 */ 100 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $ id = 0 ) {94 * @param string $output Used to append additional content (passed by reference). 95 * @param WP_Term $data_object Category data object. 96 * @param int $depth Optional. Depth of category in reference to parents. Default 0. 97 * @param array $args Optional. An array of arguments. See wp_list_categories(). 98 * Default empty array. 99 * @param int $current_object_id Optional. ID of the current category. Default 0. 100 */ 101 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 101 102 // Restores the more descriptive, specific name for use within this method. 102 103 $category = $data_object; … … 136 137 * @type string $title The title attribute. 137 138 * } 138 * @param WP_Term $category Term data object.139 * @param int $depth Depth of category, used for padding.140 * @param array $args An array of arguments.141 * @param int $ idID of the current category.139 * @param WP_Term $category Term data object. 140 * @param int $depth Depth of category, used for padding. 141 * @param array $args An array of arguments. 142 * @param int $current_object_id ID of the current category. 142 143 */ 143 $atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $ id );144 $atts = apply_filters( 'category_list_link_attributes', $atts, $category, $depth, $args, $current_object_id ); 144 145 145 146 $attributes = ''; -
trunk/src/wp-includes/class-walker-comment.php
r51739 r51779 158 158 * 159 159 * @since 2.7.0 160 * @since 5.9.0 Renamed `$comment` to `$data_object` to match parent class for PHP 8 named parameter support. 160 * @since 5.9.0 Renamed `$comment` to `$data_object` and `$id` to `$current_object_id` 161 * to match parent class for PHP 8 named parameter support. 161 162 * 162 163 * @see Walker::start_el() … … 165 166 * @global WP_Comment $comment Global comment object. 166 167 * 167 * @param string $output Used to append additional content. Passed by reference.168 * @param WP_Comment $data_object Comment data object.169 * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0.170 * @param array $args Optional. An array of arguments. Default empty array.171 * @param int $ id Optional. ID of the current comment. Default 0 (unused).172 */ 173 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $ id = 0 ) {168 * @param string $output Used to append additional content. Passed by reference. 169 * @param WP_Comment $data_object Comment data object. 170 * @param int $depth Optional. Depth of the current comment in reference to parents. Default 0. 171 * @param array $args Optional. An array of arguments. Default empty array. 172 * @param int $current_object_id Optional. ID of the current comment. Default 0. 173 */ 174 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 174 175 // Restores the more descriptive, specific name for use within this method. 175 176 $comment = $data_object; -
trunk/src/wp-includes/class-walker-nav-menu.php
r51739 r51779 107 107 * @since 3.0.0 108 108 * @since 4.4.0 The {@see 'nav_menu_item_args'} filter was added. 109 * @since 5.9.0 Renamed `$item` to `$data_object` to match parent class for PHP 8 named parameter support. 109 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id` 110 * to match parent class for PHP 8 named parameter support. 110 111 * 111 112 * @see Walker::start_el() 112 113 * 113 * @param string $output Used to append additional content (passed by reference).114 * @param WP_Post $data_object Menu item data object.115 * @param int $depth Depth of menu item. Used for padding.116 * @param stdClass $args An object of wp_nav_menu() arguments.117 * @param int $ id Current item ID.118 */ 119 public function start_el( &$output, $data_object, $depth = 0, $args = null, $ id = 0 ) {114 * @param string $output Used to append additional content (passed by reference). 115 * @param WP_Post $data_object Menu item data object. 116 * @param int $depth Depth of menu item. Used for padding. 117 * @param stdClass $args An object of wp_nav_menu() arguments. 118 * @param int $current_object_id Optional. ID of the current menu item. Default 0. 119 */ 120 public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) { 120 121 // Restores the more descriptive, specific name for use within this method. 121 122 $menu_item = $data_object; -
trunk/src/wp-includes/class-walker-page-dropdown.php
r51739 r51779 45 45 * 46 46 * @since 2.1.0 47 * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. 47 * @since 5.9.0 Renamed `$page` to `$data_object` and `$id` to `$current_object_id` 48 * to match parent class for PHP 8 named parameter support. 48 49 * 49 50 * @see Walker::start_el() 50 51 * 51 * @param string $output Used to append additional content. Passed by reference. 52 * @param WP_Post $data_object Page data object. 53 * @param int $depth Optional. Depth of page in reference to parent pages. Used for padding. 54 * Default 0. 55 * @param array $args Optional. Uses 'selected' argument for selected page to set selected HTML 56 * attribute for option element. Uses 'value_field' argument to fill "value" 57 * attribute. See wp_dropdown_pages(). Default empty array. 58 * @param int $id Optional. ID of the current page. Default 0 (unused). 52 * @param string $output Used to append additional content. Passed by reference. 53 * @param WP_Post $data_object Page data object. 54 * @param int $depth Optional. Depth of page in reference to parent pages. 55 * Used for padding. Default 0. 56 * @param array $args Optional. Uses 'selected' argument for selected page to 57 * set selected HTML attribute for option element. Uses 58 * 'value_field' argument to fill "value" attribute. 59 * See wp_dropdown_pages(). Default empty array. 60 * @param int $current_object_id Optional. ID of the current page. Default 0. 59 61 */ 60 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $ id = 0 ) {62 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 61 63 // Restores the more descriptive, specific name for use within this method. 62 64 $page = $data_object; -
trunk/src/wp-includes/class-walker-page.php
r51739 r51779 94 94 * @see Walker::start_el() 95 95 * @since 2.1.0 96 * @since 5.9.0 Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. 97 * 98 * @param string $output Used to append additional content. Passed by reference. 99 * @param WP_Post $data_object Page data object. 100 * @param int $depth Optional. Depth of page. Used for padding. Default 0. 101 * @param array $args Optional. Array of arguments. Default empty array. 102 * @param int $current_page Optional. Page ID. Default 0. 103 */ 104 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_page = 0 ) { 96 * @since 5.9.0 Renamed `$page` to `$data_object` and `$current_page` to `$current_object_id` 97 * to match parent class for PHP 8 named parameter support. 98 * 99 * @param string $output Used to append additional content. Passed by reference. 100 * @param WP_Post $data_object Page data object. 101 * @param int $depth Optional. Depth of page. Used for padding. Default 0. 102 * @param array $args Optional. Array of arguments. Default empty array. 103 * @param int $current_object_id Optional. ID of the current page. Default 0. 104 */ 105 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { 105 106 // Restores the more descriptive, specific name for use within this method. 106 $page = $data_object; 107 $page = $data_object; 108 $current_page_id = $current_object_id; 107 109 108 110 if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) { … … 125 127 } 126 128 127 if ( ! empty( $current_page ) ) {128 $_current_page = get_post( $current_page );129 if ( ! empty( $current_page_id ) ) { 130 $_current_page = get_post( $current_page_id ); 129 131 130 132 if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) { … … 132 134 } 133 135 134 if ( $page->ID == $current_page ) {136 if ( $page->ID == $current_page_id ) { 135 137 $css_class[] = 'current_page_item'; 136 138 } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) { … … 148 150 * @see wp_list_pages() 149 151 * 150 * @param string[] $css_class An array of CSS classes to be applied to each list item.151 * @param WP_Post $page Page data object.152 * @param int $depth Depth of page, used for padding.153 * @param array $args An array of arguments.154 * @param int $current_page ID of the current page.152 * @param string[] $css_class An array of CSS classes to be applied to each list item. 153 * @param WP_Post $page Page data object. 154 * @param int $depth Depth of page, used for padding. 155 * @param array $args An array of arguments. 156 * @param int $current_page_id ID of the current page. 155 157 */ 156 $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );158 $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page_id ) ); 157 159 $css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : ''; 158 160 … … 167 169 $atts = array(); 168 170 $atts['href'] = get_permalink( $page->ID ); 169 $atts['aria-current'] = ( $page->ID == $current_page ) ? 'page' : '';171 $atts['aria-current'] = ( $page->ID == $current_page_id ) ? 'page' : ''; 170 172 171 173 /** … … 180 182 * @type string $aria-current The aria-current attribute. 181 183 * } 182 * @param WP_Post $page Page data object.183 * @param int $depth Depth of page, used for padding.184 * @param array $args An array of arguments.185 * @param int $current_page ID of the current page.184 * @param WP_Post $page Page data object. 185 * @param int $depth Depth of page, used for padding. 186 * @param array $args An array of arguments. 187 * @param int $current_page_id ID of the current page. 186 188 */ 187 $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );189 $atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page_id ); 188 190 189 191 $attributes = ''; -
trunk/src/wp-includes/class-wp-walker.php
r51739 r51779 91 91 * @param int $depth Depth of the item. 92 92 * @param array $args An array of additional arguments. 93 * @param int $current_object_id ID of the current item.93 * @param int $current_object_id Optional. ID of the current item. Default 0. 94 94 */ 95 95 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
Note: See TracChangeset
for help on using the changeset viewer.