Categories
CMS Mastering Development Wordpress

Woocommerce blocking custom role to access admin_bar/admin_access

Developed a plugin which will add_role() called backend_user during plugin activation. In the plugin I had designed a controller which enables access to certain pages of ‘my custom plugin menu’ for backend_user. So whenever the user(role:backend_user) logins in via wp-admin they can see admin bar and access the ‘My custom plugin’ menus, this user is […]

Categories
CMS Mastering Development Wordpress

Enable a role named ‘backend_user’ to access my plugin pages

I am new to plugin development and I am fairly okay with development by following all the plugin development best practices set by WordPress Codex. Following code describes on how Role: Administrator of WordPress gains access to the plugin. Administrator access to plugin in settings: SettingsApi.php public function register() { if ( ! empty($this->admin_pages) || […]

Categories
CMS Mastering Development Wordpress

Gutenberg blocks for custom user role

I’m trying to hide all the default gutenberg blocks except my custom ACF blocks. The problem is, I created custom user role : student. With administrator role I got my custom block introduction but for student role, the popin with blocks is empty. How can I fix it please ? function add_role_student() { add_role( ‘student’, […]

Categories
CMS Mastering Development Wordpress

How to bulk remove capability from user role

I’ve got an issue where a custom user role ‘member’ has somehow ended up with the ‘subscriber’ capability. Example: Custom user role added via: add_role( ‘member’, ‘Member’, array( ‘read’ => true, ‘level_0′ => true ) ); Code to remove the subscriber capability- this breaks my site completely and I’m not 100% on why: add_action( ‘init’, […]

Categories
CMS Mastering Development Wordpress

Custom roles showing HTML entities in title form field

I’ve created a few custom roles. I’m noticing that when editing a post in the Admin Area, any characters with HTML entities in the title form field are showing the HTML entity code, but only for users assigned the custom roles. Users with default WordPress roles aren’t having this issue. This is one of the […]

Categories
CMS Development Wordpress

How create a role with admin capability less 1 or 2?

I’ve created a new role and I need to give this role the full permissions and capability of an admin less create new admin user and edit plugin/themes. Is possible recall all and remove only the 3 I need, or i have to put 1 by 1 like in the code i posted (edit/delete post)? […]