I just tested your code and it works, so it seems one of the two following things.
You are placing the code in the wrong place, make sure you put that code at the bottom of the functions.php
file of your theme. Or maybe the functions.php
file of your theme is having problems, in which case you could share it with us by posting its content editing your question.
It seems alright, do this:
Open your wp-config.php
and add these lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
Let me know what it shows after.
Related Posts:
- Hook to plugins admin settings
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- How to set add question capability for author role in wp pro quiz plugin
- Remove specific administrator’s capability
- Plugin permissions for Editor role
- How to hide plugin options for editors via functions.php
- Defined user role to access plugin’s pages
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Can a Plugin Override New User Default Role Type
- Can I allow certain people to add/edit pages within a parent?
- Sync User to cPanel webmail?
- Adding CSS to custom post type admin page causes error
- Display Custom Field Value on Admin Page Column
- How to remove/hide Yoast’s “SEO” tab in admin panel?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Add sub menu page in your plugin
- What’s causing this error? “Warning: Invalid argument”
- can i limit editing specific custom fields to certain roles?
- Add user role to generated plugin
- Multisite – maximum number of users with specific role
- Is there any way to make myself an admin?
- Move plugin-settings to ‘Settings’-menu in the admin
- Understanding State in WordPress Multisites
- Allow only Admin role to access plugin settings/options page
- How to allow Contributors to publish articles after approval
- WordPress Admin Menu defining function is seperate file
- How do I add some javascript validation to the admin interface form’s onsubmit?
- remove all submenus from plugin
- Create WordPress posts from JSON array using plugin in admin
- Plugin getting Cannot modify header information errors
- creating a plug in that would tap into save/update action of posts [closed]
- Simply poll & Events Calendar plugins clashing
- How to see which sites use my installed plugins (wordpress multisite)
- Custom shortcode for displaying user based on a role parameter
- How I can change the required capability for an admin menu without editing the plugin file?
- Add User Role: Pre-saved in User-Meta [SOLVED]
- How to use the CSS of the WordPress core in the development of my administration page?
- in source code but I can’t find it in files or plugins
- Updating WordPress plugin admin panel footer text
- WordPress permissions error with admin account
- Multiple authors and readers restricted by role [closed]
- getting notifications about updates only in the “core” page
- Custom Login page with custom redirects for each user?
- Remove value from array within post meta ajax admin
- Show WordPress Plugin Menu(Admin) To Editor
- Mutliple users editing single document in wordspress
- Add logo to admin menu in my plugin
- Problem after updating plugins
- Show media-uploads to all users
- Equivalent of admin.php for public pages
- problem with register_activation_hook in plugin
- Error: Can´t access facebook comment plugin admin page
- How To Create A File Archive in WordPress?
- Role based permission edit for plugins
- How to add an admin alert for missing plugins
- Creating teams of users in WordPress
- WordPress Membership Plugin Advice [closed]
- Ajax request sends url rather than data
- Gathering all Custom Post Type posts in to array/object the proper way
- How to add captcha to publish widget
- Plugin privelages for “editors”
- Adding a jQuery modal dialog to the admin area
- Redirect plugin after form submit or show errors
- Plugin access and Roles
- How to create a plugin page that shows XML?
- Plugin Hook When New Author Added
- What is the most efficient way of adding additional functionaliy for admin only
- Adding plugin editing capability for Author
- Show an admin menu item in Editor role
- implement custom roles in custom plugin
- How to create admin setting for this small plugin
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- Allow a particular user to access a particular plugin?
- Admin Custom Plugin List Files in admin Table
- See which user role / capability is needed to use a plugin
- Hide all Admin Notices and move on a separate page
- Need help with Task assigning and rewarding as currency which withdrawable
- Can I create a separate admin section for my plugin?
- how to create user profile pages and display them based on users roles
- Allow editor user to full permission to access plugin settings
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- Allow a page to be edited by a specific custom role
- How to make this custom capability work? [duplicate]
- How to create different views for different user roles?
- Public WP website with one area just for members
- How can I disable access to plugin settings in wp admin for other roles
- Remove dashboard links from wordpress
- How to show private pages based on a user’s role?
- How do I restrict a second admin certain access?
- Echo custom admin field into a is_single()
- User / membership Plugin [closed]
- Restrict role to use a plugin
- Add_Meta_box to custom page (formidable edit post)
- Why user profile update creates Additional Capabilities
- Get content and send to 3rd party
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Overwrite user role
- How to enable Admins to see Plugins
- Admin page and admin menu. Permissions plugin
- Run only on plug-in activation instead of wp_head