Changeset 6100 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
- Timestamp:
- 11/09/2017 09:58:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r6091 r6100 46 46 47 47 /** 48 * Turns a menu item that links to the Downloads page into a download button. 49 * 50 * @param array $menu_items The menu items, sorted by each menu item's menu order. 51 * @return array 52 */ 53 function nav_menu_objects( $menu_items ) { 54 foreach ( $menu_items as $menu_item ) { 55 if ( false !== stripos( $menu_item->url, 'txt-download' ) ) { 56 $menu_item->classes = array_merge( $menu_item->classes, ['button', 'button-primary', 'download'] ); 57 $menu_item->title = _x( 'Download WordPress', 'Menu title', 'wporg' ); 58 break; 59 } 60 } 61 62 return $menu_items; 63 } 64 add_action( 'wp_nav_menu_objects', __NAMESPACE__ . '\nav_menu_objects' ); 65 66 /** 48 67 * Custom template tags. 49 68 */
Note: See TracChangeset
for help on using the changeset viewer.