PluginProbe ʕ •ᴥ•ʔ
Permalink Manager Lite / 2.2.2
Permalink Manager Lite v2.2.2
2.6.0 2.5.5 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-settings.php
permalink-manager / includes / views Last commit date
permalink-manager-debug.php 7 years ago permalink-manager-permastructs.php 7 years ago permalink-manager-settings.php 7 years ago permalink-manager-tools.php 7 years ago permalink-manager-upgrade.php 7 years ago permalink-manager-uri-editor-post.php 7 years ago permalink-manager-uri-editor.php 7 years ago
permalink-manager-settings.php
149 lines
1 <?php
2
3 /**
4 * Display the settings page
5 */
6 class Permalink_Manager_Settings extends Permalink_Manager_Class {
7
8 public function __construct() {
9 add_filter( 'permalink_manager_sections', array($this, 'add_admin_section'), 3 );
10 }
11
12 public function add_admin_section($admin_sections) {
13 $admin_sections['settings'] = array(
14 'name' => __('Settings', 'permalink-manager'),
15 'function' => array('class' => 'Permalink_Manager_Settings', 'method' => 'output')
16 );
17
18 return $admin_sections;
19 }
20
21 /**
22 * Get the array with settings and render the HTML output
23 */
24 public function output() {
25 // Get all registered post types array & statuses
26 $all_post_statuses_array = get_post_statuses();
27 $all_post_types = Permalink_Manager_Helper_Functions::get_post_types_array(null, null, true);
28 $all_taxonomies = Permalink_Manager_Helper_Functions::get_taxonomies_array(false, false, false, true);
29 $content_types = (defined('PERMALINK_MANAGER_PRO')) ? array('post_types' => $all_post_types, 'taxonomies' => $all_taxonomies) : array('post_types' => $all_post_types);
30
31 $sections_and_fields = apply_filters('permalink_manager_settings_fields', array(
32 'general' => array(
33 'section_name' => __('General settings', 'permalink-manager'),
34 'container' => 'row',
35 'name' => 'general',
36 'fields' => array(
37 'auto_update_uris' => array(
38 'type' => 'single_checkbox',
39 'label' => __('Auto-update permalinks', 'permalink-manager'),
40 'input_class' => '',
41 'description' => __('If enabled, the custom permalinks will be automatically updated every time the post is saved or updated.', 'permalink-manager')
42 ),
43 'show_native_slug_field' => array(
44 'type' => 'single_checkbox',
45 'label' => __('Show "Native slug" field', 'permalink-manager'),
46 'input_class' => '',
47 'description' => __('If enabled, it would be possible to edit the native slug via URI Editor on single post/term edit page.', 'permalink-manager')
48 )
49 )
50 ),
51 'seo' => array(
52 'section_name' => __('SEO functions', 'permalink-manager'),
53 'container' => 'row',
54 'name' => 'general',
55 'fields' => array(
56 'canonical_redirect' => array(
57 'type' => 'single_checkbox',
58 'label' => __('Canonical redirect', 'permalink-manager'),
59 'input_class' => '',
60 'description' => __('This function allows Wordpress to correct the URLs used by the visitors.', 'permalink-manager')
61 ),
62 'setup_redirects' => array(
63 'type' => 'single_checkbox',
64 'label' => __('Auto-create "Extra Redirects" for old permalinks', 'permalink-manager'),
65 'input_class' => '',
66 'pro' => true,
67 'disabled' => true,
68 'description' => __('If enabled, the redirects will be automatially created for old custom permalinks, after posts or terms are updated.', 'permalink-manager')
69 ),
70 'redirect' => array(
71 'type' => 'select',
72 'label' => __('Redirect', 'permalink-manager'),
73 'input_class' => 'settings-select',
74 'choices' => array(0 => __('Disable', 'permalink-manager'), "301" => __('Enable "301 redirect"', 'permalink-manager'), "302" => __('Enable "302 redirect"', 'permalink-manager')),
75 'description' => __('If enabled - the visitors will be redirected from native permalinks to your custom permalinks.<br /><strong>Only native permalinks & extra redirects will be redirected to new custom permalinks</strong>.', 'permalink-manager')
76 ),
77 'trailing_slashes' => array(
78 'type' => 'select',
79 'label' => __('Trailing slashes', 'permalink-manager'),
80 'input_class' => 'settings-select',
81 'choices' => array(0 => __('Use default settings', 'permalink-manager'), 1 => __('Add trailing slashes', 'permalink-manager'), 10 => __('Add trailing slashes (+ auto-redirect links without them)', 'permalink-manager'), 2 => __('Remove trailing slashes', 'permalink-manager'), 20 => __('Remove trailing slashes (+ auto-redirect links with them)', 'permalink-manager'),),
82 'description' => __('This option can be used to alter the native settings and control if trailing slash should be added or removed from the end of posts & terms permalinks.', 'permalink-manager')
83 ),
84 'pagination_redirect' => array(
85 'type' => 'single_checkbox',
86 'label' => __('Force 404 on non-existing pagination pages', 'permalink-manager'),
87 'input_class' => '',
88 'description' => __('If enabled, the non-existing pagination pages (for single posts) will return 404 ("Not Found") error.<br /><strong>Please disable it, if you encounter any problems with pagination pages or use custom pagination system.</strong>', 'permalink-manager')
89 ),
90 )
91 ),
92 'advanced' => array(
93 'section_name' => __('Advanced settings', 'permalink-manager'),
94 'container' => 'row',
95 'name' => 'general',
96 'fields' => array(
97 'auto_remove_duplicates' => array(
98 'type' => 'single_checkbox',
99 'label' => __('Automatically remove broken URIs', 'permalink-manager'),
100 'input_class' => '',
101 'description' => sprintf(__('If enabled, the custom URIs assigned to removed posts & terms will be automatically removed.<br />To manually remove the duplicates please go <a href="%s">to this page</a>.', 'permalink-manager'), admin_url('tools.php?page=permalink-manager&section=tools&subsection=duplicates'))
102 ),
103 'fix_language_mismatch' => array(
104 'type' => 'single_checkbox',
105 'label' => __('Fix language mismatch', 'permalink-manager'),
106 'input_class' => '',
107 'description' => __('If enabled, the plugin will load the adjacent translation of post when the custom permalink is detected, but the language code in the URL does not match the language code assigned to the post/term.', 'permalink-manager')
108 ),
109 'pmxi_import_support' => array(
110 'type' => 'single_checkbox',
111 'label' => __('Disable support for WP All Import', 'permalink-manager'),
112 'input_class' => '',
113 'description' => __('If checked, the custom URIs will not be assigned to the posts imported by Wp All Import Pro plugin.', 'permalink-manager')
114 ),
115 'yoast_breadcrumbs' => array(
116 'type' => 'single_checkbox',
117 'label' => __('Yoast SEO breadcrumbs', 'permalink-manager'),
118 'input_class' => '',
119 'description' => __('If checked, the Yoast SEO breadcrumbs will be filtered by Permalink Manager to mimic the current URL structure.', 'permalink-manager')
120 ),
121 'force_custom_slugs' => array(
122 'type' => 'select',
123 'label' => __('Use actual post/term titles (Force custom slugs)', 'permalink-manager'),
124 'input_class' => 'settings-select',
125 'choices' => array(0 => __('No, use native slugs', 'permalink-manager'), 1 => __('Yes, use post/term titles', 'permalink-manager')),
126 'description' => __('If enabled, the slugs in the default custom permalinks will be recreated from the post titles.<br />This may cause permalinks duplicates when the post or term title is used more than once.', 'permalink-manager')
127 ),
128 'disable_slug_sanitization' => array(
129 'type' => 'select',
130 'label' => __('Strip special characters from slugs', 'permalink-manager'),
131 'input_class' => 'settings-select',
132 'choices' => array(0 => __('Yes, use native settings', 'permalink-manager'), 1 => __('No, keep special characters (.|_+) in the slugs', 'permalink-manager')),
133 'description' => __('If enabled only alphanumeric characters, underscores and dashes will be allowed for post/term slugs.', 'permalink-manager')
134 ),
135 'partial_disable' => array(
136 'type' => 'checkbox',
137 'label' => __('Disable Permalink Manager functionalities', 'permalink-manager'),
138 'choices' => $content_types,
139 'description' => __('Select the post types & taxonomies where the functionalities of Permalink Manager should be completely disabled.', 'permalink-manager')
140 ),
141 )
142 )
143 ));
144
145 $output = Permalink_Manager_Admin_Functions::get_the_form($sections_and_fields, '', array('text' => __( 'Save settings', 'permalink-manager' ), 'class' => 'primary margin-top'), '', array('action' => 'permalink-manager', 'name' => 'permalink_manager_options'));
146 return $output;
147 }
148 }
149