Version Description
Download this release
Release Info
Developer | mbis |
Plugin | Permalink Manager Lite |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.4
- README.txt +19 -4
- includes/core/permalink-manager-actions.php +29 -17
- includes/core/permalink-manager-admin-functions.php +51 -14
- includes/core/permalink-manager-core-functions.php +44 -29
- includes/core/permalink-manager-helper-functions.php +4 -2
- includes/core/permalink-manager-third-parties.php +40 -14
- includes/core/permalink-manager-uri-functions-post.php +5 -3
- out/permalink-manager-admin.css +7 -4
- out/permalink-manager-admin.js +1 -1
- permalink-manager.php +9 -9
README.txt
CHANGED
@@ -6,8 +6,8 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
6 |
Tags: urls, permalinks, custom permalinks, url, permalink, woocommerce permalinks
|
7 |
Requires at least: 4.4.0
|
8 |
Requires PHP: 5.4
|
9 |
-
Tested up to: 5.2
|
10 |
-
Stable tag: 2.2.
|
11 |
|
12 |
Advanced plugin that allows to set-up custom permalinks (bulk editors included), slugs and permastructures (WooCommerce compatible).
|
13 |
|
@@ -26,7 +26,10 @@ The plugin supports all custom post types & custom taxonomies and popular 3rd pa
|
|
26 |
* **Auto-redirect**<br/>Old (native) permalinks are redirected to new (custom) permalinks (in 301 or 302 mode) to prevent 404 error (SEO friendly).
|
27 |
* **Canonical redirects**<br/>Possibility to disable native canonical redirects.
|
28 |
* **Bulk editors**<br/>"Regenerate/Reset" + "Find and replace" tools that allow to bulk/mass change the permalinks (or native slugs).
|
29 |
-
* **Trailing slashes settings**<br/>They can be forced or removed from all permalinks.
|
|
|
|
|
|
|
30 |
|
31 |
= Additional features available in Permalink Manager Pro =
|
32 |
|
@@ -87,9 +90,21 @@ A. Currently there is no 100% guarantee that Permalink Manager will work correct
|
|
87 |
|
88 |
== Changelog ==
|
89 |
|
90 |
-
= 2.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
* Code improvement for "Quick Edit" inline form
|
92 |
* Support for Yoast SEO breadcrumbs added
|
|
|
93 |
|
94 |
= 2.2.1.1/2.2.1.2/2.2.1.3/2.2.1.4 =
|
95 |
* Hotfix for function that detects custom URIs
|
6 |
Tags: urls, permalinks, custom permalinks, url, permalink, woocommerce permalinks
|
7 |
Requires at least: 4.4.0
|
8 |
Requires PHP: 5.4
|
9 |
+
Tested up to: 5.2.1
|
10 |
+
Stable tag: 2.2.4
|
11 |
|
12 |
Advanced plugin that allows to set-up custom permalinks (bulk editors included), slugs and permastructures (WooCommerce compatible).
|
13 |
|
26 |
* **Auto-redirect**<br/>Old (native) permalinks are redirected to new (custom) permalinks (in 301 or 302 mode) to prevent 404 error (SEO friendly).
|
27 |
* **Canonical redirects**<br/>Possibility to disable native canonical redirects.
|
28 |
* **Bulk editors**<br/>"Regenerate/Reset" + "Find and replace" tools that allow to bulk/mass change the permalinks (or native slugs).
|
29 |
+
* **Trailing slashes settings**<br/>They can be forced or removed from all permalinks.
|
30 |
+
|
31 |
+
= Need additional features & priority support? =
|
32 |
+
Buy <a href="https://permalinkmanager.pro?utm_source=wordpress">Permalink Manager Pro here</a>.
|
33 |
|
34 |
= Additional features available in Permalink Manager Pro =
|
35 |
|
90 |
|
91 |
== Changelog ==
|
92 |
|
93 |
+
= 2.2.4=
|
94 |
+
* Minor code improvements
|
95 |
+
* Yoast SEO Breadcrumbs - further improvements
|
96 |
+
|
97 |
+
= 2.2.3 =
|
98 |
+
* Code improvements for WP All Import integration functions
|
99 |
+
* Hotfix for Elementor conflict with custom redirects function (Permalink Manager Pro)
|
100 |
+
* New field ("Do not automatically append the slug") in Permastructure settings added to each post type & taxonomy
|
101 |
+
* Basic support added for Mailster plugin
|
102 |
+
* New permastructure tag: "%monthname%"
|
103 |
+
|
104 |
+
= 2.2.2 =
|
105 |
* Code improvement for "Quick Edit" inline form
|
106 |
* Support for Yoast SEO breadcrumbs added
|
107 |
+
* Hotfix for Elementor
|
108 |
|
109 |
= 2.2.1.1/2.2.1.2/2.2.1.3/2.2.1.4 =
|
110 |
* Hotfix for function that detects custom URIs
|
includes/core/permalink-manager-actions.php
CHANGED
@@ -279,30 +279,40 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
|
|
279 |
global $permalink_manager_permastructs;
|
280 |
|
281 |
$post_fields = $_POST;
|
282 |
-
$
|
283 |
|
284 |
foreach($post_fields as $option_name => $option_value) {
|
285 |
$new_options[$option_name] = $option_value;
|
286 |
}
|
287 |
|
288 |
-
//
|
289 |
-
$new_options
|
290 |
-
|
291 |
-
if(is_array($group)) {
|
292 |
-
foreach($group as $element => $permastruct) {
|
293 |
-
// Trim slashes
|
294 |
-
$permastruct = trim($permastruct, "/");
|
295 |
-
}
|
296 |
-
} else {
|
297 |
-
unset($new_options[$group_name]);
|
298 |
-
}
|
299 |
}
|
300 |
|
301 |
-
|
302 |
-
|
|
|
303 |
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
}
|
307 |
|
308 |
/**
|
@@ -529,7 +539,9 @@ class Permalink_Manager_Actions extends Permalink_Manager_Class {
|
|
529 |
|
530 |
$ids = array_keys($permalink_manager_uris, $uri);
|
531 |
foreach($ids as $index => $id) {
|
532 |
-
|
|
|
|
|
533 |
}
|
534 |
}
|
535 |
|
279 |
global $permalink_manager_permastructs;
|
280 |
|
281 |
$post_fields = $_POST;
|
282 |
+
$permastructure_options = $permastructures = array();
|
283 |
|
284 |
foreach($post_fields as $option_name => $option_value) {
|
285 |
$new_options[$option_name] = $option_value;
|
286 |
}
|
287 |
|
288 |
+
// Split permastructure & permastructure settings
|
289 |
+
if(!empty($new_options['post_types'])) {
|
290 |
+
$permastructures['post_types'] = $new_options['post_types'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
}
|
292 |
|
293 |
+
if(!empty($new_options['taxonomies'])) {
|
294 |
+
$permastructures['taxonomies'] = $new_options['taxonomies'];
|
295 |
+
}
|
296 |
|
297 |
+
if(!empty($new_options['permastructure-settings'])) {
|
298 |
+
$permastructure_options = $new_options['permastructure-settings'];
|
299 |
+
}
|
300 |
+
|
301 |
+
// A. Permastructures
|
302 |
+
if(!empty($new_options['post_types']) || !empty($new_options['taxonomies'])) {
|
303 |
+
$permastructures = Permalink_Manager_Helper_Functions::multidimensional_array_map('untrailingslashit', $permastructures);
|
304 |
+
|
305 |
+
// Override the global with settings
|
306 |
+
$permalink_manager_permastructs = $permastructures;
|
307 |
+
|
308 |
+
// Save the settings in database
|
309 |
+
update_option('permalink-manager-permastructs', $permastructures);
|
310 |
+
}
|
311 |
+
|
312 |
+
// B. Permastructure settings
|
313 |
+
if(!empty($permastructure_options)) {
|
314 |
+
self::save_settings('permastructure-settings', $permastructure_options);
|
315 |
+
}
|
316 |
}
|
317 |
|
318 |
/**
|
539 |
|
540 |
$ids = array_keys($permalink_manager_uris, $uri);
|
541 |
foreach($ids as $index => $id) {
|
542 |
+
if($index > 0) {
|
543 |
+
$permalink_manager_uris[$id] = preg_replace('/(.+?)(\.[^\.]+$|$)/', '$1-' . $index . '$2', $uri);
|
544 |
+
}
|
545 |
}
|
546 |
}
|
547 |
|
includes/core/permalink-manager-admin-functions.php
CHANGED
@@ -196,12 +196,18 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
196 |
$value = $args['value'];
|
197 |
} else {
|
198 |
// Extract the section and field name from $input_name
|
199 |
-
preg_match(
|
200 |
|
201 |
if($field_section_and_name) {
|
202 |
$section_name = $field_section_and_name[1];
|
203 |
-
$
|
204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
} else {
|
206 |
$value = (isset($permalink_manager_options[$input_name])) ? $permalink_manager_options[$input_name] : $default;
|
207 |
}
|
@@ -245,7 +251,12 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
245 |
|
246 |
case 'single_checkbox' :
|
247 |
$fields .= '<div class="single_checkbox">';
|
248 |
-
|
|
|
|
|
|
|
|
|
|
|
249 |
$checkbox_label = (isset($args['checkbox_label'])) ? $args['checkbox_label'] : '';
|
250 |
|
251 |
$fields .= "<input type='hidden' {$input_atts} value='0' name='{$input_name}' />";
|
@@ -308,11 +319,13 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
308 |
if(!empty($args['post_type'])) {
|
309 |
$type = $args['post_type'];
|
310 |
$type_name = $type['name'];
|
|
|
311 |
|
312 |
$permastructures = (!empty($permalink_manager_permastructs['post_types'])) ? $permalink_manager_permastructs['post_types'] : array();
|
313 |
} else if(!empty($args['taxonomy'])) {
|
314 |
$type = $args['taxonomy'];
|
315 |
$type_name = $type['name'];
|
|
|
316 |
|
317 |
$permastructures = (!empty($permalink_manager_permastructs['taxonomies'])) ? $permalink_manager_permastructs['taxonomies'] : array();
|
318 |
} else {
|
@@ -363,6 +376,14 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
363 |
__("Default permastructure", "permalink-manager"), esc_html($default_permastruct),
|
364 |
__("Restore default permastructure", "permalink-manager")
|
365 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
$fields .= "</div>";
|
367 |
|
368 |
// 3. Show toggle button
|
@@ -588,13 +609,17 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
588 |
if(is_array($updated_array)) {
|
589 |
// Check if slugs should be displayed
|
590 |
$first_slug = reset($updated_array);
|
|
|
591 |
|
592 |
$header_footer = '<tr>';
|
593 |
$header_footer .= '<th class="column-primary">' . __('Title', 'permalink-manager') . '</th>';
|
594 |
-
$
|
595 |
-
|
596 |
-
|
597 |
-
|
|
|
|
|
|
|
598 |
$header_footer .= '</tr>';
|
599 |
|
600 |
foreach($updated_array as $row) {
|
@@ -615,10 +640,13 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
615 |
|
616 |
$main_content .= "<tr{$alternate_class}>";
|
617 |
$main_content .= '<td class="row-title column-primary" data-colname="' . __('Title', 'permalink-manager') . '">' . $row['item_title'] . "<a target=\"_blank\" href=\"{$permalink}\"><span class=\"small\">{$permalink}</span></a>" . '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __('Show more details', 'permalink-manager') . '</span></button></td>';
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
|
|
|
|
|
|
622 |
$main_content .= '</tr>';
|
623 |
}
|
624 |
|
@@ -806,10 +834,18 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
806 |
}
|
807 |
}
|
808 |
|
809 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
810 |
$html .= ($element->ID) ? self::display_redirect_panel($id) : self::display_redirect_panel("tax-{$id}");
|
811 |
|
812 |
-
//
|
813 |
if($gutenberg) {
|
814 |
$html .= sprintf(
|
815 |
"<div class=\"default-permalink-row save-row columns-container hidden\"><div><a href=\"#\" class=\"button button-primary\" id=\"permalink-manager-save-button\">%s</a></div></div>",
|
@@ -817,6 +853,7 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
817 |
);
|
818 |
}
|
819 |
|
|
|
820 |
$html .= "</div>";
|
821 |
$html .= "</div>";
|
822 |
|
196 |
$value = $args['value'];
|
197 |
} else {
|
198 |
// Extract the section and field name from $input_name
|
199 |
+
preg_match('/([^\[]+)(?:\[([^\[]+)\])(?:\[([^\[]+)\])?/', $input_name, $field_section_and_name);
|
200 |
|
201 |
if($field_section_and_name) {
|
202 |
$section_name = $field_section_and_name[1];
|
203 |
+
if(!empty($field_section_and_name[3])) {
|
204 |
+
$field_name = $field_section_and_name[2];
|
205 |
+
$subsection_name = $field_section_and_name[3];
|
206 |
+
$value = (isset($permalink_manager_options[$section_name][$field_name][$subsection_name])) ? $permalink_manager_options[$section_name][$field_name][$subsection_name] : $default;
|
207 |
+
} else {
|
208 |
+
$field_name = $field_section_and_name[2];
|
209 |
+
$value = (isset($permalink_manager_options[$section_name][$field_name])) ? $permalink_manager_options[$section_name][$field_name] : $default;
|
210 |
+
}
|
211 |
} else {
|
212 |
$value = (isset($permalink_manager_options[$input_name])) ? $permalink_manager_options[$input_name] : $default;
|
213 |
}
|
251 |
|
252 |
case 'single_checkbox' :
|
253 |
$fields .= '<div class="single_checkbox">';
|
254 |
+
if(is_array($value)) {
|
255 |
+
$input_key = preg_replace('/(.*)(?:\[([^\[]+)\])$/', '$2', $input_name);
|
256 |
+
$checked = (!empty($value[$input_key])) ? "checked='checked'" : "";
|
257 |
+
} else {
|
258 |
+
$checked = ($value == 1) ? "checked='checked'" : "";
|
259 |
+
}
|
260 |
$checkbox_label = (isset($args['checkbox_label'])) ? $args['checkbox_label'] : '';
|
261 |
|
262 |
$fields .= "<input type='hidden' {$input_atts} value='0' name='{$input_name}' />";
|
319 |
if(!empty($args['post_type'])) {
|
320 |
$type = $args['post_type'];
|
321 |
$type_name = $type['name'];
|
322 |
+
$content_type = 'post_types';
|
323 |
|
324 |
$permastructures = (!empty($permalink_manager_permastructs['post_types'])) ? $permalink_manager_permastructs['post_types'] : array();
|
325 |
} else if(!empty($args['taxonomy'])) {
|
326 |
$type = $args['taxonomy'];
|
327 |
$type_name = $type['name'];
|
328 |
+
$content_type = "taxonomies";
|
329 |
|
330 |
$permastructures = (!empty($permalink_manager_permastructs['taxonomies'])) ? $permalink_manager_permastructs['taxonomies'] : array();
|
331 |
} else {
|
376 |
__("Default permastructure", "permalink-manager"), esc_html($default_permastruct),
|
377 |
__("Restore default permastructure", "permalink-manager")
|
378 |
);
|
379 |
+
|
380 |
+
// 2B. Do not auto-append slug field
|
381 |
+
$fields .= sprintf(
|
382 |
+
"<h4>%s</h4><div class=\"settings-container\">%s</div>",
|
383 |
+
__("Permastructure settings", "permalink-manager"),
|
384 |
+
self::generate_option_field("permastructure-settings[do_not_append_slug][$content_type][{$type_name}]", array('type' => 'single_checkbox', 'checkbox_label' => __("Do not automatically append the slug", "permalink-manager")))
|
385 |
+
);
|
386 |
+
|
387 |
$fields .= "</div>";
|
388 |
|
389 |
// 3. Show toggle button
|
609 |
if(is_array($updated_array)) {
|
610 |
// Check if slugs should be displayed
|
611 |
$first_slug = reset($updated_array);
|
612 |
+
$show_slugs = (!empty($_POST['mode']) && $_POST['mode'] == 'slugs') ? true : false;
|
613 |
|
614 |
$header_footer = '<tr>';
|
615 |
$header_footer .= '<th class="column-primary">' . __('Title', 'permalink-manager') . '</th>';
|
616 |
+
if($show_slugs) {
|
617 |
+
$header_footer .= (isset($first_slug['old_slug'])) ? '<th>' . __('Old Slug', 'permalink-manager') . '</th>' : "";
|
618 |
+
$header_footer .= (isset($first_slug['new_slug'])) ? '<th>' . __('New Slug', 'permalink-manager') . '</th>' : "";
|
619 |
+
} else {
|
620 |
+
$header_footer .= '<th>' . __('Old URI', 'permalink-manager') . '</th>';
|
621 |
+
$header_footer .= '<th>' . __('New URI', 'permalink-manager') . '</th>';
|
622 |
+
}
|
623 |
$header_footer .= '</tr>';
|
624 |
|
625 |
foreach($updated_array as $row) {
|
640 |
|
641 |
$main_content .= "<tr{$alternate_class}>";
|
642 |
$main_content .= '<td class="row-title column-primary" data-colname="' . __('Title', 'permalink-manager') . '">' . $row['item_title'] . "<a target=\"_blank\" href=\"{$permalink}\"><span class=\"small\">{$permalink}</span></a>" . '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __('Show more details', 'permalink-manager') . '</span></button></td>';
|
643 |
+
if($show_slugs) {
|
644 |
+
$main_content .= (isset($row['old_slug'])) ? '<td data-colname="' . __('Old Slug', 'permalink-manager') . '">' . urldecode($row['old_slug']) . '</td>' : "";
|
645 |
+
$main_content .= (isset($row['new_slug'])) ? '<td data-colname="' . __('New Slug', 'permalink-manager') . '">' . urldecode($row['new_slug']) . '</td>' : "";
|
646 |
+
} else {
|
647 |
+
$main_content .= '<td data-colname="' . __('Old URI', 'permalink-manager') . '">' . urldecode($row['old_uri']) . '</td>';
|
648 |
+
$main_content .= '<td data-colname="' . __('New URI', 'permalink-manager') . '">' . urldecode($row['new_uri']) . '</td>';
|
649 |
+
}
|
650 |
$main_content .= '</tr>';
|
651 |
}
|
652 |
|
834 |
}
|
835 |
}
|
836 |
|
837 |
+
// 10. Extra discount
|
838 |
+
if(Permalink_Manager_Admin_Functions::is_pro_active() == false) {
|
839 |
+
$html .= sprintf(
|
840 |
+
"<div class=\"default-permalink-row save-row columns-container hidden\"><div>%s</div></div>",
|
841 |
+
__('<span><strong>Need more functionalities and dedicated support?</strong> Buy Permalink Manager Pro and apply <a href="https://permalinkmanager.pro/buy-permalink-manager-pro/">PMLITE coupon code</a> to get 10% off.</a></span>', 'permalink-manager')
|
842 |
+
);
|
843 |
+
}
|
844 |
+
|
845 |
+
// 10. Custom redirects
|
846 |
$html .= ($element->ID) ? self::display_redirect_panel($id) : self::display_redirect_panel("tax-{$id}");
|
847 |
|
848 |
+
// 11. Extra save button for Gutenberg
|
849 |
if($gutenberg) {
|
850 |
$html .= sprintf(
|
851 |
"<div class=\"default-permalink-row save-row columns-container hidden\"><div><a href=\"#\" class=\"button button-primary\" id=\"permalink-manager-save-button\">%s</a></div></div>",
|
853 |
);
|
854 |
}
|
855 |
|
856 |
+
|
857 |
$html .= "</div>";
|
858 |
$html .= "</div>";
|
859 |
|
includes/core/permalink-manager-core-functions.php
CHANGED
@@ -12,25 +12,6 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
12 |
function init_hooks() {
|
13 |
global $permalink_manager_options;
|
14 |
|
15 |
-
// Trigger only in front-end
|
16 |
-
if(!is_admin() && (function_exists('is_customize_preview') && is_customize_preview()) == false) {
|
17 |
-
// Use the URIs set in this plugin
|
18 |
-
add_filter( 'request', array($this, 'detect_post'), 0, 1 );
|
19 |
-
|
20 |
-
// Redirect from old URIs to new URIs + adjust canonical redirect settings
|
21 |
-
add_action( 'template_redirect', array($this, 'new_uri_redirect_and_404'), 1);
|
22 |
-
add_action( 'wp', array($this, 'adjust_canonical_redirect'), 0, 1);
|
23 |
-
|
24 |
-
// Case insensitive permalinks
|
25 |
-
if(!empty($permalink_manager_options['general']['case_insensitive_permalinks'])) {
|
26 |
-
add_action( 'parse_request', array($this, 'case_insensitive_permalinks'), 0);
|
27 |
-
}
|
28 |
-
// Force 404 on non-existing pagination pages
|
29 |
-
if(!empty($permalink_manager_options['general']['pagination_redirect'])) {
|
30 |
-
add_action( 'wp', array($this, 'fix_pagination_pages'), 0);
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
// Trailing slashes
|
35 |
add_filter( 'permalink_manager_filter_final_term_permalink', array($this, 'control_trailing_slashes'), 9);
|
36 |
add_filter( 'permalink_manager_filter_final_post_permalink', array($this, 'control_trailing_slashes'), 9);
|
@@ -39,6 +20,34 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
39 |
// Replace empty placeholder tags & remove BOM
|
40 |
add_filter( 'permalink_manager_filter_default_post_uri', array($this, 'replace_empty_placeholder_tags'), 10, 5 );
|
41 |
add_filter( 'permalink_manager_filter_default_term_uri', array($this, 'replace_empty_placeholder_tags'), 10, 5 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
/**
|
@@ -196,17 +205,19 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
196 |
$final_uri = $term->slug;
|
197 |
|
198 |
// Fix for hierarchical terms
|
199 |
-
if(empty($term_ancestors)) {
|
200 |
-
foreach ($term_ancestors as $
|
201 |
-
$parent = get_term($
|
202 |
if(!empty($parent->slug)) {
|
203 |
$final_uri = $parent->slug . '/' . $final_uri;
|
204 |
}
|
205 |
}
|
206 |
}
|
207 |
|
208 |
-
|
209 |
-
$query[
|
|
|
|
|
210 |
} else {
|
211 |
$broken_uri = true;
|
212 |
}
|
@@ -244,10 +255,14 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
244 |
}
|
245 |
|
246 |
// Alter query parameters + support drafts URLs
|
247 |
-
if($post_to_load->post_status == 'draft') {
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
251 |
} else if($post_type == 'page') {
|
252 |
$query['pagename'] = $final_uri;
|
253 |
// $query['post_type'] = $post_type;
|
@@ -616,7 +631,7 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
616 |
if(isset($_REQUEST['debug_redirect'])) {
|
617 |
$debug_info['query_vars'] = $wp_query->query_vars;
|
618 |
$debug_info['redirect_url'] = (!empty($correct_permalink)) ? $correct_permalink : '-';
|
619 |
-
$debug_info['
|
620 |
$debug_info['queried_object'] = (!empty($queried_object)) ? $queried_object : "-";
|
621 |
|
622 |
$debug_txt = sprintf("<pre style=\"display:block;\">%s</pre>", print_r($debug_info, true));
|
12 |
function init_hooks() {
|
13 |
global $permalink_manager_options;
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
// Trailing slashes
|
16 |
add_filter( 'permalink_manager_filter_final_term_permalink', array($this, 'control_trailing_slashes'), 9);
|
17 |
add_filter( 'permalink_manager_filter_final_post_permalink', array($this, 'control_trailing_slashes'), 9);
|
20 |
// Replace empty placeholder tags & remove BOM
|
21 |
add_filter( 'permalink_manager_filter_default_post_uri', array($this, 'replace_empty_placeholder_tags'), 10, 5 );
|
22 |
add_filter( 'permalink_manager_filter_default_term_uri', array($this, 'replace_empty_placeholder_tags'), 10, 5 );
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Detect & canonical URL/redirect functions
|
26 |
+
*/
|
27 |
+
// Do not trigger in back-end
|
28 |
+
if(is_admin()) { return false; }
|
29 |
+
|
30 |
+
// Do not trigger if Customizer is loaded
|
31 |
+
if(function_exists('is_customize_preview') && is_customize_preview()) { return false; }
|
32 |
+
|
33 |
+
// Do not trigger if Elementor is loaded
|
34 |
+
if((!empty($_REQUEST['action']) && $_REQUEST['action'] == 'elementor') || isset($_REQUEST['elementor-preview'])) { return false; }
|
35 |
+
|
36 |
+
// Use the URIs set in this plugin
|
37 |
+
add_filter( 'request', array($this, 'detect_post'), 0, 1 );
|
38 |
+
|
39 |
+
// Redirect from old URIs to new URIs + adjust canonical redirect settings
|
40 |
+
add_action( 'template_redirect', array($this, 'new_uri_redirect_and_404'), 1);
|
41 |
+
add_action( 'wp', array($this, 'adjust_canonical_redirect'), 0, 1);
|
42 |
+
|
43 |
+
// Case insensitive permalinks
|
44 |
+
if(!empty($permalink_manager_options['general']['case_insensitive_permalinks'])) {
|
45 |
+
add_action( 'parse_request', array($this, 'case_insensitive_permalinks'), 0);
|
46 |
+
}
|
47 |
+
// Force 404 on non-existing pagination pages
|
48 |
+
if(!empty($permalink_manager_options['general']['pagination_redirect'])) {
|
49 |
+
add_action( 'wp', array($this, 'fix_pagination_pages'), 0);
|
50 |
+
}
|
51 |
}
|
52 |
|
53 |
/**
|
205 |
$final_uri = $term->slug;
|
206 |
|
207 |
// Fix for hierarchical terms
|
208 |
+
if(!empty($term_ancestors)) {
|
209 |
+
foreach ($term_ancestors as $parent_id) {
|
210 |
+
$parent = get_term((int) $parent_id, $term_taxonomy);
|
211 |
if(!empty($parent->slug)) {
|
212 |
$final_uri = $parent->slug . '/' . $final_uri;
|
213 |
}
|
214 |
}
|
215 |
}
|
216 |
|
217 |
+
//$query["term"] = $final_uri;
|
218 |
+
$query["term"] = $term->slug;
|
219 |
+
//$query[$query_parameter] = $final_uri;
|
220 |
+
$query[$query_parameter] = $term->slug;
|
221 |
} else {
|
222 |
$broken_uri = true;
|
223 |
}
|
255 |
}
|
256 |
|
257 |
// Alter query parameters + support drafts URLs
|
258 |
+
if($post_to_load->post_status == 'draft' || empty($final_uri)) {
|
259 |
+
if(is_user_logged_in()) {
|
260 |
+
$query['p'] = $element_id;
|
261 |
+
$query['preview'] = true;
|
262 |
+
$query['post_type'] = $post_type;
|
263 |
+
} else {
|
264 |
+
$query = $old_query;
|
265 |
+
}
|
266 |
} else if($post_type == 'page') {
|
267 |
$query['pagename'] = $final_uri;
|
268 |
// $query['post_type'] = $post_type;
|
631 |
if(isset($_REQUEST['debug_redirect'])) {
|
632 |
$debug_info['query_vars'] = $wp_query->query_vars;
|
633 |
$debug_info['redirect_url'] = (!empty($correct_permalink)) ? $correct_permalink : '-';
|
634 |
+
$debug_info['redirect_type'] = (!empty($redirect_type)) ? $redirect_type : "-";
|
635 |
$debug_info['queried_object'] = (!empty($queried_object)) ? $queried_object : "-";
|
636 |
|
637 |
$debug_txt = sprintf("<pre style=\"display:block;\">%s</pre>", print_r($debug_info, true));
|
includes/core/permalink-manager-helper-functions.php
CHANGED
@@ -136,9 +136,9 @@ class Permalink_Manager_Helper_Functions extends Permalink_Manager_Class {
|
|
136 |
|
137 |
static function content_types_disabled_by_default($is_taxonomy = false) {
|
138 |
if($is_taxonomy) {
|
139 |
-
return array('product_shipping_class');
|
140 |
} else {
|
141 |
-
return array('revision', 'algolia_task', 'fl_builder', 'fl-builder', 'fl-theme-layout', 'wc_product_tab', 'wc_voucher', 'wc_voucher_template', 'sliders', 'thirstylink');
|
142 |
}
|
143 |
}
|
144 |
|
@@ -328,6 +328,8 @@ class Permalink_Manager_Helper_Functions extends Permalink_Manager_Class {
|
|
328 |
// Extra tags
|
329 |
$tags[] = '%taxonomy%';
|
330 |
$tags[] = '%post_type%';
|
|
|
|
|
331 |
|
332 |
foreach($tags as &$tag) {
|
333 |
$tag = ($code) ? "<code>{$tag}</code>" : "{$tag}";
|
136 |
|
137 |
static function content_types_disabled_by_default($is_taxonomy = false) {
|
138 |
if($is_taxonomy) {
|
139 |
+
return array('product_shipping_class', 'post_status');
|
140 |
} else {
|
141 |
+
return array('revision', 'algolia_task', 'fl_builder', 'fl-builder', 'fl-theme-layout', 'wc_product_tab', 'wc_voucher', 'wc_voucher_template', 'sliders', 'thirstylink', 'elementor_library', 'cms_block');
|
142 |
}
|
143 |
}
|
144 |
|
328 |
// Extra tags
|
329 |
$tags[] = '%taxonomy%';
|
330 |
$tags[] = '%post_type%';
|
331 |
+
$tags[] = '%term_id%';
|
332 |
+
$tags[] = '%monthname%';
|
333 |
|
334 |
foreach($tags as &$tag) {
|
335 |
$tag = ($code) ? "<code>{$tag}</code>" : "{$tag}";
|
includes/core/permalink-manager-third-parties.php
CHANGED
@@ -57,11 +57,11 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
57 |
$mode = 'prepend';
|
58 |
}
|
59 |
|
60 |
-
if($mode
|
61 |
add_filter('permalink_manager_detect_uri', array($this, 'detect_uri_language'), 9, 3);
|
62 |
add_filter('permalink_manager_filter_permalink_base', array($this, 'prepend_lang_prefix'), 9, 2);
|
63 |
add_filter('template_redirect', array($this, 'wpml_redirect'), 0, 998 );
|
64 |
-
} else if($mode
|
65 |
add_filter('permalink_manager_filter_final_post_permalink', array($this, 'append_lang_prefix'), 5, 2);
|
66 |
add_filter('permalink_manager_filter_final_term_permalink', array($this, 'append_lang_prefix'), 5, 2);
|
67 |
add_filter('permalink_manager_detect_uri', array($this, 'wpml_ignore_lang_query_parameter'), 9);
|
@@ -150,10 +150,18 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
150 |
if(!empty($query_vars['image_id']) && !empty($query_vars['gallery_id'])) {
|
151 |
$wp_query->query_vars['do_not_redirect'] = 1;
|
152 |
}
|
153 |
-
// Ultimate
|
154 |
else if(!empty($query_vars['um_user']) && !empty($query_vars['um_user'])) {
|
155 |
$wp_query->query_vars['do_not_redirect'] = 1;
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
}
|
159 |
|
@@ -665,10 +673,10 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
665 |
|
666 |
function yoast_fix_breadcrumbs($links) {
|
667 |
// Get post type permastructure settings
|
668 |
-
global $permalink_manager_permastructs, $permalink_manager_uris, $permalink_manager_options, $post, $wpdb;
|
669 |
|
670 |
// Check if filter should be activated
|
671 |
-
if(empty($permalink_manager_options['general']['yoast_breadcrumbs'])) { return $links; }
|
672 |
|
673 |
// Get post type
|
674 |
$post_type = (!empty($post->post_type)) ? $post->post_type : '';
|
@@ -679,18 +687,21 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
679 |
$element_id = $queried_element->ID;
|
680 |
} else if(!empty($queried_element->term_id)) {
|
681 |
$element_id = "tax-{$queried_element->term_id}";
|
682 |
-
} else {
|
683 |
return $links;
|
684 |
-
}
|
685 |
|
686 |
-
if(!empty($permalink_manager_uris[$element_id])) {
|
687 |
$custom_uri = preg_replace("/([^\/]+)$/", '', $permalink_manager_uris[$element_id]);
|
688 |
} else {
|
689 |
-
|
|
|
690 |
}
|
691 |
|
|
|
692 |
$custom_uri_parts = explode('/', trim($custom_uri));
|
693 |
$breadcrumbs = array();
|
|
|
694 |
|
695 |
// Get Yoast meta
|
696 |
$yoast_meta_terms = get_option('wpseo_taxonomy_meta');
|
@@ -702,14 +713,28 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
702 |
$available_taxonomies = Permalink_Manager_Helper_Functions::get_taxonomies_array();
|
703 |
$available_post_types = Permalink_Manager_Helper_Functions::get_post_types_array();
|
704 |
|
705 |
-
|
706 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
$sql = sprintf("SELECT t.term_id, t.name, tt.taxonomy FROM {$wpdb->terms} AS t LEFT JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE slug = '%s' AND tt.taxonomy IN ('%s') LIMIT 1", $slug, implode("','", array_keys($available_taxonomies)));
|
708 |
|
709 |
$element = $wpdb->get_row($sql);
|
710 |
}
|
711 |
|
712 |
-
//
|
713 |
if(empty($element) && !empty($available_post_types)) {
|
714 |
$sql = sprintf("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_name = '%s' AND post_status = 'publish' AND post_type IN ('%s') AND post_type != 'attachment' LIMIT 1", $slug, implode("','", array_keys($available_post_types)));
|
715 |
|
@@ -890,10 +915,10 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
890 |
if(empty($parsedData) || Permalink_Manager_Helper_Functions::is_disabled($importData['post_type'], 'post_type')) { return; }
|
891 |
|
892 |
// Get the parsed custom URI
|
893 |
-
$index = (
|
894 |
$pid = (!empty($importData['pid'])) ? $importData['pid'] : false;
|
895 |
|
896 |
-
if($index && $pid && !empty($parsedData['custom_uri'][$index])) {
|
897 |
$custom_uri = Permalink_Manager_Helper_Functions::sanitize_title($parsedData['custom_uri'][$index]);
|
898 |
|
899 |
if(!empty($custom_uri)) {
|
@@ -932,6 +957,7 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
932 |
if(!is_array($post_ids)) { return; }
|
933 |
|
934 |
foreach($post_ids as $id) {
|
|
|
935 |
$permalink_manager_uris[$id] = Permalink_Manager_URI_Functions_Post::get_default_post_uri($id);
|
936 |
}
|
937 |
|
57 |
$mode = 'prepend';
|
58 |
}
|
59 |
|
60 |
+
if($mode === 'prepend') {
|
61 |
add_filter('permalink_manager_detect_uri', array($this, 'detect_uri_language'), 9, 3);
|
62 |
add_filter('permalink_manager_filter_permalink_base', array($this, 'prepend_lang_prefix'), 9, 2);
|
63 |
add_filter('template_redirect', array($this, 'wpml_redirect'), 0, 998 );
|
64 |
+
} else if($mode === 'append') {
|
65 |
add_filter('permalink_manager_filter_final_post_permalink', array($this, 'append_lang_prefix'), 5, 2);
|
66 |
add_filter('permalink_manager_filter_final_term_permalink', array($this, 'append_lang_prefix'), 5, 2);
|
67 |
add_filter('permalink_manager_detect_uri', array($this, 'wpml_ignore_lang_query_parameter'), 9);
|
150 |
if(!empty($query_vars['image_id']) && !empty($query_vars['gallery_id'])) {
|
151 |
$wp_query->query_vars['do_not_redirect'] = 1;
|
152 |
}
|
153 |
+
// Ultimate Member
|
154 |
else if(!empty($query_vars['um_user']) && !empty($query_vars['um_user'])) {
|
155 |
$wp_query->query_vars['do_not_redirect'] = 1;
|
156 |
}
|
157 |
+
// Mailster
|
158 |
+
else if(!empty($query_vars['_mailster_page'])) {
|
159 |
+
$wp_query->query_vars['do_not_redirect'] = 1;
|
160 |
+
}
|
161 |
+
// WP Route
|
162 |
+
else if(!empty($query_vars['WP_Route'])) {
|
163 |
+
$wp_query->query_vars['do_not_redirect'] = 1;
|
164 |
+
}
|
165 |
}
|
166 |
}
|
167 |
|
673 |
|
674 |
function yoast_fix_breadcrumbs($links) {
|
675 |
// Get post type permastructure settings
|
676 |
+
global $permalink_manager_permastructs, $permalink_manager_uris, $permalink_manager_options, $post, $wpdb, $wp;
|
677 |
|
678 |
// Check if filter should be activated
|
679 |
+
if(empty($permalink_manager_options['general']['yoast_breadcrumbs']) || empty($permalink_manager_uris)) { return $links; }
|
680 |
|
681 |
// Get post type
|
682 |
$post_type = (!empty($post->post_type)) ? $post->post_type : '';
|
687 |
$element_id = $queried_element->ID;
|
688 |
} else if(!empty($queried_element->term_id)) {
|
689 |
$element_id = "tax-{$queried_element->term_id}";
|
690 |
+
} /*else {
|
691 |
return $links;
|
692 |
+
}*/
|
693 |
|
694 |
+
if(!empty($element_id) && !empty($permalink_manager_uris[$element_id])) {
|
695 |
$custom_uri = preg_replace("/([^\/]+)$/", '', $permalink_manager_uris[$element_id]);
|
696 |
} else {
|
697 |
+
$custom_uri = trim(preg_replace("/([^\/]+)$/", '', $wp->request), "/");
|
698 |
+
//return $links;
|
699 |
}
|
700 |
|
701 |
+
$all_uris = array_flip($permalink_manager_uris);
|
702 |
$custom_uri_parts = explode('/', trim($custom_uri));
|
703 |
$breadcrumbs = array();
|
704 |
+
$snowball = '';
|
705 |
|
706 |
// Get Yoast meta
|
707 |
$yoast_meta_terms = get_option('wpseo_taxonomy_meta');
|
713 |
$available_taxonomies = Permalink_Manager_Helper_Functions::get_taxonomies_array();
|
714 |
$available_post_types = Permalink_Manager_Helper_Functions::get_post_types_array();
|
715 |
|
716 |
+
$snowball = (empty($snowball)) ? $slug : "{$snowball}/{$slug}";
|
717 |
+
|
718 |
+
// A. Try to match any custom URI
|
719 |
+
if($snowball) {
|
720 |
+
$uri = trim($snowball, "/");
|
721 |
+
$element = (!empty($all_uris[$uri])) ? $all_uris[$uri] : false;
|
722 |
+
|
723 |
+
if(!empty($element) && strpos($element, 'tax-') !== false) {
|
724 |
+
$element = get_term($element);
|
725 |
+
} else if(is_numeric($element)) {
|
726 |
+
$element = get_post($element);
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
// B. Try to get term
|
731 |
+
if(empty($element) && !empty($available_taxonomies)) {
|
732 |
$sql = sprintf("SELECT t.term_id, t.name, tt.taxonomy FROM {$wpdb->terms} AS t LEFT JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE slug = '%s' AND tt.taxonomy IN ('%s') LIMIT 1", $slug, implode("','", array_keys($available_taxonomies)));
|
733 |
|
734 |
$element = $wpdb->get_row($sql);
|
735 |
}
|
736 |
|
737 |
+
// C. Try to get page/post
|
738 |
if(empty($element) && !empty($available_post_types)) {
|
739 |
$sql = sprintf("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_name = '%s' AND post_status = 'publish' AND post_type IN ('%s') AND post_type != 'attachment' LIMIT 1", $slug, implode("','", array_keys($available_post_types)));
|
740 |
|
915 |
if(empty($parsedData) || Permalink_Manager_Helper_Functions::is_disabled($importData['post_type'], 'post_type')) { return; }
|
916 |
|
917 |
// Get the parsed custom URI
|
918 |
+
$index = (isset($importData['i'])) ? $importData['i'] : false;
|
919 |
$pid = (!empty($importData['pid'])) ? $importData['pid'] : false;
|
920 |
|
921 |
+
if(isset($index) && isset($pid) && !empty($parsedData['custom_uri'][$index])) {
|
922 |
$custom_uri = Permalink_Manager_Helper_Functions::sanitize_title($parsedData['custom_uri'][$index]);
|
923 |
|
924 |
if(!empty($custom_uri)) {
|
957 |
if(!is_array($post_ids)) { return; }
|
958 |
|
959 |
foreach($post_ids as $id) {
|
960 |
+
if(!empty($permalink_manager_uris[$id])) { continue; }
|
961 |
$permalink_manager_uris[$id] = Permalink_Manager_URI_Functions_Post::get_default_post_uri($id);
|
962 |
}
|
963 |
|
includes/core/permalink-manager-uri-functions-post.php
CHANGED
@@ -180,6 +180,7 @@ class Permalink_Manager_URI_Functions_Post extends Permalink_Manager_Class {
|
|
180 |
|
181 |
// 2A. Get the date
|
182 |
$date = explode(" ", date('Y m d H i s', strtotime($post->post_date)));
|
|
|
183 |
|
184 |
// 2B. Get the author (if needed)
|
185 |
$author = '';
|
@@ -228,8 +229,8 @@ class Permalink_Manager_URI_Functions_Post extends Permalink_Manager_Class {
|
|
228 |
$post_type_tag = Permalink_Manager_Helper_Functions::get_post_tag($post_type);
|
229 |
|
230 |
// 3C. Get the standard tags and replace them with their values
|
231 |
-
$tags = array('%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%post_id%', '%author%', '%post_type%');
|
232 |
-
$tags_replacements = array($date[0], $date[1], $date[2], $date[3], $date[4], $date[5], $post->ID, $author, $post_type_slug);
|
233 |
$default_uri = str_replace($tags, $tags_replacements, $default_base);
|
234 |
|
235 |
// 3D. Get the slug tags
|
@@ -237,7 +238,8 @@ class Permalink_Manager_URI_Functions_Post extends Permalink_Manager_Class {
|
|
237 |
$slug_tags_replacement = array($full_slug, $full_slug, $custom_slug, $full_native_slug);
|
238 |
|
239 |
// 3E. Check if any post tag is present in custom permastructure
|
240 |
-
$do_not_append_slug =
|
|
|
241 |
if($do_not_append_slug == false) {
|
242 |
foreach($slug_tags as $tag) {
|
243 |
if(strpos($default_uri, $tag) !== false) {
|
180 |
|
181 |
// 2A. Get the date
|
182 |
$date = explode(" ", date('Y m d H i s', strtotime($post->post_date)));
|
183 |
+
$monthname = sanitize_title(date_i18n('F', strtotime($post->post_date)));
|
184 |
|
185 |
// 2B. Get the author (if needed)
|
186 |
$author = '';
|
229 |
$post_type_tag = Permalink_Manager_Helper_Functions::get_post_tag($post_type);
|
230 |
|
231 |
// 3C. Get the standard tags and replace them with their values
|
232 |
+
$tags = array('%year%', '%monthnum%', '%monthname%', '%day%', '%hour%', '%minute%', '%second%', '%post_id%', '%author%', '%post_type%');
|
233 |
+
$tags_replacements = array($date[0], $date[1], $monthname, $date[2], $date[3], $date[4], $date[5], $post->ID, $author, $post_type_slug);
|
234 |
$default_uri = str_replace($tags, $tags_replacements, $default_base);
|
235 |
|
236 |
// 3D. Get the slug tags
|
238 |
$slug_tags_replacement = array($full_slug, $full_slug, $custom_slug, $full_native_slug);
|
239 |
|
240 |
// 3E. Check if any post tag is present in custom permastructure
|
241 |
+
$do_not_append_slug = (!empty($permalink_manager_options['permastructure-settings']['do_not_append_slug']['post_types'][$post_type])) ? true : false;
|
242 |
+
$do_not_append_slug = apply_filters("permalink_manager_do_not_append_slug", $do_not_append_slug, $post_type, $post);
|
243 |
if($do_not_append_slug == false) {
|
244 |
foreach($slug_tags as $tag) {
|
245 |
if(strpos($default_uri, $tag) !== false) {
|
out/permalink-manager-admin.css
CHANGED
@@ -164,13 +164,16 @@
|
|
164 |
/**
|
165 |
* Permastructures
|
166 |
*/
|
167 |
-
#permalink-manager .all-permastruct-container
|
168 |
-
#permalink-manager .all-permastruct-container >
|
169 |
-
#permalink-manager .all-permastruct-container
|
|
|
170 |
#permalink-manager .all-permastruct-container h4{font-size:14px}
|
171 |
#permalink-manager .all-permastruct-container p{font-size:13px}
|
|
|
172 |
#permalink-manager .all-permastruct-container label{font-weight:600;margin-top:15px!important;font-size:13px;margin-bottom:5px!important;display:block;clear:both}
|
173 |
-
#permalink-manager .permastruct-
|
|
|
174 |
|
175 |
|
176 |
/**
|
164 |
/**
|
165 |
* Permastructures
|
166 |
*/
|
167 |
+
#permalink-manager .all-permastruct-container{}
|
168 |
+
#permalink-manager .all-permastruct-container > *{margin-bottom:15px}
|
169 |
+
#permalink-manager .all-permastruct-container > *:last-child{margin:0}
|
170 |
+
#permalink-manager .all-permastruct-container .permastruct-toggle{display:none;padding-bottom:15px;border-bottom:1px dashed #ddd}
|
171 |
#permalink-manager .all-permastruct-container h4{font-size:14px}
|
172 |
#permalink-manager .all-permastruct-container p{font-size:13px}
|
173 |
+
#permalink-manager .all-permastruct-container p.default-permastruct-row{margin-top:15px}
|
174 |
#permalink-manager .all-permastruct-container label{font-weight:600;margin-top:15px!important;font-size:13px;margin-bottom:5px!important;display:block;clear:both}
|
175 |
+
#permalink-manager .all-permastruct-container .settings-container label{font-weight:400}
|
176 |
+
#permalink-manager .permastruct-toggle-button a{font-size:90%;font-weight:bold}
|
177 |
|
178 |
|
179 |
/**
|
out/permalink-manager-admin.js
CHANGED
@@ -15,7 +15,7 @@ jQuery(document).ready(function() {
|
|
15 |
});
|
16 |
});
|
17 |
|
18 |
-
jQuery('#permalink-manager .checkboxes label').not('input').on('click', function(ev) {
|
19 |
var input = jQuery(this).find("input");
|
20 |
if(!jQuery(ev.target).is("input")) {
|
21 |
input.prop('checked', !(input.prop("checked")));
|
15 |
});
|
16 |
});
|
17 |
|
18 |
+
jQuery('#permalink-manager .checkboxes label, #permalink-manager .single_checkbox label').not('input').on('click', function(ev) {
|
19 |
var input = jQuery(this).find("input");
|
20 |
if(!jQuery(ev.target).is("input")) {
|
21 |
input.prop('checked', !(input.prop("checked")));
|
permalink-manager.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Permalink Manager Lite
|
5 |
* Plugin URI: https://permalinkmanager.pro?utm_source=plugin
|
6 |
* Description: Advanced plugin that allows to set-up custom permalinks (bulk editors included), slugs and permastructures (WooCommerce compatible).
|
7 |
-
* Version: 2.2.
|
8 |
* Author: Maciej Bis
|
9 |
* Author URI: http://maciejbis.net/
|
10 |
* License: GPL-2.0+
|
@@ -21,7 +21,7 @@ if (!defined('WPINC')) {
|
|
21 |
// Define the directories used to load plugin files.
|
22 |
define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'Permalink Manager' );
|
23 |
define( 'PERMALINK_MANAGER_PLUGIN_SLUG', 'permalink-manager' );
|
24 |
-
define( 'PERMALINK_MANAGER_VERSION', '2.2.
|
25 |
define( 'PERMALINK_MANAGER_FILE', __FILE__ );
|
26 |
define( 'PERMALINK_MANAGER_DIR', untrailingslashit(dirname(__FILE__)) );
|
27 |
define( 'PERMALINK_MANAGER_BASENAME', dirname(plugin_basename(__FILE__)));
|
@@ -162,7 +162,7 @@ class Permalink_Manager_Class {
|
|
162 |
'pagination_redirect' => 0,
|
163 |
'auto_remove_duplicates' => 1,
|
164 |
'fix_language_mismatch' => 1,
|
165 |
-
'pmxi_import_support' =>
|
166 |
'yoast_breadcrumbs' => 0,
|
167 |
'force_custom_slugs' => 0,
|
168 |
'disable_slug_sanitization' => 0,
|
@@ -189,18 +189,18 @@ class Permalink_Manager_Class {
|
|
189 |
*/
|
190 |
public function default_alerts($alerts) {
|
191 |
$default_alerts = apply_filters('permalink_manager_default_alerts', array(
|
192 |
-
'
|
193 |
'txt' => sprintf(
|
194 |
__("Get access to extra features: full taxonomy and WooCommerce support, possibility to use custom fields inside the permalinks and more!<br /><strong>Buy Permalink Manager Pro <a href=\"%s\" target=\"_blank\">here</a> and save %s using \"%s\" coupon code!</strong> Valid until %s!", "permalink-manager"),
|
195 |
-
PERMALINK_MANAGER_WEBSITE,
|
196 |
-
'
|
197 |
-
'
|
198 |
-
'
|
199 |
),
|
200 |
'type' => 'notice-info',
|
201 |
'show' => 'pro_hide',
|
202 |
'plugin_only' => true,
|
203 |
-
'until' => '2019-
|
204 |
)
|
205 |
));
|
206 |
|
4 |
* Plugin Name: Permalink Manager Lite
|
5 |
* Plugin URI: https://permalinkmanager.pro?utm_source=plugin
|
6 |
* Description: Advanced plugin that allows to set-up custom permalinks (bulk editors included), slugs and permastructures (WooCommerce compatible).
|
7 |
+
* Version: 2.2.4
|
8 |
* Author: Maciej Bis
|
9 |
* Author URI: http://maciejbis.net/
|
10 |
* License: GPL-2.0+
|
21 |
// Define the directories used to load plugin files.
|
22 |
define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'Permalink Manager' );
|
23 |
define( 'PERMALINK_MANAGER_PLUGIN_SLUG', 'permalink-manager' );
|
24 |
+
define( 'PERMALINK_MANAGER_VERSION', '2.2.4' );
|
25 |
define( 'PERMALINK_MANAGER_FILE', __FILE__ );
|
26 |
define( 'PERMALINK_MANAGER_DIR', untrailingslashit(dirname(__FILE__)) );
|
27 |
define( 'PERMALINK_MANAGER_BASENAME', dirname(plugin_basename(__FILE__)));
|
162 |
'pagination_redirect' => 0,
|
163 |
'auto_remove_duplicates' => 1,
|
164 |
'fix_language_mismatch' => 1,
|
165 |
+
'pmxi_import_support' => 0,
|
166 |
'yoast_breadcrumbs' => 0,
|
167 |
'force_custom_slugs' => 0,
|
168 |
'disable_slug_sanitization' => 0,
|
189 |
*/
|
190 |
public function default_alerts($alerts) {
|
191 |
$default_alerts = apply_filters('permalink_manager_default_alerts', array(
|
192 |
+
'june19promo' => array(
|
193 |
'txt' => sprintf(
|
194 |
__("Get access to extra features: full taxonomy and WooCommerce support, possibility to use custom fields inside the permalinks and more!<br /><strong>Buy Permalink Manager Pro <a href=\"%s\" target=\"_blank\">here</a> and save %s using \"%s\" coupon code!</strong> Valid until %s!", "permalink-manager"),
|
195 |
+
PERMALINK_MANAGER_WEBSITE . "&utm_campaign=discount_code",
|
196 |
+
'20%',
|
197 |
+
'JUNE19',
|
198 |
+
'30.06'
|
199 |
),
|
200 |
'type' => 'notice-info',
|
201 |
'show' => 'pro_hide',
|
202 |
'plugin_only' => true,
|
203 |
+
'until' => '2019-06-30'
|
204 |
)
|
205 |
));
|
206 |
|