开发者 | johnh10 |
---|---|
更新时间 | 2024年6月18日 04:40 |
PHP版本: | 3.0 及以上 |
WordPress版本: | 6.3 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Auto Post Scheduler
directory to the /wp-content/plugins/
directorySettings -> Auto Post Scheduler
to set options and Enable the scheduler.This happens when another plugin incorrectly replaces cron_schedules with their own schedules instead of correctly adding to existing schedules, so the other plugin actually removes our aps_auto_hook. Other plugin code needs to be fixed.
WordPress calls WP_Cron on every page load to check for cron_schedules. If you have a high traffic site, you might want to use caching or set cron checks on a schedule instead to save on resources. See this post for more information. To do this:
define('DISABLE_WP_CRON', true);
*/5 * * * * wget -q -O -"http://www.mydomain.com/wp-cron.php?doing_wp_cron='date +\%s'" > /dev/null2>&1
As far as I know, WP Super Cache must not hook into when a post status has changed. User MassimoD reports "Quick Cache does, W3Total Cache does, Hyper Cache does, Gator Cache does. Only WP Super Cache doesn't."
Yes! In case you think of something that is not covered in the plugin settings, here are the available filter hooks:
function my_aps_eligible_change($args) { $args['tag'] = 'featured'; return $args; } add_filter( 'aps_eligible_query', 'my_aps_eligible_change' );
Example Usage #2: I want to add a post meta field when a post has been recycled.
Add this code snippet to your theme's functions.php file or equivalent.
function my_aps_recycle_post($args) { $postID = $args['ID']; add_post_meta( $postID, 'aps_recycled', 1, true ) || update_post_meta( $postID, 'aps_recycled', 1 ); return $args; } add_filter( 'aps_recycle_post', 'my_aps_recycle_post' );
Hopefully this table will help. Hopefully. ` Eligible Posts? Pick Random? Recycle Posts? RESULTS over multiple auto post checks drafts no no drafts ordered by date and published. if no drafts nothing happens. drafts yes no drafts picked randomly and published. if no drafts nothing happens. drafts no yes drafts ordered by date and published. if no drafts then published posts ordered by date and recycled. drafts yes yes drafts ordered randomly and published. if no drafts then published posts ordered by date and recycled. drafts, publish no no drafts and published posts are ordered by date and either published or recycled. drafts, publish yes no drafts and published posts are ordered randomly and either published or recycled. drafts, publish no yes drafts and published posts are ordered by date and either published or recycled. Recycle Posts does not apply since there are always eligible posts. drafts, publish yes yes drafts and published posts are ordered randomly and either published or recycled. Recycle Posts does not apply since there are always eligible posts. `