Making WordPress.org


Ignore:
Timestamp:
11/01/2022 02:36:20 AM (3 years ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@b3bf342

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php

    r12067 r12174  
    2222    register_lesson_plan_series();
    2323    register_workshop_series();
    24     register_workshop_topic();
    2524    register_workshop_type();
    2625    register_wp_version();
    2726    register_included_content();
     27    register_topic();
    2828}
    2929
     
    234234    );
    235235
    236     $args   = array(
     236    $args = array(
    237237        'labels'            => $labels,
    238238        'hierarchical'      => true,
     
    298298
    299299/**
    300  * Register the Workshop Series taxonomy.
     300 * Register the Lesson Plan Series taxonomy.
    301301 */
    302302function register_lesson_plan_series() {
     
    387387
    388388/**
    389  * Register the Workshop Topic taxonomy.
    390  */
    391 function register_workshop_topic() {
    392     $labels = array(
    393         'name'                       => _x( 'Topics', 'Topic Plans associated to tutorial.', 'wporg-learn' ),
     389 * Register the Topic taxonomy.
     390 */
     391function register_topic() {
     392    $labels = array(
     393        'name'                       => _x( 'Topics', 'Topics associated with the content.', 'wporg-learn' ),
    394394        'singular_name'              => _x( 'Topic', 'Taxonomy Singular Name', 'wporg-learn' ),
    395395        'menu_name'                  => __( 'Topics', 'wporg-learn' ),
     
    411411        'items_list'                 => __( 'Topic list', 'wporg-learn' ),
    412412        'items_list_navigation'      => __( 'Topic list navigation', 'wporg-learn' ),
     413        'back_to_items'              => __( '← Back to topics', 'wporg-learn' ),
    413414    );
    414415
     
    424425        'show_in_rest'      => true,
    425426        'capabilities'      => array(
    426             'assign_terms' => 'edit_workshops',
    427         ),
    428     );
    429 
    430     register_taxonomy( 'topic', array( 'wporg_workshop' ), $args );
     427            'assign_terms' => 'edit_any_learn_content', // See \WPOrg_Learn\Capabilities\map_meta_caps.
     428        ),
     429    );
     430
     431    register_taxonomy( 'topic', array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson', 'meeting' ), $args );
    431432}
    432433
Note: See TracChangeset for help on using the changeset viewer.