Custom Permalinks - Version 0.7.14

Version Description

  • Delete permalinks upon page/post deletion
Download this release

Release Info

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

Code changes from version 0.7.13 to 0.7.14

Files changed (2) hide show
  1. custom-permalinks.php +13 -1
  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.13
8
  Author: Michael Tyson
9
  Author URI: http://atastypixel.com/blog
10
  */
@@ -496,6 +496,17 @@ function custom_permalinks_save_term($term, $permalink) {
496
  update_option('custom_permalink_table', $table);
497
  }
498
 
 
 
 
 
 
 
 
 
 
 
 
499
 
500
  /**
501
  * Delete term
@@ -764,6 +775,7 @@ add_action( 'edited_post_tag', 'custom_permalinks_save_tag' );
764
  add_action( 'edited_category', 'custom_permalinks_save_category' );
765
  add_action( 'create_post_tag', 'custom_permalinks_save_tag' );
766
  add_action( 'create_category', 'custom_permalinks_save_category' );
 
767
  add_action( 'delete_post_tag', 'custom_permalinks_delete_term' );
768
  add_action( 'delete_post_category', 'custom_permalinks_delete_term' );
769
  add_action( 'admin_menu', 'custom_permalinks_setup_admin' );
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.14
8
  Author: Michael Tyson
9
  Author URI: http://atastypixel.com/blog
10
  */
496
  update_option('custom_permalink_table', $table);
497
  }
498
 
499
+ /**
500
+ * Delete post
501
+ *
502
+ * @package CustomPermalinks
503
+ * @since 0.7.14
504
+ * @author Piero <maltesepiero@gmail.com>
505
+ */
506
+ function custom_permalinks_delete_permalink( $id ){
507
+ global $wpdb;
508
+ $wpdb->query("DELETE FROM $wpdb->postmeta WHERE `meta_key` = 'custom_permalink' AND `post_id` = '".mysql_escape_string($id)."'");
509
+ }
510
 
511
  /**
512
  * Delete term
775
  add_action( 'edited_category', 'custom_permalinks_save_category' );
776
  add_action( 'create_post_tag', 'custom_permalinks_save_tag' );
777
  add_action( 'create_category', 'custom_permalinks_save_category' );
778
+ add_action( 'delete_post', 'custom_permalinks_delete_permalink', 10);
779
  add_action( 'delete_post_tag', 'custom_permalinks_delete_term' );
780
  add_action( 'delete_post_category', 'custom_permalinks_delete_term' );
781
  add_action( 'admin_menu', 'custom_permalinks_setup_admin' );
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.3.1
7
- Stable tag: 0.7.13
8
 
9
  Set custom permalinks on a per-post, per-tag or per-category basis.
10
 
@@ -29,6 +29,10 @@ within that category.
29
 
30
  == Changelog ==
31
 
 
 
 
 
32
  = 0.7.13 =
33
 
34
  * Fixed issue with term permalinks not working properly on some installations
4
  Tags: permalink, url, link, address, custom, redirect
5
  Requires at least: 2.6
6
  Tested up to: 3.3.1
7
+ Stable tag: 0.7.14
8
 
9
  Set custom permalinks on a per-post, per-tag or per-category basis.
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 0.7.14 =
33
+
34
+ * Delete permalinks upon page/post deletion
35
+
36
  = 0.7.13 =
37
 
38
  * Fixed issue with term permalinks not working properly on some installations