Custom Permalinks - Version 0.7.3

Version Description

  • Fix problem with /page/# URLs on WP 3.1.3
Download this release

Release Info

Developer michaeltyson
Plugin Icon Custom Permalinks
Version 0.7.3
Comparing to
See all releases

Code changes from version 0.7.2 to 0.7.3

Files changed (2) hide show
  1. custom-permalinks.php +5 -3
  2. readme.txt +5 -1
custom-permalinks.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Permalinks
4
  Plugin URI: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
5
  Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
6
  Description: Set custom permalinks on a per-post basis
7
- Version: 0.7.2
8
  Author: Michael Tyson
9
  Author URI: http://atastypixel.com/blog
10
  */
@@ -183,11 +183,13 @@ function custom_permalinks_request($query) {
183
  }
184
 
185
  if ( !$originalUrl ) {
 
186
  $table = get_option('custom_permalink_table');
187
  if ( !$table ) return $query;
188
 
189
  foreach ( array_keys($table) as $permalink ) {
190
- if ( $permalink == substr($request_noslash, 0, strlen($permalink)) || $permalink == substr($request_noslash."/", 0, strlen($permalink)) ) {
 
191
  $term = $table[$permalink];
192
 
193
  // Preserve this url for later if it's the same as the permalink (no extra stuff)
@@ -209,6 +211,7 @@ function custom_permalinks_request($query) {
209
  }
210
 
211
  if ( $originalUrl ) {
 
212
 
213
  if ( ($pos=strpos($_SERVER['REQUEST_URI'], '?')) !== false ) {
214
  $queryVars = substr($_SERVER['REQUEST_URI'], $pos+1);
@@ -358,7 +361,6 @@ function custom_permalinks_page_options() {
358
  * @since 0.1
359
  */
360
  function custom_permalinks_term_options($object) {
361
-
362
  $permalink = custom_permalinks_permalink_for_term($object->term_id);
363
 
364
  if ( $object->term_id ) {
4
  Plugin URI: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
5
  Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
6
  Description: Set custom permalinks on a per-post basis
7
+ Version: 0.7.3
8
  Author: Michael Tyson
9
  Author URI: http://atastypixel.com/blog
10
  */
183
  }
184
 
185
  if ( !$originalUrl ) {
186
+ // See if any terms have a matching permalink
187
  $table = get_option('custom_permalink_table');
188
  if ( !$table ) return $query;
189
 
190
  foreach ( array_keys($table) as $permalink ) {
191
+ if ( $permalink == substr($request_noslash, 0, strlen($permalink)) ||
192
+ $permalink == substr($request_noslash."/", 0, strlen($permalink)) ) {
193
  $term = $table[$permalink];
194
 
195
  // Preserve this url for later if it's the same as the permalink (no extra stuff)
211
  }
212
 
213
  if ( $originalUrl ) {
214
+ $originalUrl = str_replace('//', '/', $originalUrl);
215
 
216
  if ( ($pos=strpos($_SERVER['REQUEST_URI'], '?')) !== false ) {
217
  $queryVars = substr($_SERVER['REQUEST_URI'], $pos+1);
361
  * @since 0.1
362
  */
363
  function custom_permalinks_term_options($object) {
 
364
  $permalink = custom_permalinks_permalink_for_term($object->term_id);
365
 
366
  if ( $object->term_id ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/
4
  Tags: permalink, url, link, address, custom, redirect
5
  Requires at least: 2.6
6
  Tested up to: 3.1.2
7
- Stable tag: 0.7.2
8
 
9
  Set custom permalinks on a per-post, per-tag or per-category basis.
10
 
@@ -23,6 +23,10 @@ over your site structure.
23
 
24
  == Changelog ==
25
 
 
 
 
 
26
  = 0.7.2 =
27
 
28
  * Don't clobber query parameters when redirecting to the custom permalink from the original URL
4
  Tags: permalink, url, link, address, custom, redirect
5
  Requires at least: 2.6
6
  Tested up to: 3.1.2
7
+ Stable tag: 0.7.3
8
 
9
  Set custom permalinks on a per-post, per-tag or per-category basis.
10
 
23
 
24
  == Changelog ==
25
 
26
+ = 0.7.3 =
27
+
28
+ * Fix problem with /page/# URLs on WP 3.1.3
29
+
30
  = 0.7.2 =
31
 
32
  * Don't clobber query parameters when redirecting to the custom permalink from the original URL