WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 25. 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

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

Related Articles

  • How to Allow WP Users (other than administrator) to Add and Manage Properties in Admin Dashboard
  • Technical How to: Child theme
  • Child Theme: How to add links to copyright message
  • How to install WpResidence child theme

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 13. WPResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • 04. Theme Options & Global Settings
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • 20. Translations & Languages
  • 26. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 19. Included Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 24. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

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