Make WordPress Core

Changeset 56045


Ignore:
Timestamp:
06/26/2023 09:31:30 PM (21 months ago)
Author:
audrasjb
Message:

Twenty Twenty: Remove various unused function parameters and variables.

This removes the $n variable from TwentyTwenty_Walker_Page class start_el() function, removes an unused global and the last parameter from
twentytwenty_filter_wp_list_pages_item_classes() and twentytwenty_add_sub_toggles_to_main_menu().

Props upadalavipul, sabernhardt, mukesh27.
Fixes #57371.

Location:
trunk/src/wp-content/themes/twentytwenty
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-walker-page.php

    r55276 r56045  
    3939            if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
    4040                $t = "\t";
    41                 $n = "\n";
    4241            } else {
    4342                $t = '';
    44                 $n = '';
    4543            }
    4644            if ( $depth ) {
  • trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php

    r55276 r56045  
    241241 *
    242242 * @since Twenty Twenty 1.0
    243  *
    244  * @global WP_Post $post Global post object.
    245243 *
    246244 * @param int    $post_id  The ID of the post.
     
    332330        $has_meta = false;
    333331
    334         global $post;
    335332        $the_post = get_post( $post_id );
    336333        setup_postdata( $the_post );
     
    546543 * @param int      $depth        Depth of page, used for padding.
    547544 * @param array    $args         An array of arguments.
    548  * @param int      $current_page ID of the current page.
    549545 * @return array CSS class names.
    550546 */
    551 function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $page, $depth, $args, $current_page ) {
     547function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $page, $depth, $args ) {
    552548
    553549    // Only apply to wp_list_pages() calls with match_menu_classes set to true.
     
    572568}
    573569
    574 add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 5 );
     570add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 4 );
    575571
    576572/**
     
    581577 * @param stdClass $args  An object of wp_nav_menu() arguments.
    582578 * @param WP_Post  $item  Menu item data object.
    583  * @param int      $depth Depth of menu item. Used for padding.
    584579 * @return stdClass An object of wp_nav_menu() arguments.
    585580 */
    586 function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
     581function twentytwenty_add_sub_toggles_to_main_menu( $args, $item ) {
    587582
    588583    // Add sub menu toggles to the Expanded Menu with toggles.
     
    623618}
    624619
    625 add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 3 );
     620add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 2 );
    626621
    627622/**
Note: See TracChangeset for help on using the changeset viewer.