PHP Класс Automattic\WP\Cron_Control\Cron_Options_CPT

Наследование: extends Singleton
Показать файл Открыть проект

Открытые методы

Метод Описание
create_or_update_job ( $timestamp, $action, $args, $update_id = null ) Create a post object for a given event
get_option ( ) Override cron option requests with data from CPT
job_exists ( $timestamp, $action, $instance, $return_id = false ) Check if a job post exists
mark_job_completed ( $timestamp, $action, $instance ) : boolean Mark an event's CPT entry as completed
register_post_type ( ) Register a private post type to store cron events
update_option ( $new_value, $old_value ) Handle requests to update the cron option

Защищенные методы

Метод Описание
class_init ( ) Register hooks

Приватные методы

Метод Описание
convert_option ( $new_value ) Save cron events in CPT
event_name ( $timestamp, $action, $instance ) Generate a standardized post name from an event's arguments
event_title ( $timestamp, $action, $instance ) Generate a standardized, human-readable post title from an event's arguments
find_unscheduled_jobs ( $new, $old ) Identify jobs unscheduled using wp_unschedule_event() by comparing current value with previous
get_jobs ( $args ) Retrieve list of jobs, respecting whether or not the CPT is registered
is_unscheduling ( ) Determine if current request is a call to wp_unschedule_event()
mark_job_post_completed ( $job_post_id, $flush_cache = true ) Set a job post to the "completed" status
unschedule_job ( $new_value, $old_value ) Delete jobs that are unscheduled using wp_unschedule_event()

Описание методов

class_init() защищенный метод

Register hooks
protected class_init ( )

create_or_update_job() публичный метод

Can't call wp_insert_post() because wp_unique_post_slug() breaks the plugin's expectations Also doesn't call wp_insert_post() because this function is needed before post types and capabilities are ready.
public create_or_update_job ( $timestamp, $action, $args, $update_id = null )

get_option() публичный метод

Override cron option requests with data from CPT
public get_option ( )

job_exists() публичный метод

Uses a direct query to avoid stale caches that result in duplicate events
public job_exists ( $timestamp, $action, $instance, $return_id = false )

mark_job_completed() публичный метод

Trashed posts will be cleaned up by an internal job
public mark_job_completed ( $timestamp, $action, $instance ) : boolean
$timestamp int Unix timestamp
$action string name of action used when the event is registered (unhashed)
$instance string md5 hash of the event's arguments array, which Core uses to index the `cron` option
Результат boolean

register_post_type() публичный метод

Register a private post type to store cron events
public register_post_type ( )

update_option() публичный метод

By returning $old_value, cron option won't be updated
public update_option ( $new_value, $old_value )