The custom role needs the read capability to view the backend.
Example:
$your_role = get_role('your_custom_role');
$your_role->add_cap( 'read' );
See: https://wordpress.org/documentation/article/roles-and-capabilities/#read
Ideally, this should only be done once, e.g. when activating your plugin or theme.
Related Posts:
- add_meta_boxes action with refresh on save
- Use wc_enqueue_js only on specific pages – nested add_action
- How to access function from outside of a class within this class in WP plugin?
- action hook wp_head higher priority as all other plugins/hooks
- Adding Default Settings to Theme My Login plugin
- Adding widgets to my plugin page instead of WordPress dashboard
- Adding function to Genesis genesis_header [closed]
- Action Hook Inside WordPress Plugin Shortcode
- Woocommerce custom Plugin in wordpress [closed]
- How do I remove an action hook inside a class that is called by another class?
- Submit to itself don’t work
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- what is correct way to hook when update post
- Custom plugin: Trying to show saved data on frontend
- How to set custom cookies before output
- Do I require the use of nonce?
- Check php version before theme activation
- Fatal error: Call to undefined function plugin_dir_path()
- How to make WordPress plugin check for database changes and then do something?
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- How to use copy() function and paste file in /wp-content/themes directory
- Use composer to load custom classes [closed]
- wordpress custom endpoint multiple params
- Delete option value from array using update_option()
- Am I not understanding plugins?
- Extend a class of a plugin
- Page Reloads Before AJAX Request Finishes
- Add htaccess rules with insert_with_markers at beginning of htaccess
- Insert array data on plugin activation
- Custom Form Processing Issue
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to sanitize any integer input field in wordpress?
- WordPress ajax doesn’t display object method on jQuery .change() function
- filter default query to show just selected level of child pages in wordpress
- Set meta field to publish date + 2 weeks
- How to make my custom widget appear within WordPress widgets? Plugin development
- How to insert data into database using wp cron job
- Access Child Class of Plugin Main Class Instance
- Modify custom field input data before creating a new post
- Font Awesome changing default WordPress Font
- Should `wp_login` be used since it’s deprecated?
- Download full html page with CSV export plugin
- How to show a users bio on a page
- Change order of custom submenu link in WP Admin?
- Usage of call back function of add_meta_box()
- WordPress redirect redirecting too many times or not at all
- how to save checkbox data for custom setting?
- How to Schedule Cronjobs for start of every month and year
- Display attribute on shop page after the title
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Removed jQuery script from header.php , any problems?
- How can I get plugin meta data without knowing the plugin folder?
- calling admin-ajax.php from admin-ajax.php
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- How does add_option() function enable action hooks to fire right after actiavtion?
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- Settings API form – submit with AJAX
- Post form – AJAX won’t upload featured image – Plugin development
- Remove an action created by a Gravity Forms add-on
- Submit remote form to wordpress REST API and save data to custom post type
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- How to import woocommerce custom fields data into another site?
- Add a custom link to each image in WordPress gallery
- Problem with my Login Plugin
- How to access this jQuery/AJAX data in a PHP file/WordPress plugin
- post_exists stops working in a scheduled event
- register dependency css and js inside a plugin class
- When I create a new custom post type, it replaces the old post type
- Taxonomy Child Term, Counter is staying on 0
- Help on Wp_query to print an term
- Add .php to end of all WordPress Pages (multisite)
- Upload images from one server to an other in wordpress
- PHP get_category() function redeclared
- Getting Member Data From WhishList Member on Register
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- global $post inside plugin query messes up every new post page in wp-admin
- wp_query (or hook) posts by date (id) in array then set post_type
- Chosen Select jquery Not Working in Plugin
- PHP calling function within a class
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- At what point during a typical request does the $wpdb object become available?
- Save data of select list after clicking save
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- Can’t remove menu items added by plugin
- Issues separating my Plugin pages into different files
- Fix incorrect related posts code snippet
- How to hide Ads From Certain Categories?
- Custom field fetch error on woocommerce pdf invoice
- Redirect users by role to custom pages
- I want to lists posts in wordpress to nearest location entered by the user
- getJSON response to PHP
- Custom plugin with shortcode not working
- wp_register_script – illegal string offset
- How can I modify the html output of a custom post type admin page?