Changeset 6173
- Timestamp:
- 11/27/2017 06:29:20 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r6146 r6173 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 array52 */53 function nav_menu_objects( $menu_items ) {54 foreach ( $menu_items as $menu_item ) {55 if ( false !== stripos( $menu_item->url, 'download/' ) || 'page-templates/download.php' === get_page_template_slug( $menu_item->object_id ) ) {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 /**67 48 * Custom template tags. 68 49 */
Note: See TracChangeset
for help on using the changeset viewer.