Show Welcome Panel on Dashboard for every user

This is how I solved it: In functions.php // Custom Dashboard function my_custom_dashboard() { $screen = get_current_screen(); if( $screen->base == ‘dashboard’ ) { include ‘admin/dashboard-panel.php’; } } add_action(‘admin_notices’, ‘my_custom_dashboard’); dashboard-panel.php <!– Hide Old Wrap with CSS –> <style type=”text/css”> div#wpcontent div.wrap { display: none; } div#wpcontent div.my-dashboard { display: block; } </style> <!– New Wrap … Read more

How can I restore admin capabilities?

The string below actually represents an array in serialized form. a:1:{s:13:”administrator”;s:1:”1″;} Here: a:1 means an array with a single element s:13 means string and the length of the string followed by Array { “administrator” => “1” } Once that is in the table, you can use the unserialize() function to return it to an array … Read more

Problem using role_has_cap hook

I finally figured it out: To start with, I was using the wrong hook. I should have been using user_has_cap hook instead, which is what actually has a chance of being called when using current_user_can(). But second, and most important of all, I was seeing the page while logged-in as super_admin, which didn’t trigger the … Read more

Allow Administrator role access to custom capabilities [duplicate]

Referring to the Codex entry for this, I suggest using another hook. They use the ‘admin_init’ action: function add_theme_caps() { $role = get_role( ‘author’ ); // gets the author role $role->add_cap( ‘edit_others_posts’ ); // would allow the author to edit others’ posts for current theme only } add_action( ‘admin_init’, ‘add_theme_caps’);