That added the Settings menu at the left for a logged in Author.
Because the author role now has the required capabilities.
Then I removed the second line above and the Settings menu remains!
That’s because role data is stored in dedicated tables the same way as user meta and posts. It’s not like post type registration, it’s more like post/user creation.
I can reproduce this e.g. of ‘list-users’. It seems WordPress is caching the capabilities. How do I clear this cache and end this frustrating behaviour?
There is no cache, you would need to modify the role again with something like this:
$author_role = get_role('author');
$author_role->remove_cap('manage_options');
Or a CLI command such as this:
wp role reset author
Related Posts:
- Best way to show Dynamic Content on a Cached WordPress Site?
- Is define(‘WP_CACHE’, true) needed for object caching?
- Prevent WordPress from sending Cache-control http header
- Optimize apache for WP use
- Multiple WordPress sites eat up alot of RAM
- What exactly is an advanced object cache?
- Using a wildcard with delete_transient()
- wp_cache_set() or wp_cache_add()
- Which WordPress pages/URLs should never be cached?
- How to archive a wordpress site (make it read only)
- How to purge all transient caches?
- Stale cache handling with a persistent object cache
- Varnish + W3 Total Page Cache [closed]
- Are there any server requirements for WordPress transients to work properly?
- Writing a cache manifest file for a WordPress blog (app cache, offline web applications)
- W3 Total Cache doesn’t detect memcached [closed]
- can’t see live version of style.css – is it web server caching?
- Want to enforce the visitor to load the new version of your stylesheets and scripts [closed]
- Speed up WordPress
- wp-super-cache exclude file from caching
- WordPress caching in development
- W3 total Cache – Site with query strings
- Possible to configure nginx to ignore cache for logged in users in certain roles only?
- Check if a user is connected and get is ID without fully loading wordpress
- Should I enable FastCGI on WordPress?
- Will caching WordPress affect session variables, custom filed updates and displaying images from a non wordpress table?
- Getting soft 404 errors (200 status) when caching plugins are enabled
- Automatically enabled caching in some hosting companies w/o visible plugin (Must use plugin)
- How to purge all transient caches?
- W3 Total Cache plugin integration
- server load. $_SERVER[‘REMOTE_ADDR’] and $_SERVER[‘HTTP_HOST’] [closed]
- Optimizing Jetpack for WordPress [closed]
- Is it possible to save an entire piece of rendered HTML in a transient?
- Execute a piece of code also when the cached version of a page is served
- pass-protected pages and posts not protected after enter them 1 time
- Can a WordPress blog be entirely hosted on a CDN if cached?
- Static HTML page caching for large website [closed]
- To have WordPress interact with memcached it must be installed as a PHP extension?
- Prevent installation of style.css cookies and file caching
- How can I revert to showing cached pages when no database connection is available? [closed]
- WP Super Cache Bug with Ubermenu
- Problem with caching, W3TC [closed]
- Headway body classes and W3TC page cache conflict [closed]
- Reasonable Size Limit to options entry
- Is the object cached?
- How to find time last viewed?
- How can I cache the LearnDash quizzes on my server?
- How to cache a different page version based on HTTP header?
- WP_Object_Cache for heavy WP_Query
- How to store or cache custom shopping cart data for every user’s session
- Hook an action when a transient is deleted ? Can’t get it to work!
- WordPress PHP 5.5 and OPcache
- Accelerate and clean up WordPress [closed]
- How to make page/post password protected so you must reenter everytime you visit the page?
- Fixed version number for cached stylesheets and javascript
- How effective are cacheing plugins for dynamic pages?
- How can I permanently cache or “archive” a WP blog without needing future maintenance
- Any idea why Google not caching my site? [closed]
- RSS: fetch_feed caching with different caching delay per feed?
- How to be sure to get last page version without ANY cache?
- Last-Modified header support doesnât speed up server processing – want more
- Cloud flare, cache, minify question [closed]
- HIgh CPU usage – Will using cache plugins help
- Browser cache for dynamic content (list of tags)
- Jetpack stats and caching strategy [closed]
- How to specify expiration of cacheable resources? [closed]
- How do I serve fully cached full HTML on cloudfront
- w3 total cache – Object Caching 2165/2469 objects? [closed]
- Get user name and caching system
- Changing WP Object Caching during runtime
- How to solve simple wp simple ajax chat caching problem
- dynamic page not displaying correctly when Varnish hosting ignores query string parameters
- How to not cache nonces with WP Rocket?
- What do I do if my WordPress site is suddenly sanitizing portions of URLs it shouldn’t?
- Clear cache when comment is added
- How to make login / logout links cache independent?
- Why WordPress cache is not available after reload page?
- WordPress varnish pages printed twice
- Feed cache fallback – A feed could not be found
- custom php file inside my custom folder of plugins directory is not caching
- w3 total cache uninstall remove cache
- How to let users clear their posts cache with WP Super Cache?
- Completely reload style.css
- Having 4000 posts, my site is so slow
- Super cache caches mobile pages for desktop
- Should I use transients for these API call results?
- cache reset button and question about deleting cache
- Cleared wp-cache and file is still not updated [closed]
- User cannot authenticate after signup when object cache enabled
- W3 Total Cache Minification: way to revert back? [closed]
- get_theme_mod returning cached values regardless of apache restart
- Caching with dynamic content
- After Migration, Warning: include_once() errors on all pages
- Server Variables not recognized in certain posts
- Experiencing a weird caching issues without any caching plugins
- Cannot add version of main.css to wordpress on testing enviroment
- Cache a number of responses from external json feeds?
- How to create a transient that persists the data for the whole duration of the expiration, even when object cache is enabled?
- Why does enabling caching break password protected pages? Is there a way around this?
- Sage theme caching issue on WPEngine