Revision Control - Version 1.6

Version Description

  • oops, Forgot something from 1.5: If you set the page/posts's option to the same as the default, Then the per-page option is now forgotten.

=

Download this release

Release Info

Developer dd32
Plugin Icon wp plugin Revision Control
Version 1.6
Comparing to
See all releases

Code changes from version 1.5 to 1.6

Files changed (2) hide show
  1. readme.txt +3 -1
  2. revision-control.php +13 -4
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: dd32
3
  Tags: 2.6, revisions, post, admin
4
  Requires at least: 2.6
5
  Tested up to: 2.7-bleeding
6
- Stable tag: 1.5
7
 
8
  Revision Control allows finer control over the Post Revision system included with WordPress 2.6
9
 
@@ -30,6 +30,8 @@ The plugin also allows the deletion of specific revisions via the Revisions post
30
  * Skipped 1.4
31
  * Sticking option values should finally be fixed.
32
  * Thanks to Translators, Apologies to Translators for releasing 1.5 with changes before getting updated lang files
 
 
33
 
34
  == Screenshots ==
35
 
3
  Tags: 2.6, revisions, post, admin
4
  Requires at least: 2.6
5
  Tested up to: 2.7-bleeding
6
+ Stable tag: 1.6
7
 
8
  Revision Control allows finer control over the Post Revision system included with WordPress 2.6
9
 
30
  * Skipped 1.4
31
  * Sticking option values should finally be fixed.
32
  * Thanks to Translators, Apologies to Translators for releasing 1.5 with changes before getting updated lang files
33
+ = 1.6 =
34
+ * oops, Forgot something from 1.5: If you set the page/posts's option to the *same* as the default, Then the per-page option is now forgotten.
35
 
36
  == Screenshots ==
37
 
revision-control.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Revision Control
4
  Plugin URI: http://dd32.id.au/wordpress-plugins/revision-control/
5
  Description: Allows finer control over the number of Revisions stored on a global & per-post/page basis.
6
  Author: Dion Hulse
7
- Version: 1.5
8
  */
9
 
10
  /**
@@ -181,23 +181,32 @@ function rc_perpost_value($post_ID) {
181
 
182
  switch ( $_POST['revision-control'] ) {
183
  case 'true':
184
- if ( RC_REVISION_DEFAULT === true && '' === get_post_meta($post_ID, '_revision-control') )
 
 
185
  return;
 
186
 
187
  update_post_meta($post_ID, '_revision-control', true);
188
  $number_to_delete = false;
189
  break;
190
  case 'false':
191
- if ( RC_REVISION_DEFAULT === 0 && '' === get_post_meta($post_ID, '_revision-control') )
 
 
192
  return;
 
193
 
194
  update_post_meta($post_ID, '_revision-control', 0);
195
  $number_to_delete = 0;
196
  break;
197
  case 'number':
198
  $number_to_delete = (int)$_POST['revision-control-number'];
199
- if ( RC_REVISION_DEFAULT === $number_to_delete && '' === get_post_meta($post_ID, '_revision-control') )
 
 
200
  return;
 
201
 
202
  update_post_meta($post_ID, '_revision-control', $number_to_delete);
203
  break;
4
  Plugin URI: http://dd32.id.au/wordpress-plugins/revision-control/
5
  Description: Allows finer control over the number of Revisions stored on a global & per-post/page basis.
6
  Author: Dion Hulse
7
+ Version: 1.6
8
  */
9
 
10
  /**
181
 
182
  switch ( $_POST['revision-control'] ) {
183
  case 'true':
184
+ if ( RC_REVISION_DEFAULT === true ) {
185
+ if ('' !== get_post_meta($post_ID, '_revision-control') )
186
+ delete_post_meta($post_ID, '_revision-control');
187
  return;
188
+ }
189
 
190
  update_post_meta($post_ID, '_revision-control', true);
191
  $number_to_delete = false;
192
  break;
193
  case 'false':
194
+ if ( RC_REVISION_DEFAULT === 0 ) {
195
+ if ('' !== get_post_meta($post_ID, '_revision-control') )
196
+ delete_post_meta($post_ID, '_revision-control');
197
  return;
198
+ }
199
 
200
  update_post_meta($post_ID, '_revision-control', 0);
201
  $number_to_delete = 0;
202
  break;
203
  case 'number':
204
  $number_to_delete = (int)$_POST['revision-control-number'];
205
+ if ( RC_REVISION_DEFAULT === $number_to_delete ) {
206
+ if ('' !== get_post_meta($post_ID, '_revision-control') )
207
+ delete_post_meta($post_ID, '_revision-control');
208
  return;
209
+ }
210
 
211
  update_post_meta($post_ID, '_revision-control', $number_to_delete);
212
  break;