Making WordPress.org


Ignore:
Timestamp:
10/29/2021 03:51:03 AM (5 years ago)
Author:
tellyworth
Message:

WordPress.org Learn: sync with GitHub

Props hlashbrooke, psykro, chetan200891

https://github.com/WordPress/learn/compare/0714b3f681310c0cca93ff4bf12aa31a84d5b736...f85bc0a5622798264b141d65a23d9feed1fc8e81

File:
1 edited

Legend:

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

    r11278 r11300  
    2323    register_workshop_series();
    2424    register_workshop_topic();
     25    register_workshop_type();
    2526    register_wp_version();
    2627    register_included_content();
     
    431432
    432433/**
     434 * Register the Workshop Type taxonomy.
     435 */
     436function register_workshop_type() {
     437    $labels = array(
     438        'name'                       => _x( 'Types', 'taxonomy general name', 'wporg-learn' ),
     439        'singular_name'              => _x( 'Type', 'taxonomy singular name', 'wporg-learn' ),
     440        'menu_name'                  => __( 'Types', 'wporg-learn' ),
     441        'all_items'                  => __( 'All types', 'wporg-learn' ),
     442        'parent_item'                => __( 'Parent type', 'wporg-learn' ),
     443        'parent_item_colon'          => __( 'Parent type:', 'wporg-learn' ),
     444        'new_item_name'              => __( 'New Type Name', 'wporg-learn' ),
     445        'add_new_item'               => __( 'Add Type', 'wporg-learn' ),
     446        'edit_item'                  => __( 'Edit Type', 'wporg-learn' ),
     447        'update_item'                => __( 'Update Type', 'wporg-learn' ),
     448        'view_item'                  => __( 'View Type', 'wporg-learn' ),
     449        'separate_items_with_commas' => __( 'Separate Types with commas', 'wporg-learn' ),
     450        'add_or_remove_items'        => __( 'Add or remove Type', 'wporg-learn' ),
     451        'choose_from_most_used'      => __( 'Choose from the most used', 'wporg-learn' ),
     452        'popular_items'              => __( 'Popular Types', 'wporg-learn' ),
     453        'search_items'               => __( 'Search Types', 'wporg-learn' ),
     454        'not_found'                  => __( 'No Type Found', 'wporg-learn' ),
     455        'no_terms'                   => __( 'No Type ', 'wporg-learn' ),
     456        'items_list'                 => __( 'Type list', 'wporg-learn' ),
     457        'items_list_navigation'      => __( 'Type list navigation', 'wporg-learn' ),
     458    );
     459
     460    $args = array(
     461        'labels'            => $labels,
     462        'hierarchical'      => true,
     463        'public'            => true,
     464        'query_var'         => 'wporg_workshop_type', // Prevent collisions with query params in the archive filter.
     465        'show_ui'           => true,
     466        'show_admin_column' => true,
     467        'show_in_nav_menus' => true,
     468        'show_tagcloud'     => false,
     469        'show_in_rest'      => true,
     470        'capabilities'      => array(
     471            'assign_terms' => 'edit_workshops',
     472        ),
     473    );
     474
     475    register_taxonomy( 'wporg_workshop_type', array( 'wporg_workshop' ), $args );
     476}
     477
     478/**
    433479 * Register the WordPress Versions taxonomy.
    434480 */
Note: See TracChangeset for help on using the changeset viewer.