PluginProbe ʕ •ᴥ•ʔ
Permalink Manager Lite / 2.2.9.7
Permalink Manager Lite v2.2.9.7
2.5.4 2.5.3.4 2.2.18 2.2.19.2 2.2.19.3 2.2.19.3.1 2.2.2 2.2.20 2.2.20.1 2.2.20.3 2.2.4 2.2.5 2.2.6 2.2.7.2 2.2.7.3 2.2.7.5 2.2.7.6 2.2.8.4 2.2.8.5 2.2.8.6 2.2.8.7 2.2.8.9 2.2.9.1 2.2.9.2 2.2.9.2.1 2.2.9.3 2.2.9.4 2.2.9.6 2.2.9.7 2.2.9.9 2.3.0 2.3.1.1 2.4.0 2.4.1 2.4.1.2 2.4.1.3 2.4.1.4 2.4.1.5 2.4.1.6 2.4.2 2.4.2.1 2.4.3 2.4.3.1 2.4.3.2 2.4.3.3 2.4.3.4 2.4.4 2.4.4.1 2.4.4.2 2.4.4.3 2.5.0 2.5.1 2.5.1.1 2.5.1.2 2.5.1.3 2.5.1.4 2.5.2 2.5.2.1 2.5.2.2 2.5.2.3 2.5.2.4 2.5.3 2.5.3.1 2.5.3.2 2.5.3.3 trunk 0.2 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.4 0.4.1 0.4.2 0.4.3 0.4.4 0.4.6 0.4.7 0.4.8 0.4.9 0.5.3 0.5.4 1.0.0 1.0.1 1.0.4 1.1.0 1.1.1 1.1.2 1.11.6.3 2.0.0 2.0.3 2.0.4 2.0.4.3 2.0.5.1 2.0.5.2 2.0.5.3 2.0.5.3.1 2.0.5.4 2.0.5.4a 2.0.5.5 2.0.5.6 2.0.5.6.1 2.0.5.7 2.0.5.9a 2.0.6.2.1 2.0.6.2a 2.0.6.3 2.1.0 2.1.1 2.1.2.4 2.2.0 2.2.1.1 2.2.1.2 2.2.11 2.2.12 2.2.13.1 2.2.14 2.2.15.1 2.2.16 2.2.17
permalink-manager / includes / views / permalink-manager-permastructs.php
permalink-manager / includes / views Last commit date
permalink-manager-debug.php 5 years ago permalink-manager-permastructs.php 5 years ago permalink-manager-settings.php 5 years ago permalink-manager-tools.php 5 years ago permalink-manager-uri-editor-post.php 5 years ago permalink-manager-uri-editor.php 5 years ago
permalink-manager-permastructs.php
86 lines
1 <?php
2
3 /**
4 * Display the page where the slugs could be regenerated or replaced
5 */
6 class Permalink_Manager_Permastructs extends Permalink_Manager_Class {
7
8 public function __construct() {
9 add_filter( 'permalink_manager_sections', array($this, 'add_admin_section'), 2 );
10 }
11
12 public function add_admin_section($admin_sections) {
13
14 $admin_sections['permastructs'] = array(
15 'name' => __('Permastructures', 'permalink-manager'),
16 'function' => array('class' => 'Permalink_Manager_Permastructs', 'method' => 'output')
17 );
18
19 return $admin_sections;
20 }
21
22 public function get_fields() {
23 global $permalink_manager_permastructs;
24
25 $all_post_types = Permalink_Manager_Helper_Functions::get_post_types_array('full');
26 $woocommerce_icon = "<i class=\"woocommerce-icon woocommerce-cart\"></i>";
27
28 // 1. Get fields
29 $fields = array(
30 'post_types' => array(
31 'section_name' => __('Post types', 'permalink-manager'),
32 'container' => 'row',
33 'fields' => array()
34 ),
35 'taxonomies' => array(
36 'section_name' => __('Taxonomies', 'permalink-manager'),
37 'container' => 'row',
38 'append_content' => Permalink_Manager_Admin_Functions::pro_text(),
39 'fields' => array()
40 )
41 );
42
43 // 2. Woocommerce support
44 if(class_exists('WooCommerce')) {
45 $fields['woocommerce'] = array(
46 'section_name' => "{$woocommerce_icon} " . __('WooCommerce', 'permalink-manager'),
47 'container' => 'row',
48 'append_content' => Permalink_Manager_Admin_Functions::pro_text(),
49 'fields' => array()
50 );
51 }
52
53 // 3. Append fields for all post types
54 foreach($all_post_types as $post_type) {
55 if($post_type['name'] == 'shop_coupon') { continue; }
56
57 $fields["post_types"]["fields"][$post_type['name']] = array(
58 'label' => $post_type['label'],
59 'container' => 'row',
60 'input_class' => 'permastruct-field',
61 'post_type' => $post_type,
62 'type' => 'permastruct'
63 );
64 }
65
66 return apply_filters('permalink_manager_permastructs_fields', $fields);
67 }
68
69 /**
70 * Get the array with settings and render the HTML output
71 */
72 public function output() {
73 global $permalink_manager_permastructs;
74
75 $sidebar = sprintf('<h3>%s</h3>', __('Instructions', 'permalink-manager'));
76 $sidebar .= sprintf(wpautop(__('The current permastructures settings will be applied <strong>only to the new posts & terms</strong>. To apply the <strong>new permastructures to existing posts and terms</strong>, please regenerate the custom permalinks <a href="%s">here</a>.', 'permalink-manager')), admin_url('tools.php?page=permalink-manager&section=tools&subsection=regenerate_slugs'));
77
78 $sidebar .= sprintf('<h4>%s</h4>', __('Permastructure tags', 'permalink-manager'));
79 $sidebar .= wpautop(sprintf(__('All allowed <a href="%s" target="_blank">permastructure tags</a> are listed below. Please note that some of them can be used only for particular post types or taxonomies.', 'permalink-manager'), "https://codex.wordpress.org/Using_Permalinks#Structure_Tags"));
80 $sidebar .= Permalink_Manager_Helper_Functions::get_all_structure_tags();
81
82 return Permalink_Manager_Admin_Functions::get_the_form(self::get_fields(), '', array('text' => __( 'Save permastructures', 'permalink-manager' ), 'class' => 'primary margin-top'), $sidebar, array('action' => 'permalink-manager', 'name' => 'permalink_manager_permastructs'));
83 }
84
85 }
86