Changeset 43571 for trunk/src/wp-includes/class-wp-customize-nav-menus.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r43480 r43571 181 181 182 182 $posts = array_merge( 183 $posts, get_posts( 183 $posts, 184 get_posts( 184 185 array( 185 186 'numberposts' => 10, … … 210 211 } elseif ( 'taxonomy' === $type ) { 211 212 $terms = get_terms( 212 $object, array( 213 $object, 214 array( 213 215 'child_of' => 0, 214 216 'exclude' => '', … … 364 366 $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' ); 365 367 $terms = get_terms( 366 $taxonomies, array( 368 $taxonomies, 369 array( 367 370 'name__like' => $args['s'], 368 371 'number' => 20, … … 388 391 // Add "Home" link if search term matches. Treat as a page, but switch to custom on add. 389 392 if ( isset( $args['s'] ) ) { 390 $title = _x( 'Home', 'nav menu home label' );393 $title = _x( 'Home', 'nav menu home label' ); 391 394 $matches = function_exists( 'mb_stripos' ) ? false !== mb_stripos( $title, $args['s'] ) : false !== stripos( $title, $args['s'] ); 392 395 if ( $matches ) { … … 595 598 $this->manager->add_panel( 596 599 new WP_Customize_Nav_Menus_Panel( 597 $this->manager, 'nav_menus', array( 600 $this->manager, 601 'nav_menus', 602 array( 598 603 'title' => __( 'Menus' ), 599 604 'description' => $description, … … 621 626 622 627 $this->manager->add_section( 623 'menu_locations', array( 628 'menu_locations', 629 array( 624 630 'title' => 1 === $num_locations ? _x( 'View Location', 'menu locations' ) : _x( 'View All Locations', 'menu locations' ), 625 631 'panel' => 'nav_menus', … … 657 663 } else { 658 664 $this->manager->add_setting( 659 $setting_id, array( 665 $setting_id, 666 array( 660 667 'sanitize_callback' => array( $this, 'intval_base10' ), 661 668 'theme_supports' => 'menus', … … 674 681 $this->manager->add_control( 675 682 new WP_Customize_Nav_Menu_Location_Control( 676 $this->manager, $setting_id, array( 683 $this->manager, 684 $setting_id, 685 array( 677 686 'label' => $description, 678 687 'location_id' => $location, … … 692 701 $this->manager->add_section( 693 702 new WP_Customize_Nav_Menu_Section( 694 $this->manager, $section_id, array( 703 $this->manager, 704 $section_id, 705 array( 695 706 'title' => html_entity_decode( $menu->name, ENT_QUOTES, get_bloginfo( 'charset' ) ), 696 707 'priority' => 10, … … 703 714 $this->manager->add_setting( 704 715 new WP_Customize_Nav_Menu_Setting( 705 $this->manager, $nav_menu_setting_id, array( 716 $this->manager, 717 $nav_menu_setting_id, 718 array( 706 719 'transport' => 'postMessage', 707 720 ) … … 725 738 $this->manager->add_setting( 726 739 new WP_Customize_Nav_Menu_Item_Setting( 727 $this->manager, $menu_item_setting_id, array( 740 $this->manager, 741 $menu_item_setting_id, 742 array( 728 743 'value' => $value, 729 744 'transport' => 'postMessage', … … 735 750 $this->manager->add_control( 736 751 new WP_Customize_Nav_Menu_Item_Control( 737 $this->manager, $menu_item_setting_id, array( 752 $this->manager, 753 $menu_item_setting_id, 754 array( 738 755 'label' => $item->title, 739 756 'section' => $section_id, … … 749 766 // Add the add-new-menu section and controls. 750 767 $this->manager->add_section( 751 'add_menu', array( 768 'add_menu', 769 array( 752 770 'type' => 'new_menu', 753 771 'title' => __( 'New Menu' ), … … 759 777 $this->manager->add_setting( 760 778 new WP_Customize_Filter_Setting( 761 $this->manager, 'nav_menus_created_posts', array( 779 $this->manager, 780 'nav_menus_created_posts', 781 array( 762 782 'transport' => 'postMessage', 763 783 'type' => 'option', // To prevent theme prefix in changeset. … … 1037 1057 </h3> 1038 1058 </script> 1039 <?php1059 <?php 1040 1060 } 1041 1061 … … 1095 1115 ?> 1096 1116 </div><!-- #available-menu-items --> 1097 <?php1117 <?php 1098 1118 } 1099 1119 … … 1121 1141 /* translators: %s: Title of a section with menu items */ 1122 1142 printf( __( 'Toggle section: %s' ), esc_html( $available_item_type['title'] ) ); 1123 1143 ?> 1124 1144 </span> 1125 1145 <span class="toggle-indicator" aria-hidden="true"></span>
Note: See TracChangeset
for help on using the changeset viewer.