Dearest Joost
Do you mind changing the code which creates the menus in /admin/class-admin.php
? If you think of a reason why this is a bad or creates a potential problem, I totally understand. But if you made the change, us site admins would be able to grant access to the SEO menus to our custom user roles by simply creating a filter.
Thanks in advance for the consideration.
Current code:
add_menu_page( __( 'WordPress SEO Configuration', 'wordpress-seo' ), __( 'SEO', 'wordpress-seo' ), 'manage_options', 'wpseo_dashboard', array( $this, 'config_page' ), WPSEO_URL . 'images/yoast-icon.png' );
add_submenu_page( 'wpseo_dashboard', __( 'Titles & Metas', 'wordpress-seo' ), __( 'Titles & Metas', 'wordpress-seo' ), 'manage_options', 'wpseo_titles', array( $this, 'titles_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Social', 'wordpress-seo' ), __( 'Social', 'wordpress-seo' ), 'manage_options', 'wpseo_social', array( $this, 'social_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'XML Sitemaps', 'wordpress-seo' ), __( 'XML Sitemaps', 'wordpress-seo' ), 'manage_options', 'wpseo_xml', array( $this, 'xml_sitemaps_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Permalinks', 'wordpress-seo' ), __( 'Permalinks', 'wordpress-seo' ), 'manage_options', 'wpseo_permalinks', array( $this, 'permalinks_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Internal Links', 'wordpress-seo' ), __( 'Internal Links', 'wordpress-seo' ), 'manage_options', 'wpseo_internal-links', array( $this, 'internallinks_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'RSS', 'wordpress-seo' ), __( 'RSS', 'wordpress-seo' ), 'manage_options', 'wpseo_rss', array( $this, 'rss_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Import & Export', 'wordpress-seo' ), __( 'Import & Export', 'wordpress-seo' ), 'manage_options', 'wpseo_import', array( $this, 'import_page' ) );
New code:
add_menu_page( __( 'WordPress SEO Configuration', 'wordpress-seo' ), __( 'SEO', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_dashboard', array( $this, 'config_page' ), WPSEO_URL . 'images/yoast-icon.png' );
add_submenu_page( 'wpseo_dashboard', __( 'Titles & Metas', 'wordpress-seo' ), __( 'Titles & Metas', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_titles', array( $this, 'titles_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Social', 'wordpress-seo' ), __( 'Social', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_social', array( $this, 'social_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'XML Sitemaps', 'wordpress-seo' ), __( 'XML Sitemaps', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_xml', array( $this, 'xml_sitemaps_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Permalinks', 'wordpress-seo' ), __( 'Permalinks', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_permalinks', array( $this, 'permalinks_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Internal Links', 'wordpress-seo' ), __( 'Internal Links', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_internal-links', array( $this, 'internallinks_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'RSS', 'wordpress-seo' ), __( 'RSS', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_rss', array( $this, 'rss_page' ) );
add_submenu_page( 'wpseo_dashboard', __( 'Import & Export', 'wordpress-seo' ), __( 'Import & Export', 'wordpress-seo' ), apply_filters('wpseo_manage_capability','manage_options'), 'wpseo_import', array( $this, 'import_page' ) );
Update:
One of my colleagues pointed out that there are probably other places where the user capability ‘manage_options’ is a condition. Even still, if all locations are handled by the apply_filters tag then it will work just fine.