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 check if user is in back end?
- How do i know the current post type when on post.php in admin?
- Create tabs inside Plugins Admin Page [closed]
- Deactivate plugin for a specific user group
- Publish author posts only with editor approval?
- How can I modify the Capability needed to access a plugin’s options?
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- Plugin or mod for wordpress to make content publication SUPER easy
- How do I only load a plugin js on it’s settings pages?
- Disable text tab on WordPress text-editor
- How to add a help tab to all admin pages – including plugin pages
- Allowing Custom Capability to Manage Plugin Options
- Custom plugin settings: clicking “save changes” does not display success message
- Disable plugins for a specific user role
- User profiles and object associations
- How to develop a community feature in the dashboard for multiauthor site
- Dynamic homepage according to user role
- WordPress roles – Protect administrator role
- What’s the point of using WordPress’s built in admin-ajax.php?
- How can I get a list of plugins and which blogs are using them?
- Filter or action hook to insert content on admin pages before tag
- How to set CORS header?
- How to edit/delete single row items in a table on my own menu page
- Keep user’s privileges on accessing contents in JSON response
- How do I remove the entire left nav bar in admin for certain level users?
- Change wording of admin menu item?
- How create a role with admin capability less 1 or 2?
- Set user ID at time of wp_create_user
- Set of plugins to control the Admin UI
- Getting user roles in plugin files
- Which plugin will let me decide what users have access to on their side bar in wp-admin?
- What would be the advantages/disadvantages of remote plugin installation?
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Disable plugin per user role
- Remove Duplicator plugin from admin menu if not an administrator
- Doubt using $wpbd->get_col for a single column
- Add a custom form on the post-new.php admin page
- how to give a user a role?
- Redirection of users away from wp-admin (but not administrators)
- Admin accounts unable to see plugins from external IP
- Plugin dependencies: show notice like theme plugins dependencies
- WordPress wp-admin/network/plugin-install
- how to access all user dashboard on fronted page [closed]
- 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”
- How to allow Contributors to publish articles after approval
- WordPress Admin Menu defining function is seperate file
- Create WordPress posts from JSON array using plugin in admin
- Plugin getting Cannot modify header information errors
- 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
- 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
- Mutliple users editing single document in wordspress
- Add logo to admin menu in my plugin
- Role based permission edit for plugins
- How to add an admin alert for missing plugins
- WordPress Membership Plugin Advice [closed]
- Redirect plugin after form submit or show errors
- Plugin access and Roles
- How to create a plugin page that shows XML?
- Adding plugin editing capability for Author
- Show an admin menu item in Editor role
- 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
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- Allow a page to be edited by a specific custom role
- How to create different views for different user roles?
- 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?
- 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.
- Admin page and admin menu. Permissions plugin
- Allow non-admin users to access plug-in
- Different email notifications (about pending posts) to different users
- Getting 404 page not found error while trying to access add new plugin / themes
- Create a blank admin page from plugin
- admin panel save option with ajax
- What would cause edit buttons for plugins to disappear?
- WordPress plugins not showing after switching servers
- Need help with restricted page for users
- How to give different user access to different people?
- registration plugin [closed]
- How to disable plugin capability : “create new category”
- Display Any Field fromAdmin Panel in Frontend via Shortcode?