Version Description
- Minor change to permalink saving routine to fix some possible issues
- Fixed issue with %-encoded permalinks
Download this release
Release Info
Developer | michaeltyson |
Plugin | Custom Permalinks |
Version | 0.7.7 |
Comparing to | |
See all releases |
Code changes from version 0.7.6 to 0.7.7
- custom-permalinks.php +3 -15
- readme.txt +6 -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.
|
8 |
Author: Michael Tyson
|
9 |
Author URI: http://atastypixel.com/blog
|
10 |
*/
|
@@ -211,7 +211,7 @@ function custom_permalinks_request($query) {
|
|
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);
|
@@ -432,19 +432,7 @@ function custom_permalinks_save_post($id) {
|
|
432 |
$permalink_structure = get_option('permalink_structure');
|
433 |
|
434 |
if ( $_REQUEST['custom_permalink'] && $_REQUEST['custom_permalink'] != $original_link ) {
|
435 |
-
|
436 |
-
dirname($_REQUEST['custom_permalink']) == dirname($original_link) &&
|
437 |
-
($_REQUEST['custom_permalink']{strlen($_REQUEST['custom_permalink'])-1} == "/") == ($original_link{strlen($original_link)-1} == "/") ) {
|
438 |
-
// Just slug changed
|
439 |
-
$post = wp_get_single_post($id, ARRAY_A);
|
440 |
-
$new_name = basename($_REQUEST['custom_permalink']);
|
441 |
-
$new_name = wp_unique_post_slug($new_name, $id, $post['post_status'], $post['post_type'], $post['post_parent']);
|
442 |
-
|
443 |
-
global $wpdb;
|
444 |
-
$wpdb->update($wpdb->posts, array('post_name' => $new_name), array('ID' => $id));
|
445 |
-
} else {
|
446 |
-
add_post_meta( $id, 'custom_permalink', ltrim(stripcslashes($_REQUEST['custom_permalink']),"/") );
|
447 |
-
}
|
448 |
}
|
449 |
}
|
450 |
|
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.7
|
8 |
Author: Michael Tyson
|
9 |
Author URI: http://atastypixel.com/blog
|
10 |
*/
|
211 |
}
|
212 |
|
213 |
if ( $originalUrl ) {
|
214 |
+
$originalUrl = str_replace('//', '/', urldecode($originalUrl));
|
215 |
|
216 |
if ( ($pos=strpos($_SERVER['REQUEST_URI'], '?')) !== false ) {
|
217 |
$queryVars = substr($_SERVER['REQUEST_URI'], $pos+1);
|
432 |
$permalink_structure = get_option('permalink_structure');
|
433 |
|
434 |
if ( $_REQUEST['custom_permalink'] && $_REQUEST['custom_permalink'] != $original_link ) {
|
435 |
+
add_post_meta( $id, 'custom_permalink', ltrim(stripcslashes($_REQUEST['custom_permalink']),"/") );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
}
|
437 |
}
|
438 |
|
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.2.1
|
7 |
-
Stable tag: 0.7.
|
8 |
|
9 |
Set custom permalinks on a per-post, per-tag or per-category basis.
|
10 |
|
@@ -23,6 +23,11 @@ over your site structure.
|
|
23 |
|
24 |
== Changelog ==
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
= 0.7.6 =
|
27 |
|
28 |
* Fixed permalink saving issue when not using ".../%postname%" or similar permalink structure
|
4 |
Tags: permalink, url, link, address, custom, redirect
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.2.1
|
7 |
+
Stable tag: 0.7.7
|
8 |
|
9 |
Set custom permalinks on a per-post, per-tag or per-category basis.
|
10 |
|
23 |
|
24 |
== Changelog ==
|
25 |
|
26 |
+
= 0.7.7 =
|
27 |
+
|
28 |
+
* Minor change to permalink saving routine to fix some possible issues
|
29 |
+
* Fixed issue with %-encoded permalinks
|
30 |
+
|
31 |
= 0.7.6 =
|
32 |
|
33 |
* Fixed permalink saving issue when not using ".../%postname%" or similar permalink structure
|