Making WordPress.org

Changeset 6173


Ignore:
Timestamp:
11/27/2017 06:29:20 PM (7 years ago)
Author:
obenland
Message:

Main: Remove Download button handler.

Removed from the theme so it can be moved to a more central and rosetta-specific place.

See #2861.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php

    r6146 r6173  
    4646
    4747/**
    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, '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 /**
    6748 * Custom template tags.
    6849 */
Note: See TracChangeset for help on using the changeset viewer.