ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup()
Schedules the WP Post comment table cleanup to run in 6 months if it's not already scheduled. Attached to the migration complete hook 'action_scheduler/migration_complete'.
Метод класса: ActionScheduler_WPCommentCleaner{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup();
Код ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup() ActionScheduler WPCommentCleaner::maybe schedule cleanup WC 8.7.0
public static function maybe_schedule_cleanup() { if ( (bool) get_comments( array( 'type' => ActionScheduler_wpCommentLogger::TYPE, 'number' => 1, 'fields' => 'ids' ) ) ) { update_option( self::$has_logs_option_key, 'yes' ); if ( ! as_next_scheduled_action( self::$cleanup_hook ) ) { as_schedule_single_action( gmdate( 'U' ) + ( 6 * MONTH_IN_SECONDS ), self::$cleanup_hook ); } } }