Version Description
(January 23, 2021) = * Enhancement - Improved support for "Primary category" feature included in Yoast SEO * Enhancement - Added support for Avia/Enfold breadcrumbs filter * Enhancement - Further optimisation and improvements for Permalink_Manager_Core_Functions->new_uri_redirect_and_404() function * Fix - Permalink Manager now recognises the "Explore" listing page in MyListing theme properly
Download this release
Release Info
Developer | mbis |
Plugin | Permalink Manager Lite |
Version | 2.2.16 |
Comparing to | |
See all releases |
Code changes from version 2.2.15.1 to 2.2.16
README.txt
CHANGED
@@ -6,8 +6,8 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
6 |
Tags: permalinks, custom permalinks, url editor, permalinks, woocommerce permalinks
|
7 |
Requires at least: 4.4.0
|
8 |
Requires PHP: 5.4
|
9 |
-
Tested up to: 5.
|
10 |
-
Stable tag: 2.2.
|
11 |
|
12 |
Permalink Manager lets you customize the complete URL addresses of your posts, pages, custom post types, terms, and WooCommerce links with ease without touching any core files.
|
13 |
|
@@ -93,16 +93,22 @@ It is because Permalink Manager overwrites one of the core Wordpress functionali
|
|
93 |
7. Permastructure settings (different permalink structure per language).
|
94 |
8. Permalink Manager settings.
|
95 |
|
96 |
-
== Changelog ==
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
= 2.2.15.1 (January 14, 2021) =
|
99 |
-
* Fix - "Regenerate/reset" tool works correctly again in Permalink Manager Lite
|
100 |
|
101 |
= 2.2.15 (January 12, 2021) =
|
102 |
* Enhancement - UI Improvements for Regenerate/reset tool
|
103 |
-
* Dev - WPML_URL_Filters->permalink_filter() hook is also used by Permalink Manager to filter custom permalinks
|
104 |
* Enhancement - wp_make_link_relative() function is used to prevent redirect loops in new_uri_redirect_and_404() (suggested by mgussekloo)
|
105 |
-
* Fix -
|
106 |
|
107 |
= 2.2.14 (October 20, 2021) =
|
108 |
* Enhancement - Improvements for Gutenberg Editor
|
6 |
Tags: permalinks, custom permalinks, url editor, permalinks, woocommerce permalinks
|
7 |
Requires at least: 4.4.0
|
8 |
Requires PHP: 5.4
|
9 |
+
Tested up to: 5.9.1
|
10 |
+
Stable tag: 2.2.16
|
11 |
|
12 |
Permalink Manager lets you customize the complete URL addresses of your posts, pages, custom post types, terms, and WooCommerce links with ease without touching any core files.
|
13 |
|
93 |
7. Permastructure settings (different permalink structure per language).
|
94 |
8. Permalink Manager settings.
|
95 |
|
96 |
+
== Changelog ==
|
97 |
+
|
98 |
+
= 2.2.16 (January 23, 2021) =
|
99 |
+
* Enhancement - Improved support for "Primary category" feature included in Yoast SEO
|
100 |
+
* Enhancement - Added support for Avia/Enfold breadcrumbs filter
|
101 |
+
* Enhancement - Further optimisation and improvements for Permalink_Manager_Core_Functions->new_uri_redirect_and_404() function
|
102 |
+
* Fix - Permalink Manager now recognises the "Explore" listing page in MyListing theme properly
|
103 |
+
|
104 |
= 2.2.15.1 (January 14, 2021) =
|
105 |
+
* Fix - "Regenerate/reset" tool works correctly again in Permalink Manager Lite
|
106 |
|
107 |
= 2.2.15 (January 12, 2021) =
|
108 |
* Enhancement - UI Improvements for Regenerate/reset tool
|
109 |
+
* Dev - WPML_URL_Filters->permalink_filter() hook is also used by Permalink Manager to filter custom permalinks
|
110 |
* Enhancement - wp_make_link_relative() function is used to prevent redirect loops in new_uri_redirect_and_404() (suggested by mgussekloo)
|
111 |
+
* Fix - Adjustments to the debug function's security to prevent XSS injection
|
112 |
|
113 |
= 2.2.14 (October 20, 2021) =
|
114 |
* Enhancement - Improvements for Gutenberg Editor
|
includes/core/permalink-manager-admin-functions.php
CHANGED
@@ -609,9 +609,7 @@ class Permalink_Manager_Admin_Functions extends Permalink_Manager_Class {
|
|
609 |
global $wpdb, $permalink_manager_before_sections_html, $permalink_manager_after_sections_html;
|
610 |
|
611 |
$html = "<div id=\"permalink-manager\" class=\"wrap\">";
|
612 |
-
|
613 |
-
$donate_link = (self::is_pro_active()) ? "" : sprintf("<a href=\"%s\" target=\"_blank\" class=\"page-title-action\">%s</a>", PERMALINK_MANAGER_DONATE, __("Donate", "permalink-manager"));
|
614 |
-
$html .= sprintf("<h2 id=\"plugin-name-heading\">%s <a href=\"http://maciejbis.net\" class=\"author-link\" target=\"_blank\">%s</a> %s</h2>", PERMALINK_MANAGER_PLUGIN_NAME, __("by Maciej Bis", "permalink-manager"), $donate_link);
|
615 |
|
616 |
// Display the tab navigation
|
617 |
$html .= "<div id=\"permalink-manager-tab-nav\" class=\"nav-tab-wrapper\">";
|
609 |
global $wpdb, $permalink_manager_before_sections_html, $permalink_manager_after_sections_html;
|
610 |
|
611 |
$html = "<div id=\"permalink-manager\" class=\"wrap\">";
|
612 |
+
$html .= sprintf("<h2 id=\"plugin-name-heading\">%s <a href=\"http://maciejbis.net\" class=\"author-link\" target=\"_blank\">%s</a></h2>", PERMALINK_MANAGER_PLUGIN_NAME, __("by Maciej Bis", "permalink-manager"));
|
|
|
|
|
613 |
|
614 |
// Display the tab navigation
|
615 |
$html .= "<div id=\"permalink-manager-tab-nav\" class=\"nav-tab-wrapper\">";
|
includes/core/permalink-manager-core-functions.php
CHANGED
@@ -64,6 +64,9 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
64 |
$request_url = (!empty($request_url)) ? parse_url($request_url, PHP_URL_PATH) : $_SERVER['REQUEST_URI'];
|
65 |
$request_url = strtok($request_url, "?");
|
66 |
|
|
|
|
|
|
|
67 |
$http_host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : preg_replace('/www\./i', '', $_SERVER['SERVER_NAME']);
|
68 |
$request_url = sprintf("http://%s%s", str_replace("www.", "", $http_host), $request_url);
|
69 |
$raw_home_url = trim(get_option('home'));
|
@@ -365,7 +368,7 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
365 |
/**
|
366 |
* 5A. Endpoints
|
367 |
*/
|
368 |
-
if(!empty($element_id) && (!empty($endpoint) || !empty($endpoint_value))) {
|
369 |
if(is_array($endpoint)) {
|
370 |
foreach($endpoint as $endpoint_name => $endpoint_value) {
|
371 |
$query[$endpoint_name] = $endpoint_value;
|
@@ -421,7 +424,7 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
421 |
/**
|
422 |
* 6. Set global with detected item id
|
423 |
*/
|
424 |
-
if(!empty($element_id)) {
|
425 |
$pm_query['id'] = $element_id;
|
426 |
|
427 |
// Make the redirects more clever - see new_uri_redirect_and_404() method
|
@@ -558,8 +561,10 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
558 |
$correct_permalink = '';
|
559 |
|
560 |
// Get query string & URI
|
|
|
|
|
561 |
$query_string = ($copy_query_redirect && !empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : '';
|
562 |
-
$old_uri = $_SERVER['REQUEST_URI'];
|
563 |
|
564 |
// Fix for WP installed in directories (remove the directory name from the URI)
|
565 |
if(!empty($home_dir)) {
|
@@ -691,9 +696,11 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
691 |
/**
|
692 |
* 2. Check if URL contains duplicated slashes
|
693 |
*/
|
694 |
-
if(!empty($old_uri) && ($old_uri
|
695 |
-
$new_uri = ltrim(preg_replace('/([^:])([\/]+)/', '$1/', $old_uri),
|
696 |
-
$correct_permalink = "
|
|
|
|
|
697 |
}
|
698 |
|
699 |
/**
|
@@ -731,24 +738,26 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
731 |
/**
|
732 |
* 5. Check trailing slashes (ignore links with query parameters)
|
733 |
*/
|
734 |
-
if($trailing_slashes_mode && $trailing_slashes_redirect && empty($correct_permalink) && empty($
|
735 |
// Check if $old_uri ends with slash or not
|
736 |
$ends_with_slash = (substr($old_uri, -1) == "/") ? true : false;
|
737 |
$trailing_slashes_mode = (preg_match("/.*\.([a-zA-Z]{3,4})\/?$/", $old_uri) && $trailing_slashes_mode == 1) ? 2 : $trailing_slashes_mode;
|
738 |
|
739 |
// Ignore empty URIs
|
740 |
if($old_uri != "/") {
|
|
|
|
|
741 |
// 2A. Force trailing slashes
|
742 |
if($trailing_slashes_mode == 1 && $ends_with_slash == false) {
|
743 |
-
$correct_permalink = sprintf("%s/%s/",
|
744 |
}
|
745 |
// 2B. Remove trailing slashes
|
746 |
else if($trailing_slashes_mode == 2 && $ends_with_slash == true) {
|
747 |
-
$correct_permalink = sprintf("%s/%s",
|
748 |
}
|
749 |
// 2C. Remove duplicated trailing slashes
|
750 |
else if($trailing_slashes_mode == 1 && preg_match('/[\/]{2,}$/', $old_uri)) {
|
751 |
-
$correct_permalink = sprintf("%s/%s/",
|
752 |
}
|
753 |
}
|
754 |
|
@@ -765,7 +774,9 @@ class Permalink_Manager_Core_Functions extends Permalink_Manager_Class {
|
|
765 |
$requested_url_has_ssl = is_ssl();
|
766 |
|
767 |
if(($home_url_has_www !== $requested_url_has_www) || ($home_url_has_ssl !== $requested_url_has_ssl)) {
|
768 |
-
$
|
|
|
|
|
769 |
$redirect_type = 'www_redirect';
|
770 |
}
|
771 |
}
|
64 |
$request_url = (!empty($request_url)) ? parse_url($request_url, PHP_URL_PATH) : $_SERVER['REQUEST_URI'];
|
65 |
$request_url = strtok($request_url, "?");
|
66 |
|
67 |
+
// Make sure that either $_SERVER['SERVER_NAME'] or $_SERVER['HTTP_HOST'] are set
|
68 |
+
if(empty($_SERVER['HTTP_HOST']) && empty($_SERVER['SERVER_NAME'])) { return $query; }
|
69 |
+
|
70 |
$http_host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : preg_replace('/www\./i', '', $_SERVER['SERVER_NAME']);
|
71 |
$request_url = sprintf("http://%s%s", str_replace("www.", "", $http_host), $request_url);
|
72 |
$raw_home_url = trim(get_option('home'));
|
368 |
/**
|
369 |
* 5A. Endpoints
|
370 |
*/
|
371 |
+
if(!empty($element_id) && empty($disabled) && (!empty($endpoint) || !empty($endpoint_value))) {
|
372 |
if(is_array($endpoint)) {
|
373 |
foreach($endpoint as $endpoint_name => $endpoint_value) {
|
374 |
$query[$endpoint_name] = $endpoint_value;
|
424 |
/**
|
425 |
* 6. Set global with detected item id
|
426 |
*/
|
427 |
+
if(!empty($element_id) && empty($disabled)) {
|
428 |
$pm_query['id'] = $element_id;
|
429 |
|
430 |
// Make the redirects more clever - see new_uri_redirect_and_404() method
|
561 |
$correct_permalink = '';
|
562 |
|
563 |
// Get query string & URI
|
564 |
+
if(empty($_SERVER['REQUEST_URI'])) { return; }
|
565 |
+
|
566 |
$query_string = ($copy_query_redirect && !empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : '';
|
567 |
+
$old_uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
568 |
|
569 |
// Fix for WP installed in directories (remove the directory name from the URI)
|
570 |
if(!empty($home_dir)) {
|
696 |
/**
|
697 |
* 2. Check if URL contains duplicated slashes
|
698 |
*/
|
699 |
+
if(!empty($old_uri) && ($old_uri !== '/') && preg_match('/\/{2,}/', $old_uri)) {
|
700 |
+
$new_uri = ltrim(preg_replace('/([^:])([\/]+)/', '$1/', $old_uri), '/');
|
701 |
+
$correct_permalink = sprintf("%s/%s", $home_url, $new_uri);
|
702 |
+
|
703 |
+
$redirect_type = ($redirect_type == '-') ? 'duplicated_slash_redirect' : $redirect_type;
|
704 |
}
|
705 |
|
706 |
/**
|
738 |
/**
|
739 |
* 5. Check trailing slashes (ignore links with query parameters)
|
740 |
*/
|
741 |
+
if($trailing_slashes_mode && $trailing_slashes_redirect && empty($correct_permalink) && empty($query_string) && !empty($old_uri) && !is_front_page()) {
|
742 |
// Check if $old_uri ends with slash or not
|
743 |
$ends_with_slash = (substr($old_uri, -1) == "/") ? true : false;
|
744 |
$trailing_slashes_mode = (preg_match("/.*\.([a-zA-Z]{3,4})\/?$/", $old_uri) && $trailing_slashes_mode == 1) ? 2 : $trailing_slashes_mode;
|
745 |
|
746 |
// Ignore empty URIs
|
747 |
if($old_uri != "/") {
|
748 |
+
$new_uri = trim($old_uri, '/');
|
749 |
+
|
750 |
// 2A. Force trailing slashes
|
751 |
if($trailing_slashes_mode == 1 && $ends_with_slash == false) {
|
752 |
+
$correct_permalink = sprintf("%s/%s/", $home_url, $new_uri);
|
753 |
}
|
754 |
// 2B. Remove trailing slashes
|
755 |
else if($trailing_slashes_mode == 2 && $ends_with_slash == true) {
|
756 |
+
$correct_permalink = sprintf("%s/%s", $home_url, $new_uri);
|
757 |
}
|
758 |
// 2C. Remove duplicated trailing slashes
|
759 |
else if($trailing_slashes_mode == 1 && preg_match('/[\/]{2,}$/', $old_uri)) {
|
760 |
+
$correct_permalink = sprintf("%s/%s/", $home_url, $new_uri);
|
761 |
}
|
762 |
}
|
763 |
|
774 |
$requested_url_has_ssl = is_ssl();
|
775 |
|
776 |
if(($home_url_has_www !== $requested_url_has_www) || ($home_url_has_ssl !== $requested_url_has_ssl)) {
|
777 |
+
$new_uri = ltrim($old_uri, '/');
|
778 |
+
$correct_permalink = sprintf("%s/%s", $home_url, $new_uri);
|
779 |
+
|
780 |
$redirect_type = 'www_redirect';
|
781 |
}
|
782 |
}
|
includes/core/permalink-manager-helper-functions.php
CHANGED
@@ -52,8 +52,17 @@ class Permalink_Manager_Helper_Functions extends Permalink_Manager_Class {
|
|
52 |
|
53 |
// A. Yoast SEO
|
54 |
if(class_exists('WPSEO_Primary_Term')) {
|
55 |
-
$
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
// B. The SEO Framework
|
59 |
else if(function_exists('the_seo_framework')) {
|
52 |
|
53 |
// A. Yoast SEO
|
54 |
if(class_exists('WPSEO_Primary_Term')) {
|
55 |
+
$yoast_primary_term_label = sprintf('yoast_wpseo_primary_%s_term', $taxonomy);
|
56 |
+
|
57 |
+
// Hotfix: Yoast SEO saves the primary term using 'save_post' hook with highest priority, so the primary term ID is taken directly from $_POST
|
58 |
+
if(!empty($_POST[$yoast_primary_term_label])) {
|
59 |
+
$yoast_primary_term_id = filter_input(INPUT_POST, $yoast_primary_term_label, FILTER_SANITIZE_NUMBER_INT);
|
60 |
+
} else {
|
61 |
+
$yoast_primary_term = new WPSEO_Primary_Term($taxonomy, $post_id);
|
62 |
+
$yoast_primary_term_id = $yoast_primary_term->get_primary_term();
|
63 |
+
}
|
64 |
+
|
65 |
+
$primary_term = (is_numeric($yoast_primary_term_id)) ? get_term($yoast_primary_term_id, $taxonomy) : '';
|
66 |
}
|
67 |
// B. The SEO Framework
|
68 |
else if(function_exists('the_seo_framework')) {
|
includes/core/permalink-manager-third-parties.php
CHANGED
@@ -80,6 +80,7 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
80 |
add_filter('seopress_pro_breadcrumbs_crumbs', array($this, 'filter_breadcrumbs'), 9);
|
81 |
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_breadcrumbs'), 9);
|
82 |
add_filter('slim_seo_breadcrumbs_links', array($this, 'filter_breadcrumbs'), 9);
|
|
|
83 |
|
84 |
// 8. WooCommerce Wishlist Plugin
|
85 |
if(function_exists('tinv_get_option')) {
|
@@ -123,7 +124,7 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
123 |
if(class_exists('\MyListing\Post_Types')) {
|
124 |
add_filter('permalink_manager_filter_default_post_uri', array($this, 'ml_listing_custom_fields'), 5, 5 );
|
125 |
add_action('mylisting/submission/save-listing-data', array($this, 'ml_set_listing_uri'), 100);
|
126 |
-
add_filter('permalink_manager_filter_query', array($this, 'ml_detect_archives'), 1);
|
127 |
}
|
128 |
|
129 |
// 14. bbPress
|
@@ -717,7 +718,7 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
717 |
}
|
718 |
}
|
719 |
|
720 |
-
|
721 |
if(!empty($links) && is_array($links)) {
|
722 |
$first_element = reset($links);
|
723 |
$last_element = end($links);
|
@@ -731,13 +732,24 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
731 |
$breadcrumb[1] = $breadcrumb['url'];
|
732 |
}
|
733 |
}
|
734 |
-
}
|
735 |
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
|
|
740 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
}
|
742 |
|
743 |
return array_filter($links);
|
@@ -1101,27 +1113,46 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
1101 |
}
|
1102 |
}
|
1103 |
|
1104 |
-
function ml_detect_archives($query) {
|
1105 |
if(function_exists('mylisting_custom_taxonomies') && empty($_POST['submit_job'])) {
|
1106 |
$explore_page_id = get_option('options_general_explore_listings_page', false);
|
1107 |
if(empty($explore_page_id)) { return $query; }
|
1108 |
|
1109 |
-
|
1110 |
-
$
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1120 |
}
|
1121 |
}
|
1122 |
}
|
1123 |
|
1124 |
-
return $query;
|
1125 |
}
|
1126 |
|
1127 |
/**
|
@@ -1164,7 +1195,7 @@ class Permalink_Manager_Third_Parties extends Permalink_Manager_Class {
|
|
1164 |
global $post, $wp_query, $wp, $pm_query;
|
1165 |
|
1166 |
// Check if Dokan is activated
|
1167 |
-
if(!function_exists('dokan_get_option') || is_admin()) { return; }
|
1168 |
|
1169 |
// Get Dokan dashboard page id
|
1170 |
$dashboard_page = dokan_get_option('dashboard', 'dokan_pages');
|
80 |
add_filter('seopress_pro_breadcrumbs_crumbs', array($this, 'filter_breadcrumbs'), 9);
|
81 |
add_filter('woocommerce_get_breadcrumb', array($this, 'filter_breadcrumbs'), 9);
|
82 |
add_filter('slim_seo_breadcrumbs_links', array($this, 'filter_breadcrumbs'), 9);
|
83 |
+
add_filter('avia_breadcrumbs_trail', array($this, 'filter_breadcrumbs'), 100);
|
84 |
|
85 |
// 8. WooCommerce Wishlist Plugin
|
86 |
if(function_exists('tinv_get_option')) {
|
124 |
if(class_exists('\MyListing\Post_Types')) {
|
125 |
add_filter('permalink_manager_filter_default_post_uri', array($this, 'ml_listing_custom_fields'), 5, 5 );
|
126 |
add_action('mylisting/submission/save-listing-data', array($this, 'ml_set_listing_uri'), 100);
|
127 |
+
add_filter('permalink_manager_filter_query', array($this, 'ml_detect_archives'), 1, 2);
|
128 |
}
|
129 |
|
130 |
// 14. bbPress
|
718 |
}
|
719 |
}
|
720 |
|
721 |
+
// Add new links to current breadcrumbs array
|
722 |
if(!empty($links) && is_array($links)) {
|
723 |
$first_element = reset($links);
|
724 |
$last_element = end($links);
|
732 |
$breadcrumb[1] = $breadcrumb['url'];
|
733 |
}
|
734 |
}
|
|
|
735 |
|
736 |
+
if(in_array($current_filter, array('slim_seo_breadcrumbs_links'))) {
|
737 |
+
$links = array_merge(array($first_element), $breadcrumbs);
|
738 |
+
} else {
|
739 |
+
$links = array_merge(array($first_element), $breadcrumbs, array($last_element));
|
740 |
+
}
|
741 |
}
|
742 |
+
// Support Avia/Enfold breadcrumbs
|
743 |
+
else if($current_filter == 'avia_breadcrumbs_trail') {
|
744 |
+
foreach($breadcrumbs as &$breadcrumb) {
|
745 |
+
if(isset($breadcrumb['text'])) {
|
746 |
+
$breadcrumb = sprintf('<a href="%s" title="%2$s">%2$s</a>', esc_attr($breadcrumb['url']), esc_attr($breadcrumb['text']));
|
747 |
+
}
|
748 |
+
}
|
749 |
+
|
750 |
+
$links = $breadcrumbs;
|
751 |
+
$links['trail_end'] = $last_element;
|
752 |
+
}
|
753 |
}
|
754 |
|
755 |
return array_filter($links);
|
1113 |
}
|
1114 |
}
|
1115 |
|
1116 |
+
function ml_detect_archives($query, $old_query) {
|
1117 |
if(function_exists('mylisting_custom_taxonomies') && empty($_POST['submit_job'])) {
|
1118 |
$explore_page_id = get_option('options_general_explore_listings_page', false);
|
1119 |
if(empty($explore_page_id)) { return $query; }
|
1120 |
|
1121 |
+
// 1. Set-up new query array variable
|
1122 |
+
$new_query = array(
|
1123 |
+
"page_id" => $explore_page_id
|
1124 |
+
);
|
1125 |
+
|
1126 |
+
// 2A. Check if any custom MyListing taxonomy was detected
|
1127 |
+
$ml_taxonomies = mylisting_custom_taxonomies();
|
1128 |
+
|
1129 |
+
if(!empty($ml_taxonomies) && is_array($ml_taxonomies)) {
|
1130 |
+
$ml_taxonomies = array_keys($ml_taxonomies);
|
1131 |
+
|
1132 |
+
foreach($ml_taxonomies as $taxonomy) {
|
1133 |
+
if(!empty($query[$taxonomy]) && empty($_GET[$taxonomy])) {
|
1134 |
+
$new_query["explore_tab"] = $taxonomy;
|
1135 |
+
$new_query["explore_{$taxonomy}"] = $query['term'];
|
1136 |
+
}
|
1137 |
+
}
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// 2b. Check if any MyListing query var was detected
|
1141 |
+
$ml_query_vars = array(
|
1142 |
+
'explore_tag' => 'tags',
|
1143 |
+
'explore_region' => 'regions',
|
1144 |
+
'explore_category' => 'categories'
|
1145 |
+
);
|
1146 |
+
|
1147 |
+
foreach($ml_query_vars as $query_var => $explore_tab) {
|
1148 |
+
if(!empty($old_query[$query_var]) && empty($_GET[$query_var])) {
|
1149 |
+
$new_query[$query_var] = $old_query[$query_var];
|
1150 |
+
$new_query["explore_tab"] = $explore_tab;
|
1151 |
}
|
1152 |
}
|
1153 |
}
|
1154 |
|
1155 |
+
return (!empty($new_query["explore_tab"])) ? $new_query : $query;
|
1156 |
}
|
1157 |
|
1158 |
/**
|
1195 |
global $post, $wp_query, $wp, $pm_query;
|
1196 |
|
1197 |
// Check if Dokan is activated
|
1198 |
+
if(!function_exists('dokan_get_option') || is_admin() || empty($pm_query['id'])) { return; }
|
1199 |
|
1200 |
// Get Dokan dashboard page id
|
1201 |
$dashboard_page = dokan_get_option('dashboard', 'dokan_pages');
|
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+
|
@@ -12,7 +12,7 @@
|
|
12 |
* Text Domain: permalink-manager
|
13 |
* Domain Path: /languages
|
14 |
* WC requires at least: 3.0.0
|
15 |
-
* WC tested up to: 6.
|
16 |
*/
|
17 |
|
18 |
// If this file is called directly or plugin is already defined, abort.
|
@@ -25,7 +25,7 @@ if(!class_exists('Permalink_Manager_Class')) {
|
|
25 |
// Define the directories used to load plugin files.
|
26 |
define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'Permalink Manager' );
|
27 |
define( 'PERMALINK_MANAGER_PLUGIN_SLUG', 'permalink-manager' );
|
28 |
-
define( 'PERMALINK_MANAGER_VERSION', '2.2.
|
29 |
define( 'PERMALINK_MANAGER_FILE', __FILE__ );
|
30 |
define( 'PERMALINK_MANAGER_DIR', untrailingslashit(dirname(__FILE__)) );
|
31 |
define( 'PERMALINK_MANAGER_BASENAME', plugin_basename(__FILE__));
|
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.16
|
8 |
* Author: Maciej Bis
|
9 |
* Author URI: http://maciejbis.net/
|
10 |
* License: GPL-2.0+
|
12 |
* Text Domain: permalink-manager
|
13 |
* Domain Path: /languages
|
14 |
* WC requires at least: 3.0.0
|
15 |
+
* WC tested up to: 6.1.1
|
16 |
*/
|
17 |
|
18 |
// If this file is called directly or plugin is already defined, abort.
|
25 |
// Define the directories used to load plugin files.
|
26 |
define( 'PERMALINK_MANAGER_PLUGIN_NAME', 'Permalink Manager' );
|
27 |
define( 'PERMALINK_MANAGER_PLUGIN_SLUG', 'permalink-manager' );
|
28 |
+
define( 'PERMALINK_MANAGER_VERSION', '2.2.16' );
|
29 |
define( 'PERMALINK_MANAGER_FILE', __FILE__ );
|
30 |
define( 'PERMALINK_MANAGER_DIR', untrailingslashit(dirname(__FILE__)) );
|
31 |
define( 'PERMALINK_MANAGER_BASENAME', plugin_basename(__FILE__));
|