Changeset 1047423
- Timestamp:
- 12/17/2014 07:24:04 PM (11 years ago)
- Location:
- content-scheduler/trunk
- Files:
-
- 2 edited
-
content-scheduler.php (modified) (6 diffs)
-
includes/process-expirations.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
content-scheduler/trunk/content-scheduler.php
r1047421 r1047423 219 219 // Test for the event already existing before you schedule the event again 220 220 // for expirations 221 // NOTE: The following is only valid for multisite because of the current_blog_id var 222 /* 221 223 if( !wp_next_scheduled( 'contentscheduler'.$current_blog_id ) ) { 222 224 // NOTE: For some reason there seems to be a problem on some systems where the hook must not contain underscores or uppercase characters. … … 228 230 // wp_schedule_event( time(), 'contsched_usertime', 'contentschedulernotify'.$current_blog_id ); 229 231 } 232 */ 233 // non-multisite version 234 if( !wp_next_scheduled( 'contentscheduler' ) ) { 235 // NOTE: For some reason there seems to be a problem on some systems where the hook must not contain underscores or uppercase characters. 236 // We previously used content_scheduler_(blogid) 237 // http://codex.wordpress.org/Function_Reference/wp_schedule_event 238 wp_schedule_event( time(), 'contsched_usertime', 'contentscheduler' ); 239 // wp_schedule_event( time(), 'hourly', 'content_scheduler_'.$current_blog_id ); 240 // TODO 241 // wp_schedule_event( time(), 'contsched_usertime', 'contentschedulernotify'.$current_blog_id ); 242 } 230 243 } // end activate_function 231 244 … … 238 251 $current_blog_id = get_current_blog_id(); 239 252 // it is a networked site activation 253 // NOTE: Multisite version 254 /* 240 255 // for expirations 241 256 wp_clear_scheduled_hook('contentscheduler'.$current_blog_id); 242 257 // for notifications 243 258 wp_clear_scheduled_hook('contentschedulernotify'.$current_blog_id); 259 */ 260 // non-multisite version 261 // for expirations 262 wp_clear_scheduled_hook('contentscheduler'); 263 // for notifications 264 wp_clear_scheduled_hook('contentschedulernotify'); 265 244 266 } // end deactivate_function() 245 267 … … 620 642 function answer_expiration_event() 621 643 { 644 if( PEK_CONTENT_SCHEDULER_VERSION ) { 645 error_log( __FILE__ . " :: " . __FUNCTION__ . " Top" ); 646 } 622 647 // we should get our options right now, and decide if we need to proceed or not. 623 648 $options = get_option('ContentScheduler_Options'); … … 627 652 // We need to process expirations 628 653 $this->process_expirations(); 629 } // end if 654 } else { 655 if( PEK_CONTENT_SCHEDULER_VERSION ) { 656 error_log( "Expiration status is HOLD, so we won't process" ); 657 } 658 } 659 630 660 } 631 661 // Respond to a call from wp-cron checking for valid notification rules … … 642 672 function process_expirations() 643 673 { 674 if( PEK_CONTENT_SCHEDULER_VERSION ) { 675 error_log( __FILE__ . " :: " . __FUNCTION__ . " Top" ); 676 } 644 677 // Check database for posts meeting expiration criteria 645 678 // Hand them off to appropriate functions -
content-scheduler/trunk/includes/process-expirations.php
r1047421 r1047423 25 25 if ( ! empty( $result ) ) 26 26 { 27 if( PEK_CONTENT_SCHEDULER_VERSION ) { 28 error_log( __FILE__ . " :: " . __FUNCTION__ . " Top" ); 29 error_log( "We got results from our query" ); 30 error_log( count( $result ) . " results were fetched" ); 31 } 32 27 33 // See if we are supposed to NOTIFY upon expiration 28 34 // we do this in its own loop before deleting … … 43 49 if( $options['exp-status'] == '2' ) 44 50 { 51 if( PEK_CONTENT_SCHEDULER_VERSION ) { 52 error_log( __FILE__ . " :: " . __FUNCTION__ . " Top" ); 53 error_log( "We're only supposed to delete these" ); 54 } 45 55 // Delete all those posts 46 56 foreach ( $result as $cur_post ) … … 52 62 else 53 63 { 64 if( PEK_CONTENT_SCHEDULER_VERSION ) { 65 error_log( __FILE__ . " :: " . __FUNCTION__ . " Top" ); 66 error_log( "We're supposed to fully process these" ); 67 } 54 68 // Proceed with the updating process 55 69 // step through the results
Note: See TracChangeset
for help on using the changeset viewer.