JSFiddle - React, Tailwind, and code Playground

by rvpatel

JavaScript

/*************  share this button short code  **************/
if (function_exists('st_makeEntries')) :
    add_shortcode('sharethis', 'st_makeEntries');
endif;

/*************  Remove admin menu(user)**************/
    function my_remove_menu_pages() {
        remove_menu_page('users.php');	
        remove_menu_page('profile.php');	
    }
    add_action( 'admin_menu', 'my_remove_menu_pages' );


/************* Remove user-account from adminbar **************/

    function my_tweaked_admin_bar() {
            global $wp_admin_bar;
                $wp_admin_bar->remove_menu('my-account');
    }
    add_action( 'wp_before_admin_bar_render', 'my_tweaked_admin_bar' ); 

/************* Add logout link in from adminbar **************/
    function add_tweaked_admin_bar() {
	global $wp_admin_bar;
        global $user_logout;
        if (!current_user_can('administrator') ) :
            $user_logout = get_option('user_logout');
        else:
            $user_logout = get_option('admin_logout');
        endif;
        
        $wp_admin_bar->add_node(array(
		'id'    => 'my-link',
		'title' => 'Logout',
		'href'  => $user_logout,
        ));

    }
    add_action( 'wp_before_admin_bar_render', 'add_tweaked_admin_bar' ); 
    
/************* Add Heal deshboard admin link in from adminbar **************/
if (current_user_can('administrator') ) :    
    function add_heal_admin_bar() {
	global $wp_admin_bar;
        $heal_dashbord = get_option('dashboard');
        $wp_admin_bar->add_node(array(
		'id'    => 'heal-link',
		'title' => 'Heal Dashbord',
		'href'  => $heal_dashbord,
        ));

    }
    add_action( 'wp_before_admin_bar_render', 'add_heal_admin_bar' ); 
endif;    
    
/************* wp-login.php to redirect to own page **************/

    function dp_redir_login() {
     global $user_login_link;
     $user_login_link = get_option('user_login');
     wp_redirect($user_login_link);
	 exit;
    }
    add_action( 'login_enqueue_scripts', 'dp_redir_login' );
  ...