Changeset 12268 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php
- Timestamp:
- 11/23/2022 02:00:20 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/taxonomy.php
r12259 r12268 10 10 add_action( 'init', __NAMESPACE__ . '\register' ); 11 11 add_action( 'audience_add_form_fields', __NAMESPACE__ . '\register_custom_fields' ); 12 add_action( 'wporg_lesson_category_add_form_fields', __NAMESPACE__ . '\register_custom_fields' );13 12 add_action( 'topic_add_form_fields', __NAMESPACE__ . '\register_custom_fields' ); 14 13 add_action( 'audience_edit_form_fields', __NAMESPACE__ . '\tax_edit_term_fields', 10, 2 ); 15 add_action( 'wporg_lesson_category_edit_form_fields', __NAMESPACE__ . '\tax_edit_term_fields', 10, 2 );16 14 add_action( 'topic_edit_form_fields', __NAMESPACE__ . '\tax_edit_term_fields', 10, 2 ); 17 15 add_action( 'created_audience', __NAMESPACE__ . '\tax_save_term_fields' ); 18 16 add_action( 'edited_audience', __NAMESPACE__ . '\tax_save_term_fields' ); 19 add_action( 'created_wporg_lesson_category', __NAMESPACE__ . '\tax_save_term_fields' );20 add_action( 'edited_wporg_lesson_category', __NAMESPACE__ . '\tax_save_term_fields' );21 17 add_action( 'created_topic', __NAMESPACE__ . '\tax_save_term_fields' ); 22 18 add_action( 'edited_topic', __NAMESPACE__ . '\tax_save_term_fields' ); … … 27 23 function register() { 28 24 register_lesson_audience(); 29 register_lesson_category();30 25 register_lesson_duration(); 31 26 register_lesson_group(); … … 83 78 84 79 register_taxonomy( 'audience', array( 'lesson-plan' ), $args ); 85 }86 87 /**88 * Register the Lesson Category taxonomy.89 */90 function register_lesson_category() {91 $labels = array(92 'name' => _x( 'Lesson Categories', 'Taxonomy General Name', 'wporg-learn' ),93 'singular_name' => _x( 'Lesson Category', 'Taxonomy Singular Name', 'wporg-learn' ),94 'menu_name' => __( 'Categories', 'wporg-learn' ),95 'all_items' => __( 'All Lesson Categories', 'wporg-learn' ),96 'new_item_name' => __( 'New Lesson Category', 'wporg-learn' ),97 'add_new_item' => __( 'Add New Lesson Category', 'wporg-learn' ),98 'edit_item' => __( 'Edit Lesson Category', 'wporg-learn' ),99 'update_item' => __( 'Update Lesson Category', 'wporg-learn' ),100 'view_item' => __( 'View Lesson Category', 'wporg-learn' ),101 'separate_items_with_commas' => __( 'Separate lesson categories with commas', 'wporg-learn' ),102 'add_or_remove_items' => __( 'Add or remove lesson categories', 'wporg-learn' ),103 'choose_from_most_used' => __( 'Choose from the most used', 'wporg-learn' ),104 'popular_items' => __( 'Popular lesson categories', 'wporg-learn' ),105 'search_items' => __( 'Search lesson categories', 'wporg-learn' ),106 'not_found' => __( 'Not Found', 'wporg-learn' ),107 'no_terms' => __( 'No lesson categories', 'wporg-learn' ),108 'items_list' => __( 'Lesson Categories list', 'wporg-learn' ),109 'items_list_navigation' => __( 'Lesson Categories list navigation', 'wporg-learn' ),110 );111 112 $args = array(113 'labels' => $labels,114 'hierarchical' => true,115 'public' => true,116 'rewrite' => array(117 'slug' => 'lesson-plans',118 ),119 'show_ui' => true,120 'show_admin_column' => true,121 'show_in_nav_menus' => false,122 'show_tagcloud' => false,123 'show_in_rest' => true,124 'capabilities' => array(125 'assign_terms' => 'edit_lesson_plans',126 ),127 );128 129 register_taxonomy( 'wporg_lesson_category', array( 'lesson-plan' ), $args );130 80 } 131 81
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)