Changeset 7674
- Timestamp:
- 09/19/2018 03:33:33 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-admin-bar.php
r7543 r7674 5 5 6 6 /** 7 * Makes Logo and About menu items link to the w.org/about/ page for logged-outusers.7 * Makes Logo and About menu items link to the localised w.org/about/ page for all users. 8 8 * 9 9 * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference. 10 10 */ 11 function wporg_logged_out_admin_bar( $wp_admin_bar ) { 12 if ( is_user_logged_in() ) { 13 return; 14 } 15 11 function wporg_about_links_in_admin_bar( $wp_admin_bar ) { 16 12 $nodes = [ 17 13 $wp_admin_bar->get_node( 'wp-logo' ), … … 19 15 ]; 20 16 17 $about_url = 'https://wordpress.org/about/'; 18 19 if ( class_exists( 'Rosetta_Sites' ) && is_object( $GLOBALS['rosetta'] ) ) { 20 $about_url = 'https://' . $GLOBALS['rosetta']->current_site_domain . '/about/'; 21 } 22 21 23 foreach ( $nodes as $node ) { 22 $node->href = '/about/';24 $node->href = $about_url; 23 25 24 26 $wp_admin_bar->add_node( $node ); 25 27 } 26 28 } 27 add_action( 'admin_bar_menu', 'wporg_ logged_out_admin_bar', 11 );29 add_action( 'admin_bar_menu', 'wporg_about_links_in_admin_bar', 11 );
Note: See TracChangeset
for help on using the changeset viewer.