Created
September 24, 2018 16:19
-
-
Save ChrisHardie/dbac982a368ebc30b6d449b8732df4f7 to your computer and use it in GitHub Desktop.
WordPress one-time role/capability fix for Yoast SEO on Multisite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'my_add_seo_caps' ) ) { | |
function dnc_add_seo_caps() { | |
// Get admin role | |
$role = get_role( 'administrator' ); | |
// Add YOAST SEO Roles | |
$role->add_cap( 'wpseo_manage_options' ); | |
$role->add_cap( 'wpseo_edit_advanced_metadata' ); | |
$role->add_cap( 'wpseo_manage_redirects' ); | |
$role->add_cap( 'wpseo_bulk_edit' ); | |
} | |
add_action( 'init', 'my_add_seo_caps' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment