Display users current level in the admin dashboard

I would like to display user current level in the admin dashboard. Right now, we just have a "Your Account" link, that redirects to the checkout page, no info in the admin dashboard like "Wix"
How do I do this?

  • Luís

    Hi Nicolas ,

    Hope you're doing well today!

    After a closer look and from what I tested in my install, you should be able to get the current level with:

    add_action( 'admin_bar_menu', 'blog_pro_site_level',90 );
    
    function blog_pro_site_level($admin_bar) {
    
    	global $psts;
    	$blog_current_level = $psts->get_level_setting( $psts->get_level( get_current_blog_id() ), 'name' );
    //create a admin bar menu item
    	  $admin_bar->add_menu( array(
            'id'    => $blog_current_level,
            'title' => 'Your current level: ' . $blog_current_level,
            'meta'  => array(
                'title' => __($blog_current_level),
            ),
        ));
    }

    The above code will get the current Pro site level and will output it as an admin bar menu item. Attached I shared the mu-plugin I used to test this, if you are interested:

    1) Download the .zip file attached and unzip it;

    2) Using FTP, upload "check-pro-level.php" to "wp-content/mu-plugins";

    If you don't have a "mu-plugins" folder under "wp-content", please create it.

    Cheers, Luís

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.