Changeset 470181
- Timestamp:
- 12/02/2011 10:59:59 AM (14 years ago)
- Location:
- revision-cleaner/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
revision-cleaner.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
revision-cleaner/trunk/readme.txt
r469862 r470181 4 4 Requires at least: 3.1 5 5 Tested up to: 3.2 6 Stable tag: 2.1 6 Stable tag: 2.1.1 7 7 License: GPLv2 or later 8 8 … … 24 24 3. Each user can set their own clean interval in Personal Profile. 25 25 26 == Frequently Asked Questions ==27 28 = How can I set my Interval =29 A:In your personal profile.30 26 31 27 … … 35 31 after you've translated it please send it to wordpress(at)mengzhuo.org, and attach with po file name by what your language called in English. 36 32 37 = Acknowledge=33 == Changelog == 38 34 39 == Changelog == 35 = 2.1.1 = 36 * Add:delete the old setting while not valid 37 * Fixed:the bug http://wordpress.org/support/topic/plugin-revision-cleaner-can-activate-the-plugin 40 38 41 39 = 2.1 = -
revision-cleaner/trunk/revision-cleaner.php
r469862 r470181 7 7 Plugin URI: http://wordpress.org/extend/plugins/revision-cleaner/ 8 8 Description: Auto clean your revisions while you don't needed any more 9 Version: 2.1 9 Version: 2.1.1 10 10 Author: Meng Zhuo 11 11 Author URI: http://mengzhuo.org … … 29 29 */ 30 30 //definition goes here... 31 define('REVISION_CLEANER_VERSION', '2.1 ');31 define('REVISION_CLEANER_VERSION', '2.1.1'); 32 32 define('REVISION_CLEANER_NAME','revision-cleaner'); 33 33 define('RevC_DEBUG',FALSE); … … 57 57 $Revis_Setting["neo_id"] = $admin_list[0]->ID; 58 58 } 59 return $Revis_Setting['neo_id']; 59 if ( isset($Revis_Setting["neo_id"]) && $Revis_Setting["neo_id"] > 0 ){ 60 return $Revis_Setting['neo_id']; 61 } 62 else{ 63 return 1; 64 } 65 60 66 } 61 67 … … 63 69 64 70 $neo_id = Revis_get_neo_id(); 65 71 72 66 73 $neo_setting = get_user_meta($neo_id,'Revis_Setting'); 67 74 if (isset($neo_setting[0])){ … … 87 94 } 88 95 else{ 89 if ( update_user_meta( $neo_id, 'Revis_Setting', $neo_setting) ) 90 return TRUE; 91 } 92 93 } 94 Revis_crazy_type(5,__FUNCTION__); 96 if ( update_user_meta( $neo_id, 'Revis_Setting', $neo_setting) ){ 97 return TRUE; 98 } 99 } 100 101 } 102 Revis_crazy_type(5,__FUNCTION__.'$neo_id='.$neo_id); 95 103 } 96 104 … … 245 253 } 246 254 255 function Revis_check_setting($global_setting){ 256 if (is_array($global_setting)){ 257 extract($global_setting); 258 if (isset($neo_id) && $neo_id > 0 ){ 259 return TRUE; 260 } 261 } 262 return FALSE; 263 } 264 247 265 function Revis_Cleaner() { 248 266 … … 250 268 $global_setting = get_option('Revis_Setting'); 251 269 252 if ( $global_setting){270 if ( $global_setting && Revis_check_setting($global_setting ) ){ 253 271 254 272 global $wpdb,$current_user; 255 256 //----For those users immigrant from 1.2----257 258 if (get_option('Revis_ctop') != FALSE ){259 //get what is set in old version260 $revis_interval = get_option('Revis_interval');261 $revis_keeplast = get_option('Revis_keeplast');262 $revis_ddr = get_option('Revis_delete_draft_revision');263 264 // update it into new form265 $admin_setting_array = array(266 'interval' => $revis_interval,267 'keep_draft_revision' => TRUE268 );269 update_user_meta( 1, 'Revis_Setting', $user_settting_array );270 271 //delete the old version's data272 delete_option('Revis_interval');273 delete_option('Revis_ctop');274 delete_option('Revis_keeplast');275 delete_option('Revis_ctop');276 277 //set new Setting, default multi_user is FALSE278 $initial_array = array(279 'multi_user' => FALSE,280 'version' => REVISION_CLEANER_VERSION281 );282 add_option('Revis_Setting',$initial_array,'','no');283 284 //initial other user's setting285 $wp_user_search = new WP_User_Query( array( 'exclude'=>array('id'=>1) ) );286 $authors = $wp_user_search->get_results();287 if ($authors[0]->ID != 1){288 foreach ( $authors as $author){289 Revis_update_author($author->ID,FALSE,TRUE);290 }291 }292 else{293 Revis_crazy_type(6,__FUNCTION__);294 }295 }296 //-----immigrant block end-----297 273 298 274 … … 339 315 'neo_id' => $neo_id 340 316 ); 317 delete_option('Revis_Setting'); 318 delete_option('Revis_Cleaned'); 341 319 add_option('Revis_Setting',$initial_array,'','no'); 342 320 add_option('Revis_Cleaned',0,'','no');
Note: See TracChangeset
for help on using the changeset viewer.