Role capabilities issue

I solved the issue! If you create a new CPT with the function register_post_type You have to add this line in the array with arguments ‘map_meta_cap’ => true, Now you can set capabilities to a role like below add_role(‘owner’, ‘Eigenaar’, array( ‘read’ => true, ‘publish_agendas’ => true, ‘edit_agenda’ => true, ‘edit_agendas’ => true, ‘delete_agenda’ => … Read more

Hiding custom theme functionality using capabilities

If what you want to do is to hide the menu items you can make use of remove_menu_page and remove_submenu_page by hooking into admin_menu. In order to hide certain links based on the user’s role (in your case, Editor): function custom_remove_menus(){ // Get current user’s data $current_user = wp_get_current_user(); $user_id = $current_user->ID; // Check user’s … Read more

How to disable Edit Post and Allow only Custom Field?

You can remove post type support for the editor on a conditional basis. The following should work: add_action( ‘add_meta_boxes’, ‘wpse45113_remove_editor’ ); function wpse45113_remove_editor() { // change the capability and post type to whatever is appropriate if ( ! current_user_can( ‘install_plugins’ ) ) remove_post_type_support( ‘post’, ‘editor’ ); } I’m using add_meta_boxes because it fires not too … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)