PluginProbe ʕ •ᴥ•ʔ
Permalink Manager Lite / 2.0.5.3
Permalink Manager Lite v2.0.5.3
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 8 years ago permalink-manager-permastructs.php 8 years ago permalink-manager-settings.php 8 years ago permalink-manager-tools.php 8 years ago permalink-manager-upgrade.php 8 years ago permalink-manager-uri-editor-post.php 8 years ago permalink-manager-uri-editor.php 8 years ago
permalink-manager-settings.php
117 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'), 1 );
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 'case_insensitive_permalinks' => array(
44 'type' => 'single_checkbox',
45 'label' => __('Case insensitive permalinks', 'permalink-manager'),
46 'input_class' => '',
47 'description' => __('Make all the permalinks case-insensitive.', '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 )
85 ),
86 'advanced' => array(
87 'section_name' => __('Advanced settings', 'permalink-manager'),
88 'container' => 'row',
89 'name' => 'general',
90 'fields' => array(
91 'auto_remove_duplicates' => array(
92 'type' => 'single_checkbox',
93 'label' => __('Automatically remove duplicates', 'permalink-manager'),
94 'input_class' => '',
95 'description' => sprintf(__('If enabled, the duplicated redirects & custom permalinks will be automatically removed if they were previously assigned to removed posts or terms.<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'))
96 ),
97 'force_custom_slugs' => array(
98 'type' => 'single_checkbox',
99 'label' => __('Force custom slugs', 'permalink-manager'),
100 'input_class' => '',
101 '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')
102 ),
103 'partial_disable' => array(
104 'type' => 'checkbox',
105 'label' => __('Disable Permalink Manager functionalities', 'permalink-manager'),
106 'choices' => $content_types,
107 'description' => __('Select the post types & taxonomies where the functionalities of Permalink Manager should be completely disabled.', 'permalink-manager')
108 ),
109 )
110 )
111 ));
112
113 $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'));
114 return $output;
115 }
116 }
117