WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical: Child Theme / Technical – How to Grant Access to Custom Post Type Capabilities for a Specific Role after 5.1.1 Theme Update

Technical – How to Grant Access to Custom Post Type Capabilities for a Specific Role after 5.1.1 Theme Update

718 views 0

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:

  1. Install and activate the Members plugin.

  2. Go to Members > Roles in your WordPress Dashboard.

  3. Edit the desired role (e.g., Editor).

  4. Check the capabilities you want to assign (like edit_estate_property, publish_estate_properties, etc.).

  5. 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);
    }
});
Technical: Child Theme

Related Articles

  • Disable WordPress PDF Preview Thumbnails for Property PDF Uploads
  • Technical How to: Child theme
  • How to install WpResidence child theme
  • Child Theme: How to make child theme changes to work with theme Minifiy option enabled
MLSImportWordPress IDX Plugin for MLS ListingsImport MLS listings into your WordPress website, customize your property pages, and keep your inventory updated.Start free 30-day trial →

Help Categories

  • 111 Installation & Changelog
  • 19Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 14Footer
  • 38Header
  • 2IDX & MLSImport
  • 23Maps & Location Settings
  • 50Multilingual Websites – WPEstate Translate (Included)
  • 21Pages & Page Templates
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 38Property Single Page
  • 32Search & Filtering
  • 170Technical how to | Custom Code
  • 9Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 6Theme Translation & Localization
  • 28Third Party Plugins Compatible
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 9WPResidence Elementor Studio
  • 39WPResidence Elementor Widgets
  • 79WPResidence FAQ

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API