Ticket #8874: 8874.wp_page_menu.patch
| File 8874.wp_page_menu.patch, 1.1 KB (added by hakre, 4 years ago) |
|---|
-
wp-includes/post-template.php
801 801 * @param array|string $args 802 802 */ 803 803 function wp_page_menu( $args = array() ) { 804 $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '' );804 $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '', 'show_home' => ''); 805 805 $args = wp_parse_args( $args, $defaults ); 806 806 $args = apply_filters( 'wp_page_menu_args', $args ); 807 807 … … 810 810 $list_args = $args; 811 811 812 812 // Show Home in the menu 813 if ( isset($args['show_home']) &&! empty($args['show_home']) ) {814 if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 ===$args['show_home'] )813 if ( ! empty($args['show_home']) ) { 814 if ( '1' === (string) $args['show_home'] ) 815 815 $text = __('Home'); 816 816 else 817 817 $text = $args['show_home'];