I created an admin menu page in WordPress. But it is accessible only to admin. How to make it available to the editor also.
JavaScript
x
function essof_add_setup_page()
{
add_menu_page(
__('Essof Setup', 'textdomain'),
__('Essof Setup', 'textdomain'),
'manage_options',
'setup',
'essof_setup_page',
'dashicons-admin-tools',
4
);
}
add_action('admin_menu', 'essof_add_setup_page');
Advertisement
Answer
You’ll need to change the capability to an editor’s capability, i.e., editor:
JavaScript
add_menu_page(
'parent_slug',
'page_title',
'menu_title',
'editor',
'menu_slug',
'callback function'
);
Check here for detailed description: https://developer.wordpress.org/reference/functions/add_menu_page/