PluginProbe
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / trunk
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms vtrunk
3.53.0 3.52.0 3.51.0 3.50.0 3.45.0 3.38.0 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.40.0 3.40.1 3.41.0 3.42.0 3.43.0 3.44.0 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 All 177 releases
simple-tags / inc / utilities.php

utilities.php in Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms trunk, at inc/utilities.php

90 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Register media tags taxonomy
5 */
6
7 add_action('init', function () {
8 if ((int)get_option('taxopress_media_tag_deleted') === 0) {
9 $labels = [
10 "name" => __("Media Tags", "simple-tags"),
11 "singular_name" => __("Media Tag", "simple-tags"),
12 "menu_name" => __("Media Tags", "simple-tags"),
13 "all_items" => __("All Media Tags", "simple-tags"),
14 "edit_item" => __("Edit Media Tag", "simple-tags"),
15 "view_item" => __("View Media Tag", "simple-tags"),
16 "update_item" => __("Update Media Tag name", "simple-tags"),
17 "add_new_item" => __("Add new Media Tag", "simple-tags"),
18 "new_item_name" => __("New Media Tag name", "simple-tags"),
19 "parent_item" => __("Parent Media Tag", "simple-tags"),
20 "parent_item_colon" => __("Parent Media Tag:", "simple-tags"),
21 "search_items" => __("Search Media Tags", "simple-tags"),
22 "popular_items" => __("Popular Media Tags", "simple-tags"),
23 "separate_items_with_commas" => __("Separate Media Tags with commas", "simple-tags"),
24 "add_or_remove_items" => __("Add or remove Media Tags", "simple-tags"),
25 "choose_from_most_used" => __("Choose from the most used Media Tags", "simple-tags"),
26 "not_found" => __("No Media Tags found", "simple-tags"),
27 "no_terms" => __("No Media Tags", "simple-tags"),
28 "items_list_navigation" => __("Media Tags list navigation", "simple-tags"),
29 "items_list" => __("Media Tags list", "simple-tags"),
30 "back_to_items" => __("Back to Media Tags", "simple-tags"),
31 ];
32
33 $args = [
34 "label" => __("Media Tags", "simple-tags"),
35 "labels" => $labels,
36 "public" => true,
37 "publicly_queryable" => true,
38 "hierarchical" => false,
39 "show_ui" => true,
40 "show_in_menu" => true,
41 "show_in_nav_menus" => true,
42 "query_var" => true,
43 "update_count_callback" => '_update_generic_term_count',
44 "rewrite" => [ 'slug' => 'media_tag', 'with_front' => true, ],
45 "show_admin_column" => false,
46 "show_in_rest" => true,
47 "rest_base" => "media_tag",
48 "rest_controller_class" => "WP_REST_Terms_Controller",
49 "show_in_quick_edit" => false,
50 ];
51 register_taxonomy("media_tag", [ "attachment" ], $args);
52 }
53 }, 0);
54
55 /**
56 * TaxoPress log post types
57 */
58 add_action('init', function () {
59
60 // set up labels
61 $labels = array(
62 'name' => __('TaxoPress Logs', 'simple-tags'),
63 'singular_name' => __('TaxoPress Logs', 'simple-tags'),
64 'search_items' => __('Search TaxoPress Logs', 'simple-tags'),
65 'all_items' => __('TaxoPress Logs', 'simple-tags'),
66 'edit_item' => __('Edit TaxoPress Logs', 'simple-tags'),
67 'update_item' => __('Update TaxoPress Logs', 'simple-tags'),
68 'add_new_item' => __('Add New TaxoPress Logs', 'simple-tags'),
69 'new_item_name' => __('New TaxoPress Logs', 'simple-tags'),
70 'menu_name' => __('TaxoPress Logs', 'simple-tags')
71 );
72
73 register_post_type('taxopress_logs', array(
74 'labels' => $labels,
75 'public' => false,
76 'show_ui' => false,
77 'capability_type' => 'post',
78 'hierarchical' => false,
79 'rewrite' => array('slug' => 'taxopress_logs'),
80 'query_var' => false,
81 'show_in_nav_menus' => false,
82 'menu_icon' => 'dashicons-editor-justify',
83 'supports' => array(
84 'title',
85 'editor',
86 'author',
87 ),
88 ));
89 }, 0);
90