<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[11269] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn: WordPress.org Learn: Sync with GitHub</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/11269">11269</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/11269","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coreymckrill</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-10-07 19:32:58 +0000 (Thu, 07 Oct 2021)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordPress.org Learn: Sync with GitHub

Props coreymckrill, iandunn

https://github.com/WordPress/learn/compare/01d376977b40af2d2e1d50e7d4eb2efbd07811d1...1b62e06cdd98e1e4b7d386a453f3021412fad3d5</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincposttypephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearninctaxonomyphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnwporglearnphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearninccapabilitiesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/capabilities.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearninccapabilitiesphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/capabilities.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/capabilities.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/capabilities.php   2021-10-07 19:32:58 UTC (rev 11269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,239 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+namespace WPOrg_Learn\Capabilities;
+
+defined( 'WPINC' ) || die();
+
+/**
+ * Actions and filters.
+ */
+add_filter( 'user_has_cap', __NAMESPACE__ . '\set_post_type_caps' );
+add_filter( 'user_has_cap', __NAMESPACE__ . '\set_caps_for_internal_notes' );
+add_filter( 'map_meta_cap', __NAMESPACE__ . '\map_meta_caps', 20, 4 ); // Needs to fire after meta caps in wporg-internal-notes.
+add_action( 'init', __NAMESPACE__ . '\add_or_update_lesson_plan_editor_role' );
+add_action( 'init', __NAMESPACE__ . '\add_or_update_workshop_reviewer_role' );
+
+/**
+ * Assign custom post type caps to roles based on their equivalents for the 'post' post type.
+ *
+ * Example: If a user has the `edit_others_posts` cap (from Editor role), this will also give them
+ * the equivalent `edit_others_lesson_plans` and `edit_others_workshops` caps.
+ *
+ * @param bool[] $user_caps A list of primitive caps (keys) and whether user has them (boolean values).
+ *
+ * @return array
+ */
+function set_post_type_caps( $user_caps ) {
+       $capability_types = array(
+               array( 'lesson_plan', 'lesson_plans' ),
+               array( 'workshop', 'workshops' ),
+       );
+
+       foreach ( $capability_types as $capability_type ) {
+               // Generate the caps for a capability type.
+               $cap_args = array(
+                       'capability_type' => $capability_type,
+                       'capabilities'    => array(),
+                       'map_meta_cap'    => true,
+               );
+               $cap_map = (array) get_post_type_capabilities( (object) $cap_args );
+
+               foreach ( $user_caps as $cap_slug => $granted ) {
+                       if ( $granted && isset( $cap_map[ $cap_slug ] ) ) {
+                               $user_caps[ $cap_map[ $cap_slug ] ] = true;
+                       }
+               }
+       }
+
+       return $user_caps;
+}
+
+/**
+ * Enable a cap for managing internal notes on workshop posts.
+ *
+ * The `promote_users` cap is shared by admin and workshop reviewer roles, which are the two roles
+ * that should also have access to internal notes.
+ *
+ * @param bool[] $user_caps
+ *
+ * @return mixed
+ */
+function set_caps_for_internal_notes( $user_caps ) {
+       if ( isset( $user_caps['promote_users'] ) && true === $user_caps['promote_users'] ) {
+               $user_caps['manage_workshop_internal_notes'] = true;
+       }
+
+       return $user_caps;
+}
+
+/**
+ * Map primitive caps to our custom caps.
+ *
+ * @param array  $required_caps
+ * @param string $current_cap
+ * @param int    $user_id
+ * @param mixed  $args
+ *
+ * @return mixed
+ */
+function map_meta_caps( $required_caps, $current_cap, $user_id, $args ) {
+       switch ( $current_cap ) {
+               case 'edit_any_learn_content':
+                       $required_caps       = array();
+                       $learn_content_types = array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson' );
+
+                       // Grant `edit_any_learn_content` when the user has `edit_posts` for any of our custom post types.
+                       foreach ( $learn_content_types as $post_type ) {
+                               $object = get_post_type_object( $post_type );
+                               if ( user_can( $user_id, $object->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;
+
+               case 'read-internal-notes':
+               case 'create-internal-note':
+               case 'delete-internal-note':
+                       // Override the meta caps set up in the Internal Notes plugin, specifically for the workshop post type.
+                       $parent = ! empty( $args[0] ) ? get_post( $args[0] ) : false;
+                       if ( $parent && 'wporg_workshop' === get_post_type( $parent ) ) {
+                               $required_caps = array( 'manage_workshop_internal_notes' );
+                       }
+                       break;
+       }
+
+       return $required_caps;
+}
+
+/**
+ * Add the Lesson Plan Editor role if it doesn't exist yet, or ensure it has the correct capabilities.
+ *
+ * Once a role has been added, and is stored in the database, it can't be changed using `add_role` because it
+ * will return early.
+ *
+ * @return \WP_Role|null
+ */
+function add_or_update_lesson_plan_editor_role() {
+       $role_caps = get_lesson_plan_editor_role_caps();
+       $lpe_role  = get_role( 'lesson_plan_editor' );
+
+       if ( is_null( $lpe_role ) ) {
+               $lpe_role = add_role(
+                       'lesson_plan_editor',
+                       __( 'Lesson Plan Editor', 'wporg-learn' ),
+                       $role_caps
+               );
+       } else {
+               $caps_to_remove = array_diff(
+                       array_keys( $lpe_role->capabilities, true, true ),
+                       array_keys( $role_caps, true, true )
+               );
+
+               foreach ( $caps_to_remove as $remove ) {
+                       $lpe_role->remove_cap( $remove );
+               }
+
+               $caps_to_add = array_diff(
+                       array_keys( $role_caps, true, true ),
+                       array_keys( $lpe_role->capabilities, true, true )
+               );
+
+               foreach ( $caps_to_add as $add ) {
+                       $lpe_role->add_cap( $add );
+               }
+       }
+
+       return $lpe_role;
+}
+
+/**
+ * Generate a list of capabilities for the Lesson Plan Editor role.
+ *
+ * The Lesson Plan Editor should have full editing caps for the Lesson Plan post type, but no other post types.
+ * They can assign/unassign terms from the various taxonomies to lesson plans, but they can't add/edit/delete terms.
+ *
+ * @return bool[]
+ */
+function get_lesson_plan_editor_role_caps() {
+       // Generate the caps for a capability type.
+       $cap_args = array(
+               'capability_type' => array( 'lesson_plan', 'lesson_plans' ),
+               'capabilities'    => array(),
+               'map_meta_cap'    => true,
+       );
+       $cap_map = (array) get_post_type_capabilities( (object) $cap_args );
+
+       $editor_caps = get_role( 'editor' )->capabilities;
+       $role_caps   = array();
+
+       // Same caps as the editor, but only for lesson plans, not posts.
+       foreach ( $cap_map as $primative_cap => $mapped_cap ) {
+               if ( isset( $editor_caps[ $primative_cap ] ) && $editor_caps[ $primative_cap ] ) {
+                       $role_caps[ $mapped_cap ] = true;
+               }
+       }
+
+       return $role_caps;
+}
+
+/**
+ * Add the Workshop Reviewer role if it doesn't exist yet, or ensure it has the correct capabilities.
+ *
+ * Once a role has been added, and is stored in the database, it can't be changed using `add_role` because it
+ * will return early.
+ *
+ * @return \WP_Role|null
+ */
+function add_or_update_workshop_reviewer_role() {
+       $role_caps = get_workshop_reviewer_role_caps();
+       $wr_role  = get_role( 'workshop_reviewer' );
+
+       if ( is_null( $wr_role ) ) {
+               $wr_role = add_role(
+                       'workshop_reviewer',
+                       __( 'Workshop Reviewer', 'wporg-learn' ),
+                       $role_caps
+               );
+       } else {
+               $caps_to_remove = array_diff(
+                       array_keys( $wr_role->capabilities, true, true ),
+                       array_keys( $role_caps, true, true )
+               );
+
+               foreach ( $caps_to_remove as $remove ) {
+                       $wr_role->remove_cap( $remove );
+               }
+
+               $caps_to_add = array_diff(
+                       array_keys( $role_caps, true, true ),
+                       array_keys( $wr_role->capabilities, true, true )
+               );
+
+               foreach ( $caps_to_add as $add ) {
+                       $wr_role->add_cap( $add );
+               }
+       }
+
+       return $wr_role;
+}
+
+/**
+ * Generate a list of capabilities for the Workshop Reviewer role.
+ *
+ * The Workshop Reviewer should have all the same caps as the Editor role, with the addition of `promote_users`
+ * (normally reserved for the Admin role), so that they can add workshop presenters as new users on the site.
+ *
+ * This also gives them the cap to manage internal notes on workshop posts. (See `set_caps_for_internal_notes` above.)
+ *
+ * @return bool[]
+ */
+function get_workshop_reviewer_role_caps() {
+       $role_caps = get_role( 'editor' )->capabilities;
+
+       $role_caps['promote_users'] = true;
+
+       return $role_caps;
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnincposttypephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php    2021-10-07 02:36:00 UTC (rev 11268)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/post-type.php      2021-10-07 19:32:58 UTC (rev 11269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,7 +74,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'has_archive'         => 'lesson-plans',
</span><span class="cx" style="display: block; padding: 0 10px">                'exclude_from_search' => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'publicly_queryable'  => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'capability_type'     => 'page',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'capability_type'     => array( 'lesson_plan', 'lesson_plans' ),
+               'map_meta_cap'        => true,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'show_in_rest'        => true,
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,7 +145,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'can_export'          => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'exclude_from_search' => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'publicly_queryable'  => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'capability_type'     => 'page',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'capability_type'     => array( 'workshop', 'workshops' ),
+               'map_meta_cap'        => true,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'show_in_rest'        => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'rewrite'             => array( 'slug' => 'workshop' ),
</span><span class="cx" style="display: block; padding: 0 10px">                'template'            => generate_workshop_template_structure(),
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearninctaxonomyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php     2021-10-07 02:36:00 UTC (rev 11268)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php       2021-10-07 19:32:58 UTC (rev 11269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,6 +62,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'audience', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,6 +107,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'wporg_lesson_category', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,6 +152,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'duration', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -187,6 +196,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'lesson_group', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,6 +241,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'instruction_type', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,6 +286,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_lesson_plans',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'level', array( 'lesson-plan' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,6 +332,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_workshops',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'wporg_workshop_series', array( 'wporg_workshop' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -356,6 +377,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_workshops',
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        register_taxonomy( 'topic', array( 'wporg_workshop' ), $args );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,6 +420,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_any_learn_content', // See \WPOrg_Learn\Capabilities\map_meta_caps.
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $post_types = array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,6 +465,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_nav_menus' => true,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_tagcloud'     => false,
</span><span class="cx" style="display: block; padding: 0 10px">                'show_in_rest'      => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'capabilities'      => array(
+                       'assign_terms' => 'edit_any_learn_content', // See \WPOrg_Learn\Capabilities\map_meta_caps.
+               ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $post_types = array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson' );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporglearnwporglearnphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php      2021-10-07 02:36:00 UTC (rev 11268)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/wporg-learn.php        2021-10-07 19:32:58 UTC (rev 11269)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,6 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function load_files() {
</span><span class="cx" style="display: block; padding: 0 10px">        require_once get_includes_path() . 'admin.php';
</span><span class="cx" style="display: block; padding: 0 10px">        require_once get_includes_path() . 'blocks.php';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        require_once get_includes_path() . 'capabilities.php';
</ins><span class="cx" style="display: block; padding: 0 10px">         require_once get_includes_path() . 'class-markdown-import.php';
</span><span class="cx" style="display: block; padding: 0 10px">        require_once get_includes_path() . 'events.php';
</span><span class="cx" style="display: block; padding: 0 10px">        require_once get_includes_path() . 'form.php';
</span></span></pre>
</div>
</div>

</body>
</html>