If you need to give specific user roles (like Editor) the ability to manage a custom post type like estate_property (properties) from Wp-Admin after 5.1.1 WpResidence theme update, you have two options:
Option 1: Use a Plugin (No Code Required)
You can use the free Members plugin by MemberPress to manage roles and capabilities through a visual interface.
Steps:
-
Install and activate the Members plugin.
-
Go to Members > Roles in your WordPress Dashboard.
-
Edit the desired role (e.g., Editor).
-
Check the capabilities you want to assign (like edit_estate_property, publish_estate_properties, etc.).
-
Save changes.
Option 2: Add Custom Code (for Developers)
If you prefer to use code, add the following snippet to your child theme’s functions.php file or a custom plugin:
add_action('init', function () { $role = get_role('editor'); // Change to 'administrator' or another role if needed if (!$role) return; $capabilities = array( 'edit_estate_property', 'read_estate_property', 'delete_estate_property', 'edit_estate_properties', 'edit_others_estate_properties', 'publish_estate_properties', 'read_private_estate_properties', 'create_estate_properties', 'delete_estate_properties', 'delete_private_estate_properties', 'delete_published_estate_properties', 'delete_others_estate_properties', 'edit_private_estate_properties', 'edit_published_estate_properties', ); foreach ($capabilities as $cap) { $role->add_cap($cap); } });