esc_html__('Number of items per page', 'simple-tags'), 'default' => 20, 'option' => 'st_autoterms_logs_per_page' ]; $this->logs_table = new Autoterms_Logs(); }else{ $args = [ 'label' => esc_html__('Number of items per page', 'simple-tags'), 'default' => 20, 'option' => 'st_autoterms_per_page' ]; $this->terms_table = new Autoterms_List(); } add_screen_option($option, $args); } /** * Method for build the page HTML manage tags * * @return void * @author Olatechpro */ public function page_manage_autoterms() { // Default order if (!isset($_GET['order'])) { $_GET['order'] = 'name-asc'; } settings_errors(__CLASS__); if (isset($_GET['tab']) && $_GET['tab'] === 'logs') { //autoterms logs $delete_all_link = add_query_arg([ 'page' => 'st_autoterms', 'tab' => 'logs', 'action' => 'taxopress-delete-autoterm-logs', '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce') ], admin_url('admin.php') ); $enable_log_link = add_query_arg([ 'page' => 'st_autoterms', 'tab' => 'logs', 'action' => 'taxopress-enable-autoterm-logs', '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce') ], admin_url('admin.php') ); $disable_log_link = add_query_arg([ 'page' => 'st_autoterms', 'tab' => 'logs', 'action' => 'taxopress-disable-autoterm-logs', '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce') ], admin_url('admin.php') ); ?>

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

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

taxopress_manage_autoterms(); echo '
'; } } ?>
0 && apply_filters('taxopress_autoterms_create_limit', true)) { $autoterm_limit = true; } $ui = new taxopress_admin_ui(); $taxonomy_replace_options = [ 'options' => [ [ 'attr' => 'append', 'text' => esc_attr__('Add new terms and keep existing terms.', 'simple-tags'), 'default' => 'true' ], [ 'attr' => 'append_and_replace', 'text' => esc_attr__('Add new terms and remove existing terms.', 'simple-tags') ], [ 'attr' => 'replace', 'text' => esc_attr__('Remove existing terms even if no new terms are found.', 'simple-tags') ] ], ]; ?>

autoterms_logs_count()); ?>

'; echo ''; echo ''; } else { $active_tab = 'autoterm_general'; echo ''; echo esc_html__('Add new Auto Terms', 'simple-tags'); } ?>

' . esc_html__('To create more Auto Terms, please upgrade to TaxoPress Pro.', 'simple-tags') . '

' . esc_html__('With TaxoPress Pro, you can create unlimited Auto Terms. You can create Auto Terms for any taxonomy.', 'simple-tags') . '

