Changeset 10275
- Timestamp:
- 09/17/2020 01:22:41 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/class-plugin.php
r7530 r10275 34 34 private function __construct() { 35 35 add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ], 1 ); 36 add_ action( 'wp_nav_menu_objects', [ $this, 'download_button_menu_item' ], 11 );36 add_filter( 'wp_nav_menu_objects', [ $this, 'download_button_menu_item' ], 11 ); 37 37 38 38 $this->sites = [ … … 73 73 public function download_button_menu_item( $menu_items ) { 74 74 foreach ( $menu_items as $menu_item ) { 75 if ( false !== stripos( $menu_item->url, 'download/' ) || 'page-download.php' === get_page_template_slug( $menu_item->object_id ) ) { 75 if ( 76 false !== stripos( $menu_item->url, 'download/' ) || 77 ( 78 $menu_item->object_id && 79 'post_type' == $menu_item->type && 80 'page-download.php' === get_page_template_slug( $menu_item->object_id ) 81 ) 82 ) { 83 $menu_item->ID = -1; // Prevents the title being overwritten by the page title. 76 84 $menu_item->classes = array_merge( $menu_item->classes, ['button', 'button-primary', 'download'] ); 77 85 $menu_item->title = _x( 'Get WordPress', 'Menu title', 'rosetta' );
Note: See TracChangeset
for help on using the changeset viewer.