Description
Republish posts from a chosen category, setting a new published time if required
Usage
oik_batchmove_category_republish( $cat, $time, $verbose );Parameters
- $cat
- ( string ) required – The Category ID to republish
- $time
- ( string ) required – the target time in format hh:mmm
- $verbose
- ( bool ) optional – whether or not to display activity
Returns
voidSource
File name: oik-batchmove/admin/oik-batchmove-cron.phpLines:
1 to 24 of 24
function oik_batchmove_category_republish( $cat, $time, $verbose=false ) { $post_date = oik_batchmove_query_oldest_date( $cat ); if ( $post_date ) { $posts = oik_batchmove_query_reposts( $post_date, $cat ); if ( $verbose ) { p( "Rescheduling posts for $post_date, category: $cat, time: $time" ); } if ( $posts ) { foreach ( $posts as $post ) { if ( $verbose ) { p( "Rescheduling: " . $post->ID ); } oik_batchmove_republish_post( $post, $cat, $time ); } } else { $posts = null; p( "No posts to reschedule: $cat" ); } } else { p( "No posts to reschedule for $cat" ); } }View on GitHub View on Trac
Called by
1 to 1 of 1
Invoked by
Calls
1 to 4 of 4
- oik_batchmove_query_oldest_date() – Find the oldest date for posts in this category and/or with this tag which are not marked as "_do_not_reschedule"
- oik_batchmove_query_reposts() – Query the posts to be published or republished
- oik_batchmove_republish_post() – Republish a post
- p() – Output a paragraph of translatable text
