Changeset 48103
- Timestamp:
- 06/20/2020 11:20:25 AM (5 years ago)
- Location:
- trunk/src/wp-content/themes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r47808 r48103 492 492 * @since Twenty Fifteen 1.0 493 493 * 494 * @param string $item_output The menu itemoutput.495 * @param WP_Post $item Menu itemobject.496 * @param int $depth Depth of the menu.497 * @param array $argswp_nav_menu() arguments.494 * @param string $item_output The menu item's starting HTML output. 495 * @param WP_Post $item Menu item data object. 496 * @param int $depth Depth of the menu. Used for padding. 497 * @param stdClass $args An object of wp_nav_menu() arguments. 498 498 * @return string Menu item with possible description. 499 499 */ -
trunk/src/wp-content/themes/twentynineteen/inc/icon-functions.php
r48101 r48103 32 32 * Display SVG icons in social links menu. 33 33 * 34 * @param string $item_output The menu itemoutput.35 * @param WP_Post $item Menu itemobject.36 * @param int $depth Depth of the menu.37 * @param object $argswp_nav_menu() arguments.34 * @param string $item_output The menu item's starting HTML output. 35 * @param WP_Post $item Menu item data object. 36 * @param int $depth Depth of the menu. Used for padding. 37 * @param stdClass $args An object of wp_nav_menu() arguments. 38 38 * @return string The menu item output with social icon. 39 39 */ … … 55 55 * Add a dropdown icon to top-level menu items. 56 56 * 57 * @param string $output Nav menu item start element.58 * @param object $item Nav menu item.59 * @param int $depth Depth.60 * @param object $args Nav menu args.57 * @param string $item_output The menu item's starting HTML output. 58 * @param WP_Post $item Menu item data object. 59 * @param int $depth Depth of the menu. Used for padding. 60 * @param stdClass $args An object of wp_nav_menu() arguments. 61 61 * @return string Nav menu item start element. 62 * Add a dropdown icon to top-level menu items63 62 */ 64 function twentynineteen_add_dropdown_icons( $ output, $item, $depth, $args ) {63 function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) { 65 64 66 65 // Only add class to 'top level' items on the 'primary' menu. 67 66 if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) { 68 return $ output;67 return $item_output; 69 68 } 70 69 … … 78 77 79 78 // Replace opening <a> with <button>. 80 $ output = preg_replace(79 $item_output = preg_replace( 81 80 '/<a\s.*?>/', 82 81 $link, 83 $ output,82 $item_output, 84 83 1 // Limit. 85 84 ); 86 85 87 86 // Replace closing </a> with </button>. 88 $ output = preg_replace(87 $item_output = preg_replace( 89 88 '#</a>#i', 90 89 '</button>', 91 $ output,90 $item_output, 92 91 1 // Limit. 93 92 ); … … 98 97 $icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 ); 99 98 100 $ output .= sprintf(99 $item_output .= sprintf( 101 100 '<button class="submenu-expand" tabindex="-1">%s</button>', 102 101 $icon … … 104 103 } 105 104 106 return $ output;105 return $item_output; 107 106 } 108 107 add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 ); -
trunk/src/wp-content/themes/twentyseventeen/inc/icon-functions.php
r48101 r48103 118 118 * Display SVG icons in social links menu. 119 119 * 120 * @param string $item_output The menu itemoutput.121 * @param WP_Post $item Menu itemobject.122 * @param int $depth Depth of the menu.123 * @param object $argswp_nav_menu() arguments.120 * @param string $item_output The menu item's starting HTML output. 121 * @param WP_Post $item Menu item data object. 122 * @param int $depth Depth of the menu. Used for padding. 123 * @param stdClass $args An object of wp_nav_menu() arguments. 124 124 * @return string The menu item output with social icon. 125 125 */ … … 144 144 * Add dropdown icon if menu item has children. 145 145 * 146 * @param string$title The menu item's title.147 * @param WP_Post$item The current menu item.148 * @param object $args An arrayof wp_nav_menu() arguments.149 * @param int$depth Depth of menu item. Used for padding.146 * @param string $title The menu item's title. 147 * @param WP_Post $item The current menu item. 148 * @param stdClass $args An object of wp_nav_menu() arguments. 149 * @param int $depth Depth of menu item. Used for padding. 150 150 * @return string The menu item's title with dropdown icon. 151 151 */ -
trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php
r48102 r48103 500 500 * styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set. 501 501 * 502 * @param array $css_class CSS Class names.503 * @param string $item Comment.504 * @param int $depth Depth of the current comment.505 * @param array $argsAn array of arguments.506 * @param string $current_page Whether or not the item is the current item.507 * @return array $css_class CSS Class names.508 */ 509 function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $ item, $depth, $args, $current_page ) {502 * @param string[] $css_class An array of CSS classes to be applied to each list item. 503 * @param WP_Post $page Page data object. 504 * @param int $depth Depth of page, used for padding. 505 * @param array $args An array of arguments. 506 * @param int $current_page ID of the current page. 507 * @return array CSS class names. 508 */ 509 function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $page, $depth, $args, $current_page ) { 510 510 511 511 // Only apply to wp_list_pages() calls with match_menu_classes set to true. … … 535 535 * Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu. 536 536 * 537 * @param stdClass $args An array ofarguments.538 * @param string $item Menu item.539 * @param int $depth Depth of the current menu item.540 * @return stdClass $argsAn object of wp_nav_menu() arguments.537 * @param stdClass $args An object of wp_nav_menu() arguments. 538 * @param WP_Post $item Menu item data object. 539 * @param int $depth Depth of menu item. Used for padding. 540 * @return stdClass An object of wp_nav_menu() arguments. 541 541 */ 542 542 function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) { … … 581 581 * Displays SVG icons in social links menu. 582 582 * 583 * @param string $item_output The menu itemoutput.584 * @param WP_Post $item Menu itemobject.585 * @param int $depth Depth of the menu.586 * @param array $argswp_nav_menu() arguments.587 * @return string $item_outputThe menu item output with social icon.583 * @param string $item_output The menu item's starting HTML output. 584 * @param WP_Post $item Menu item data object. 585 * @param int $depth Depth of the menu. Used for padding. 586 * @param stdClass $args An object of wp_nav_menu() arguments. 587 * @return string The menu item output with social icon. 588 588 */ 589 589 function twentytwenty_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
Note: See TracChangeset
for help on using the changeset viewer.