BP_Core_Members_Switching::action_admin_footer()
Adds a ‘Switch back to {user}’ link to the WordPress footer if the admin toolbar isn’t showing.
Description
Source
File: bp-members/classes/class-bp-core-members-switching.php
public function action_admin_footer() {
if ( ! function_exists( 'is_admin_bar_showing' ) ) {
return;
}
if ( ! is_admin_bar_showing() ) {
return;
}
$old_user = self::get_old_user();
if ( $old_user instanceof WP_User ) {
$colors = self::admin_bar_link_color_scheme();
if ( isset( $colors['background'] ) && isset( $colors['color'] ) ) {
?>
<style>
/* Member Switching */
#wpadminbar #wp-admin-bar-top-secondary li#wp-admin-bar-switch-back a {
background: <?php echo $colors['background'] ?>;
color: <?php echo $colors['color'] ?>;;
}
</style>
<?php
}
}
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.