Allow other user roles to access all in one seo settings
Hi all, today i am sharing a wordpress snippet for Allow other user roles to access all in one seo settings, means normally all in one seo settings access is only for the administrator but i need to assign the full control of all in one seo plugin to another user role ( here it is editor). Add the following code to your theme functions.php file, this code will allow other user roles to access all in one seo settings.
function can_use_SEO() { if (is_admin()) { $role = get_role( 'editor' ); if ( is_object( $role ) ) $role->add_cap( 'aiosp_manage_seo' ); } } add_action( 'admin_init', 'can_use_SEO', 1 );