true]); $public = get_taxonomies([ '_builtin' => false, 'public' => true, ]); $private = get_taxonomies([ '_builtin' => false, 'public' => false, ]); $registered_taxonomies = array_merge($core, $public, $private); wp_localize_script('st-taxonomies', 'taxopress_tax_data', [ 'confirm' => esc_html__('Are you sure you want to delete this? Deleting will NOT remove created content.', 'simple-tags'), 'no_associated_type' => esc_html__('Please select at least one post type.', 'simple-tags'), 'existing_taxonomies' => $registered_taxonomies, 'integer_error' => esc_html__('Taxonomy slug cannot be numbers only.', 'simple-tags'), ] ); } } public static function set_screen($status, $option, $value) { return $value; } /** Singleton instance */ public static function get_instance() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; } /** * Add WP admin menu for Tags * * @return void * @author Olatechpro */ public function admin_menu() { $hook = add_submenu_page( self::MENU_SLUG, esc_html__('Taxonomies', 'simple-tags'), esc_html__('Taxonomies', 'simple-tags'), 'simple_tags', 'st_taxonomies', [ $this, 'page_manage_taxonomies', ] ); if(taxopress_is_screen_main_page()){ add_action("load-$hook", [$this, 'screen_option']); } } /** * Screen options */ public function screen_option() { $option = 'per_page'; $args = [ 'label' => esc_html__('Number of items per page', 'simple-tags'), 'default' => 20, 'option' => 'st_taxonomies_per_page' ]; add_screen_option($option, $args); $this->terms_table = new Taxonomy_List(); } /** * Method for build the page HTML manage tags * * @return void * @author Olatechpro */ public function page_manage_taxonomies() { // Default order if (!isset($_GET['order'])) { $_GET['order'] = 'name-asc'; } settings_errors(__CLASS__); if (!isset($_GET['add'])) { //all tax ?>

' . esc_html__('Search results for “%s”', 'simple-tags') . '', esc_html($search)); } ?> terms_table->prepare_items(); ?>
terms_table->search_box(__('Search Taxonomies', 'simple-tags'), 'term'); ?>
terms_table->display(); //Display the table ?>

taxopress_manage_taxonomies(); echo '
'; } } ?>
$request_tax], 'objects'); if (isset($external_taxonomy) > 0) { $current = taxopress_convert_external_taxonomy($external_taxonomy[$request_tax], $request_tax); $external_edit = true; $taxonomy_edit = true; } } if($request_tax === 'media_tag'){ $external_edit = false; } } if($taxonomy_edit){ $wordpress_core_tax = array_keys(get_taxonomies(['_builtin' => true])); $wordpress_core_tax[] = 'post_tag'; $wordpress_core_tax[] = 'category'; if(in_array($current['name'], $wordpress_core_tax)){ $core_edit = true; } } $ui = new taxopress_admin_ui(); ?>

'; } ?>

