Custom Permalinks - Version 1.0.2

Version Description

  • Fixed Notice and some URL Issues
Download this release

Release Info

Developer sasiddiqui
Plugin Icon Custom Permalinks
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

Files changed (2) hide show
  1. custom-permalinks.php +2 -2
  2. readme.txt +5 -1
custom-permalinks.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
6
  * Donate link: https://www.paypal.me/yasglobal
7
  * Description: Set custom permalinks on a per-post basis
8
- * Version: 1.0.1
9
  * Author: Sami Ahmed Siddiqui
10
  * Author URI: https://www.yasglobal.com/web-design-development/wordpress/custom-permalinks/
11
  * Text Domain: custom-permalinks
@@ -174,7 +174,7 @@ function custom_permalinks_request($query) {
174
  $request = custom_permalinks_check_conflicts($request);
175
  $request_noslash = preg_replace('@/+@','/', trim($request, '/'));
176
 
177
- $sql = $wpdb->prepare("SELECT p.ID as ID, pm.meta_value as meta_value, p.post_type as post_type, p.post_status as post_status FROM $wpdb->posts AS p, $wpdb->postmeta AS pm WHERE p.ID = pm.post_id AND pm.meta_key = 'custom_permalink' AND ( LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) OR LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) ) AND p.post_status != 'trash' AND p.post_type != 'nav_menu_item' LIMIT 1", $request_noslash, $request_noslash."/");
178
 
179
  $posts = $wpdb->get_results($sql);
180
 
5
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
6
  * Donate link: https://www.paypal.me/yasglobal
7
  * Description: Set custom permalinks on a per-post basis
8
+ * Version: 1.0.2
9
  * Author: Sami Ahmed Siddiqui
10
  * Author URI: https://www.yasglobal.com/web-design-development/wordpress/custom-permalinks/
11
  * Text Domain: custom-permalinks
174
  $request = custom_permalinks_check_conflicts($request);
175
  $request_noslash = preg_replace('@/+@','/', trim($request, '/'));
176
 
177
+ $sql = $wpdb->prepare("SELECT p.ID as ID, pm.meta_value as meta_value, p.post_type as post_type, p.post_status as post_status FROM $wpdb->posts AS p, $wpdb->postmeta AS pm WHERE p.ID = pm.post_id AND pm.meta_key = 'custom_permalink' AND meta_value != '' AND ( LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) OR LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) ) AND p.post_status != 'trash' AND p.post_type != 'nav_menu_item' ORDER BY LENGTH(meta_value) DESC, p.ID LIMIT 1", $request_noslash, $request_noslash."/");
178
 
179
  $posts = $wpdb->get_results($sql);
180
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.paypal.me/yasglobal
5
  Tags: permalink, url, link, address, custom, redirect, custom post type
6
  Requires at least: 2.6
7
  Tested up to: 4.8
8
- Stable tag: 1.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -34,6 +34,10 @@ within that category.
34
 
35
  == Changelog ==
36
 
 
 
 
 
37
  = 1.0.1 =
38
 
39
  * Fixed issue with AMP Pages
5
  Tags: permalink, url, link, address, custom, redirect, custom post type
6
  Requires at least: 2.6
7
  Tested up to: 4.8
8
+ Stable tag: 1.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
34
 
35
  == Changelog ==
36
 
37
+ = 1.0.2 =
38
+
39
+ * Fixed Notice and some URL Issues
40
+
41
  = 1.0.1 =
42
 
43
  * Fixed issue with AMP Pages