Custom Permalinks - Version 1.2.15

Version Description

  • Added filter which can be used to add PATH_INFO in $_SERVER Variable
Download this release

Release Info

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

Code changes from version 1.2.14 to 1.2.15

custom-permalinks-main.php CHANGED
@@ -15,7 +15,7 @@ if ( ! function_exists( 'add_action' ) || ! function_exists( 'add_filter' ) ) {
15
  exit();
16
  }
17
 
18
- define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.14' );
19
 
20
  if ( ! defined( 'CUSTOM_PERMALINKS_PATH' ) ) {
21
  define( 'CUSTOM_PERMALINKS_PATH', plugin_dir_path( CUSTOM_PERMALINKS_FILE ) );
15
  exit();
16
  }
17
 
18
+ define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.15' );
19
 
20
  if ( ! defined( 'CUSTOM_PERMALINKS_PATH' ) ) {
21
  define( 'CUSTOM_PERMALINKS_PATH', plugin_dir_path( CUSTOM_PERMALINKS_FILE ) );
custom-permalinks.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Custom Permalinks
4
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
5
  * Description: Set custom permalinks on a per-post basis
6
- * Version: 1.2.14
7
  * Author: Sami Ahmed Siddiqui
8
  * Author URI: https://www.custompermalinks.com/
9
  * Donate link: https://www.paypal.me/yasglobal
3
  * Plugin Name: Custom Permalinks
4
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
5
  * Description: Set custom permalinks on a per-post basis
6
+ * Version: 1.2.15
7
  * Author: Sami Ahmed Siddiqui
8
  * Author URI: https://www.custompermalinks.com/
9
  * Donate link: https://www.paypal.me/yasglobal
frontend/class-custom-permalinks-frontend.php CHANGED
@@ -192,8 +192,11 @@ class Custom_Permalinks_Frontend {
192
  if ( isset( $_SERVER['QUERY_STRING'] ) ) {
193
  $old_query_string = $_SERVER['QUERY_STRING'];
194
  }
195
- $_SERVER['REQUEST_URI'] = '/' . ltrim( $original_url, '/' );
196
- $_SERVER['PATH_INFO'] = '/' . ltrim( $original_url, '/' );
 
 
 
197
  $_SERVER['QUERY_STRING'] = ( ( $pos = strpos( $original_url, '?' ) ) !== false ? substr( $original_url, $pos + 1 ) : '' );
198
  parse_str( $_SERVER['QUERY_STRING'], $query_array );
199
  $old_values = array();
192
  if ( isset( $_SERVER['QUERY_STRING'] ) ) {
193
  $old_query_string = $_SERVER['QUERY_STRING'];
194
  }
195
+ $_SERVER['REQUEST_URI'] = '/' . ltrim( $original_url, '/' );
196
+ $path_info = apply_filters( 'custom_permalinks_path_info', '__false' );
197
+ if ( '__false' !== $path_info ) {
198
+ $_SERVER['PATH_INFO'] = '/' . ltrim( $original_url, '/' );
199
+ }
200
  $_SERVER['QUERY_STRING'] = ( ( $pos = strpos( $original_url, '?' ) ) !== false ? substr( $original_url, $pos + 1 ) : '' );
201
  parse_str( $_SERVER['QUERY_STRING'], $query_array );
202
  $old_values = array();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/yasglobal
4
  Tags: permalink, url, link, address, custom, redirect, custom post type
5
  Requires at least: 2.6
6
  Tested up to: 4.9
7
- Stable tag: 1.2.14
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl.html
10
 
@@ -60,6 +60,11 @@ add_filter( 'custom_permalinks_like_query', '__return_true');
60
 
61
  Note: Use `custom_permalinks_like_query` filter if the URLs doesn't works for you after upgrading to v1.2.9
62
 
 
 
 
 
 
63
  === Thanks for the Support ===
64
 
65
  I does not always provide active support for the Custom Permalinks plugin on the WordPress.org forums, as i have prioritize the email support.
@@ -88,6 +93,10 @@ This process defines you the steps to follow either you are installing through W
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = 1.2.14 =
92
 
93
  * Enhancement
4
  Tags: permalink, url, link, address, custom, redirect, custom post type
5
  Requires at least: 2.6
6
  Tested up to: 4.9
7
+ Stable tag: 1.2.15
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl.html
10
 
60
 
61
  Note: Use `custom_permalinks_like_query` filter if the URLs doesn't works for you after upgrading to v1.2.9
62
 
63
+ To add `PATH_INFO` in `$_SERVER` Variable just add this line in your theme's functions.php:
64
+ `
65
+ add_filter( 'custom_permalinks_path_info', '__return_true');
66
+ `
67
+
68
  === Thanks for the Support ===
69
 
70
  I does not always provide active support for the Custom Permalinks plugin on the WordPress.org forums, as i have prioritize the email support.
93
 
94
  == Changelog ==
95
 
96
+ = 1.2.15 =
97
+
98
+ * Added filter which can be used to add PATH_INFO in $_SERVER Variable
99
+
100
  = 1.2.14 =
101
 
102
  * Enhancement