How to hook into the subscriber /wp-admin/index.php page?

All of WP’s built-in roles have subscriber capabilities. You’re basically checking here, “if the current user has at least subscriber capabilities”. If you want to isolate only the subscribers, you can check for the absence of a higher capability. If you are just using built-in roles, the next higher role of Contributor has edit_posts and … Read more

Editor capabilities – admin_init

There is a capability called edit_theme_options which is by default assigned to only site admins not to editors. Check out – Roles Vs Capabilities . To allow your editors to manage theme options you’ve to manually assign that capability to editors. Here to assign edit_theme_options capability to editors just drop in this code into your … Read more

Get current session in WP admin

Google is your friend. How to use session_start in WordPress? and How to use session in wordpress in plugin development It looks like your mistake is that you didn’t capitalise “Session” when you declare the variable. Instead of $_session[‘wp_nonce’], try $_SESSION[‘wp_nonce’].

Admin_init not working in submenu page

(Updated answer) Looking at the simplified plugin source, the following works: // In class-init-test.php public function __construct(){ add_action( ‘admin_init’, array( $this, ‘page_init’ ) ); … } because when that add_action() is called, the admin_init action is not yet fired. Hence Init_test::page_init() gets called. However, the following doesn’t work because admin_init has already been fired by … Read more