Changeset 927089
- Timestamp:
- 06/05/2014 12:14:20 PM (12 years ago)
- Location:
- custom-permalinks
- Files:
-
- 4 added
- 2 edited
-
tags/0.7.19 (added)
-
tags/0.7.19/custom-permalinks.php (added)
-
tags/0.7.19/index.html (added)
-
tags/0.7.19/readme.txt (added)
-
trunk/custom-permalinks.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-permalinks/trunk/custom-permalinks.php
r869003 r927089 5 5 Donate link: http://atastypixel.com/blog/wordpress/plugins/custom-permalinks/ 6 6 Description: Set custom permalinks on a per-post basis 7 Version: 0.7.1 87 Version: 0.7.19 8 8 Author: Michael Tyson 9 9 Author URI: http://atastypixel.com/blog … … 161 161 if ( !$request ) return $query; 162 162 163 $sql = "SELECT $wpdb->posts.ID, $wpdb->postmeta.meta_value, $wpdb->posts.post_type FROM $wpdb->posts ". 163 // Queries are now WP3.9 compatible (by Steve from Sowmedia.nl) 164 $sql = $wpdb->prepare("SELECT $wpdb->posts.ID, $wpdb->postmeta.meta_value, $wpdb->posts.post_type FROM $wpdb->posts ". 164 165 "LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE ". 165 166 " meta_key = 'custom_permalink' AND ". 166 167 " meta_value != '' AND ". 167 " ( LOWER(meta_value) = LEFT(LOWER(' ".mysql_real_escape_string($request_noslash)."'), LENGTH(meta_value)) OR ".168 " LOWER(meta_value) = LEFT(LOWER(' ".mysql_real_escape_string($request_noslash."/")."'), LENGTH(meta_value)) ) ".168 " ( LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) OR ". 169 " LOWER(meta_value) = LEFT(LOWER('%s'), LENGTH(meta_value)) ) ". 169 170 " AND post_status != 'trash' AND post_type != 'nav_menu_item'". 170 171 " ORDER BY LENGTH(meta_value) DESC, ". 171 172 " FIELD(post_status,'publish','private','draft','auto-draft','inherit'),". 172 173 " FIELD(post_type,'post','page'),". 173 "$wpdb->posts.ID ASC LIMIT 1"; 174 "$wpdb->posts.ID ASC LIMIT 1", 175 $request_noslash, 176 $request_noslash."/" 177 ); 174 178 175 179 $posts = $wpdb->get_results($sql); … … 512 516 function custom_permalinks_delete_permalink( $id ){ 513 517 global $wpdb; 514 $wpdb->query("DELETE FROM $wpdb->postmeta WHERE `meta_key` = 'custom_permalink' AND `post_id` = '".mysql_real_escape_string($id)."'"); 518 // Queries are now WP3.9 compatible (by Steve from Sowmedia.nl) 519 $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE `meta_key` = 'custom_permalink' AND `post_id` = %d",$id)); 515 520 } 516 521 -
custom-permalinks/trunk/readme.txt
r869003 r927089 4 4 Tags: permalink, url, link, address, custom, redirect 5 5 Requires at least: 2.6 6 Tested up to: 3. 3.17 Stable tag: 0.7.1 86 Tested up to: 3.9 7 Stable tag: 0.7.19 8 8 9 9 Set custom permalinks on a per-post, per-tag or per-category basis. … … 29 29 30 30 == Changelog == 31 32 = 0.7.19 = 33 34 * WP 3.9 compatibility fix, thanks to Sowmedia 31 35 32 36 = 0.7.18 =
Note: See TracChangeset
for help on using the changeset viewer.