<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
thefrosty / wp-missed-schedule-publisher example snippets
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher;
add_action(MissedSchedulePublisher::ACTION_SCHEDULE_MISSED, static function(array $post_ids): void {
// Do something with the post ID's array.
});
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher;
add_action(MissedSchedulePublisher::ACTION_SCHEDULE_PUBLISH, static function(int $post_id, false | string $old_status): void {
$new_status = get_post_status($post_id);
// Maybe there was an issue publishing?
if ($old_status === $new_status) {
return;
}
// Do something with the $post_id.
});
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher;
// Lower it to only 10 (defaults to 20)
add_filter(MissedSchedulePublisher::FILTER_BATCH_LIMIT, static fn(): int => 10);
use TheFrosty\WpMissedSchedulePublisher\WpAdmin\MissedSchedulePublisher;
// Every hour (defaults to 15 minutes)
add_filter(MissedSchedulePublisher::FILTER_FREQUENCY, static fn(): int => \HOUR_IN_SECONDS);
// Every minute (defaults to 15 minutes)
add_filter(MissedSchedulePublisher::FILTER_FREQUENCY, static fn(): int => \MINUTE_IN_SECONDS);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.