'; } else { ?>
get_tr_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_th_start(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_label('title', esc_html__('Title', 'simple-tags')) . $ui->get_required_span(); // 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' => 'taxopress_autoterm', 'name' => 'title', 'textvalue' => isset($current['title']) ? esc_attr($current['title']) : '', 'maxlength' => '32', 'helptext' => '', 'required' => true, 'placeholder' => false, 'wrap' => false, ]); $options = []; foreach (get_all_taxopress_taxonomies() as $_taxonomy) { $_taxonomy = $_taxonomy->name; $tax = get_taxonomy($_taxonomy); if (empty($tax->labels->name)) { continue; } if ($tax->name === 'post_tag') { $options[] = [ 'attr' => $tax->name, 'text' => $tax->labels->name. ' ('.$tax->name.')', 'default' => 'true', ]; } else { $options[] = [ 'attr' => $tax->name, 'text' => $tax->labels->name. ' ('.$tax->name.')', ]; } } $select = [ 'options' => $options, ]; $selected = isset($current) ? taxopress_disp_boolean($current['taxonomy']) : ''; $select['selected'] = !empty($selected) ? $current['taxonomy'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input_main([ 'namearray' => 'taxopress_autoterm', 'name' => 'taxonomy', 'class' => 'st-post-taxonomy-select', 'labeltext' => esc_html__('Taxonomy', 'simple-tags'), 'required' => true, 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected_option = (isset($current) && isset($current['autoterm_from'])) ? $current['autoterm_from'] : ''; $term_from_options = [ '' => esc_attr__('Don\'t scan Post Content or Title', 'simple-tags'), 'post_content' => esc_attr__('Post Content', 'simple-tags'), 'post_title' => esc_attr__('Post Title', 'simple-tags'), 'posts' => esc_attr__('Post Content and Title', 'simple-tags') ]; ?> get_td_end() . $ui->get_tr_end(); ?>
$entry_options) : if (!empty($entry_options)) : foreach ($entry_options as $entry_option) : $checked_option = false; if ($entry_type == 'custom_fields' && in_array($entry_option, $find_in_custom_fields_custom_items)) { $checked_option = true; } elseif (in_array($entry_option, $find_in_taxonomies_custom_items)) { $checked_option = true; } ?>
/>
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); $term_auto_locations = []; foreach ($post_types as $post_type) { if (!in_array($post_type->name, ['attachment'])) { $term_auto_locations[$post_type->name] = $post_type->label; } } echo ''; ?>
'; foreach ($term_auto_locations as $key => $value) { echo ''; } echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_check_input([ 'checkvalue' => esc_attr($key), 'checked' => (!empty($current['post_types']) && is_array($current['post_types']) && in_array($key, $current['post_types'], true)) ? 'true' : 'false', 'name' => esc_attr($key), 'namearray' => 'post_types', 'textvalue' => esc_attr($key), 'labeltext' => "", 'wrap' => false, ]); echo '
[ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; }else{ $default_select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; } /** * Post */ $selected = (isset($current) && isset($current['autoterm_for_post'])) ? taxopress_disp_boolean($current['autoterm_for_post']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_for_post'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_for_post', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post fields-control', 'labeltext' => esc_html__('Post', 'simple-tags'), 'aftertext' => esc_html__('Enable Auto Terms when a post is saved or updated.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_number_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'terms_limit', 'textvalue' => isset($current['terms_limit']) ? esc_attr($current['terms_limit']) : '5', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post', 'labeltext' => esc_html__('Auto Terms Limit', 'simple-tags'), 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'), 'min' => '0', 'required' => false, ]); $selected = (isset($current) && isset($current['autoterm_target'])) ? taxopress_disp_boolean($current['autoterm_target']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_target'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_target', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post', 'labeltext' => esc_html__('Target content', 'simple-tags'), 'aftertext' => esc_html__('Only use Auto Terms on posts with no added terms.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected = (isset($current) && isset($current['autoterm_word'])) ? taxopress_disp_boolean($current['autoterm_word']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_word'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_word', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post', 'labeltext' => esc_html__('Whole words', 'simple-tags'), 'aftertext' => esc_html__('Only add terms when the word is an exact match. Do not make matches for partial words.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected = (isset($current) && isset($current['autoterm_hash'])) ? taxopress_disp_boolean($current['autoterm_hash']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_hash'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_hash', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post', 'labeltext' => esc_html__('Hashtags', 'simple-tags'), 'aftertext' => esc_html__('Support hashtags symbols # in Auto Terms.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected = (isset($current) && isset($current['post_replace_type'])) ? taxopress_disp_boolean($current['post_replace_type']) : ''; $taxonomy_replace_options['selected'] = !empty($selected) ? $current['post_replace_type'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_radio_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'post_replace_type', 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post', 'labeltext' => esc_html__('Auto Terms replacement settings', 'simple-tags'), 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'), 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); /** * Schedule */ $default_select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = (isset($current) && isset($current['autoterm_for_schedule'])) ? taxopress_disp_boolean($current['autoterm_for_schedule']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_for_schedule'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_for_schedule', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule fields-control', 'labeltext' => esc_html__('Schedule', 'simple-tags'), 'aftertext' => esc_html__('Enable Auto Terms for the "Schedule" feature.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_number_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'schedule_terms_limit', 'textvalue' => isset($current['schedule_terms_limit']) ? esc_attr($current['schedule_terms_limit']) : '5', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule', 'labeltext' => esc_html__('Auto Terms Limit', 'simple-tags'), 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'), 'min' => '0', 'required' => false, ]); $selected = (isset($current) && isset($current['schedule_autoterm_target'])) ? taxopress_disp_boolean($current['schedule_autoterm_target']) : ''; $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_target'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'schedule_autoterm_target', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule', 'labeltext' => esc_html__('Target content', 'simple-tags'), 'aftertext' => esc_html__('Only use Auto Terms on schedules with no added terms.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected = (isset($current) && isset($current['schedule_autoterm_word'])) ? taxopress_disp_boolean($current['schedule_autoterm_word']) : ''; $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_word'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'schedule_autoterm_word', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule', 'labeltext' => esc_html__('Whole words', 'simple-tags'), 'aftertext' => esc_html__('Only add terms when the word is an exact match. Do not make matches for partial words.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $selected = (isset($current) && isset($current['schedule_autoterm_hash'])) ? taxopress_disp_boolean($current['schedule_autoterm_hash']) : ''; $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_hash'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'schedule_autoterm_hash', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule', 'labeltext' => esc_html__('Hashtags', 'simple-tags'), 'aftertext' => esc_html__('Support hashtags symbols # in Auto Terms.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $taxonomy_replace_options = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = (isset($current) && isset($current['schedule_replace_type'])) ? taxopress_disp_boolean($current['schedule_replace_type']) : ''; $taxonomy_replace_options['selected'] = !empty($selected) ? $current['schedule_replace_type'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_radio_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'schedule_replace_type', 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule', 'labeltext' => esc_html__('Auto Terms replacement settings', 'simple-tags'), 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'), 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); /** * Existing Content */ $selected = (isset($current) && isset($current['autoterm_for_existing_content'])) ? taxopress_disp_boolean($current['autoterm_for_existing_content']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_for_existing_content'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_for_existing_content', 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content fields-control', 'labeltext' => esc_html__('Existing Content', 'simple-tags'), 'aftertext' => esc_html__('Enable Auto Terms for the "Existing Content" feature.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_number_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'existing_content_terms_limit', 'textvalue' => isset($current['existing_content_terms_limit']) ? esc_attr($current['existing_content_terms_limit']) : '5', 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content', 'labeltext' => esc_html__('Auto Terms Limit', 'simple-tags'), 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'), 'min' => '0', 'required' => false, ]); $selected = (isset($current) && isset($current['existing_content_replace_type'])) ? taxopress_disp_boolean($current['existing_content_replace_type']) : ''; $taxonomy_replace_options['selected'] = !empty($selected) ? $current['existing_content_replace_type'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_radio_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'existing_content_replace_type', 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content', 'labeltext' => esc_html__('Auto Terms replacement settings', 'simple-tags'), 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'), 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); /** * Metaboxes */ $selected = (isset($current) && isset($current['autoterm_for_metaboxes'])) ? taxopress_disp_boolean($current['autoterm_for_metaboxes']) : ''; $default_select['selected'] = !empty($selected) ? $current['autoterm_for_metaboxes'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_for_metaboxes', 'class' => 'autoterm_for_metaboxes autoterm-terms-when-to-field autoterm-terms-when-metaboxes fields-control', 'labeltext' => esc_html__('Metaboxes', 'simple-tags'), 'aftertext' => esc_html__('Enable Auto Terms for the "Metaboxes" and the "Fast Update" feature.', 'simple-tags'), 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); ?>
[ [ '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['autoterm_use_taxonomy'])) ? taxopress_disp_boolean($current['autoterm_use_taxonomy']) : ''; $select['selected'] = !empty($selected) ? $current['autoterm_use_taxonomy'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_use_taxonomy', 'class' => 'autoterm_use_taxonomy autoterm-terms-to-use-field autoterm-terms-use-existing fields-control', 'labeltext' => esc_html__('Existing taxonomy terms', 'simple-tags'), 'aftertext' => esc_html__('This will add existing terms from the taxonomy selected in the "General" tab.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); if($autoterm_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['autoterm_useall'])) ? taxopress_disp_boolean($current['autoterm_useall']) : ''; $select['selected'] = !empty($selected) ? $current['autoterm_useall'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_useall', 'class' => 'autoterm_useall autoterm-terms-to-use-field autoterm-terms-use-existing', 'labeltext' => '', 'aftertext' => esc_html__('Use all the terms in the selected taxonomy.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'required' => false, ]); $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = (isset($current) && isset($current['autoterm_useonly'])) ? taxopress_disp_boolean($current['autoterm_useonly']) : ''; $select['selected'] = !empty($selected) ? $current['autoterm_useonly'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_useonly', 'class' => 'autoterm_useonly autoterm-terms-to-use-field autoterm-terms-use-existing', 'labeltext' => ' ', 'aftertext' => esc_html__('Use only some terms in the selected taxonomy.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); $specific_terms = ( isset($current) && isset($current['specific_terms'])) ? taxopress_change_to_array($current['specific_terms']) : ''; echo ''; $select = [ 'options' => [ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = ( isset($current) && isset($current['suggest_local_terms_show_post_count']) ) ? taxopress_disp_boolean($current['suggest_local_terms_show_post_count']) : ''; $select['selected'] = !empty($selected) ? $current['suggest_local_terms_show_post_count'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'suggest_local_terms_show_post_count', 'labeltext' => esc_html__('Show Term Post Count', 'simple-tags'), 'aftertext' => esc_html__('This will show the number of posts attached to the terms.', 'simple-tags'), 'class' => 'autoterm-terms-to-use-field autoterm-terms-use-existing', 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); do_action('taxopress_autoterms_after_autoterm_terms_to_use', $current); ?>
'; echo ''; echo '
'; echo '
    '; if (!empty($specific_terms)) { foreach ($specific_terms as $specific_term) { if (!empty($specific_term)) { ?>
  • '; echo '
[ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), 'default' => 'true', ], ], ]; $selected = (isset($current) && isset($current['synonyms_term'])) ? taxopress_disp_boolean($current['synonyms_term']) : ''; $select['selected'] = !empty($selected) ? $current['synonyms_term'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'synonyms_term', 'labeltext' => esc_html__( 'Add terms if synonyms found', 'simple-tags' ), 'aftertext' => esc_html__( 'TaxoPress will add a term to the post if a synonym is found.', 'simple-tags' ), 'selections' => $select, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); } $post_status_objects = taxopress_get_post_statuses(); $post_status_options = []; foreach ( $post_status_objects as $status_slug => $status_object ) { if (in_array($status_slug, ['publish', 'future', 'draft', 'pending'])) { $post_status_options[$status_slug] = $status_object->label; } } echo ''; ?>
*'; echo ''; $autoterms_post_status = (!empty($current['post_status'])) ? (array)$current['post_status'] : ['publish']; foreach ($post_status_options as $key => $value) { $checked_status = (in_array($key, $autoterms_post_status)) ? 'checked' : ''; echo ' ' . esc_html($value) . '

'; } echo '
get_textarea_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_exclude', 'rows' => '4', 'cols' => '40', 'class' => 'autocomplete-input auto-terms-stopwords', 'textvalue' => isset($current['autoterm_exclude']) ? esc_attr($current['autoterm_exclude']) : '', 'labeltext' => esc_html__( 'Exclude terms from Auto Term', 'simple-tags' ), 'helptext' => esc_html__( 'Choose terms to be excluded from auto terms.', 'simple-tags' ), 'required' => false, ]); $html_exclusions = [ //headers 'h1' => esc_attr__('H1', 'simple-tags'), 'h2' => esc_attr__('H2', 'simple-tags'), 'h3' => esc_attr__('H3', 'simple-tags'), 'h4' => esc_attr__('H4', 'simple-tags'), 'h5' => esc_attr__('H5', 'simple-tags'), 'h6' => esc_attr__('H6', 'simple-tags'), //html elements 'a' => esc_attr__('a', 'simple-tags'), 'script' => esc_attr__('script', 'simple-tags'), 'style' => esc_attr__('style', 'simple-tags'), 'pre' => esc_attr__('pre', 'simple-tags'), 'code' => esc_attr__('code', 'simple-tags'), ]; echo ''; /** * Fires after the autoterms html_exclusions tr. * @param $current array * @param taxopress_admin_ui $ui Admin UI instance. */ do_action('taxopress_autoterms_after_html_exclusions_tr', $current, $ui); ?>

' . esc_html__( 'Terms inside these HTML tags will not be used to generate terms.', 'simple-tags' ) . '
'; foreach ($html_exclusions as $key => $value) { echo ''; if ($key === 'h6') { echo ''; } } /** * Fires after the autoterms html_exclusions. * @param $current array * @param taxopress_admin_ui $ui Admin UI instance. */ do_action('taxopress_autoterms_after_html_exclusions', $current, $ui); echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_check_input([ 'checkvalue' => $key, 'checked' => (!empty($current['html_exclusion']) && is_array($current['html_exclusion']) && in_array( $key, $current['html_exclusion'], true )) ? 'true' : 'false', 'name' => esc_attr($key), 'namearray' => 'html_exclusion', 'textvalue' => esc_attr($key), 'labeltext' => esc_html($key), 'labeldescription' => true, 'wrap' => false, ]); echo '


[ [ 'attr' => '0', 'text' => esc_attr__('False', 'simple-tags'), 'default' => 'true', ], [ 'attr' => '1', 'text' => esc_attr__('True', 'simple-tags'), ], ], ]; $selected = (isset($current) && isset($current['autoterm_existing_content_exclude'])) ? taxopress_disp_boolean($current['autoterm_existing_content_exclude']) : ''; $select['selected'] = !empty($selected) ? $current['autoterm_existing_content_exclude'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_checkbox_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'autoterm_existing_content_exclude', 'class' => '', 'labeltext' => esc_html__('Exclude previously analyzed content', 'simple-tags'), 'aftertext' => esc_html__('This enables you to skip posts that have already been analyzed by the Existing Content feature.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_number_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'existing_terms_batches', 'textvalue' => isset($current['existing_terms_batches']) ? esc_attr($current['existing_terms_batches']) : '2', 'labeltext' => esc_html__('Limit per batches', 'simple-tags'), 'helptext' => esc_html__('This enables you to add Auto Terms to existing content in batches. If you have a lot of existing content, set this to a lower number to avoid timeouts.', 'simple-tags'), 'min' => '1', 'required' => true, ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_number_input([ 'namearray' => 'taxopress_autoterm', 'name' => 'existing_terms_sleep', 'textvalue' => isset($current['existing_terms_sleep']) ? esc_attr($current['existing_terms_sleep']) : '10', 'labeltext' => esc_html__('Batches wait time', 'simple-tags'), 'helptext' => esc_html__('This is the wait time (in seconds) between processing batches of Auto Terms. If you have a lot of existing content, set this to a higher number to avoid timeouts.', 'simple-tags'), 'min' => '0', 'required' => true, ]); $select = [ 'options' => [ [ 'attr' => '1', 'text' => esc_attr__('24 hours ago', 'simple-tags') ], [ 'attr' => '7', 'text' => esc_attr__('7 days ago', 'simple-tags') ], [ 'attr' => '14', 'text' => esc_attr__('2 weeks ago', 'simple-tags') ], [ 'attr' => '30', 'text' => esc_attr__('1 month ago', 'simple-tags'), 'default' => 'true' ], [ 'attr' => '180', 'text' => esc_attr__('6 months ago', 'simple-tags') ], [ 'attr' => '365', 'text' => esc_attr__('1 year ago', 'simple-tags') ], [ 'attr' => '0', 'text' => esc_attr__('No limit', 'simple-tags') ], ], ]; if(isset($current) && is_array($current)){ $select = [ 'options' => [ [ 'attr' => '1', 'text' => esc_attr__('24 hours ago', 'simple-tags') ], [ 'attr' => '7', 'text' => esc_attr__('7 days ago', 'simple-tags') ], [ 'attr' => '14', 'text' => esc_attr__('2 weeks ago', 'simple-tags') ], [ 'attr' => '30', 'text' => esc_attr__('1 month ago', 'simple-tags'), ], [ 'attr' => '180', 'text' => esc_attr__('6 months ago', 'simple-tags') ], [ 'attr' => '365', 'text' => esc_attr__('1 year ago', 'simple-tags') ], [ 'attr' => '0', 'text' => esc_attr__('No limit', 'simple-tags'), 'default' => 'true' ], ], ]; } $selected = (isset($current) && isset($current['limit_days'])) ? taxopress_disp_boolean($current['limit_days']) : ''; $select['selected'] = !empty($selected) ? $current['limit_days'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $ui->get_select_number_select([ 'namearray' => 'taxopress_autoterm', 'name' => 'limit_days', 'labeltext' => esc_html__('Limit Auto Terms, based on published date', 'simple-tags'), 'aftertext' => esc_html__('This setting allows you to add Auto Terms only to recent content.', 'simple-tags'), 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ]); ?>