How do I clear user permissions from the WordPress object cache? How do I clear user permissions from the WordPress object cache? wordpress wordpress

How do I clear user permissions from the WordPress object cache?


I'm not very shure if this is connected with user role capabilities, but if it is...this should be a little script to reset administrator capabilities to defaults:

add_action( 'after_setup_theme', 'add_roles_caps' );function add_roles_caps() {  $caps = array(    "edit_post",    "read_post",    "delete_post",    "edit_posts",    ...  );  $roles = array(    get_role( 'administrator' ),    get_role( 'subscriber' ),  );  foreach ($roles as $role) {    foreach ($caps as $cap) {      $role->add_cap( $cap );    }  }}

This is an example.. you should fill $caps array with all capabilities, listed here