# wp_next_scheduled()

URL: https://chugunov.pro/api-wordpress/functions/wp_next_scheduled/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.1.0.

## Сигнатура

```php
wp_next_scheduled( string $hook, array $args = array() ): int|false
```

## Описание

Получает временную метку следующего запланированного события для указанного хука.

## Параметры

- `$hook` `string` — обязательный. Хук-действие события.
- `$args` `array` — необязательный, по умолчанию `array()`. Массив, содержащий каждый отдельный аргумент для передачи в функцию обратного вызова хука.
  
  Хотя эти аргументы не передаются в функцию обратного вызова, они используются для однозначной идентификации события, поэтому должны совпадать с теми, что использовались при первоначальном планировании события. Если аргументы не совпадают в точности, событие не будет найдено.

## Возвращаемое значение

`int|false`

## Исходный код

Файл: `wp-includes/cron.php:859`

```php
function wp_next_scheduled( $hook, $args = array() ) {
	$next_event = wp_get_scheduled_event( $hook, $args );

	if ( ! $next_event ) {
		return false;
	}

	/**
	 * Filters the timestamp of the next scheduled event for the given hook.
	 *
	 * @since 6.8.0
	 *
	 * @param int    $timestamp  Unix timestamp (UTC) for when to next run the event.
	 * @param object $next_event {
	 *     An object containing an event's data.
	 *
	 *     @type string $hook      Action hook of the event.
	 *     @type int    $timestamp Unix timestamp (UTC) for when to next run the event.
	 *     @type string $schedule  How often the event should subsequently recur.
	 *     @type array  $args      Array containing each separate argument to pass to the hook
	 *                             callback function.
	 *     @type int    $interval  Optional. The interval time in seconds for the schedule. Only
	 *                             present for recurring events.
	 * }
	 * @param string $hook       Action hook of the event.
	 * @param array  $args       Array containing each separate argument to pass to the hook
	 *                           callback function.
	 */
	return apply_filters( 'wp_next_scheduled', $next_event->timestamp, $next_event, $hook, $args );
}
```

## История изменений

- 2.1.0 — Introduced.

## Связанные

Использует: [`wp_get_scheduled_event`](https://chugunov.pro/api-wordpress/functions/wp_get_scheduled_event/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `WP_Upgrader::schedule_temp_backup_cleanup`, [`wp_schedule_update_user_counts`](https://chugunov.pro/api-wordpress/functions/wp_schedule_update_user_counts/), [`wp_get_auto_update_message`](https://chugunov.pro/api-wordpress/functions/wp_get_auto_update_message/), `WP_Site_Health::maybe_create_scheduled_event`, `WP_Recovery_Mode::initialize`, [`wp_schedule_delete_old_privacy_export_files`](https://chugunov.pro/api-wordpress/functions/wp_schedule_delete_old_privacy_export_files/), [`populate_network`](https://chugunov.pro/api-wordpress/functions/populate_network/), [`get_default_post_to_edit`](https://chugunov.pro/api-wordpress/functions/get_default_post_to_edit/), [`wp_schedule_update_checks`](https://chugunov.pro/api-wordpress/functions/wp_schedule_update_checks/), [`wp_version_check`](https://chugunov.pro/api-wordpress/functions/wp_version_check/), [`_publish_post_hook`](https://chugunov.pro/api-wordpress/functions/_publish_post_hook/), [`wp_schedule_update_network_counts`](https://chugunov.pro/api-wordpress/functions/wp_schedule_update_network_counts/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_next_scheduled/
