diff --git a/wp-content/themes/pub/wporg-learn-2024/functions.php b/wp-content/themes/pub/wporg-learn-2024/functions.php index 171fd0fe8..e3d08c1a0 100644 --- a/wp-content/themes/pub/wporg-learn-2024/functions.php +++ b/wp-content/themes/pub/wporg-learn-2024/functions.php @@ -7,6 +7,11 @@ */ require __DIR__ . '/inc/admin.php'; +/** + * Capabilities. + */ +require __DIR__ . '/inc/capabilities.php'; + /** * Taxonomies. */ diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/capabilities.php b/wp-content/themes/pub/wporg-learn-2024/inc/capabilities.php new file mode 100644 index 000000000..2fc0727b2 --- /dev/null +++ b/wp-content/themes/pub/wporg-learn-2024/inc/capabilities.php @@ -0,0 +1,42 @@ +cap->edit_posts ) ) { + $required_caps[] = $object->cap->edit_posts; + break 2; // Breaks out of the foreach and the switch. + } + } + + $required_caps[] = 'do_not_allow'; + break; + } + + return $required_caps; +} diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/taxonomy.php b/wp-content/themes/pub/wporg-learn-2024/inc/taxonomy.php index 4c561af47..332d822b2 100644 --- a/wp-content/themes/pub/wporg-learn-2024/inc/taxonomy.php +++ b/wp-content/themes/pub/wporg-learn-2024/inc/taxonomy.php @@ -54,7 +54,7 @@ function register_experience_level() { 'show_tagcloud' => false, 'show_in_rest' => true, 'capabilities' => array( - 'assign_terms' => 'edit_lessons', + 'assign_terms' => 'edit_any_learn_content', // See WordPressdotorg\Theme\Learn_2024\Capabilities\map_meta_caps. ), );