Making WordPress.org


Ignore:
Timestamp:
08/23/2021 09:54:33 PM (4 years ago)
Author:
coreymckrill
Message:

WordPress.org Learn: Sync with GitHub

https://github.com/WordPress/learn/compare/f98b15bae834689a46f35ed602251647b29ff78f...3238fc6851d4126e3d83ab4cbb5014e5249764b3

File:
1 edited

Legend:

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

    r10528 r11193  
    2222    register_workshop_series();
    2323    register_workshop_topic();
     24    register_wp_version();
     25    register_included_content();
    2426}
    2527
     
    359361    register_taxonomy( 'topic', array( 'wporg_workshop' ), $args );
    360362}
     363
     364/**
     365 * Register the WordPress Versions taxonomy.
     366 */
     367function register_wp_version() {
     368    $labels = array(
     369        'name'                       => _x( 'WordPress Version', 'taxonomy general name', 'wporg-learn' ),
     370        'singular_name'              => _x( 'WordPress Version', 'taxonomy singular name', 'wporg-learn' ),
     371        'menu_name'                  => __( 'WP Version', 'wporg-learn' ),
     372        'all_items'                  => __( 'All WordPress versions', 'wporg-learn' ),
     373        'new_item_name'              => __( 'New WordPress version', 'wporg-learn' ),
     374        'add_new_item'               => __( 'Add WordPress version', 'wporg-learn' ),
     375        'edit_item'                  => __( 'Edit WordPress version', 'wporg-learn' ),
     376        'update_item'                => __( 'Update WordPress version', 'wporg-learn' ),
     377        'view_item'                  => __( 'View WordPress version', 'wporg-learn' ),
     378        'separate_items_with_commas' => __( 'Separate WordPress versions with commas', 'wporg-learn' ),
     379        'add_or_remove_items'        => __( 'Add or remove WordPress version', 'wporg-learn' ),
     380        'choose_from_most_used'      => __( 'Choose from the most used', 'wporg-learn' ),
     381        'popular_items'              => __( 'Popular WordPress versions', 'wporg-learn' ),
     382        'search_items'               => __( 'Search WordPress versions', 'wporg-learn' ),
     383        'not_found'                  => __( 'No WordPress version found', 'wporg-learn' ),
     384        'no_terms'                   => __( 'No WordPress versions', 'wporg-learn' ),
     385        'items_list'                 => __( 'WordPress version list', 'wporg-learn' ),
     386        'items_list_navigation'      => __( 'WordPress version list navigation', 'wporg-learn' ),
     387        'back_to_items'              => __( '← Back to WordPress Versions', 'wporg-learn' ),
     388    );
     389
     390    $args = array(
     391        'labels'            => $labels,
     392        'hierarchical'      => true,
     393        'public'            => false,
     394        'show_ui'           => true,
     395        'show_admin_column' => true,
     396        'show_in_nav_menus' => true,
     397        'show_tagcloud'     => false,
     398        'show_in_rest'      => true,
     399    );
     400
     401    $post_types = array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson' );
     402
     403    register_taxonomy( 'wporg_wp_version', $post_types, $args );
     404}
     405
     406/**
     407 * Register the Included Content taxonomy.
     408 */
     409function register_included_content() {
     410    $labels = array(
     411        'name'                       => _x( 'Included Content', 'taxonomy general name', 'wporg-learn' ),
     412        'singular_name'              => _x( 'Included Content', 'taxonomy singular name', 'wporg-learn' ),
     413        'menu_name'                  => __( 'Included Content', 'wporg-learn' ),
     414        'all_items'                  => __( 'All included content', 'wporg-learn' ),
     415        'new_item_name'              => __( 'New included content', 'wporg-learn' ),
     416        'add_new_item'               => __( 'Add included content', 'wporg-learn' ),
     417        'edit_item'                  => __( 'Edit included content', 'wporg-learn' ),
     418        'update_item'                => __( 'Update included content', 'wporg-learn' ),
     419        'view_item'                  => __( 'View included content', 'wporg-learn' ),
     420        'separate_items_with_commas' => __( 'Separate included content items with commas', 'wporg-learn' ),
     421        'add_or_remove_items'        => __( 'Add or remove included content', 'wporg-learn' ),
     422        'choose_from_most_used'      => __( 'Choose from the most used', 'wporg-learn' ),
     423        'popular_items'              => __( 'Popular included content items', 'wporg-learn' ),
     424        'search_items'               => __( 'Search included content', 'wporg-learn' ),
     425        'not_found'                  => __( 'No included content found', 'wporg-learn' ),
     426        'no_terms'                   => __( 'No included content', 'wporg-learn' ),
     427        'items_list'                 => __( 'Included content list', 'wporg-learn' ),
     428        'items_list_navigation'      => __( 'Included content list navigation', 'wporg-learn' ),
     429        'back_to_items'              => __( '← Back to Included Content', 'wporg-learn' ),
     430    );
     431
     432    $args = array(
     433        'labels'            => $labels,
     434        'hierarchical'      => true,
     435        'public'            => false,
     436        'show_ui'           => true,
     437        'show_admin_column' => true,
     438        'show_in_nav_menus' => true,
     439        'show_tagcloud'     => false,
     440        'show_in_rest'      => true,
     441    );
     442
     443    $post_types = array( 'lesson-plan', 'wporg_workshop', 'course', 'lesson' );
     444
     445    register_taxonomy( 'wporg_included_content', $post_types, $args );
     446}
Note: See TracChangeset for help on using the changeset viewer.