Custom Permalinks - Version 1.0.1

Version Description

  • Fixed issue with AMP Pages
Download this release

Release Info

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

Code changes from version 1.0 to 1.0.1

Files changed (3) hide show
  1. license.txt → LICENSE +5 -5
  2. custom-permalinks.php +2 -17
  3. readme.txt +5 -1
license.txt → LICENSE RENAMED
@@ -1,7 +1,7 @@
1
  GNU GENERAL PUBLIC LICENSE
2
  Version 2, June 1991
3
 
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
  Everyone is permitted to copy and distribute verbatim copies
7
  of this license document, but changing it is not allowed.
@@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
- <one line to give the program's name and a brief idea of what it does.>
294
- Copyright (C) <year> <name of author>
295
 
296
  This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
@@ -329,11 +329,11 @@ necessary. Here is a sample; alter the names:
329
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
 
332
- <signature of Ty Coon>, 1 April 1989
333
  Ty Coon, President of Vice
334
 
335
  This General Public License does not permit incorporating your program into
336
  proprietary programs. If your program is a subroutine library, you may
337
  consider it more useful to permit linking proprietary applications with the
338
  library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
1
  GNU GENERAL PUBLIC LICENSE
2
  Version 2, June 1991
3
 
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
  Everyone is permitted to copy and distribute verbatim copies
7
  of this license document, but changing it is not allowed.
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
 
296
  This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
329
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
 
332
+ {signature of Ty Coon}, 1 April 1989
333
  Ty Coon, President of Vice
334
 
335
  This General Public License does not permit incorporating your program into
336
  proprietary programs. If your program is a subroutine library, you may
337
  consider it more useful to permit linking proprietary applications with the
338
  library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
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
9
  * Author: Sami Ahmed Siddiqui
10
  * Author URI: https://www.yasglobal.com/web-design-development/wordpress/custom-permalinks/
11
  * Text Domain: custom-permalinks
@@ -174,22 +174,7 @@ function custom_permalinks_request($query) {
174
  $request = custom_permalinks_check_conflicts($request);
175
  $request_noslash = preg_replace('@/+@','/', trim($request, '/'));
176
 
177
- // Queries are now WP3.9 compatible (by Steve from Sowmedia.nl)
178
- /* $sql = $wpdb->prepare("SELECT $wpdb->posts.ID, $wpdb->postmeta.meta_value, $wpdb->posts.post_type, $wpdb->posts.post_status FROM $wpdb->posts ".
179
- "LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE ".
180
- " meta_key = 'custom_permalink' AND ".
181
- " meta_value != '' AND ".
182
- " ( LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) OR ".
183
- " LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) ) ".
184
- " AND post_status != 'trash' AND post_type != 'nav_menu_item'".
185
- " ORDER BY LENGTH(meta_value) DESC, ".
186
- " FIELD(post_status,'publish','private','draft','auto-draft','inherit'),".
187
- " FIELD(post_type,'post','page'),".
188
- "$wpdb->posts.ID ASC LIMIT 1",
189
- $request_noslash,
190
- $request_noslash."/"); */
191
-
192
- $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 (pm.meta_value = '%s' OR pm.meta_value = '%s') AND p.post_status != 'trash' AND p.post_type != 'nav_menu_item' LIMIT 1", $request_noslash, $request_noslash."/");
193
 
194
  $posts = $wpdb->get_results($sql);
195
 
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
  $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
 
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
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 =
38
 
39
  * Updated Query on the `custom_permalinks_request` Function
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
 
35
  == Changelog ==
36
 
37
+ = 1.0.1 =
38
+
39
+ * Fixed issue with AMP Pages
40
+
41
  = 1.0 =
42
 
43
  * Updated Query on the `custom_permalinks_request` Function