PluginProbe
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / 3.44.0
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms v3.44.0
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 / autoterms.php

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

1,735 lines 129.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class SimpleTags_Autoterms
4 {
5
6 const MENU_SLUG = 'st_options';
7
8 // class instance
9 static $instance;
10
11 // WP_List_Table object
12 public $terms_table;
13
14 // WP_List_Table object
15 public $logs_table;
16
17 /**
18 * Constructor
19 *
20 * @return void
21 * @author Olatechpro
22 */
23 public function __construct()
24 {
25
26 add_filter('set-screen-option', [__CLASS__, 'set_screen'], 10, 3);
27 // Admin menu
28 add_action('admin_menu', [$this, 'admin_menu']);
29 // Javascript
30 add_action('admin_enqueue_scripts', [__CLASS__, 'admin_enqueue_scripts'], 11);
31
32 }
33
34 /**
35 * Init somes JS and CSS need for this feature
36 *
37 * @return void
38 * @author Olatechpro
39 */
40 public static function admin_enqueue_scripts()
41 {
42
43 // add JS for manage click tags
44 if (isset($_GET['page']) && $_GET['page'] == 'st_autoterms') {
45 wp_enqueue_style('st-taxonomies-css');
46 }
47 }
48
49 public static function set_screen($status, $option, $value)
50 {
51 return $value;
52 }
53
54 /** Singleton instance */
55 public static function get_instance()
56 {
57 if (!isset(self::$instance)) {
58 self::$instance = new self();
59 }
60
61 return self::$instance;
62 }
63
64 /**
65 * Add WP admin menu for Tags
66 *
67 * @return void
68 * @author Olatechpro
69 */
70 public function admin_menu()
71 {
72 $hook = add_submenu_page(
73 self::MENU_SLUG,
74 esc_html__('Auto Terms', 'simple-tags'),
75 esc_html__('Auto Terms', 'simple-tags'),
76 'simple_tags',
77 'st_autoterms',
78 [
79 $this,
80 'page_manage_autoterms',
81 ]
82 );
83
84 if(taxopress_is_screen_main_page()){
85 add_action("load-$hook", [$this, 'screen_option']);
86 }
87 }
88
89 public function autoterms_logs_count(){
90
91 $count = taxopress_autoterms_logs_data(1)['counts'];
92 return '('. number_format_i18n($count) .')';
93 }
94
95 /**
96 * Screen options
97 */
98 public function screen_option()
99 {
100
101 $option = 'per_page';
102
103 if (isset($_GET['tab']) && $_GET['tab'] === 'logs') {
104 $args = [
105 'label' => esc_html__('Number of items per page', 'simple-tags'),
106 'default' => 20,
107 'option' => 'st_autoterms_logs_per_page'
108 ];
109 $this->logs_table = new Autoterms_Logs();
110 }else{
111 $args = [
112 'label' => esc_html__('Number of items per page', 'simple-tags'),
113 'default' => 20,
114 'option' => 'st_autoterms_per_page'
115 ];
116 $this->terms_table = new Autoterms_List();
117 }
118
119 add_screen_option($option, $args);
120 }
121
122 /**
123 * Method for build the page HTML manage tags
124 *
125 * @return void
126 * @author Olatechpro
127 */
128 public function page_manage_autoterms()
129 {
130 // Default order
131 if (!isset($_GET['order'])) {
132 $_GET['order'] = 'name-asc';
133 }
134
135 settings_errors(__CLASS__);
136
137 if (isset($_GET['tab']) && $_GET['tab'] === 'logs') {
138 //autoterms logs
139
140 $delete_all_link = add_query_arg([
141 'page' => 'st_autoterms',
142 'tab' => 'logs',
143 'action' => 'taxopress-delete-autoterm-logs',
144 '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce')
145 ],
146 admin_url('admin.php')
147 );
148
149 $enable_log_link = add_query_arg([
150 'page' => 'st_autoterms',
151 'tab' => 'logs',
152 'action' => 'taxopress-enable-autoterm-logs',
153 '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce')
154 ],
155 admin_url('admin.php')
156 );
157
158 $disable_log_link = add_query_arg([
159 'page' => 'st_autoterms',
160 'tab' => 'logs',
161 'action' => 'taxopress-disable-autoterm-logs',
162 '_wpnonce' => wp_create_nonce('autoterm-action-request-nonce')
163 ],
164 admin_url('admin.php')
165 );
166 ?>
167 <div class="wrap st_wrap st-manage-taxonomies-page">
168
169 <div id="">
170 <h1 class="wp-heading-inline"><?php esc_html_e('Auto Terms Logs', 'simple-tags'); ?></h1>
171 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms')); ?>"
172 class="page-title-action"><?php esc_html_e('Auto Terms', 'simple-tags'); ?></a>
173
174 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms&add=new_item')); ?>"
175 class="page-title-action"><?php esc_html_e('Add New Auto Terms', 'simple-tags'); ?></a>
176
177 <?php if(get_option('taxopress_autoterms_logs_disabled')){ ?>
178 <a href="<?php echo esc_url($enable_log_link); ?>" class="page-title-action taxopress-logs-tablenav-enable-logs"><?php esc_html_e('Enable Logs', 'simple-tags'); ?></a>
179 <?php } else { ?>
180 <a href="<?php echo esc_url($disable_log_link); ?>" class="page-title-action taxopress-logs-tablenav-disable-logs" onclick="return confirm('<?php esc_attr_e('Are you sure you want to disable logs?', 'simple-tags'); ?>')"><?php esc_html_e('Disable Logs', 'simple-tags'); ?></a>
181 <?php } ?>
182
183 <a href="<?php echo esc_url($delete_all_link); ?>" class="page-title-action taxopress-logs-tablenav-purge-logs" onclick="return confirm('<?php esc_attr_e('Are you sure you want to delete all logs?', 'simple-tags'); ?>')"><?php esc_html_e('Delete All Logs', 'simple-tags'); ?></a>
184
185 <div class="taxopress-description">
186 <?php esc_html_e('Auto Terms logs history.', 'simple-tags'); ?>
187 </div>
188
189
190 <?php
191 if (isset($_REQUEST['s']) && $search = esc_attr(sanitize_text_field(wp_unslash($_REQUEST['s'])))) {
192 /* translators: %s: search keywords */
193 printf(' <span class="subtitle">' . esc_html__('Search results for &#8220;%s&#8221;',
194 'simple-tags') . '</span>', esc_html($search));
195 }
196 ?>
197 <?php
198
199 //the terms table instance
200 $this->logs_table->prepare_items();
201 ?>
202
203
204 <hr class="wp-header-end">
205 <div id="ajax-response"></div>
206 <form class="search-form wp-clearfix st-taxonomies-search-form" method="get">
207 <?php $this->logs_table->search_box(esc_html__('Search Auto Terms Logs', 'simple-tags'), 'term'); ?>
208 </form>
209 <div class="clear"></div>
210
211 <div id="col-container" class="wp-clearfix">
212
213 <div class="col-wrap">
214 <form action="<?php echo esc_url(add_query_arg('', '')); ?>" method="post">
215 <?php $this->logs_table->display(); //Display the table ?>
216 </form>
217 <div class="form-wrap edit-term-notes">
218 <p><?php esc_html__('Description here.', 'simple-tags') ?></p>
219 </div>
220 </div>
221
222
223 </div>
224
225
226 </div>
227 <?php }elseif (!isset($_GET['add'])) {
228 //all tax
229 ?>
230 <div class="wrap st_wrap st-manage-taxonomies-page">
231
232 <div id="">
233 <h1 class="wp-heading-inline"><?php esc_html_e('Auto Terms', 'simple-tags'); ?></h1>
234 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms&add=new_item')); ?>"
235 class="page-title-action taxopress">
236 <span class="dashicons dashicons-lock"></span>
237 <?php esc_html_e('Add New Auto Terms', 'simple-tags'); ?>
238 </a>
239
240 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms&tab=logs')); ?>"
241 class="page-title-action"><?php esc_html_e('Logs', 'simple-tags'); ?> <span class="update-plugins"><span class="plugin-count"><?php echo esc_html($this->autoterms_logs_count()); ?></span></span></a>
242
243 <div class="taxopress-description">
244 <?php esc_html_e('Auto Terms can scan your content and automatically assign new and existing terms.', 'simple-tags'); ?>
245 </div>
246
247
248 <?php
249 if (isset($_REQUEST['s']) && $search = esc_attr(sanitize_text_field(wp_unslash($_REQUEST['s'])))) {
250 /* translators: %s: search keywords */
251 printf(' <span class="subtitle">' . esc_html__('Search results for &#8220;%s&#8221;',
252 'simple-tags') . '</span>', esc_html($search));
253 }
254 ?>
255 <?php
256
257 //the terms table instance
258 $this->terms_table->prepare_items();
259 ?>
260
261
262 <hr class="wp-header-end">
263 <div id="ajax-response"></div>
264 <form class="search-form wp-clearfix st-taxonomies-search-form" method="get">
265 <?php $this->terms_table->search_box(esc_html__('Search Auto Terms', 'simple-tags'), 'term'); ?>
266 </form>
267 <div class="clear"></div>
268
269 <div id="col-container" class="wp-clearfix">
270
271 <div class="col-wrap">
272 <form action="<?php echo esc_url(add_query_arg('', '')); ?>" method="post">
273 <?php $this->terms_table->display(); //Display the table ?>
274 </form>
275 <div class="form-wrap edit-term-notes">
276 <p><?php esc_html__('Description here.', 'simple-tags') ?></p>
277 </div>
278 </div>
279
280
281 </div>
282
283
284 </div>
285 <?php } else {
286 if ($_GET['add'] == 'new_item') {
287 //add/edit taxonomy
288 $this->taxopress_manage_autoterms();
289 echo '<div>';
290 }
291 } ?>
292
293
294 <?php SimpleTags_Admin::printAdminFooter(); ?>
295 </div>
296 <?php
297 }
298
299
300 /**
301 * Create our settings page output.
302 *
303 * @internal
304 */
305 public function taxopress_manage_autoterms()
306 {
307
308 $tab = (!empty($_GET) && !empty($_GET['action']) && 'edit' == $_GET['action']) ? 'edit' : 'new';
309 $tab_class = 'taxopress-' . $tab;
310 $current = null;
311
312 ?>
313
314 <div class="wrap <?php echo esc_attr($tab_class); ?>">
315
316 <?php
317
318 $autoterms = taxopress_get_autoterm_data();
319 $autoterm_edit = false;
320 $autoterm_limit = false;
321
322 if ('edit' === $tab) {
323
324
325 $selected_autoterm = taxopress_get_current_autoterm();
326
327 if ($selected_autoterm && array_key_exists($selected_autoterm, $autoterms)) {
328 $current = $autoterms[$selected_autoterm];
329 $autoterm_edit = true;
330 }
331
332 }
333
334
335 if (!isset($current['title']) && count($autoterms) > 0 && apply_filters('taxopress_autoterms_create_limit', true)) {
336 $autoterm_limit = true;
337 }
338
339
340 $ui = new taxopress_admin_ui();
341
342 $taxonomy_replace_options = [
343 'options' => [
344 [
345 'attr' => 'append',
346 'text' => esc_attr__('Add new terms and keep existing terms.', 'simple-tags'),
347 'default' => 'true'
348 ],
349 [
350 'attr' => 'append_and_replace',
351 'text' => esc_attr__('Add new terms and remove existing terms.', 'simple-tags')
352 ],
353 [
354 'attr' => 'replace',
355 'text' => esc_attr__('Remove existing terms even if no new terms are found.', 'simple-tags')
356 ]
357 ],
358 ];
359 ?>
360
361
362 <div class="wrap <?php echo esc_attr($tab_class); ?>">
363 <h1><?php echo esc_html__('Manage Auto Terms', 'simple-tags'); ?>
364
365 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms')); ?>"
366 class="page-title-action"><?php esc_html_e('Auto Terms', 'simple-tags'); ?></a>
367
368 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autoterms&tab=logs')); ?>"
369 class="page-title-action"><?php esc_html_e('Logs', 'simple-tags'); ?> <span class="update-plugins"><span class="plugin-count"><?php echo esc_html($this->autoterms_logs_count()); ?></span></span></a>
370
371 </h1>
372
373 <div class="wp-clearfix"></div>
374
375 <form method="post" action="">
376
377
378 <div class="tagcloudui st-tabbed">
379
380
381 <div class="autoterms-postbox-container">
382 <div id="poststuff">
383 <div class="taxopress-section postbox">
384 <div class="postbox-header">
385 <h2 class="hndle ui-sortable-handle">
386 <?php
387 if ($autoterm_edit) {
388 $active_tab = ( isset($current['active_tab']) && !empty(trim($current['active_tab'])) ) ? $current['active_tab'] : 'autoterm_general';
389 echo esc_html__('Edit Auto Terms', 'simple-tags');
390 echo '<input type="hidden" name="edited_autoterm" value="' . esc_attr($current['ID']) . '" />';
391 echo '<input type="hidden" name="taxopress_autoterm[ID]" value="' . esc_attr($current['ID']) . '" />';
392 echo '<input type="hidden" name="taxopress_autoterm[active_tab]" class="taxopress-active-subtab" value="'.esc_attr($active_tab).'" />';
393 } else {
394 $active_tab = 'autoterm_general';
395 echo '<input type="hidden" name="taxopress_autoterm[active_tab]" class="taxopress-active-subtab" value="" />';
396 echo esc_html__('Add new Auto Terms', 'simple-tags');
397 }
398 ?>
399 </h2>
400 </div>
401 <div class="inside">
402 <div class="main">
403
404
405 <?php if ($autoterm_limit) {
406 echo '<div class="st-taxonomy-content promo-box-area"><div class="taxopress-warning upgrade-pro">
407
408 <h2 style="margin-bottom: 5px;">' . esc_html__('To create more Auto Terms, please upgrade to TaxoPress Pro.',
409 'simple-tags') . '</h2>
410 <p>
411 ' . esc_html__('With TaxoPress Pro, you can create unlimited Auto Terms. You can create Auto Terms for any taxonomy.',
412 'simple-tags') . '
413
414 </p>
415 </div></div>';
416
417 } else {
418 ?>
419
420
421 <ul class="taxopress-tab">
422 <li aria-current="<?php echo $active_tab === 'autoterm_general' ? 'true' : 'false'; ?>" class="autoterm_general_tab <?php echo $active_tab === 'autoterm_general' ? 'active' : ''; ?>" data-content="autoterm_general">
423 <a href="#autoterm_general"><span><?php esc_html_e('General',
424 'simple-tags'); ?></span></a>
425 </li>
426 <li aria-current="<?php echo $active_tab === 'autoterm_display' ? 'true' : 'false'; ?>" class="autoterm_display_tab <?php echo $active_tab === 'autoterm_display' ? 'active' : ''; ?>" data-content="autoterm_display">
427 <a href="#autoterm_display"><span><?php esc_html_e('Post Types',
428 'simple-tags'); ?></span></a>
429 </li>
430
431 <li aria-current="<?php echo $active_tab === 'autoterm_terms' ? 'true' : 'false'; ?>" class="autoterm_terms_tab <?php echo $active_tab === 'autoterm_terms' ? 'active' : ''; ?>" data-content="autoterm_terms">
432 <a href="#autoterm_terms"><span><?php esc_html_e('Sources',
433 'simple-tags'); ?></span></a>
434 </li>
435
436 <li aria-current="<?php echo $active_tab === 'autoterm_when_to_use' ? 'true' : 'false'; ?>" class="autoterm_when_to_use_tab <?php echo $active_tab === 'autoterm_when_to_use' ? 'active' : ''; ?>" data-content="autoterm_when_to_use">
437 <a href="#autoterm_when_to_use"><span><?php esc_html_e('When to Use',
438 'simple-tags'); ?></span></a>
439 </li>
440
441 <li aria-current="<?php echo $active_tab === 'autoterm_options' ? 'true' : 'false'; ?>" class="autoterm_options_tab <?php echo $active_tab === 'autoterm_options' ? 'active' : ''; ?>" data-content="autoterm_options">
442 <a href="#autoterm_options"><span><?php esc_html_e('Options',
443 'simple-tags'); ?></span></a>
444 </li>
445
446 <li aria-current="<?php echo $active_tab === 'autoterm_exceptions' ? 'true' : 'false'; ?>" class="autoterm_exceptions_tab <?php echo $active_tab === 'autoterm_exceptions' ? 'active' : ''; ?>" data-content="autoterm_exceptions">
447 <a href="#autoterm_exceptions"><span><?php esc_html_e(
448 'Exceptions',
449 'simple-tags'
450 ); ?></span></a>
451 </li>
452
453 <!--<li aria-current="<?php echo $active_tab === 'autoterm_oldcontent' ? 'true' : 'false'; ?>" class="autoterm_oldcontent_tab <?php echo $active_tab === 'autoterm_oldcontent' ? 'active' : ''; ?>" data-content="autoterm_oldcontent">
454 <a href="#autoterm_oldcontent"><span><?php esc_html_e('Existing Content',
455 'simple-tags'); ?></span></a>
456 </li>-->
457
458 <li aria-current="<?php echo $active_tab === 'autoterm_advanced' ? 'true' : 'false'; ?>" class="autoterm_advanced_tab <?php echo $active_tab === 'autoterm_advanced' ? 'active' : ''; ?>" data-content="autoterm_advanced">
459 <a href="#autoterm_advanced"><span><?php esc_html_e('Advanced',
460 'simple-tags'); ?></span></a>
461 </li>
462
463 <li aria-current="<?php echo $active_tab === 'autoterm_preview' ? 'true' : 'false'; ?>" class="autoterm_preview_tab <?php echo $active_tab === 'autoterm_preview' ? 'active' : ''; ?>" data-content="autoterm_preview">
464 <a href="#autoterm_preview"><span><?php esc_html_e('Preview',
465 'simple-tags'); ?></span></a>
466 </li>
467
468 </ul>
469
470 <div class="st-taxonomy-content taxopress-tab-content">
471
472
473 <table class="form-table taxopress-table autoterm_general"
474 style="<?php echo $active_tab === 'autoterm_general' ? '' : 'display:none;'; ?>">
475 <?php
476 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
477 echo $ui->get_tr_start();
478
479 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
480 echo $ui->get_th_start();
481 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
482 echo $ui->get_label('title', esc_html__('Title', 'simple-tags')) . $ui->get_required_span();
483 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
484 echo $ui->get_th_end() . $ui->get_td_start();
485
486 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
487 echo $ui->get_text_input([
488 'namearray' => 'taxopress_autoterm',
489 'name' => 'title',
490 'textvalue' => isset($current['title']) ? esc_attr($current['title']) : '',
491 'maxlength' => '32',
492 'helptext' => '',
493 'required' => true,
494 'placeholder' => false,
495 'wrap' => false,
496 ]);
497
498
499 $options = [];
500 foreach (get_all_taxopress_taxonomies() as $_taxonomy) {
501 $_taxonomy = $_taxonomy->name;
502 $tax = get_taxonomy($_taxonomy);
503 if (empty($tax->labels->name)) {
504 continue;
505 }
506 if ($tax->name === 'post_tag') {
507 $options[] = [
508 'attr' => $tax->name,
509 'text' => $tax->labels->name. ' ('.$tax->name.')',
510 'default' => 'true',
511 ];
512 } else {
513 $options[] = [
514 'attr' => $tax->name,
515 'text' => $tax->labels->name. ' ('.$tax->name.')',
516 ];
517 }
518 }
519
520 $select = [
521 'options' => $options,
522 ];
523 $selected = isset($current) ? taxopress_disp_boolean($current['taxonomy']) : '';
524 $select['selected'] = !empty($selected) ? $current['taxonomy'] : '';
525 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
526 echo $ui->get_select_checkbox_input_main([
527 'namearray' => 'taxopress_autoterm',
528 'name' => 'taxonomy',
529 'class' => 'st-post-taxonomy-select',
530 'labeltext' => esc_html__('Taxonomy', 'simple-tags'),
531 'required' => true,
532 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
533 ]);
534
535 $selected_option = (isset($current) && isset($current['autoterm_from'])) ? $current['autoterm_from'] : '';
536
537 $term_from_options = [
538 '' => esc_attr__('Don\'t scan Post Content or Title', 'simple-tags'),
539 'post_content' => esc_attr__('Post Content', 'simple-tags'),
540 'post_title' => esc_attr__('Post Title', 'simple-tags'),
541 'posts' => esc_attr__('Post Content and Title', 'simple-tags')
542 ];
543 ?>
544 <tr valign="top">
545 <th scope="row">
546 <label for="autoterm_from">
547 <?php esc_html_e('Find term in:', 'simple-tags'); ?>
548 </label>
549 </th>
550 <td>
551 <select class="" id="autoterm_from" name="taxopress_autoterm[autoterm_from]">
552 <?php foreach ($term_from_options as $option => $label) : ?>
553 <option value="<?php echo esc_attr($option); ?>" <?php selected($selected_option, $option); ?>>
554 <?php echo esc_html($label); ?>
555 </option>
556 <?php endforeach; ?>
557 </select>
558 </td>
559 </tr>
560 <tr valign="top">
561 <th></th>
562 <td style="margin-top: 0; padding-top: 0;">
563 <table class="visbile-table st-autoterm-area-table">
564 <tr>
565 <th scope="row" colspan="3" style="margin-top: 0; padding-top: 0; padding-bottom: 0;">
566 <label>
567 <?php echo esc_html__('Find in more areas:', 'simple-tags'); ?>
568 </label>
569 </th>
570 </tr>
571 <tr class="autoterm-custom-findin-row form-tr option">
572 <td style="padding-left: 0; padding-top: 0;" colspan="3">
573 <select class="autoterm-area-custom-type" style="max-width: 100%;">
574 <?php
575 $area_types = [
576 'custom_fields' => esc_html__('Custom Field', 'simple-tags'),
577 'taxonomies' => esc_html__('Taxonomy', 'simple-tags'),
578 ];
579 foreach ($area_types as $area_type_value => $area_type_label) : ?>
580 <option value="<?php echo esc_attr($area_type_value); ?>">
581 <?php echo esc_html($area_type_label); ?>
582 </option>
583 <?php endforeach; ?>
584 </select>
585 </td>
586 </tr>
587 <tr class="autoterm-custom-findin-row form-tr fields">
588 <td style="padding-left: 0; padding-top: 0;" colspan="3">
589 <select class="autoterm-area-custom-taxonomy st-hide-content find-in-content taxonomies" style="max-width: 100%"
590 placeholder="<?php echo esc_attr__("Search Taxonomy", "simple-tags"); ?>">
591 <option value=""><?php echo esc_html__("Search Taxonomy", "simple-tags"); ?></option>
592 <?php
593 foreach (get_all_taxopress_taxonomies() as $_taxonomy) :
594 $_taxonomy = $_taxonomy->name;
595 $tax = get_taxonomy($_taxonomy);
596 if (empty($tax->labels->name)) {
597 continue;
598 }
599 ?>
600 <option value="<?php echo esc_attr($tax->name); ?>">
601 <?php echo esc_html($tax->labels->name. ' ('.$tax->name.')'); ?>
602 </option>
603 <?php endforeach; ?>
604 </select>
605 <div class="autoterm-field-area">
606 <select style="width: 100%;" class="taxopress-custom-fields-search find-in-content custom_fields"
607 data-placeholder="<?php echo esc_attr__("Search Custom Field...", "simple-tags"); ?>"
608 data-nonce="<?php echo esc_attr(wp_create_nonce('taxopress-custom-fields-search')); ?>"></select>
609 </div>
610 </td>
611 </tr>
612 <?php
613 $find_in_customs_entries = (!empty($current['find_in_customs_entries']) && is_array($current['find_in_customs_entries'])) ? $current['find_in_customs_entries'] : [];
614
615 $find_in_custom_fields_custom_items = (!empty($current['find_in_custom_fields_custom_items']) && is_array($current['find_in_custom_fields_custom_items'])) ? $current['find_in_custom_fields_custom_items'] : [];
616
617 $find_in_taxonomies_custom_items = (!empty($current['find_in_taxonomies_custom_items']) && is_array($current['find_in_taxonomies_custom_items'])) ? $current['find_in_taxonomies_custom_items'] : [];
618
619 if (!empty($find_in_customs_entries)) :
620 foreach ($find_in_customs_entries as $entry_type => $entry_options) :
621
622 if (!empty($entry_options)) :
623 foreach ($entry_options as $entry_option) :
624 $checked_option = false;
625 if ($entry_type == 'custom_fields' && in_array($entry_option, $find_in_custom_fields_custom_items)) {
626 $checked_option = true;
627 } elseif (in_array($entry_option, $find_in_taxonomies_custom_items)) {
628 $checked_option = true;
629 }
630 ?>
631 <tr valign="top" class="find-in-customs-row <?php echo esc_attr($entry_type); ?> <?php echo esc_attr($entry_option); ?>">
632 <td colspan="2" class="item-header">
633 <div>
634 <span class="action-checkbox">
635 <input type="hidden" name="find_in_customs_entries[<?php echo esc_attr($entry_type); ?>][]" value="<?php echo esc_attr($entry_option); ?>" /><input type="checkbox" id="<?php echo esc_attr($entry_option); ?>" name="find_in_<?php echo esc_attr($entry_type); ?>_custom_items[]" value="<?php echo esc_attr($entry_option); ?>" <?php checked($checked_option, true); ?> />
636 </span>
637 <label for="<?php echo esc_attr($entry_option); ?>">
638 <?php echo esc_html($entry_option); ?>
639 </label>
640 </div>
641 </td>
642 <td>
643 <span class="delete">
644 <?php echo esc_html__("Delete", "simple-tags"); ?>
645 </span>
646 </td>
647 </tr>
648 <?php endforeach;
649 endif;
650
651 endforeach;
652 endif;
653
654 ?>
655 </table>
656 </td>
657 </tr>
658 <?php
659 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
660 echo $ui->get_td_end() . $ui->get_tr_end();
661 ?>
662 </table>
663
664 <table class="form-table taxopress-table autoterm_display"
665 style="<?php echo $active_tab === 'autoterm_display' ? '' : 'display:none;'; ?>">
666
667 <?php
668
669 /**
670 * Filters the arguments for post types to list for taxonomy association.
671 *
672 *
673 * @param array $value Array of default arguments.
674 */
675 $args = apply_filters('taxopress_attach_post_types_to_taxonomy',
676 ['public' => true]);
677
678 // 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.
679 if (!is_array($args)) {
680 $args = ['public' => true];
681 }
682 $output = 'objects'; // Or objects.
683
684 /**
685 * Filters the results returned to display for available post types for taxonomy.
686 *
687 * @param array $value Array of post type objects.
688 * @param array $args Array of arguments for the post type query.
689 * @param string $output The output type we want for the results.
690 */
691 $post_types = apply_filters('taxopress_get_post_types_for_taxonomies',
692 get_post_types($args, $output), $args, $output);
693
694 $term_auto_locations = [];
695 foreach ($post_types as $post_type) {
696 if (!in_array($post_type->name, ['attachment'])) {
697 $term_auto_locations[$post_type->name] = $post_type->label;
698 }
699 }
700
701 echo '<tr valign="top"><th scope="row"><label>' . esc_html__('Post Types to scan:',
702 'simple-tags') . '</label> </th><td>
703 <table class="visbile-table">';
704 foreach ($term_auto_locations as $key => $value) {
705
706
707 echo '<tr valign="top"><th scope="row"><label for="' . esc_attr($key) . '">' . esc_html($value) . '</label></th><td>';
708 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
709 echo $ui->get_check_input([
710 'checkvalue' => esc_attr($key),
711 'checked' => (!empty($current['post_types']) && is_array($current['post_types']) && in_array($key, $current['post_types'], true)) ? 'true' : 'false',
712 'name' => esc_attr($key),
713 'namearray' => 'post_types',
714 'textvalue' => esc_attr($key),
715 'labeltext' => "",
716 'wrap' => false,
717 ]);
718
719 echo '</td></tr>';
720
721
722 }
723 echo '</table></td></tr>';
724 ?>
725
726 </table>
727
728
729 <table class="form-table taxopress-table autoterm_when_to_use"
730 style="<?php echo $active_tab === 'autoterm_when_to_use' ? '' : 'display:none;'; ?>">
731 <tr valign="top" class="tab-group-tr">
732 <td colspan="2">
733 <div class="taxopress-group-wrap autoterm-tab-group when">
734 <div class="taxopress-button-group">
735
736 <label class="post current">
737 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_when_to_use_tab][]" value="post"><?php esc_html_e('Posts', 'simple-tags'); ?></label>
738 <label class="schedule">
739 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_when_to_use_tab][]" value="schedule"><?php esc_html_e('Schedule', 'simple-tags'); ?></label>
740 <label class="existing-content">
741 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_when_to_use_tab][]" value="existing_content"><?php esc_html_e('Existing Content', 'simple-tags'); ?></label>
742 <label class="metaboxes">
743 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_when_to_use_tab][]" value="metaboxes"><?php esc_html_e('Metaboxes', 'simple-tags'); ?></label>
744 </div>
745 </div>
746 </td>
747 </tr>
748 <?php
749
750 if($autoterm_edit){
751 $default_select = [
752 'options' => [
753 [
754 'attr' => '0',
755 'text' => esc_attr__('False', 'simple-tags'),
756 'default' => 'true',
757 ],
758 [
759 'attr' => '1',
760 'text' => esc_attr__('True', 'simple-tags'),
761 ],
762 ],
763 ];
764 }else{
765 $default_select = [
766 'options' => [
767 [
768 'attr' => '0',
769 'text' => esc_attr__('False', 'simple-tags'),
770 ],
771 [
772 'attr' => '1',
773 'text' => esc_attr__('True', 'simple-tags'),
774 'default' => 'true',
775 ],
776 ],
777 ];
778
779 }
780
781 /**
782 * Post
783 */
784 $selected = (isset($current) && isset($current['autoterm_for_post'])) ? taxopress_disp_boolean($current['autoterm_for_post']) : '';
785 $default_select['selected'] = !empty($selected) ? $current['autoterm_for_post'] : '';
786 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
787 echo $ui->get_select_checkbox_input([
788 'namearray' => 'taxopress_autoterm',
789 'name' => 'autoterm_for_post',
790 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post fields-control',
791 'labeltext' => esc_html__('Post', 'simple-tags'),
792 'aftertext' => esc_html__('Enable Auto Terms when a post is saved or updated.', 'simple-tags'),
793 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
794 'required' => false,
795 ]);
796
797 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
798 echo $ui->get_number_input([
799 'namearray' => 'taxopress_autoterm',
800 'name' => 'terms_limit',
801 'textvalue' => isset($current['terms_limit']) ? esc_attr($current['terms_limit']) : '5',
802 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post',
803 'labeltext' => esc_html__('Auto Terms Limit',
804 'simple-tags'),
805 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'),
806 'min' => '0',
807 'required' => false,
808 ]);
809
810
811 $selected = (isset($current) && isset($current['autoterm_target'])) ? taxopress_disp_boolean($current['autoterm_target']) : '';
812 $default_select['selected'] = !empty($selected) ? $current['autoterm_target'] : '';
813 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
814 echo $ui->get_select_checkbox_input([
815 'namearray' => 'taxopress_autoterm',
816 'name' => 'autoterm_target',
817 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post',
818 'labeltext' => esc_html__('Target content', 'simple-tags'),
819 'aftertext' => esc_html__('Only use Auto Terms on posts with no added terms.', 'simple-tags'),
820 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
821 ]);
822
823
824 $selected = (isset($current) && isset($current['autoterm_word'])) ? taxopress_disp_boolean($current['autoterm_word']) : '';
825 $default_select['selected'] = !empty($selected) ? $current['autoterm_word'] : '';
826 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
827 echo $ui->get_select_checkbox_input([
828 'namearray' => 'taxopress_autoterm',
829 'name' => 'autoterm_word',
830 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post',
831 'labeltext' => esc_html__('Whole words', 'simple-tags'),
832 'aftertext' => esc_html__('Only add terms when the word is an exact match. Do not make matches for partial words.', 'simple-tags'),
833 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
834 ]);
835
836
837 $selected = (isset($current) && isset($current['autoterm_hash'])) ? taxopress_disp_boolean($current['autoterm_hash']) : '';
838 $default_select['selected'] = !empty($selected) ? $current['autoterm_hash'] : '';
839 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
840 echo $ui->get_select_checkbox_input([
841 'namearray' => 'taxopress_autoterm',
842 'name' => 'autoterm_hash',
843 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post',
844 'labeltext' => esc_html__('Hashtags', 'simple-tags'),
845 'aftertext' => esc_html__('Support hashtags symbols # in Auto Terms.', 'simple-tags'),
846 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
847 ]);
848
849 $selected = (isset($current) && isset($current['post_replace_type'])) ? taxopress_disp_boolean($current['post_replace_type']) : '';
850 $taxonomy_replace_options['selected'] = !empty($selected) ? $current['post_replace_type'] : '';
851 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
852 echo $ui->get_radio_input([
853 'namearray' => 'taxopress_autoterm',
854 'name' => 'post_replace_type',
855 'class' => 'autoterm_for_post autoterm-terms-when-to-field autoterm-terms-when-post',
856 'labeltext' => esc_html__('Auto Terms replacement settings',
857 'simple-tags'),
858 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'),
859 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
860 ]);
861
862
863 /**
864 * Schedule
865 */
866 $default_select = [
867 'options' => [
868 [
869 'attr' => '0',
870 'text' => esc_attr__('False', 'simple-tags'),
871 'default' => 'true',
872 ],
873 [
874 'attr' => '1',
875 'text' => esc_attr__('True', 'simple-tags'),
876 ],
877 ],
878 ];
879
880 $selected = (isset($current) && isset($current['autoterm_for_schedule'])) ? taxopress_disp_boolean($current['autoterm_for_schedule']) : '';
881 $default_select['selected'] = !empty($selected) ? $current['autoterm_for_schedule'] : '';
882 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
883 echo $ui->get_select_checkbox_input([
884 'namearray' => 'taxopress_autoterm',
885 'name' => 'autoterm_for_schedule',
886 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule fields-control',
887 'labeltext' => esc_html__('Schedule', 'simple-tags'),
888 'aftertext' => esc_html__('Enable Auto Terms for the "Schedule" feature.', 'simple-tags'),
889 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
890 'required' => false,
891 ]);
892
893 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
894 echo $ui->get_number_input([
895 'namearray' => 'taxopress_autoterm',
896 'name' => 'schedule_terms_limit',
897 'textvalue' => isset($current['schedule_terms_limit']) ? esc_attr($current['schedule_terms_limit']) : '5',
898 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule',
899 'labeltext' => esc_html__('Auto Terms Limit',
900 'simple-tags'),
901 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'),
902 'min' => '0',
903 'required' => false,
904 ]);
905
906
907 $selected = (isset($current) && isset($current['schedule_autoterm_target'])) ? taxopress_disp_boolean($current['schedule_autoterm_target']) : '';
908 $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_target'] : '';
909 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
910 echo $ui->get_select_checkbox_input([
911 'namearray' => 'taxopress_autoterm',
912 'name' => 'schedule_autoterm_target',
913 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule',
914 'labeltext' => esc_html__('Target content', 'simple-tags'),
915 'aftertext' => esc_html__('Only use Auto Terms on schedules with no added terms.', 'simple-tags'),
916 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
917 ]);
918
919
920 $selected = (isset($current) && isset($current['schedule_autoterm_word'])) ? taxopress_disp_boolean($current['schedule_autoterm_word']) : '';
921 $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_word'] : '';
922 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
923 echo $ui->get_select_checkbox_input([
924 'namearray' => 'taxopress_autoterm',
925 'name' => 'schedule_autoterm_word',
926 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule',
927 'labeltext' => esc_html__('Whole words', 'simple-tags'),
928 'aftertext' => esc_html__('Only add terms when the word is an exact match. Do not make matches for partial words.', 'simple-tags'),
929 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
930 ]);
931
932
933 $selected = (isset($current) && isset($current['schedule_autoterm_hash'])) ? taxopress_disp_boolean($current['schedule_autoterm_hash']) : '';
934 $default_select['selected'] = !empty($selected) ? $current['schedule_autoterm_hash'] : '';
935 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
936 echo $ui->get_select_checkbox_input([
937 'namearray' => 'taxopress_autoterm',
938 'name' => 'schedule_autoterm_hash',
939 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule',
940 'labeltext' => esc_html__('Hashtags', 'simple-tags'),
941 'aftertext' => esc_html__('Support hashtags symbols # in Auto Terms.', 'simple-tags'),
942 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
943 ]);
944
945 $taxonomy_replace_options = [
946 'options' => [
947 [
948 'attr' => '0',
949 'text' => esc_attr__('False', 'simple-tags'),
950 'default' => 'true',
951 ],
952 [
953 'attr' => '1',
954 'text' => esc_attr__('True', 'simple-tags'),
955 ],
956 ],
957 ];
958
959 $selected = (isset($current) && isset($current['schedule_replace_type'])) ? taxopress_disp_boolean($current['schedule_replace_type']) : '';
960 $taxonomy_replace_options['selected'] = !empty($selected) ? $current['schedule_replace_type'] : '';
961 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
962 echo $ui->get_radio_input([
963 'namearray' => 'taxopress_autoterm',
964 'name' => 'schedule_replace_type',
965 'class' => 'autoterm_for_schedule autoterm-terms-when-to-field autoterm-terms-when-schedule',
966 'labeltext' => esc_html__('Auto Terms replacement settings',
967 'simple-tags'),
968 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'),
969 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
970 ]);
971
972 /**
973 * Existing Content
974 */
975 $selected = (isset($current) && isset($current['autoterm_for_existing_content'])) ? taxopress_disp_boolean($current['autoterm_for_existing_content']) : '';
976 $default_select['selected'] = !empty($selected) ? $current['autoterm_for_existing_content'] : '';
977 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
978 echo $ui->get_select_checkbox_input([
979 'namearray' => 'taxopress_autoterm',
980 'name' => 'autoterm_for_existing_content',
981 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content fields-control',
982 'labeltext' => esc_html__('Existing Content', 'simple-tags'),
983 'aftertext' => esc_html__('Enable Auto Terms for the "Existing Content" feature.', 'simple-tags'),
984 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
985 'required' => false,
986 ]);
987
988 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
989 echo $ui->get_number_input([
990 'namearray' => 'taxopress_autoterm',
991 'name' => 'existing_content_terms_limit',
992 'textvalue' => isset($current['existing_content_terms_limit']) ? esc_attr($current['existing_content_terms_limit']) : '5',
993 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content',
994 'labeltext' => esc_html__('Auto Terms Limit',
995 'simple-tags'),
996 'helptext' => esc_html__('Limit the number of generated Auto Terms. \'0\' for unlimited terms', 'simple-tags'),
997 'min' => '0',
998 'required' => false,
999 ]);
1000
1001 $selected = (isset($current) && isset($current['existing_content_replace_type'])) ? taxopress_disp_boolean($current['existing_content_replace_type']) : '';
1002 $taxonomy_replace_options['selected'] = !empty($selected) ? $current['existing_content_replace_type'] : '';
1003 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1004 echo $ui->get_radio_input([
1005 'namearray' => 'taxopress_autoterm',
1006 'name' => 'existing_content_replace_type',
1007 'class' => 'autoterm_for_existing_content autoterm-terms-when-to-field autoterm-terms-when-existing-content',
1008 'labeltext' => esc_html__('Auto Terms replacement settings',
1009 'simple-tags'),
1010 'aftertext' => esc_html__('This option determines what happens when adding new terms to posts.', 'simple-tags'),
1011 'selections' => $taxonomy_replace_options,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1012 ]);
1013
1014
1015 /**
1016 * Metaboxes
1017 */
1018 $selected = (isset($current) && isset($current['autoterm_for_metaboxes'])) ? taxopress_disp_boolean($current['autoterm_for_metaboxes']) : '';
1019 $default_select['selected'] = !empty($selected) ? $current['autoterm_for_metaboxes'] : '';
1020 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1021 echo $ui->get_select_checkbox_input([
1022 'namearray' => 'taxopress_autoterm',
1023 'name' => 'autoterm_for_metaboxes',
1024 'class' => 'autoterm_for_metaboxes autoterm-terms-when-to-field autoterm-terms-when-metaboxes fields-control',
1025 'labeltext' => esc_html__('Metaboxes', 'simple-tags'),
1026 'aftertext' => esc_html__('Enable Auto Terms for the "Metaboxes" and the "Fast Update" feature.', 'simple-tags'),
1027 'selections' => $default_select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1028 'required' => false,
1029 ]);
1030 ?>
1031 </table>
1032
1033
1034
1035
1036 <table class="form-table taxopress-table autoterm_terms"
1037 style="<?php echo $active_tab === 'autoterm_terms' ? '' : 'display:none;'; ?>">
1038 <tr valign="top" class="tab-group-tr">
1039 <td colspan="2">
1040 <div class="taxopress-group-wrap autoterm-tab-group source">
1041 <div class="taxopress-button-group">
1042 <label class="existing current">
1043 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_tab][]" value="existing_terms"><?php esc_html_e('Existing Terms', 'simple-tags'); ?></label>
1044 <label class="openai">
1045 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_tab][]" value="open_ai"><?php esc_html_e('OpenAI', 'simple-tags'); ?></label>
1046 <label class="ibm-watson">
1047 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_tab][]" value="ibm_watson"><?php esc_html_e('IBM Watson', 'simple-tags'); ?></label>
1048 <label class="dandelion">
1049 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_tab][]" value="dandelion"><?php esc_html_e('Dandelion', 'simple-tags'); ?></label>
1050 <label class="lseg-refinitiv">
1051 <input disabled type="checkbox" name="taxopress_autoterm[autoterm_source_tab][]" value="lseg_refinitiv"><?php esc_html_e('LSEG / Refinitiv', 'simple-tags'); ?></label>
1052 </div>
1053 </div>
1054 </td>
1055 </tr>
1056 <?php
1057
1058 if($autoterm_edit){
1059 $select = [
1060 'options' => [
1061 [
1062 'attr' => '0',
1063 'text' => esc_attr__('False', 'simple-tags'),
1064 'default' => 'true',
1065 ],
1066 [
1067 'attr' => '1',
1068 'text' => esc_attr__('True', 'simple-tags'),
1069 ],
1070 ],
1071 ];
1072 }else{
1073 $select = [
1074 'options' => [
1075 [
1076 'attr' => '0',
1077 'text' => esc_attr__('False', 'simple-tags'),
1078 ],
1079 [
1080 'attr' => '1',
1081 'text' => esc_attr__('True', 'simple-tags'),
1082 'default' => 'true',
1083 ],
1084 ],
1085 ];
1086
1087 }
1088 $selected = (isset($current) && isset($current['autoterm_use_taxonomy'])) ? taxopress_disp_boolean($current['autoterm_use_taxonomy']) : '';
1089 $select['selected'] = !empty($selected) ? $current['autoterm_use_taxonomy'] : '';
1090 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1091 echo $ui->get_select_checkbox_input([
1092 'namearray' => 'taxopress_autoterm',
1093 'name' => 'autoterm_use_taxonomy',
1094 'class' => 'autoterm_use_taxonomy autoterm-terms-to-use-field autoterm-terms-use-existing fields-control',
1095 'labeltext' => esc_html__('Existing taxonomy terms', 'simple-tags'),
1096 'aftertext' => esc_html__('This will add existing terms from the taxonomy selected in the "General" tab.', 'simple-tags'),
1097 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1098 'required' => false,
1099 ]);
1100
1101
1102
1103 if($autoterm_edit){
1104 $select = [
1105 'options' => [
1106 [
1107 'attr' => '0',
1108 'text' => esc_attr__('False', 'simple-tags'),
1109 'default' => 'true',
1110 ],
1111 [
1112 'attr' => '1',
1113 'text' => esc_attr__('True', 'simple-tags'),
1114 ],
1115 ],
1116 ];
1117 }else{
1118 $select = [
1119 'options' => [
1120 [
1121 'attr' => '0',
1122 'text' => esc_attr__('False', 'simple-tags'),
1123 ],
1124 [
1125 'attr' => '1',
1126 'text' => esc_attr__('True', 'simple-tags'),
1127 'default' => 'true',
1128 ],
1129 ],
1130 ];
1131
1132 }
1133
1134 $selected = (isset($current) && isset($current['autoterm_useall'])) ? taxopress_disp_boolean($current['autoterm_useall']) : '';
1135 $select['selected'] = !empty($selected) ? $current['autoterm_useall'] : '';
1136 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1137 echo $ui->get_select_checkbox_input([
1138 'namearray' => 'taxopress_autoterm',
1139 'name' => 'autoterm_useall',
1140 'class' => 'autoterm_useall autoterm-terms-to-use-field autoterm-terms-use-existing',
1141 'labeltext' => '',
1142 'aftertext' => esc_html__('Use all the terms in the selected taxonomy.', 'simple-tags'),
1143 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1144 'required' => false,
1145 ]);
1146
1147
1148 $select = [
1149 'options' => [
1150 [
1151 'attr' => '0',
1152 'text' => esc_attr__('False', 'simple-tags'),
1153 'default' => 'true',
1154 ],
1155 [
1156 'attr' => '1',
1157 'text' => esc_attr__('True', 'simple-tags'),
1158 ],
1159 ],
1160 ];
1161 $selected = (isset($current) && isset($current['autoterm_useonly'])) ? taxopress_disp_boolean($current['autoterm_useonly']) : '';
1162 $select['selected'] = !empty($selected) ? $current['autoterm_useonly'] : '';
1163 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1164 echo $ui->get_select_checkbox_input([
1165 'namearray' => 'taxopress_autoterm',
1166 'name' => 'autoterm_useonly',
1167 'class' => 'autoterm_useonly autoterm-terms-to-use-field autoterm-terms-use-existing',
1168 'labeltext' => ' ',
1169 'aftertext' => esc_html__('Use only some terms in the selected taxonomy.', 'simple-tags'),
1170 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1171 ]);
1172
1173 $specific_terms = ( isset($current) && isset($current['specific_terms'])) ? taxopress_change_to_array($current['specific_terms']) : '';
1174 echo '<tr class="autoterm_useonly_options '. ($selected === 'false' ? 'st-hide-content' : '') .'" valign="top"><th scope="row"><label for=""></label></th><td>';
1175 echo '<div class="auto-terms-to-use-error" style="display:none;"> '.esc_html__('Please choose an option for "Sources"', 'simple-tags').' </div>';
1176
1177 echo '<div class="st-autoterms-single-specific-term autoterm-terms-use-existing">
1178 <input autocomplete="off" type="text" class="st-full-width specific_terms_input" name="specific_terms_search" maxlength="32" placeholder="'. esc_attr(__('Choose the terms to use.', 'simple-tags')) .'" value="">
1179 </div>';
1180 echo '<ul class="taxopress-term-list-style">';
1181 if (!empty($specific_terms)) {
1182 foreach ($specific_terms as $specific_term) {
1183 if (!empty($specific_term)) {
1184 ?>
1185 <li class="taxopress-term-li">
1186 <span class="display-text"><?php echo esc_html($specific_term); ?></span>
1187 <span class="remove-term-row">
1188 <span class="dashicons dashicons-no-alt"></span>
1189 </span>
1190 <input type="hidden" class="taxopress-terms-names" name="specific_terms[]" value="<?php echo esc_attr($specific_term); ?>">
1191 </li>
1192 <?php
1193 }
1194 }
1195 }
1196 echo '</div>';
1197 echo '</td></tr>';
1198
1199
1200 $select = [
1201 'options' => [
1202 [
1203 'attr' => '0',
1204 'text' => esc_attr__('False', 'simple-tags'),
1205 'default' => 'true',
1206 ],
1207 [
1208 'attr' => '1',
1209 'text' => esc_attr__('True', 'simple-tags'),
1210 ],
1211 ],
1212 ];
1213 $selected = ( isset($current) && isset($current['suggest_local_terms_show_post_count']) ) ? taxopress_disp_boolean($current['suggest_local_terms_show_post_count']) : '';
1214 $select['selected'] = !empty($selected) ? $current['suggest_local_terms_show_post_count'] : '';
1215 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1216 echo $ui->get_select_checkbox_input([
1217 'namearray' => 'taxopress_autoterm',
1218 'name' => 'suggest_local_terms_show_post_count',
1219 'labeltext' => esc_html__('Show Term Post Count', 'simple-tags'),
1220 'aftertext' => esc_html__('This will show the number of posts attached to the terms.', 'simple-tags'),
1221 'class' => 'autoterm-terms-to-use-field autoterm-terms-use-existing',
1222 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1223 ]);
1224
1225 do_action('taxopress_autoterms_after_autoterm_terms_to_use', $current);
1226
1227 ?>
1228 </table>
1229
1230
1231 <table class="form-table taxopress-table autoterm_options"
1232 style="<?php echo $active_tab === 'autoterm_options' ? '' : 'display:none;'; ?>">
1233 <?php
1234
1235 if (taxopress_is_pro_version() && taxopress_is_synonyms_enabled()) {
1236 $select = [
1237 'options' => [
1238 [
1239 'attr' => '0',
1240 'text' => esc_attr__('False', 'simple-tags'),
1241 ],
1242 [
1243 'attr' => '1',
1244 'text' => esc_attr__('True', 'simple-tags'),
1245 'default' => 'true',
1246 ],
1247 ],
1248 ];
1249 $selected = (isset($current) && isset($current['synonyms_term'])) ? taxopress_disp_boolean($current['synonyms_term']) : '';
1250 $select['selected'] = !empty($selected) ? $current['synonyms_term'] : '';
1251 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1252 echo $ui->get_select_checkbox_input([
1253 'namearray' => 'taxopress_autoterm',
1254 'name' => 'synonyms_term',
1255 'labeltext' => esc_html__(
1256 'Add terms if synonyms found',
1257 'simple-tags'
1258 ),
1259 'aftertext' => esc_html__(
1260 'TaxoPress will add a term to the post if a synonym is found.',
1261 'simple-tags'
1262 ),
1263 'selections' => $select, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1264 ]);
1265 }
1266
1267
1268 $post_status_objects = taxopress_get_post_statuses();
1269 $post_status_options = [];
1270 foreach ( $post_status_objects as $status_slug => $status_object ) {
1271 if (in_array($status_slug, ['publish', 'future', 'draft', 'pending'])) {
1272 $post_status_options[$status_slug] = $status_object->label;
1273 }
1274 }
1275
1276 echo '<tr valign="top"><th scope="row"><label for="">' . esc_html__('Content statuses', 'simple-tags') . '</label> <span class="required">*</span></th><td>';
1277
1278 echo '<div class="auto-terms-post-status-error" style="display:none;"> '.esc_html__('Please choose an option for "Content statuses"', 'simple-tags').' </div>';
1279
1280 $autoterms_post_status = (!empty($current['post_status'])) ? (array)$current['post_status'] : ['publish'];
1281 foreach ($post_status_options as $key => $value) {
1282 $checked_status = (in_array($key, $autoterms_post_status)) ? 'checked' : '';
1283 echo '<input class="autoterm_post_status_'.esc_attr($key).'" type="checkbox" name="post_status[]" value="'.esc_attr($key).'" '.esc_attr($checked_status).'> ' . esc_html($value) . ' <br /><br />';
1284
1285 }
1286 echo '</td></tr>';
1287
1288 ?>
1289
1290 </table>
1291
1292
1293 <table class="form-table taxopress-table autoterm_exceptions" style="<?php echo $active_tab === 'autoterm_exceptions' ? '' : 'display:none;'; ?>">
1294 <?php
1295 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1296 echo $ui->get_textarea_input([
1297 'namearray' => 'taxopress_autoterm',
1298 'name' => 'autoterm_exclude',
1299 'rows' => '4',
1300 'cols' => '40',
1301 'class' => 'autocomplete-input auto-terms-stopwords',
1302 'textvalue' => isset($current['autoterm_exclude']) ? esc_attr($current['autoterm_exclude']) : '',
1303 'labeltext' => esc_html__(
1304 'Exclude terms from Auto Term',
1305 'simple-tags'
1306 ),
1307 'helptext' => esc_html__(
1308 'Choose terms to be excluded from auto terms.',
1309 'simple-tags'
1310 ),
1311 'required' => false,
1312 ]);
1313
1314 $html_exclusions = [
1315 //headers
1316 'h1' => esc_attr__('H1', 'simple-tags'),
1317 'h2' => esc_attr__('H2', 'simple-tags'),
1318 'h3' => esc_attr__('H3', 'simple-tags'),
1319 'h4' => esc_attr__('H4', 'simple-tags'),
1320 'h5' => esc_attr__('H5', 'simple-tags'),
1321 'h6' => esc_attr__('H6', 'simple-tags'),
1322 //html elements
1323 'a' => esc_attr__('a', 'simple-tags'),
1324 'script' => esc_attr__('script', 'simple-tags'),
1325 'style' => esc_attr__('style', 'simple-tags'),
1326 'pre' => esc_attr__('pre', 'simple-tags'),
1327 'code' => esc_attr__('code', 'simple-tags'),
1328 ];
1329
1330 echo '<tr valign="top"><th scope="row"><label>' . esc_html__(
1331 'Prevent Auto Term inside elements',
1332 'simple-tags'
1333 ) . '</label><br /><small style=" color: #646970;">' . esc_html__(
1334 'Terms inside these HTML tags will not be used to generate terms.',
1335 'simple-tags'
1336 ) . '</small></th><td>
1337 <table class="visbile-table st-html-exclusion-table" style="width: 100%;">';
1338 foreach ($html_exclusions as $key => $value) {
1339
1340 echo '<tr valign="top"><th scope="row"><label for="' . esc_attr($key) . '">' . esc_html($value) . '</label></th><td>';
1341
1342 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1343 echo $ui->get_check_input([
1344 'checkvalue' => $key,
1345 'checked' => (!empty($current['html_exclusion']) && is_array($current['html_exclusion']) && in_array(
1346 $key,
1347 $current['html_exclusion'],
1348 true
1349 )) ? 'true' : 'false',
1350 'name' => esc_attr($key),
1351 'namearray' => 'html_exclusion',
1352 'textvalue' => esc_attr($key),
1353 'labeltext' => esc_html($key),
1354 'labeldescription' => true,
1355 'wrap' => false,
1356 ]);
1357
1358 echo '</td></tr>';
1359
1360 if ($key === 'h6') {
1361 echo '<tr valign="top"><th style="padding: 0;" scope="row"><hr /></th><td style="padding: 0;"><hr /></td></tr>';
1362 }
1363 }
1364
1365 /**
1366 * Fires after the autoterms html_exclusions.
1367 * @param $current array
1368 * @param taxopress_admin_ui $ui Admin UI instance.
1369 */
1370 do_action('taxopress_autoterms_after_html_exclusions', $current, $ui);
1371
1372 echo '</table></td></tr>';
1373
1374 /**
1375 * Fires after the autoterms html_exclusions tr.
1376 * @param $current array
1377 * @param taxopress_admin_ui $ui Admin UI instance.
1378 */
1379 do_action('taxopress_autoterms_after_html_exclusions_tr', $current, $ui);
1380
1381 ?>
1382
1383 </table>
1384
1385
1386 <table class="form-table taxopress-table autoterm_oldcontent"
1387 style="<?php echo $active_tab === 'autoterm_oldcontent' ? '' : 'display:none;'; ?>">
1388
1389 <?php
1390
1391 $select = [
1392 'options' => [
1393 [
1394 'attr' => '0',
1395 'text' => esc_attr__('False', 'simple-tags'),
1396 'default' => 'true',
1397 ],
1398 [
1399 'attr' => '1',
1400 'text' => esc_attr__('True', 'simple-tags'),
1401 ],
1402 ],
1403 ];
1404 $selected = (isset($current) && isset($current['autoterm_existing_content_exclude'])) ? taxopress_disp_boolean($current['autoterm_existing_content_exclude']) : '';
1405 $select['selected'] = !empty($selected) ? $current['autoterm_existing_content_exclude'] : '';
1406 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1407 echo $ui->get_select_checkbox_input([
1408 'namearray' => 'taxopress_autoterm',
1409 'name' => 'autoterm_existing_content_exclude',
1410 'class' => '',
1411 'labeltext' => esc_html__('Exclude previously analyzed content', 'simple-tags'),
1412 'aftertext' => esc_html__('This enables you to skip posts that have already been analyzed by the Existing Content feature.', 'simple-tags'),
1413 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1414 ]);
1415
1416 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1417 echo $ui->get_number_input([
1418 'namearray' => 'taxopress_autoterm',
1419 'name' => 'existing_terms_batches',
1420 'textvalue' => isset($current['existing_terms_batches']) ? esc_attr($current['existing_terms_batches']) : '2',
1421 'labeltext' => esc_html__('Limit per batches',
1422 'simple-tags'),
1423 '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'),
1424 'min' => '1',
1425 'required' => true,
1426 ]);
1427
1428 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1429 echo $ui->get_number_input([
1430 'namearray' => 'taxopress_autoterm',
1431 'name' => 'existing_terms_sleep',
1432 'textvalue' => isset($current['existing_terms_sleep']) ? esc_attr($current['existing_terms_sleep']) : '10',
1433 'labeltext' => esc_html__('Batches wait time', 'simple-tags'),
1434 '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'),
1435 'min' => '0',
1436 'required' => true,
1437 ]);
1438
1439 $select = [
1440 'options' => [
1441 [
1442 'attr' => '1',
1443 'text' => esc_attr__('24 hours ago', 'simple-tags')
1444 ],
1445 [
1446 'attr' => '7',
1447 'text' => esc_attr__('7 days ago', 'simple-tags')
1448 ],
1449 [
1450 'attr' => '14',
1451 'text' => esc_attr__('2 weeks ago', 'simple-tags')
1452 ],
1453 [
1454 'attr' => '30',
1455 'text' => esc_attr__('1 month ago', 'simple-tags'),
1456 'default' => 'true'
1457 ],
1458 [
1459 'attr' => '180',
1460 'text' => esc_attr__('6 months ago', 'simple-tags')
1461 ],
1462 [
1463 'attr' => '365',
1464 'text' => esc_attr__('1 year ago', 'simple-tags')
1465 ],
1466 [
1467 'attr' => '0',
1468 'text' => esc_attr__('No limit', 'simple-tags')
1469 ],
1470 ],
1471 ];
1472
1473 if(isset($current) && is_array($current)){
1474 $select = [
1475 'options' => [
1476 [
1477 'attr' => '1',
1478 'text' => esc_attr__('24 hours ago', 'simple-tags')
1479 ],
1480 [
1481 'attr' => '7',
1482 'text' => esc_attr__('7 days ago', 'simple-tags')
1483 ],
1484 [
1485 'attr' => '14',
1486 'text' => esc_attr__('2 weeks ago', 'simple-tags')
1487 ],
1488 [
1489 'attr' => '30',
1490 'text' => esc_attr__('1 month ago', 'simple-tags'),
1491 ],
1492 [
1493 'attr' => '180',
1494 'text' => esc_attr__('6 months ago', 'simple-tags')
1495 ],
1496 [
1497 'attr' => '365',
1498 'text' => esc_attr__('1 year ago', 'simple-tags')
1499 ],
1500 [
1501 'attr' => '0',
1502 'text' => esc_attr__('No limit', 'simple-tags'),
1503 'default' => 'true'
1504 ],
1505 ],
1506 ];
1507 }
1508
1509 $selected = (isset($current) && isset($current['limit_days'])) ? taxopress_disp_boolean($current['limit_days']) : '';
1510 $select['selected'] = !empty($selected) ? $current['limit_days'] : '';
1511 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1512 echo $ui->get_select_number_select([
1513 'namearray' => 'taxopress_autoterm',
1514 'name' => 'limit_days',
1515 'labeltext' => esc_html__('Limit Auto Terms, based on published date',
1516 'simple-tags'),
1517 'aftertext' => esc_html__('This setting allows you to add Auto Terms only to recent content.', 'simple-tags'),
1518 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1519 ]);
1520 ?>
1521
1522 <tr valign="top"><th scope="row"><label><?php echo esc_html__('Existing Content', 'simple-tags'); ?></label></th>
1523
1524 <td>
1525 <input type="submit" class="button taxopress-autoterm-all-content" value="<?php echo esc_attr(__('Add Auto Terms to existing content', 'simple-tags')); ?>">
1526 <span class="spinner taxopress-spinner"></span>
1527
1528 <p class="taxopress-field-description description">
1529 <?php echo esc_html__('Click the button to add Auto Terms to existing content.', 'simple-tags'); ?>
1530 </p>
1531
1532 <div class="auto-term-content-result-title"></div>
1533
1534 </div>
1535
1536 <ul class="auto-term-content-result"></ul>
1537 </td></tr>
1538
1539 </table>
1540
1541
1542 <table class="form-table taxopress-table autoterm_advanced"
1543 style="<?php echo $active_tab === 'autoterm_advanced' ? '' : 'display:none;'; ?>">
1544
1545 <?php do_action('taxopress_autoterms_after_autoterm_advanced', $current); ?>
1546
1547 </table>
1548
1549
1550 <table class="form-table taxopress-table autoterm_preview"
1551 style="<?php echo $active_tab === 'autoterm_preview' ? '' : 'display:none;'; ?>">
1552 <tr class="autoterm-description-tr">
1553 <td colspan="2">
1554 <p class="description" style="margin-bottom: 20px;"><?php echo esc_attr__('Save changes to the settings before using this feature.', 'simple-tags'); ?></p>
1555 <div class="taxopress-autoterm-fetch-wrap">
1556 <select class="preview-post-types-select"
1557 style="width: auto;max-width: 33%;display: none;">
1558 <?php foreach (TaxoPressAiUtilities::get_post_types_options() as $post_type => $post_type_object):
1559 if (!in_array($post_type, ['attachment'])) {
1560 if (empty($default_post_type)) {
1561 $default_post_type = $post_type;
1562 $posts = $posts = get_posts(['post_type' => $post_type, 'numberposts' => 1, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC']);
1563 if (!empty($posts)) {
1564 $post = $posts[0];
1565 }
1566 }
1567 ?>
1568 <option value='<?php echo esc_attr($post_type); ?>'
1569 data-singular_label="<?php echo esc_html($post_type_object->labels->singular_name); ?>">
1570 <?php echo esc_html($post_type_object->labels->name); ?>
1571 </option>
1572 <?php
1573 }
1574 endforeach; ?>
1575 </select>
1576
1577 <select class="preview-post-select taxopress-post-search"
1578 style="max-width: 250px; width: 250px;"
1579 data-placeholder="<?php echo esc_attr__('Select...', 'simple-tags'); ?>"
1580 data-allow-clear="true"
1581 data-nonce="<?php echo esc_attr(wp_create_nonce('taxopress-post-search')); ?>">
1582 <?php if (is_object($post)) : ?>
1583 <option value='<?php echo esc_attr($post->ID); ?>'>
1584 <?php echo esc_html($post->post_title); ?>
1585 </option>
1586 <?php endif; ?>
1587 </select>
1588 <button class="button button-secondary preview-button">
1589 <div class="spinner"></div>
1590 <span class="btn-text"><?php echo esc_attr__('Preview', 'simple-tags'); ?></span>
1591 </button>
1592 </div>
1593
1594 <div class="taxopress-autoterm-result">
1595 <div class="output"></div>
1596 <div class="response"></div>
1597 </div>
1598 </td>
1599 </tr>
1600
1601 </table>
1602
1603
1604 </div>
1605
1606
1607 <?php }//end new fields
1608 ?>
1609
1610
1611 <div class="clear"></div>
1612
1613
1614 </div>
1615 </div>
1616 </div>
1617
1618
1619 <?php if ($autoterm_limit) { ?>
1620
1621 <div class="pp-version-notice-bold-purple" style="margin-left:0px;">
1622 <div class="pp-version-notice-bold-purple-message"><?php echo esc_html__('You\'re using TaxoPress Free.
1623 The Pro version has more features and support.', 'simple-tags'); ?>
1624 </div>
1625 <div class="pp-version-notice-bold-purple-button"><a
1626 href="https://taxopress.com/taxopress/" target="_blank"><?php echo esc_html__('Upgrade to Pro', 'simple-tags'); ?></a>
1627 </div>
1628 </div>
1629
1630 <?php } ?>
1631 <?php
1632 /**
1633 * Fires after the default fieldsets on the taxonomy screen.
1634 *
1635 * @param taxopress_admin_ui $ui Admin UI instance.
1636 */
1637 do_action('taxopress_taxonomy_after_fieldsets', $ui);
1638 ?>
1639
1640 </div>
1641 </div>
1642
1643
1644 </div>
1645
1646 <div class="taxopress-right-sidebar">
1647 <div class="taxopress-right-sidebar-wrapper" style="min-height: 205px;<?php echo ($autoterm_limit) ? 'display: none;' : ''; ?>">
1648
1649
1650 <?php
1651 if (!$autoterm_limit) { ?>
1652 <p class="submit">
1653
1654 <?php
1655 wp_nonce_field('taxopress_addedit_autoterm_nonce_action',
1656 'taxopress_addedit_autoterm_nonce_field');
1657 if (!empty($_GET) && !empty($_GET['action']) && 'edit' === $_GET['action']) { ?>
1658 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-autoterm-submit"
1659 name="autoterm_submit"
1660 value="<?php echo esc_attr(esc_attr__('Save Auto Terms',
1661 'simple-tags')); ?>"/>
1662 <?php
1663 } else { ?>
1664 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-autoterm-submit"
1665 name="autoterm_submit"
1666 value="<?php echo esc_attr(esc_attr__('Add Auto Terms',
1667 'simple-tags')); ?>"/>
1668 <?php } ?>
1669
1670
1671 <input type="hidden" name="cpt_tax_status" id="cpt_tax_status"
1672 value="<?php echo esc_attr($tab); ?>"/>
1673 </p>
1674
1675 <?php
1676 }
1677 ?>
1678
1679 </div>
1680
1681 <?php do_action('taxopress_admin_after_sidebar'); ?>
1682 <div class="taxopress-advertisement-right-sidebar">
1683 <div id="postbox-container-1" class="postbox-container">
1684 <div class="meta-box-sortables">
1685 <div class="advertisement-box-content postbox">
1686 <div class="postbox-header">
1687 <h3 class="advertisement-box-header hndle is-non-sortable">
1688 <span><?php echo esc_html__('TaxoPress and Languages', 'simple-tags'); ?></span>
1689 </h3>
1690 </div>
1691 <div class="inside">
1692 <p><?php echo sprintf(esc_html__('Please note that this is an automatic tool. It does have limitations around languages, types of content, and other factors. %1s Please read this documentation. %2s', 'simple-tags'), '<a href="https://taxopress.com/docs/characters/">', '</a>'); ?>
1693 </p>
1694 </div>
1695 </div>
1696 </div>
1697 </div>
1698 </div>
1699
1700
1701 </div>
1702
1703 <div class="clear"></div>
1704
1705
1706
1707 </form>
1708
1709 </div><!-- End .wrap -->
1710
1711 <div class="clear"></div>
1712
1713 <?php # Modal Windows; ?>
1714 <div class="remodal" data-remodal-id="taxopress-modal-alert"
1715 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
1716 <div class="" style="color:red;"><?php echo esc_html__('Please complete the following required fields to save your changes:', 'simple-tags'); ?></div>
1717 <div id="taxopress-modal-alert-content"></div>
1718 <br>
1719 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo esc_html__('Okay', 'simple-tags'); ?></button>
1720 </div>
1721
1722 <div class="remodal" data-remodal-id="taxopress-modal-confirm"
1723 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
1724 <div id="taxopress-modal-confirm-content"></div>
1725 <br>
1726 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo esc_html__('No', 'simple-tags'); ?></button>
1727 <button data-remodal-action="confirm"
1728 class="remodal-confirm"><?php echo esc_html__('Yes', 'simple-tags'); ?></button>
1729 </div>
1730
1731 <?php
1732 }
1733
1734 }
1735