Changeset 4927 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
- Timestamp:
- 02/18/2017 06:12:44 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r4924 r4927 47 47 // Toolbar. 48 48 add_action( 'admin_bar_menu', array( $this, 'add_profile_settings_to_admin_bar' ) ); 49 add_action( 'admin_bar_menu', array( $this, 'replace_login_url_in_admin_bar' ), 20 ); 49 50 add_action( 'admin_bar_init', array( $this, 'show_admin_bar' ) ); 50 51 add_action( 'add_admin_bar_menus', array( $this, 'remove_admin_bar_menus' ) ); … … 89 90 * Adds the link to profile settings to the user actions toolbar menu. 90 91 * 91 * @param \WP_Admin_Bar $wp_admin_bar 92 * @param \WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance. 92 93 */ 93 94 public function add_profile_settings_to_admin_bar( $wp_admin_bar ) { … … 105 106 $wp_admin_bar->add_node( $logout_node ); // Ensures that logout is the last action. 106 107 } 108 } 109 110 /** 111 * Changes the login URL to include a redirect parameter for the current page. 112 * 113 * @param \WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance. 114 */ 115 public function replace_login_url_in_admin_bar( $wp_admin_bar ) { 116 if ( ! $wp_admin_bar->get_node( 'log-in' ) ) { 117 return; 118 } 119 120 $menu = [ 121 'id' => 'log-in', 122 'href' => wp_login_url( gp_url_current() ), 123 ]; 124 $wp_admin_bar->add_menu( $menu ); 107 125 } 108 126
Note: See TracChangeset
for help on using the changeset viewer.