PluginProbe
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms / 3.4.5
Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms v3.4.5
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 / related-posts.php

related-posts.php in Tag, Category, and Taxonomy Manager – Autotagger Automatically Add Terms 3.4.5, at inc/related-posts.php

802 lines 48.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class SimpleTags_Related_Post
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_related_posts') {
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 esc_html__('Related Posts', 'simple-tags'),
73 esc_html__('Related Posts', 'simple-tags'),
74 'simple_tags',
75 'st_related_posts',
76 [
77 $this,
78 'page_manage_relatedposts',
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' => esc_html__('Number of items per page', 'simple-tags'),
96 'default' => 20,
97 'option' => 'st_related_posts_per_page'
98 ];
99
100 add_screen_option($option, $args);
101
102 $this->terms_table = new RelatedPosts_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_relatedposts()
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('Related Posts', 'simple-tags'); ?></h1>
127 <a href="<?php echo esc_url(admin_url('admin.php?page=st_related_posts&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('The Related Posts feature works by checking for shared taxonomy terms. If your post has the terms “WordPress” and “Website”, then Related Posts will display other posts that also have the terms “WordPress” and “Website”.', '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">' . esc_html__('Search results for &#8220;%s&#8221;',
137 'simple-tags') . '</span>', esc_html($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 Related Posts', '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 esc_url(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 esc_html__('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_relatedposts();
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_relatedposts()
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 $relatedposts = taxopress_get_relatedpost_data();
204 $related_post_edit = false;
205 $related_post_limit = false;
206
207 if ('edit' === $tab) {
208
209
210 $selected_relatedpost = taxopress_get_current_relatedpost();
211
212 if ($selected_relatedpost && array_key_exists($selected_relatedpost, $relatedposts)) {
213 $current = $relatedposts[$selected_relatedpost];
214 $related_post_edit = true;
215 }
216
217 }
218
219
220 if (!isset($current['title']) && count($relatedposts) > 0 && apply_filters('taxopress_related_posts_create_limit', true)) {
221 $related_post_limit = true;
222 }
223
224
225 $ui = new taxopress_admin_ui();
226 ?>
227
228
229 <div class="wrap <?php echo esc_attr($tab_class); ?>">
230 <h1><?php echo esc_html__('Manage Related Posts', 'simple-tags'); ?></h1>
231 <div class="wp-clearfix"></div>
232
233 <form method="post" action="">
234
235
236 <div class="tagcloudui">
237
238
239 <div class="relatedposts-postbox-container">
240 <div id="poststuff">
241 <div class="taxopress-section postbox">
242 <div class="postbox-header">
243 <h2 class="hndle ui-sortable-handle">
244 <?php
245 if ($related_post_edit) {
246 echo esc_html__('Edit Related Posts', 'simple-tags');
247 echo '<input type="hidden" name="edited_relatedpost" value="' . esc_attr($current['ID']) . '" />';
248 echo '<input type="hidden" name="taxopress_related_post[ID]" value="' . esc_attr($current['ID']) . '" />';
249 } else {
250 echo esc_html__('Add new Related Posts', 'simple-tags');
251 }
252 ?>
253 </h2>
254 </div>
255 <div class="inside">
256 <div class="main">
257
258
259 <div class="st-taxonomy-content">
260
261 <?php if ($related_post_limit) {
262 echo '<div class="taxopress-warning upgrade-pro">
263 <p>
264
265 <h2 style="margin-bottom: 5px;">' . esc_html__('To create more Related Posts, please upgrade to TaxoPress Pro.',
266 'simple-tags') . '</h2>
267 ' . esc_html__('With TaxoPress Pro, you can create unlimited Related Posts. You can create Related Posts for any taxonomy and then display those Related Posts anywhere on your site.',
268 'simple-tags') . '
269
270 </p>
271 </div>';
272
273 } else {
274 ?>
275 <table class="form-table taxopress-table">
276 <?php
277 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
278 echo $ui->get_tr_start();
279
280 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
281 echo $ui->get_th_start();
282 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
283 echo $ui->get_label('name', esc_html__('Title', 'simple-tags')) . $ui->get_required_span();
284 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
285 echo $ui->get_th_end() . $ui->get_td_start();
286 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
287 echo $ui->get_text_input([
288 'namearray' => 'taxopress_related_post',
289 'name' => 'title',
290 'textvalue' => isset($current['title']) ? esc_attr($current['title']) : '',
291 'maxlength' => '32',
292 'helptext' => '',
293 'required' => true,
294 'placeholder' => false,
295 'wrap' => false,
296 ]);
297
298
299 $select = [
300 'options' => [
301 [
302 'attr' => '',
303 'text' => esc_attr__('None', 'simple-tags')
304 ],
305 [
306 'attr' => 'h1',
307 'text' => esc_attr__('H1', 'simple-tags')
308 ],
309 [
310 'attr' => 'h2',
311 'text' => esc_attr__('H2', 'simple-tags')
312 ],
313 [
314 'attr' => 'h3',
315 'text' => esc_attr__('H3', 'simple-tags')
316 ],
317 [
318 'attr' => 'h4',
319 'text' => esc_attr__('H4', 'simple-tags'),
320 'default' => 'true'
321 ],
322 [
323 'attr' => 'h5',
324 'text' => esc_attr__('H5', 'simple-tags')
325 ],
326 [
327 'attr' => 'h6',
328 'text' => esc_attr__('H6', 'simple-tags')
329 ],
330 ],
331 ];
332 $selected = isset($current) ? taxopress_disp_boolean($current['title_header']) : '';
333
334 $select['selected'] = !empty($selected) ? $current['title_header'] : '';
335 if(isset($current['title_header']) && empty($current['title_header'])){
336 $select['selected'] = 'none';
337 }
338 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
339 echo $ui->get_select_checkbox_input_main([
340 'namearray' => 'taxopress_related_post',
341 'name' => 'title_header',
342 'labeltext' => esc_html__('Title header', 'simple-tags'),
343 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
344 ]);
345
346
347 $select = [
348 'options' => [
349 [
350 'attr' => '0',
351 'text' => esc_attr__('False', 'simple-tags'),
352 'default' => 'true',
353 ],
354 [
355 'attr' => '1',
356 'text' => esc_attr__('True', 'simple-tags'),
357 ],
358 ],
359 ];
360 $selected = (isset($current) && isset($current['hide_title'])) ? taxopress_disp_boolean($current['hide_title']) : '';
361 $select['selected'] = !empty($selected) ? $current['hide_title'] : '';
362 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
363 echo $ui->get_select_checkbox_input([
364 'namearray' => 'taxopress_related_post',
365 'name' => 'hide_title',
366 'labeltext' => esc_html__('Hide title in output ?',
367 'simple-tags'),
368 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
369 ]);
370
371 $options[] = [
372 'attr' => 'st_all_posttype',
373 'text' => esc_html__('All post types', 'simple-tags')
374 ];
375 $options[] = [
376 'attr' => 'st_current_posttype',
377 'text' => esc_html__('Current post type', 'simple-tags'),
378 'default' => 'true'
379 ];
380 foreach (get_post_types(['public' => true],
381 'objects') as $post_type) {
382 $options[] = [
383 'attr' => $post_type->name,
384 'text' => $post_type->label
385 ];
386 }
387
388 $select = [
389 'options' => $options,
390 ];
391 $selected = (isset($current) && isset($current['post_type'])) ? taxopress_disp_boolean($current['post_type']) : '';
392 $select['selected'] = !empty($selected) ? $current['post_type'] : '';
393 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
394 echo $ui->get_select_checkbox_input_main([
395 'namearray' => 'taxopress_related_post',
396 'name' => 'post_type',
397 'class' => 'st-post-type-select',
398 'labeltext' => esc_html__('Post Type', 'simple-tags'),
399 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
400 ]);
401
402 $options = [];
403 foreach (get_all_taxopress_taxonomies() as $_taxonomy) {
404 $_taxonomy = $_taxonomy->name;
405 $tax = get_taxonomy($_taxonomy);
406 if (empty($tax->labels->name)) {
407 continue;
408 }
409 if ($tax->name === 'post_tag') {
410 $options[] = [
411 'attr' => $tax->name,
412 'text' => $tax->labels->name. ' ('.$tax->name.')',
413 'default' => 'true',
414 'post_type' => join(',', $tax->object_type),
415 ];
416 } else {
417 $options[] = [
418 'attr' => $tax->name,
419 'text' => $tax->labels->name. ' ('.$tax->name.')',
420 'post_type' => join(',', $tax->object_type),
421 ];
422 }
423 }
424
425 $select = [
426 'options' => $options,
427 ];
428 $selected = isset($current) ? taxopress_disp_boolean($current['taxonomy']) : '';
429 $select['selected'] = !empty($selected) ? $current['taxonomy'] : '';
430 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
431 echo $ui->get_select_checkbox_input_main([
432 'namearray' => 'taxopress_related_post',
433 'name' => 'taxonomy',
434 'class' => 'st-post-taxonomy-select',
435 'labeltext' => esc_html__('Taxonomy', 'simple-tags'),
436 'required' => true,
437 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
438 ]);
439
440
441 /**
442 * Filters the arguments for post types to list for taxonomy association.
443 *
444 *
445 * @param array $value Array of default arguments.
446 */
447 $args = apply_filters('taxopress_attach_post_types_to_taxonomy',
448 ['public' => true]);
449
450 // 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.
451 if (!is_array($args)) {
452 $args = ['public' => true];
453 }
454 $output = 'objects'; // Or objects.
455
456 /**
457 * Filters the results returned to display for available post types for taxonomy.
458 *
459 * @param array $value Array of post type objects.
460 * @param array $args Array of arguments for the post type query.
461 * @param string $output The output type we want for the results.
462 */
463 $post_types = apply_filters('taxopress_get_post_types_for_taxonomies',
464 get_post_types($args, $output), $args, $output);
465
466 $term_auto_locations = [
467 'homeonly' => esc_attr__('Homepage', 'simple-tags'),
468 'blogonly' => esc_attr__('Blog display', 'simple-tags'),
469 ];
470 foreach ($post_types as $post_type) {
471 $term_auto_locations[$post_type->name] = $post_type->label;
472 }
473
474 echo '<tr valign="top"><th scope="row"><label>' . esc_html__('Attempt to automatically display related posts',
475 'simple-tags') . '</label><br /><small style=" color: #646970;">' . esc_html__('TaxoPress will attempt to automatically display related posts in this content. It may not be successful for all post types and layouts.',
476 'simple-tags') . '</small></th><td>
477 <table>';
478 foreach ($term_auto_locations as $key => $value) {
479
480
481 echo '<tr valign="top"><th scope="row"><label for="' . esc_attr($key) . '">' .esc_html($value) . '</label></th><td>';
482
483 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
484 echo $ui->get_check_input([
485 'checkvalue' => esc_attr($key),
486 'checked' => (!empty($current['embedded']) && is_array($current['embedded']) && in_array($key,
487 $current['embedded'], true)) ? 'true' : 'false',
488 'name' => esc_attr($key),
489 'namearray' => 'embedded',
490 'textvalue' => esc_attr($key),
491 'labeltext' => "",
492 'wrap' => false,
493 ]);
494
495 echo '</td></tr>';
496
497 if ($key === 'blogonly') {
498 echo '<tr valign="top"><th style="padding: 0;" scope="row"><hr /></th><td style="padding: 0;"><hr /></td></tr>';
499 }
500
501
502 }
503 echo '</table></td></tr>';
504
505 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
506 echo $ui->get_number_input([
507 'namearray' => 'taxopress_related_post',
508 'name' => 'number',
509 'textvalue' => isset($current['number']) ? esc_attr($current['number']) : '5',
510 'labeltext' => esc_html__('Maximum related posts to display',
511 'simple-tags'),
512 'helptext' => '',
513 'required' => true,
514 ]);
515
516 $select = [
517 'options' => [
518 [
519 'attr' => '1',
520 'text' => esc_attr__('24 hours', 'simple-tags')
521 ],
522 [
523 'attr' => '7',
524 'text' => esc_attr__('7 days', 'simple-tags')
525 ],
526 [
527 'attr' => '14',
528 'text' => esc_attr__('2 weeks', 'simple-tags')
529 ],
530 [
531 'attr' => '30',
532 'text' => esc_attr__('1 month', 'simple-tags')
533 ],
534 [
535 'attr' => '180',
536 'text' => esc_attr__('6 months', 'simple-tags')
537 ],
538 [
539 'attr' => '365',
540 'text' => esc_attr__('1 year', 'simple-tags')
541 ],
542 [
543 'attr' => '0',
544 'text' => esc_attr__('No limit', 'simple-tags'),
545 'default' => 'true'
546 ],
547 ],
548 ];
549 $selected = isset($current) ? taxopress_disp_boolean($current['limit_days']) : '';
550 $select['selected'] = !empty($selected) ? $current['limit_days'] : '';
551 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
552 echo $ui->get_select_number_select([
553 'namearray' => 'taxopress_related_post',
554 'name' => 'limit_days',
555 'labeltext' => esc_html__('Limit related posts based on timeframe',
556 'simple-tags'),
557 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
558 ]);
559
560
561 $select = [
562 'options' => [
563 [
564 'attr' => 'count-asc',
565 'text' => esc_attr__('Least common tags between posts',
566 'simple-tags')
567 ],
568 [
569 'attr' => 'count-desc',
570 'text' => esc_attr__('Most common tags between posts',
571 'simple-tags'),
572 'default' => 'true'
573 ],
574 [
575 'attr' => 'date-asc',
576 'text' => esc_attr__('Older Entries', 'simple-tags')
577 ],
578 [
579 'attr' => 'date-desc',
580 'text' => esc_attr__('Newer Entries', 'simple-tags')
581 ],
582 [
583 'attr' => 'name-asc',
584 'text' => esc_attr__('Alphabetical', 'simple-tags')
585 ],
586 [
587 'attr' => 'name-desc',
588 'text' => esc_attr__('Inverse Alphabetical',
589 'simple-tags')
590 ],
591 [
592 'attr' => 'random',
593 'text' => esc_attr__('Random', 'simple-tags')
594 ],
595 ],
596 ];
597 $selected = isset($current) ? taxopress_disp_boolean($current['order']) : '';
598 $select['selected'] = !empty($selected) ? $current['order'] : '';
599 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
600 echo $ui->get_select_checkbox_input_main([
601 'namearray' => 'taxopress_related_post',
602 'name' => 'order',
603 'labeltext' => esc_html__('Related Posts Order',
604 'simple-tags'),
605 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
606 ]);
607
608 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
609 echo $ui->get_text_input([
610 'namearray' => 'taxopress_related_post',
611 'name' => 'nopoststext',
612 'textvalue' => isset($current['nopoststext']) ? esc_attr($current['nopoststext']) : 'No related posts.',
613 'labeltext' => esc_html__('Text to show when there is no related post',
614 'simple-tags'),
615 'helptext' => '',
616 'required' => false,
617 ]);
618
619
620 $select = [
621 'options' => [
622 [
623 'attr' => '0',
624 'text' => esc_attr__('False', 'simple-tags'),
625 'default' => 'true',
626 ],
627 [
628 'attr' => '1',
629 'text' => esc_attr__('True', 'simple-tags'),
630 ],
631 ],
632 ];
633 $selected = (isset($current) && isset($current['hide_output'])) ? taxopress_disp_boolean($current['hide_output']) : '';
634 $select['selected'] = !empty($selected) ? $current['hide_output'] : '';
635 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
636 echo $ui->get_select_checkbox_input([
637 'namearray' => 'taxopress_related_post',
638 'name' => 'hide_output',
639 'labeltext' => esc_html__('Hide output if no related post is found ?',
640 'simple-tags'),
641 'selections' => $select,// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
642 ]);
643
644 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
645 echo $ui->get_text_input([
646 'namearray' => 'taxopress_related_post',
647 'name' => 'wrap_class',
648 'class' => '',
649 'textvalue' => isset($current['wrap_class']) ? esc_attr($current['wrap_class']) : '',
650 'labeltext' => esc_html__('Related Posts div class', 'simple-tags'),
651 'helptext' => '',
652 'required' => false,
653 ]);
654
655 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
656 echo $ui->get_text_input([
657 'namearray' => 'taxopress_related_post',
658 'name' => 'link_class',
659 'class' => '',
660 'textvalue' => isset($current['link_class']) ? esc_attr($current['link_class']) : '',
661 'labeltext' => esc_html__('Term link class', 'simple-tags'),
662 'helptext' => '',
663 'required' => false,
664 ]);
665
666
667 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
668 echo $ui->get_text_input([
669 'namearray' => 'taxopress_related_post',
670 'name' => 'xformat',
671 'class' => 'st-full-width',
672 'textvalue' => isset($current['xformat']) ? esc_attr($current['xformat']) : esc_attr('<a href="%post_permalink%" title="%post_title% (%post_date%)">%post_title%</a>'),
673 'labeltext' => esc_html__('Term link format', 'simple-tags'),
674 'helptext' => sprintf(esc_html__('You can find markers and explanations %1sin the documentation%2s.', 'simple-tags'), '<a target="blank" href="https://taxopress.com/docs/format-related-posts/">', '</a>'),
675 'required' => false,
676 ]);
677
678 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
679 echo $ui->get_td_end() . $ui->get_tr_end();
680 ?>
681 </table>
682
683 <?php }//end new fields
684 ?>
685
686
687 </div>
688 <div class="clear"></div>
689
690
691 </div>
692 </div>
693 </div>
694
695
696 <?php if ($related_post_limit) { ?>
697
698 <div class="pp-version-notice-bold-purple" style="margin-left:0px;">
699 <div class="pp-version-notice-bold-purple-message"><?php echo esc_html__('You\'re using TaxoPress Free.
700 The Pro version has more features and support.', 'simple-tags'); ?>
701 </div>
702 <div class="pp-version-notice-bold-purple-button"><a
703 href="https://taxopress.com/pro" target="_blank"><?php echo esc_html__('Upgrade to Pro', 'simple-tags'); ?></a>
704 </div>
705 </div>
706
707 <?php } ?>
708 <?php
709 /**
710 * Fires after the default fieldsets on the taxonomy screen.
711 *
712 * @param taxopress_admin_ui $ui Admin UI instance.
713 */
714 do_action('taxopress_taxonomy_after_fieldsets', $ui);
715 ?>
716
717 </div>
718 </div>
719
720
721 </div>
722
723 <div class="taxopress-right-sidebar">
724 <div class="taxopress-right-sidebar-wrapper" style="min-height: 205px;">
725
726
727 <?php
728 if (!$related_post_limit){ ?>
729 <p class="submit">
730
731 <?php
732 wp_nonce_field('taxopress_addedit_relatedpost_nonce_action',
733 'taxopress_addedit_relatedpost_nonce_field');
734 if (!empty($_GET) && !empty($_GET['action']) && 'edit' === $_GET['action']) { ?>
735 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-relatedposts-submit"
736 name="relatedpost_submit"
737 value="<?php echo esc_attr(esc_attr__('Save Related Posts',
738 'simple-tags')); ?>"/>
739 <?php
740 } else { ?>
741 <input type="submit" class="button-primary taxopress-taxonomy-submit taxopress-relatedposts-submit"
742 name="relatedpost_submit"
743 value="<?php echo esc_attr(esc_attr__('Add Related Posts',
744 'simple-tags')); ?>"/>
745 <?php } ?>
746
747 <input type="hidden" name="cpt_tax_status" id="cpt_tax_status"
748 value="<?php echo esc_attr($tab); ?>"/>
749 </p>
750
751 <?php if (!empty($current)) {
752 ?>
753 <p>
754 <?php echo '<div class="taxopress-warning" style="">' . esc_html__('Shortcode: ',
755 'simple-tags'); ?> &nbsp;
756 <textarea
757 style="resize: none;padding: 5px;">[taxopress_relatedposts id="<?php echo (int)$current['ID']; ?>"]</textarea>
758 </div>
759 </p>
760 <?php } ?>
761
762 <?php
763 }
764 ?>
765
766 </div>
767
768 <?php do_action('taxopress_admin_after_sidebar'); ?>
769 </div>
770
771 <div class="clear"></div>
772
773
774
775 </form>
776
777 </div><!-- End .wrap -->
778
779 <div class="clear"></div>
780
781 <?php # Modal Windows; ?>
782 <div class="remodal" data-remodal-id="taxopress-modal-alert"
783 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
784 <div class="" style="color:red;"><?php echo esc_html__('Please complete the following required fields to save your changes:', 'simple-tags'); ?></div>
785 <div id="taxopress-modal-alert-content"></div>
786 <br>
787 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo esc_html__('Okay', 'simple-tags'); ?></button>
788 </div>
789
790 <div class="remodal" data-remodal-id="taxopress-modal-confirm"
791 data-remodal-options="hashTracking: false, closeOnOutsideClick: false">
792 <div id="taxopress-modal-confirm-content"></div>
793 <br>
794 <button data-remodal-action="cancel" class="remodal-cancel"><?php echo esc_html__('No', 'simple-tags'); ?></button>
795 <button data-remodal-action="confirm"
796 class="remodal-confirm"><?php echo esc_html__('Yes', 'simple-tags'); ?></button>
797 </div>
798 <?php
799 }
800
801 }
802