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

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

889 lines 51.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class SimpleTags_Autolink
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 /**
15 * Constructor
16 *
17 * @return void
18 * @author Olatechpro
19 */
20 public function __construct()
21 {
22
23 add_filter('set-screen-option', [__CLASS__, 'set_screen'], 10, 3);
24 // Admin menu
25 add_action('admin_menu', [$this, 'admin_menu']);
26
27 // Javascript
28 add_action('admin_enqueue_scripts', [__CLASS__, 'admin_enqueue_scripts'], 11);
29
30 }
31
32 /**
33 * Init somes JS and CSS need for this feature
34 *
35 * @return void
36 * @author Olatechpro
37 */
38 public static function admin_enqueue_scripts()
39 {
40
41 // add JS for manage click tags
42 if (isset($_GET['page']) && $_GET['page'] == 'st_autolinks') {
43 wp_enqueue_style('st-taxonomies-css');
44 }
45 }
46
47 public static function set_screen($status, $option, $value)
48 {
49 return $value;
50 }
51
52 /** Singleton instance */
53 public static function get_instance()
54 {
55 if (!isset(self::$instance)) {
56 self::$instance = new self();
57 }
58
59 return self::$instance;
60 }
61
62 /**
63 * Add WP admin menu for Tags
64 *
65 * @return void
66 * @author Olatechpro
67 */
68 public function admin_menu()
69 {
70 $hook = add_submenu_page(
71 self::MENU_SLUG,
72 __('Auto Links', 'simple-tags'),
73 __('Auto Links', 'simple-tags'),
74 'simple_tags',
75 'st_autolinks',
76 [
77 $this,
78 'page_manage_autolinks',
79 ]
80 );
81
82 if(taxopress_is_screen_main_page()){
83 add_action("load-$hook", [$this, 'screen_option']);
84 }
85 }
86
87 /**
88 * Screen options
89 */
90 public function screen_option()
91 {
92
93 $option = 'per_page';
94 $args = [
95 'label' => __('Number of items per page', 'simple-tags'),
96 'default' => 20,
97 'option' => 'st_autolinks_per_page'
98 ];
99
100 add_screen_option($option, $args);
101
102 $this->terms_table = new Autolinks_List();
103 }
104
105 /**
106 * Method for build the page HTML manage tags
107 *
108 * @return void
109 * @author Olatechpro
110 */
111 public function page_manage_autolinks()
112 {
113 // Default order
114 if (!isset($_GET['order'])) {
115 $_GET['order'] = 'name-asc';
116 }
117
118 settings_errors(__CLASS__);
119
120 if (!isset($_GET['add'])) {
121 //all tax
122 ?>
123 <div class="wrap st_wrap st-manage-taxonomies-page">
124
125 <div id="">
126 <h1 class="wp-heading-inline"><?php _e('Auto Links', 'simple-tags'); ?></h1>
127 <a href="<?php echo esc_url(admin_url('admin.php?page=st_autolinks&add=new_item')); ?>"
128 class="page-title-action"><?php esc_html_e('Add New', 'simple-tags'); ?></a>
129
130 <div class="taxopress-description"><?php esc_html_e('Auto Links can automatically create links to your defined terms. For example, if you have a term called “WordPress”, the Auto Links feature can find the word “WordPress” in your content and add links to the archive page for that term.', 'simple-tags'); ?></div>
131
132
133 <?php
134 if (isset($_REQUEST['s']) && $search = sanitize_text_field(wp_unslash($_REQUEST['s']))) {
135 /* translators: %s: search keywords */
136 printf(' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;',
137 'simple-tags') . '</span>', $search);
138 }
139 ?>
140 <?php
141
142 //the terms table instance
143 $this->terms_table->prepare_items();
144 ?>
145
146
147 <hr class="wp-header-end">
148 <div id="ajax-response"></div>
149 <form class="search-form wp-clearfix st-taxonomies-search-form" method="get">
150 <?php $this->terms_table->search_box(__('Search Auto Links', 'simple-tags'), 'term'); ?>
151 </form>
152 <div class="clear"></div>
153
154 <div id="col-container" class="wp-clearfix">
155
156 <div class="col-wrap">
157 <form action="<?php echo add_query_arg('', '') ?>" method="post">
158 <?php $this->terms_table->display(); //Display the table ?>
159 </form>
160 <div class="form-wrap edit-term-notes">
161 <p><?php __('Description here.', 'simple-tags') ?></p>
162 </div>
163 </div>
164
165
166 </div>
167
168
169 </div>
170 <?php } else {
171 if ($_GET['add'] == 'new_item') {
172 //add/edit taxonomy
173 $this->taxopress_manage_autolinks();
174 echo '<div>';
175 }
176 } ?>
177
178
179 <?php SimpleTags_Admin::printAdminFooter(); ?>
180 </div>
181 <?php
182 }
183
184
185 /**
186 * Create our settings page output.
187 *
188 * @internal
189 */
190 public function taxopress_manage_autolinks()
191 {
192
193 $tab = (!empty($_GET) && !empty($_GET['action']) && 'edit' == $_GET['action']) ? 'edit' : 'new';
194 $tab_class = 'taxopress-' . $tab;
195 $current = null;
196
197 ?>
198
199 <div class="wrap <?php echo esc_attr($tab_class); ?>">
200
201 <?php
202
203 $autolinks = taxopress_get_autolink_data();
204 $autolink_edit = false;
205 $autolink_limit = false;
206
207 if ('edit' === $tab) {
208
209
210 $selected_autolink = taxopress_get_current_autolink();
211
212 if ($selected_autolink && array_key_exists($selected_autolink, $autolinks)) {
213 $current = $autolinks[$selected_autolink];
214 $autolink_edit = true;
215 }
216
217 }
218
219
220 if (!isset($current['title']) && count($autolinks) > 0 && apply_filters('taxopress_autolinks_create_limit',
221 true)) {
222 $autolink_limit = true;
223 }
224
225
226 $ui = new taxopress_admin_ui();
227 ?>
228
229
230 <div class="wrap <?php echo esc_attr($tab_class); ?>">
231 <h1><?php echo __('Manage Auto Links', 'simple-tags'); ?></h1>
232 <div class="wp-clearfix"></div>
233
234 <form method="post" action="">
235
236
237 <div class="tagcloudui st-tabbed">
238
239
240 <div class="autolinks-postbox-container">
241 <div id="poststuff">
242 <div class="taxopress-section postbox">
243 <div class="postbox-header">
244 <h2 class="hndle ui-sortable-handle">
245 <?php
246 if ($autolink_edit) {
247 $active_tab = ( isset($current['active_tab']) && !empty(trim($current['active_tab'])) ) ? $current['active_tab'] : 'autolink_general';
248 echo esc_html__('Edit Auto Links', 'simple-tags');
249 echo '<input type="hidden" name="edited_autolink" value="' . $current['ID'] . '" />';
250 echo '<input type="hidden" name="taxopress_autolink[ID]" value="' . $current['ID'] . '" />';
251 echo '<input type="hidden" name="taxopress_autolink[active_tab]" class="taxopress-active-subtab" value="'.$active_tab.'" />';
252 } else {
253 $active_tab = 'autolink_general';
254 echo '<input type="hidden" name="taxopress_autolink[active_tab]" class="taxopress-active-subtab" value="" />';
255 echo esc_html__('Add new Auto Links', 'simple-tags');
256 }
257 ?>
258 </h2>
259 </div>
260 <div class="inside">
261 <div class="main">
262
263
264 <?php if ($autolink_limit) {
265 echo '<div class="st-taxonomy-content"><div class="taxopress-warning upgrade-pro">
266 <p>
267
268 <h2 style="margin-bottom: 5px;">' . __('To create more Auto Links, please upgrade to TaxoPress Pro.',
269 'simple-tags') . '</h2>
270 ' . __('With TaxoPress Pro, you can create unlimited Auto Links. You can create Auto Links for any taxonomy.',
271 'simple-tags') . '
272
273 </p>
274 </div></div>';
275
276 } else {
277 ?>
278
279
280 <ul class="taxopress-tab">
281 <li class="autolink_general_tab <?php echo $active_tab === 'autolink_general' ? 'active' : ''; ?>" data-content="autolink_general">
282 <a href="#autolink_general"><span><?php esc_html_e('General',
283 'simple-tags'); ?></span></a>
284 </li>
285
286 <li class="autolink_display_tab <?php echo $active_tab === 'autolink_display' ? 'active' : ''; ?>" data-content="autolink_display">
287 <a href="#autolink_display"><span><?php esc_html_e('Post Types',
288 'simple-tags'); ?></span></a>
289 </li>
290
291 <li class="autolink_control_tab <?php echo $active_tab === 'autolink_control' ? 'active' : ''; ?>" data-content="autolink_control">
292 <a href="#autolink_control"><span><?php esc_html_e('Control',
293 'simple-tags'); ?></span></a>
294 </li>
295
296 <li class="autolink_exceptions_tab <?php echo $active_tab === 'autolink_exceptions' ? 'active' : ''; ?>" data-content="autolink_exceptions">
297 <a href="#autolink_exceptions"><span><?php esc_html_e('Exceptions',
298 'simple-tags'); ?></span></a>
299 </li>
300
301 <li class="autolink_advanced_tab <?php echo $active_tab === 'autolink_advanced' ? 'active' : ''; ?>" data-content="autolink_advanced">
302 <a href="#autolink_advanced"><span><?php esc_html_e('Advanced',
303 'simple-tags'); ?></span></a>
304 </li>
305
306 </ul>
307
308 <div class="st-taxonomy-content taxopress-tab-content">
309
310
311 <table class="form-table taxopress-table autolink_general"
312 style="<?php echo $active_tab === 'autolink_general' ? '' : 'display:none;'; ?>">
313 <?php
314 echo $ui->get_tr_start();
315
316
317 echo $ui->get_th_start();
318 echo $ui->get_label('title', esc_html__('Title',
319 'simple-tags')) . $ui->get_required_span();
320 echo $ui->get_th_end() . $ui->get_td_start();
321
322 echo $ui->get_text_input([
323 'namearray' => 'taxopress_autolink',
324 'name' => 'title',
325 'textvalue' => isset($current['title']) ? esc_attr($current['title']) : '',
326 'maxlength' => '32',
327 'helptext' => '',
328 'required' => true,
329 'placeholder' => false,
330 'wrap' => false,
331 ]);
332
333
334 $options = [];
335 foreach (get_all_taxopress_taxonomies() as $_taxonomy) {
336 $_taxonomy = $_taxonomy->name;
337 $tax = get_taxonomy($_taxonomy);
338 if (empty($tax->labels->name)) {
339 continue;
340 }
341 if ($tax->name === 'post_tag') {
342 $options[] = [
343 'attr' => $tax->name,
344 'text' => $tax->labels->name. ' ('.$tax->name.')',
345 'default' => 'true',
346 ];
347 } else {
348 $options[] = [
349 'attr' => $tax->name,
350 'text' => $tax->labels->name. ' ('.$tax->name.')',
351 ];
352 }
353 }
354
355 $select = [
356 'options' => $options,
357 ];
358 $selected = isset($current) ? taxopress_disp_boolean($current['taxonomy']) : '';
359 $select['selected'] = !empty($selected) ? $current['taxonomy'] : '';
360 echo $ui->get_select_checkbox_input_main([
361 'namearray' => 'taxopress_autolink',
362 'name' => 'taxonomy',
363 'class' => 'st-post-taxonomy-select',
364 'labeltext' => esc_html__('Taxonomy', 'simple-tags'),
365 'required' => true,
366 'selections' => $select,
367 ]);
368
369
370 $select = [
371 'options' => [
372 [
373 'attr' => 'none',
374 'text' => esc_attr__('Use case of text in content',
375 'simple-tags'),
376 'default' => 'true'
377 ],
378 [
379 'attr' => 'termcase',
380 'text' => esc_attr__('Use case of term', 'simple-tags')
381 ],
382 [
383 'attr' => 'uppercase',
384 'text' => esc_attr__('All uppercase', 'simple-tags')
385 ],
386 [
387 'attr' => 'lowercase',
388 'text' => esc_attr__('All lowercase', 'simple-tags')
389 ],
390 ],
391 ];
392 $selected = isset($current) ? taxopress_disp_boolean($current['autolink_case']) : '';
393 $select['selected'] = !empty($selected) ? $current['autolink_case'] : '';
394 echo $ui->get_select_number_select([
395 'namearray' => 'taxopress_autolink',
396 'name' => 'autolink_case',
397 'labeltext' => esc_html__('Auto Link case',
398 'simple-tags'),
399 'selections' => $select,
400 ]);
401
402 $select = [
403 'options' => [
404 [
405 'attr' => 'post_content',
406 'text' => esc_attr__('Post Content', 'simple-tags'),
407 'default' => 'true'
408 ],
409 [
410 'attr' => 'post_title',
411 'text' => esc_attr__('Post Title', 'simple-tags')
412 ],
413 [
414 'attr' => 'posts',
415 'text' => esc_attr__('Post Content and Title',
416 'simple-tags')
417 ],
418 ],
419 ];
420 $selected = isset($current) ? taxopress_disp_boolean($current['autolink_display']) : '';
421 $select['selected'] = !empty($selected) ? $current['autolink_display'] : '';
422 echo $ui->get_select_number_select([
423 'namearray' => 'taxopress_autolink',
424 'name' => 'autolink_display',
425 'labeltext' => esc_html__('Auto Link areas',
426 'simple-tags'),
427 'selections' => $select,
428 ]);
429
430
431 echo $ui->get_text_input([
432 'namearray' => 'taxopress_autolink',
433 'name' => 'autolink_title_attribute',
434 'textvalue' => isset($current['autolink_title_attribute']) ? esc_attr($current['autolink_title_attribute']) : 'Posts tagged with %s',
435 'labeltext' => esc_html__('Auto Link title attribute',
436 'simple-tags'),
437 'helptext' => '',
438 'required' => false,
439 ]);
440
441
442
443 $select = [
444 'options' => [
445 [
446 'attr' => '0',
447 'text' => esc_attr__('False', 'simple-tags'),
448 'default' => 'true',
449 ],
450 [
451 'attr' => '1',
452 'text' => esc_attr__('True', 'simple-tags'),
453 ],
454 ],
455 ];
456 $selected = (isset($current) && isset($current['unattached_terms'])) ? taxopress_disp_boolean($current['unattached_terms']) : '';
457 $select['selected'] = !empty($selected) ? $current['unattached_terms'] : '';
458 echo $ui->get_select_checkbox_input([
459 'namearray' => 'taxopress_autolink',
460 'name' => 'unattached_terms',
461 'labeltext' => esc_html__('Add links for unattached terms',
462 'simple-tags'),
463 'aftertext' => __('By default, TaxoPress will only add Auto Links for terms that are attached to the post. If this box is checked, TaxoPress will add links for all terms.',
464 'simple-tags'),
465 'selections' => $select,
466 ]);
467
468
469 $select = [
470 'options' => [
471 [
472 'attr' => '0',
473 'text' => esc_attr__('False', 'simple-tags'),
474 'default' => 'true',
475 ],
476 [
477 'attr' => '1',
478 'text' => esc_attr__('True', 'simple-tags'),
479 ],
480 ],
481 ];
482 $selected = (isset($current) && isset($current['ignore_attached'])) ? taxopress_disp_boolean($current['ignore_attached']) : '';
483 $select['selected'] = !empty($selected) ? $current['ignore_attached'] : '';
484 echo $ui->get_select_checkbox_input([
485 'namearray' => 'taxopress_autolink',
486 'name' => 'ignore_attached',
487 'labeltext' => esc_html__('Don\'t add links for attached terms',
488 'simple-tags'),
489 'aftertext' => __('Don\'t add Auto Links if the term is already attached to the post.',
490 'simple-tags'),
491 'selections' => $select,
492 ]);
493
494
495 echo $ui->get_td_end() . $ui->get_tr_end();
496 ?>
497 </table>
498
499
500 <table class="form-table taxopress-table autolink_display"
501 style="<?php echo $active_tab === 'autolink_display' ? '' : 'display:none;'; ?>">
502 <?php
503
504
505 /**
506 * Filters the arguments for post types to list for taxonomy association.
507 *
508 *
509 * @param array $value Array of default arguments.
510 */
511 $args = apply_filters('taxopress_attach_post_types_to_taxonomy',
512 ['public' => true]);
513
514 // 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.
515 if (!is_array($args)) {
516 $args = ['public' => true];
517 }
518 $output = 'objects'; // Or objects.
519
520 /**
521 * Filters the results returned to display for available post types for taxonomy.
522 *
523 * @param array $value Array of post type objects.
524 * @param array $args Array of arguments for the post type query.
525 * @param string $output The output type we want for the results.
526 */
527 $post_types = apply_filters('taxopress_get_post_types_for_taxonomies',
528 get_post_types($args, $output), $args, $output);
529
530 $term_auto_locations = [];
531 foreach ($post_types as $post_type) {
532 $term_auto_locations[$post_type->name] = $post_type->label;
533 }
534
535 echo '<tr valign="top"><th scope="row"><label>' . esc_html__('Enable this Auto Links instance for:',
536 'simple-tags') . '</label><br /><small style=" color: #646970;">' . esc_html__('TaxoPress will attempt to automatically insert Auto Links in this content. It may not be successful for all post types and layouts.',
537 'simple-tags') . '</small></th><td>
538 <table class="visbile-table">';
539 foreach ($term_auto_locations as $key => $value) {
540
541
542 echo '<tr valign="top"><th scope="row"><label for="' . $key . '">' . $value . '</label></th><td>';
543
544 echo $ui->get_check_input([
545 'checkvalue' => $key,
546 'checked' => (!empty($current['embedded']) && is_array($current['embedded']) && in_array($key,
547 $current['embedded'], true)) ? 'true' : 'false',
548 'name' => $key,
549 'namearray' => 'embedded',
550 'textvalue' => $key,
551 'labeltext' => "",
552 'wrap' => false,
553 ]);
554
555 echo '</td></tr>';
556
557
558 }
559 echo '</table></td></tr>';
560
561
562 ?>
563
564 </table>
565
566
567 <table class="form-table taxopress-table autolink_control"
568 style="<?php echo $active_tab === 'autolink_control' ? '' : 'display:none;'; ?>">
569 <?php
570
571
572 echo $ui->get_number_input([
573 'namearray' => 'taxopress_autolink',
574 'name' => 'autolink_usage_min',
575 'textvalue' => isset($current['autolink_usage_min']) ? esc_attr($current['autolink_usage_min']) : '1',
576 'labeltext' => esc_html__('Minimum term usage for Auto Links',
577 'simple-tags'),
578 'helptext' => __('To be included in Auto Links, a term must be used at least this many times.',
579 'simple-tags'),
580 'min' => '1',
581 'required' => true,
582 ]);
583
584
585 echo $ui->get_number_input([
586 'namearray' => 'taxopress_autolink',
587 'name' => 'autolink_usage_max',
588 'textvalue' => isset($current['autolink_usage_max']) ? esc_attr($current['autolink_usage_max']) : '10',
589 'labeltext' => esc_html__('Maximum number of links per post',
590 'simple-tags'),
591 'helptext' => __('This setting determines the maximum number of Auto Links in one post.',
592 'simple-tags'),
593 'min' => '1',
594 'required' => true,
595 ]);
596
597
598 echo $ui->get_number_input([
599 'namearray' => 'taxopress_autolink',
600 'name' => 'autolink_same_usage_max',
601 'textvalue' => isset($current['autolink_same_usage_max']) ? esc_attr($current['autolink_same_usage_max']) : '1',
602 'labeltext' => esc_html__('Maximum number of links for the same term',
603 'simple-tags'),
604 'helptext' => __('This setting determines the maximum number of Auto Links for each term in one post.',
605 'simple-tags'),
606 'min' => '1',
607 'required' => true,
608 ]);
609
610
611 echo $ui->get_number_input([
612 'namearray' => 'taxopress_autolink',
613 'name' => 'autolink_min_char',
614 'textvalue' => isset($current['autolink_min_char']) ? esc_attr($current['autolink_min_char']) : '',
615 'labeltext' => esc_html__('Minimum character length for an Auto Link',
616 'simple-tags'),
617 'helptext' => __('For example, \'4\' would only link terms that are of 4 characters or more in length.',
618 'simple-tags'),
619 'min' => '0',
620 'required' => false,
621 ]);
622
623
624 echo $ui->get_number_input([
625 'namearray' => 'taxopress_autolink',
626 'name' => 'autolink_max_char',
627 'textvalue' => isset($current['autolink_max_char']) ? esc_attr($current['autolink_max_char']) : '',
628 'labeltext' => esc_html__('Maximum character length for an Auto Link',
629 'simple-tags'),
630 'helptext' => __('For example, \'4\' would only link terms that are of 4 characters or less in length.',
631 'simple-tags'),
632 'min' => '0',
633 'required' => false,
634 ]);
635
636
637 ?>
638
639 </table>
640
641
642 <table class="form-table taxopress-table autolink_exceptions"
643 style="<?php echo $active_tab === 'autolink_exceptions' ? '' : 'display:none;'; ?>">
644 <?php
645
646
647 echo $ui->get_text_input([
648 'namearray' => 'taxopress_autolink',
649 'name' => 'auto_link_exclude',
650 'textvalue' => isset($current['auto_link_exclude']) ? esc_attr($current['auto_link_exclude']) : '',
651 'labeltext' => esc_html__('Exclude terms from Auto Links',
652 'simple-tags'),
653 'helptext' => esc_html__('If you enter the terms "WordPress", "Website" the Auto Links feature will never replace these terms. Separate multiple entries with a comma.',
654 'simple-tags'),
655 'required' => false,
656 ]);
657
658
659 echo $ui->get_text_input([
660 'namearray' => 'taxopress_autolink',
661 'name' => 'autolink_exclude_class',
662 'textvalue' => isset($current['autolink_exclude_class']) ? esc_attr($current['autolink_exclude_class']) : '',
663 'labeltext' => esc_html__('Prevent Auto Links inside classes or IDs',
664 'simple-tags'),
665 'helptext' => esc_html__('Separate multiple entries with a comma. For example: .notag, #main-header',
666 'simple-tags'),
667 'required' => false,
668 ]);
669
670 $html_exclusions = [
671 //headers
672 'h1' => esc_attr__('H1', 'simple-tags'),
673 'h2' => esc_attr__('H2', 'simple-tags'),
674 'h3' => esc_attr__('H3', 'simple-tags'),
675 'h4' => esc_attr__('H4', 'simple-tags'),
676 'h5' => esc_attr__('H5', 'simple-tags'),
677 'h6' => esc_attr__('H6', 'simple-tags'),
678 //html elements
679 'script' => esc_attr__('script', 'simple-tags'),
680 'style' => esc_attr__('style', 'simple-tags'),
681 'pre' => esc_attr__('pre', 'simple-tags'),
682 'code' => esc_attr__('code', 'simple-tags'),
683 ];
684
685 echo '<tr valign="top"><th scope="row"><label>' . esc_html__('Prevent Auto Links inside elements',
686 'simple-tags') . '</label><br /><small style=" color: #646970;">' . esc_html__('Terms inside these html tags will not be auto link.',
687 'simple-tags') . '</small></th><td>
688 <table class="visbile-table st-html-exclusion-table">';
689 foreach ($html_exclusions as $key => $value) {
690
691 echo '<tr valign="top"><th scope="row"><label for="' . $key . '">' . $value . '</label></th><td>';
692
693 echo $ui->get_check_input([
694 'checkvalue' => $key,
695 'checked' => (!empty($current['html_exclusion']) && is_array($current['html_exclusion']) && in_array($key,
696 $current['html_exclusion'],
697 true)) ? 'true' : 'false',
698 'name' => $key,
699 'namearray' => 'html_exclusion',
700 'textvalue' => $key,
701 'labeltext' => $key,
702 'labeldescription' => true,
703 'wrap' => false,
704 ]);
705
706 echo '</td></tr>';
707
708 if ($key === 'h6') {
709 echo '<tr valign="top"><th style="padding: 0;" scope="row"><hr /></th><td style="padding: 0;"><hr /></td></tr>';
710 }
711
712
713 }
714 echo '</table></td></tr>';
715
716 ?>
717
718 </table>
719
720
721 <table class="form-table taxopress-table autolink_advanced"
722 style="<?php echo $active_tab === 'autolink_advanced' ? '' : 'display:none;'; ?>">
723 <?php
724
725 echo $ui->get_text_input([
726 'namearray' => 'taxopress_autolink',
727 'name' => 'link_class',
728 'class' => '',
729 'textvalue' => isset($current['link_class']) ? esc_attr($current['link_class']) : '',
730 'labeltext' => esc_html__('Term link class', 'simple-tags'),
731 'helptext' => '',
732 'required' => false,
733 ]);
734
735
736 echo $ui->get_number_input([
737 'namearray' => 'taxopress_autolink',
738 'name' => 'hook_priority',
739 'textvalue' => isset($current['hook_priority']) ? esc_attr($current['hook_priority']) : '12',
740 'labeltext' => esc_html__('Priority on the_content and the_title hook',
741 'simple-tags'),
742 'helptext' => __('Change the priority of the Auto Links functions on the_content hook. This is useful for fixing conflicts with other plugins. Higher number means autolink will be executed only after hooks with lower number has been executed.',
743 'simple-tags'),
744 'min' => '1',
745 'required' => false,
746 ]);
747
748 $select = [
749 'options' => [
750 [
751 'attr' => '0',
752 'text' => esc_attr__('False', 'simple-tags'),
753 ],
754 [
755 'attr' => '1',
756 'text' => esc_attr__('True', 'simple-tags'),
757 'default' => 'true',
758 ],
759 ],
760 ];
761 $selected = (isset($current) && isset($current['autolink_dom'])) ? taxopress_disp_boolean($current['autolink_dom']) : '';
762 $select['selected'] = !empty($selected) ? $current['autolink_dom'] : '';
763 echo $ui->get_select_checkbox_input([
764 'namearray' => 'taxopress_autolink',
765 'name' => 'autolink_dom',
766 'labeltext' => esc_html__('Use new Auto Links engine',
767 'simple-tags'),
768 'aftertext' => __('The new Auto Links engine uses the DOMDocument PHP class and may offer better performance. If your server does not support this functionality, TaxoPress will use the usual engine.',
769 'simple-tags'),
770 'selections' => $select,
771 ]);
772
773 ?>
774 </table>
775
776
777 </div>
778
779
780 <?php }//end new fields
781 ?>
782
783
784 <div class="clear"></div>
785
786
787 </div>
788 </div>
789 </div>
790
791
792 <?php if ($autolink_limit) { ?>
793
794 <div class="pp-version-notice-bold-purple" style="margin-left:0px;">
795 <div class="pp-version-notice-bold-purple-message"><?php esc_html_e('You\'re using TaxoPress Free.
796 The Pro version has more features and support.', 'simple-tags'); ?>
797 </div>
798 <div class="pp-version-notice-bold-purple-button"><a
799 href="https://taxopress.com/pro" target="_blank"><?php esc_html_e('Upgrade to Pro', 'simple-tags'); ?></a>
800 </div>
801 </div>
802
803 <?php } ?>
804 <?php
805 /**
806 * Fires after the default fieldsets on the taxonomy screen.
807 *
808 * @param taxopress_admin_ui $ui Admin UI instance.
809 */
810 do_action('taxopress_taxonomy_after_fieldsets', $ui);
811 ?>
812
813 </div>
814 </div>
815
816
817 </div>
818
819 <div class="taxopress-right-sidebar">
820 <div class="taxopress-right-sidebar-wrapper" style="min-height: 205px;">
821
822
823 <?php
824 if (!$autolink_limit) { ?>
825 <p class="submit">
826
827 <?php
828 wp_nonce_field('taxopress_addedit_autolink_nonce_action',
829 'taxopress_addedit_autolink_nonce_field');
830 if (!empty($_GET) && !empty($_GET['action']) && 'edit' === $_GET['action']) { ?>
831 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-autolink-submit"
832 name="autolink_submit"
833 value="<?php echo esc_attr(esc_attr__('Save Auto Links',
834 'simple-tags')); ?>"/>
835 <?php
836 } else { ?>
837 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-autolink-submit"
838 name="autolink_submit"
839 value="<?php echo esc_attr(esc_attr__('Add Auto Links',
840 'simple-tags')); ?>"/>
841 <?php } ?>
842
843
844 <input type="hidden" name="cpt_tax_status" id="cpt_tax_status"
845 value="<?php echo esc_attr($tab); ?>"/>
846 </p>
847
848 <?php
849 }
850 ?>
851
852 </div>
853
854 <?php do_action('taxopress_admin_after_sidebar'); ?>
855 </div>
856
857 <div class="clear"></div>
858
859
860
861 </form>
862
863 </div><!-- End .wrap -->
864
865 <div class="clear"></div>
866
867 <?php # Modal Windows; ?>
868 <div class="remodal" data-remodal-id="taxopress-modal-alert"
869 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
870 <div class="" style="color:red;"><?php echo __('Please complete the following required fields to save your changes:', 'simple-tags'); ?></div>
871 <div id="taxopress-modal-alert-content"></div>
872 <br>
873 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo __('Okay', 'simple-tags'); ?></button>
874 </div>
875
876 <div class="remodal" data-remodal-id="taxopress-modal-confirm"
877 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
878 <div id="taxopress-modal-confirm-content"></div>
879 <br>
880 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo __('No', 'simple-tags'); ?></button>
881 <button data-remodal-action="confirm"
882 class="remodal-confirm"><?php echo __('Yes', 'simple-tags'); ?></button>
883 </div>
884
885 <?php
886 }
887
888 }
889