WordPress.org

Make WordPress Core

Ticket #13293: t13293-twentyten-square-brackets-syntax-r002.diff

File t13293-twentyten-square-brackets-syntax-r002.diff, 649 bytes (added by demetris, 5 years ago)

Square brackets syntax for filtering wp_page_menu_args from 2010, and removal of unneeded bits

  • wp-content/themes/twentyten/functions.php

     
    209209 * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link 
    210210 */ 
    211211function twentyten_page_menu_args($args) { 
    212         $args = array( 
    213                 'sort_column' => 'menu_order, post_title', 
    214                 'menu_class'  => 'menu', 
    215                 'echo'        => true,           
    216                 'show_home' => true              
    217         ); 
     212        $args['show_home'] = true; 
     213 
    218214        return $args; 
    219215} 
    220216add_filter('wp_page_menu_args', 'twentyten_page_menu_args');