get_tr_start(); if(!$taxonomy_edit){ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_th_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_label('name', esc_html__('Taxonomy Slug', 'simple-tags')) . $ui->get_required_span(); if ('edit' === $tab) { echo '

' . esc_html__('Slug has changed', 'simple-tags') . '

'; } echo '

' . esc_html__('Slug already exists', 'simple-tags') . '

'; echo '

' . esc_html__('Special character not allowed in slug.', 'simple-tags') . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'name', 'textvalue' => isset($current['name']) ? esc_attr($current['name']) : '', 'maxlength' => '32', 'helptext' => esc_html__('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'simple-tags'), 'class' => 'tax-slug-input', 'required' => true, 'placeholder' => false, 'wrap' => false, ]); if ('edit' === $tab) { echo '

'; esc_html_e('DO NOT EDIT the taxonomy slug unless also planning to migrate terms. Changing the slug registers a new taxonomy entry.', 'simple-tags'); echo '

'; echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_check_input([ 'checkvalue' => 'update_taxonomy', 'checked' => 'false', 'name' => 'update_taxonomy', 'namearray' => 'update_taxonomy', 'labeltext' => esc_html__('Migrate terms to newly renamed taxonomy?', 'simple-tags'), 'helptext' => '', 'default' => false, 'wrap' => false, ]); echo '
'; } } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'label', 'textvalue' => isset($current['label']) ? esc_attr($current['label']) : '', 'aftertext' => esc_html__('(e.g. Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Plural Label', 'simple-tags'), 'maxlength' => '100', 'helptext' => '', 'required' => true, ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'singular_label', 'textvalue' => isset($current['singular_label']) ? esc_attr($current['singular_label']) : '', 'aftertext' => esc_html__('(e.g. Job)', 'simple-tags'), 'labeltext' => esc_html__('Singular Label', 'simple-tags'), 'maxlength' => '100', 'helptext' => '', 'required' => true, ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['hierarchical']) : ''; $select['selected'] = !empty($selected) ? $current['hierarchical'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'hierarchical', 'labeltext' => esc_html__('Parent-Child Relationships', 'simple-tags'), 'aftertext' => esc_html__('Can terms in this taxonomy be organized into hierarchical relationships?', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); if (isset($current['description'])) { $current['description'] = stripslashes_deep($current['description']); } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_textarea_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'description', 'rows' => '4', 'cols' => '40', 'textvalue' => isset($current['description']) ? esc_textarea($current['description']) : '', 'labeltext' => esc_html__('Description', 'simple-tags'), 'helptext' => esc_attr__('Describe what your taxonomy is used for.', 'simple-tags'), ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_td_end() . $ui->get_tr_end(); ?>
true]); // If they don't return an array, fall back to the original default. Don't need to check for empty, because empty array is default for $args param in get_post_types anyway. if (!is_array($args)) { $args = ['public' => true]; } $output = 'objects'; // Or objects. /** * Filters the results returned to display for available post types for taxonomy. * * @param array $value Array of post type objects. * @param array $args Array of arguments for the post type query. * @param string $output The output type we want for the results. */ $post_types = apply_filters('taxopress_get_post_types_for_taxonomies', get_post_types($args, $output), $args, $output); foreach ($post_types as $post_type) { $core_label = in_array($post_type->name, [ 'post', 'page', 'attachment', ], true) ? '' : ''; echo ''; } if($taxonomy_edit){ $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; }else{ $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; } $selected = isset($current) && isset($current['include_in_result']) ? taxopress_disp_boolean($current['include_in_result']) : ''; $select['selected'] = !empty($selected) ? $current['include_in_result'] : ''; echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'include_in_result', 'labeltext' => esc_html__('Archive page result', 'simple-tags'), 'aftertext' => esc_html__('Show content from all post types on archive page', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); ?> get_th_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_label('name', esc_html__('Taxonomy Slug', 'simple-tags')) . $ui->get_required_span(); if ('edit' === $tab) { echo '

' . esc_html__('Slug has changed', 'simple-tags') . '

'; } echo '

' . esc_html__('Slug already exists', 'simple-tags') . '

'; echo '

' . esc_html__('Special character not allowed in slug.', 'simple-tags') . '

'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_th_end() . $ui->get_td_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'name', 'textvalue' => isset($current['name']) ? esc_attr($current['name']) : '', 'maxlength' => '32', 'helptext' => 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'class' => 'tax-slug-input', 'required' => true, 'placeholder' => false, 'wrap' => false, ]); if ('edit' === $tab) { echo '

'; esc_html_e('DO NOT EDIT the taxonomy slug unless also planning to migrate terms. Changing the slug registers a new taxonomy entry.', 'simple-tags'); echo '

'; echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_check_input([ 'checkvalue' => 'update_taxonomy', 'checked' => 'false', 'name' => 'update_taxonomy', 'namearray' => 'update_taxonomy', 'labeltext' => esc_html__('Migrate terms to newly renamed taxonomy?', 'simple-tags'), 'helptext' => '', 'default' => false, 'wrap' => false, ]); echo '
'; } } ?> get_tr_start() . $ui->get_th_start(); echo 'Template Hierarchy'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_th_end(); $template_hierarchy_slug = isset($current['name']) ? esc_attr($current['name']) : ''; $template_hierarchy = '
  • taxonomy-'.esc_html( $template_hierarchy_slug ).'-term_slug.php *
  • taxonomy-'. esc_html( $template_hierarchy_slug ).'.php
  • taxonomy.php
  • archive.php
  • index.php

'.esc_html__( '*Replace "term_slug" with the slug of the actual taxonomy term.', 'simple-tags' ).'

'; echo ''; } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_tr_end(); ?> [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['rewrite']) : ''; $select['selected'] = !empty($selected) ? $current['rewrite'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rewrite', 'labeltext' => esc_html__('Rewrite', 'simple-tags'), 'aftertext' => esc_html__('WordPress can use a custom permalink for this taxonomy. It does not have to match the slug.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rewrite_slug', 'textvalue' => isset($current['rewrite_slug']) ? esc_attr($current['rewrite_slug']) : '', 'aftertext' => esc_attr__('(default: taxonomy name)', 'simple-tags'), 'labeltext' => esc_html__('Custom Rewrite Slug', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy rewrite slug.', 'simple-tags'), ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['rewrite_withfront']) : ''; $select['selected'] = !empty($selected) ? $current['rewrite_withfront'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rewrite_withfront', 'labeltext' => esc_html__('Rewrite With Front', 'simple-tags'), 'aftertext' => esc_html__('Should the permastruct be prepended with the front base.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'false', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['rewrite_hierarchical']) : ''; $select['selected'] = !empty($selected) ? $current['rewrite_hierarchical'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rewrite_hierarchical', 'labeltext' => esc_html__('Rewrite Hierarchical', 'simple-tags'), 'aftertext' => esc_html__('Should the permastruct allow hierarchical urls.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); ?> [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['show_ui']) : ''; $select['selected'] = !empty($selected) ? $current['show_ui'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_ui', 'labeltext' => esc_html__('Show user interface', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['show_in_menu']) : ''; $select['selected'] = !empty($selected) ? $current['show_in_menu'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_in_menu', 'labeltext' => esc_html__('Show in admin menus', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = (isset($current) && !empty($current['show_in_nav_menus'])) ? taxopress_disp_boolean($current['show_in_nav_menus']) : ''; $select['selected'] = !empty($selected) ? $current['show_in_nav_menus'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_in_nav_menus', 'labeltext' => esc_html__('Show in frontend menus', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['show_admin_column']) : ''; $select['selected'] = !empty($selected) ? $current['show_admin_column'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_admin_column', 'labeltext' => esc_html__('Show admin column', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'false', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = (isset($current) && !empty($current['show_in_quick_edit'])) ? taxopress_disp_boolean($current['show_in_quick_edit']) : ''; $select['selected'] = !empty($selected) ? $current['show_in_quick_edit'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_in_quick_edit', 'labeltext' => esc_html__('Show in "Quick Edit" and "Bulk Edit"', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); ?> get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'menu_name', 'textvalue' => isset($current['labels']['menu_name']) ? esc_attr($current['labels']['menu_name']) : '', 'aftertext' => esc_attr__('(e.g. Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Menu Name', 'simple-tags'), 'helptext' => esc_html__('Custom admin menu name for your taxonomy.', 'simple-tags'), 'maxlength' => '100', 'data' => [ 'label' => 'item', // Not localizing because it's isolated. 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'all_items', 'textvalue' => isset($current['labels']['all_items']) ? esc_attr($current['labels']['all_items']) : '', 'aftertext' => esc_attr__('(e.g. All Jobs)', 'simple-tags'), 'labeltext' => esc_html__('All Items', 'simple-tags'), 'helptext' => esc_html__('Used as tab text when showing all terms for hierarchical taxonomy while editing post.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('All %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'edit_item', 'textvalue' => isset($current['labels']['edit_item']) ? esc_attr($current['labels']['edit_item']) : '', 'aftertext' => esc_attr__('(e.g. Edit Job)', 'simple-tags'), 'labeltext' => esc_html__('Edit Item', 'simple-tags'), 'helptext' => esc_html__('Used at the top of the term editor screen for an existing taxonomy term.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Edit %s', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'view_item', 'textvalue' => isset($current['labels']['view_item']) ? esc_attr($current['labels']['view_item']) : '', 'aftertext' => esc_attr__('(e.g. View Job)', 'simple-tags'), 'labeltext' => esc_html__('View Item', 'simple-tags'), 'helptext' => esc_html__('Used in the admin bar when viewing editor screen for an existing taxonomy term.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('View %s', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'update_item', 'textvalue' => isset($current['labels']['update_item']) ? esc_attr($current['labels']['update_item']) : '', 'aftertext' => esc_attr__('(e.g. Update Job Name)', 'simple-tags'), 'labeltext' => esc_html__('Update Item Name', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Update %s name', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'add_new_item', 'textvalue' => isset($current['labels']['add_new_item']) ? esc_attr($current['labels']['add_new_item']) : '', 'aftertext' => esc_attr__('(e.g. Add New Job)', 'simple-tags'), 'labeltext' => esc_html__('Add New Item', 'simple-tags'), 'helptext' => esc_html__('Used at the top of the term editor screen and button text for a new taxonomy term.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Add new %s', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'new_item_name', 'textvalue' => isset($current['labels']['new_item_name']) ? esc_attr($current['labels']['new_item_name']) : '', 'aftertext' => esc_attr__('(e.g. New Job Name)', 'simple-tags'), 'labeltext' => esc_html__('New Item Name', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('New %s name', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'parent_item', 'textvalue' => isset($current['labels']['parent_item']) ? esc_attr($current['labels']['parent_item']) : '', 'aftertext' => esc_attr__('(e.g. Parent Job)', 'simple-tags'), 'labeltext' => esc_html__('Parent Item', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Parent %s', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'parent_item_colon', 'textvalue' => isset($current['labels']['parent_item_colon']) ? esc_attr($current['labels']['parent_item_colon']) : '', 'aftertext' => esc_attr__('(e.g. Parent Job:)', 'simple-tags'), 'labeltext' => esc_html__('Parent Item Colon', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Parent %s:', 'simple-tags'), 'item'), 'plurality' => 'singular', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'search_items', 'textvalue' => isset($current['labels']['search_items']) ? esc_attr($current['labels']['search_items']) : '', 'aftertext' => esc_attr__('(e.g. Search Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Search Items', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Search %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'popular_items', 'textvalue' => isset($current['labels']['popular_items']) ? esc_attr($current['labels']['popular_items']) : null, 'aftertext' => esc_attr__('(e.g. Popular Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Popular Items', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Popular %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'separate_items_with_commas', 'textvalue' => isset($current['labels']['separate_items_with_commas']) ? esc_attr($current['labels']['separate_items_with_commas']) : null, 'aftertext' => esc_attr__('(e.g. Separate Jobs with commas)', 'simple-tags'), 'labeltext' => esc_html__('Separate Items with Commas', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Separate %s with commas', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'add_or_remove_items', 'textvalue' => isset($current['labels']['add_or_remove_items']) ? esc_attr($current['labels']['add_or_remove_items']) : null, 'aftertext' => esc_attr__('(e.g. Add or remove Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Add or Remove Items', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Add or remove %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'choose_from_most_used', 'textvalue' => isset($current['labels']['choose_from_most_used']) ? esc_attr($current['labels']['choose_from_most_used']) : null, 'aftertext' => esc_attr__('(e.g. Choose from the most used Jobs)', 'simple-tags'), 'labeltext' => esc_html__('Choose From Most Used', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Choose from the most used %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'not_found', 'textvalue' => isset($current['labels']['not_found']) ? esc_attr($current['labels']['not_found']) : null, 'aftertext' => esc_attr__('(e.g. No Jobs found)', 'simple-tags'), 'labeltext' => esc_html__('Not found', 'simple-tags'), 'helptext' => esc_html__('Custom taxonomy label. Used in the admin menu for displaying taxonomies.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('No %s found', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'no_terms', 'textvalue' => isset($current['labels']['no_terms']) ? esc_attr($current['labels']['no_terms']) : null, 'aftertext' => esc_html__('(e.g. No jobs)', 'simple-tags'), 'labeltext' => esc_html__('No terms', 'simple-tags'), 'helptext' => esc_attr__('Used when indicating that there are no terms in the given taxonomy associated with an object.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('No %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'items_list_navigation', 'textvalue' => isset($current['labels']['items_list_navigation']) ? esc_attr($current['labels']['items_list_navigation']) : null, 'aftertext' => esc_html__('(e.g. Jobs list navigation)', 'simple-tags'), 'labeltext' => esc_html__('Items List Navigation', 'simple-tags'), 'helptext' => esc_attr__('Screen reader text for the pagination heading on the term listing screen.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('%s list navigation', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'items_list', 'textvalue' => isset($current['labels']['items_list']) ? esc_attr($current['labels']['items_list']) : null, 'aftertext' => esc_html__('(e.g. Jobs list)', 'simple-tags'), 'labeltext' => esc_html__('Items List', 'simple-tags'), 'helptext' => esc_attr__('Screen reader text for the items list heading on the term listing screen.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('%s list', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'not_found', 'textvalue' => isset($current['labels']['not_found']) ? esc_attr($current['labels']['not_found']) : null, 'aftertext' => esc_html__('(e.g. No jobs found)', 'simple-tags'), 'labeltext' => esc_html__('Not Found', 'simple-tags'), 'helptext' => esc_attr__('The text displayed via clicking ‘Choose from the most used items’ in the taxonomy meta box when no items are available.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('No %s found', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_tax_labels', 'name' => 'back_to_items', 'textvalue' => isset($current['labels']['back_to_items']) ? esc_attr($current['labels']['back_to_items']) : null, 'aftertext' => esc_html__('(e.g. ← Back to jobs', 'simple-tags'), 'labeltext' => esc_html__('Back to Items', 'simple-tags'), 'helptext' => esc_attr__('The text displayed after a term has been updated for a link back to main index.', 'simple-tags'), 'data' => [ /* translators: Used for autofill */ 'label' => sprintf(esc_attr__('Back to %s', 'simple-tags'), 'item'), 'plurality' => 'plural', ], ]); ?> [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['show_in_rest']) : ''; $select['selected'] = !empty($selected) ? $current['show_in_rest'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'show_in_rest', 'labeltext' => esc_html__('Show in REST API', 'simple-tags'), 'aftertext' => '', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rest_base', 'labeltext' => esc_html__('REST API base slug', 'simple-tags'), 'helptext' => esc_attr__('Slug to use in REST API URLs.', 'simple-tags'), 'textvalue' => isset($current['rest_base']) ? esc_attr($current['rest_base']) : '', ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'rest_controller_class', 'labeltext' => esc_html__('REST API controller class', 'simple-tags'), 'aftertext' => esc_attr__('Custom controller to use instead of WP_REST_Terms_Controller.', 'simple-tags'), 'textvalue' => isset($current['rest_controller_class']) ? esc_attr($current['rest_controller_class']) : '', ]); ?> [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['public']) : ''; $select['selected'] = !empty($selected) ? $current['public'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'public', 'labeltext' => esc_html__('Public', 'simple-tags'), 'aftertext' => esc_html__('The taxonomy is for public use. It can be seen by frontend users.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['publicly_queryable']) : ''; $select['selected'] = !empty($selected) ? $current['publicly_queryable'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'publicly_queryable', 'labeltext' => esc_html__('Public Queryable', 'simple-tags'), 'aftertext' => esc_html__('The taxonomy is publicly queryable.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = isset($current) ? taxopress_disp_boolean($current['query_var']) : ''; $select['selected'] = !empty($selected) ? $current['query_var'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'query_var', 'labeltext' => esc_html__('Query Var', 'simple-tags'), 'aftertext' => esc_html__('Enable a custom query_var key for this taxonomy.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'query_var_slug', 'textvalue' => isset($current['query_var_slug']) ? esc_attr($current['query_var_slug']) : '', 'aftertext' => '', 'labeltext' => esc_html__('Custom Query Var String', 'simple-tags'), 'helptext' => esc_html__('Sets a custom query_var slug for this taxonomy.', 'simple-tags'), ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'meta_box_cb', 'textvalue' => isset($current['meta_box_cb']) ? esc_attr($current['meta_box_cb']) : '', 'labeltext' => esc_html__('Metabox callback', 'simple-tags'), 'helptext' => esc_html__('Sets a callback function name for the meta box display. Hierarchical default: post_categories_meta_box, non-hierarchical default: post_tags_meta_box. To remove the metabox completely, use "false".', 'simple-tags'), ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_text_input([ 'namearray' => 'cpt_custom_tax', 'name' => 'default_term', 'textvalue' => isset($current['default_term']) ? esc_attr($current['default_term']) : '', 'labeltext' => esc_html__('Default Term', 'simple-tags'), 'helptext' => esc_html__('Set a default term for the taxonomy. Able to set a name, slug, and description. Only a name is required if setting a default, others are optional. Set values in the following order, separated by comma. Example: name, slug, description', 'simple-tags'), ]); ?> get_tr_start() . $ui->get_th_start(); ?> 'st_taxonomies', 'add' => 'taxonomy', 'action' => 'edit', 'action2' => 'taxopress-reactivate-taxonomy', 'taxonomy' => esc_attr($request_tax), '_wpnonce' => wp_create_nonce('taxonomy-action-request-nonce'), 'taxopress_taxonomy' => esc_attr($request_tax), ], taxopress_admin_url('admin.php') ); $deactivate_action_link = add_query_arg( [ 'page' => 'st_taxonomies', 'add' => 'taxonomy', 'action' => 'edit', 'action2' => 'taxopress-deactivate-taxonomy', 'taxonomy' => esc_attr($request_tax), '_wpnonce' => wp_create_nonce('taxonomy-action-request-nonce'), 'taxopress_taxonomy' => esc_attr($request_tax), ], taxopress_admin_url('admin.php') ); if (in_array($request_tax, taxopress_get_deactivated_taxonomy())) { ?> ' . esc_html__('You can only delete taxonomies created with TaxoPress.', 'simple-tags') . ''; } } ?> get_th_end(). $ui->get_tr_end(); ?>

' . esc_html__('This taxonomy is part of the WordPress core.', 'simple-tags') . '

' . esc_html__('Registration key', 'simple-tags') . ': ' . esc_html($current["name"]) . '
'; }elseif ($external_edit) { echo '
' . esc_html__('This is an external taxonomy and not created with TaxoPress.', 'simple-tags') . '

' . esc_html__('Registration key', 'simple-tags') . ': ' . esc_html($current["name"]) . '
'; }else{ echo '
' . esc_html__('This taxonomy was created by TaxoPress.', 'simple-tags') . '

' . esc_html__('Registration key', 'simple-tags') . ': ' . esc_html($current["name"]) . '
'; } $taxonomy_url = add_query_arg( [ 'taxonomy' => $current["name"], ], taxopress_admin_url('edit-tags.php') ); echo '
' . esc_html__('View Taxonomy', 'simple-tags') . ''; } ?>