1 | <?php |
---|
2 | /** |
---|
3 | * Plugin Name: Example of issue 38053 |
---|
4 | * Plugin URI: http://circularcontent.nl |
---|
5 | * Description: Example of issue 38053 |
---|
6 | * Author: Bjorn Wijers <burobjorn at burobjorn dot nl> |
---|
7 | * Author URI: http://burobjorn.nl |
---|
8 | * License: GPLv2 or later |
---|
9 | * Version: 0.0.0 |
---|
10 | * |
---|
11 | */ |
---|
12 | |
---|
13 | function issue_38053_example_tax_init() { |
---|
14 | register_taxonomy( 'example-tax', array( 'post' ), array( |
---|
15 | 'hierarchical' => false, |
---|
16 | 'public' => true, |
---|
17 | 'show_in_nav_menus' => true, |
---|
18 | 'show_ui' => true, |
---|
19 | 'show_admin_column' => false, |
---|
20 | 'query_var' => true, |
---|
21 | 'rewrite' => true, |
---|
22 | 'capabilities' => array( |
---|
23 | 'manage_terms' => 'activate_plugins', |
---|
24 | 'edit_terms' => 'activate_plugins', |
---|
25 | 'delete_terms' => 'activate_plugins', |
---|
26 | 'assign_terms' => 'edit_posts' |
---|
27 | ), |
---|
28 | 'labels' => array( |
---|
29 | 'name' => __( 'Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
30 | 'singular_name' => _x( 'Example taxonomy', 'taxonomy general name', 'YOUR-TEXTDOMAIN' ), |
---|
31 | 'search_items' => __( 'Search Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
32 | 'popular_items' => __( 'Popular Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
33 | 'all_items' => __( 'All Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
34 | 'parent_item' => __( 'Parent Example taxonomy', 'YOUR-TEXTDOMAIN' ), |
---|
35 | 'parent_item_colon' => __( 'Parent Example taxonomy:', 'YOUR-TEXTDOMAIN' ), |
---|
36 | 'edit_item' => __( 'Edit Example taxonomy', 'YOUR-TEXTDOMAIN' ), |
---|
37 | 'update_item' => __( 'Update Example taxonomy', 'YOUR-TEXTDOMAIN' ), |
---|
38 | 'add_new_item' => __( 'New Example taxonomy', 'YOUR-TEXTDOMAIN' ), |
---|
39 | 'new_item_name' => __( 'New Example taxonomy', 'YOUR-TEXTDOMAIN' ), |
---|
40 | 'separate_items_with_commas' => __( 'Example taxonomies separated by comma', 'YOUR-TEXTDOMAIN' ), |
---|
41 | 'add_or_remove_items' => __( 'Add or remove Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
42 | 'choose_from_most_used' => __( 'Choose from the most used Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
43 | 'not_found' => __( 'No Example taxonomies found.', 'YOUR-TEXTDOMAIN' ), |
---|
44 | 'menu_name' => __( 'Example taxonomies', 'YOUR-TEXTDOMAIN' ), |
---|
45 | ), |
---|
46 | 'show_in_rest' => true, |
---|
47 | 'rest_base' => 'example-tax', |
---|
48 | 'rest_controller_class' => 'WP_REST_Terms_Controller', |
---|
49 | ) ); |
---|
50 | |
---|
51 | } |
---|
52 | add_action( 'init', 'issue_38053_example_tax_init' ); |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | ?> |
---|