Title: wp_get_schedule
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_get_schedule( string $hook, array $args = array() ): string|false

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#wp--skip-link--target)

Retrieves the name of the recurrence schedule for an event.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#see-also)󠁿

 * [wp_get_schedules()](https://developer.wordpress.org/reference/functions/wp_get_schedules/):
   for available schedules.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#parameters)󠁿

 `$hook`stringrequired

Action hook to identify the event.

`$args`arrayoptional

Arguments passed to the event’s callback function.

Default:`array()`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#return)󠁿

 string|false Schedule name on success, false if no schedule.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#source)󠁿

    ```php
    function wp_get_schedule( $hook, $args = array() ) {
    	$schedule = false;
    	$event    = wp_get_scheduled_event( $hook, $args );

    	if ( $event ) {
    		$schedule = $event->schedule;
    	}

    	/**
    	 * Filters the schedule name for a hook.
    	 *
    	 * @since 5.1.0
    	 *
    	 * @param string|false $schedule Schedule for the hook. False if not found.
    	 * @param string       $hook     Action hook to execute when cron is run.
    	 * @param array        $args     Arguments to pass to the hook's callback function.
    	 */
    	return apply_filters( 'get_schedule', $schedule, $hook, $args );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/cron.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/cron.php#L1155)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/cron.php#L1155-L1173)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#hooks)󠁿

 [apply_filters( ‘get_schedule’, string|false $schedule, string $hook, array $args )](https://developer.wordpress.org/reference/hooks/get_schedule/)

Filters the schedule name for a hook.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_scheduled_event()](https://developer.wordpress.org/reference/functions/wp_get_scheduled_event/)`wp-includes/cron.php` |

Retrieves a scheduled event.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.1.0](https://developer.wordpress.org/reference/since/5.1.0/) | ['get_schedule'](https://developer.wordpress.org/reference/hooks/get_schedule/) filter added. | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#comment-content-944)
 2.    [Andrei G.](https://profiles.wordpress.org/27shutterclicks/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_schedule/#comment-944)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%23comment-944)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%23comment-944)
 4.  I suggest that maybe the documentation here should be updated to say that the 
     function returns false if no RECURRENCE.
 5.  I came across an issue lately with a plugin that was scheduling a single event
     and using [wp_get_schedule()](https://developer.wordpress.org/reference/functions/wp_get_schedule/)
     to check for the existence of a schedule.
 6.      ```php
         if ( !wp_get_schedule( 'groups_file_access_session_delete_transients' )) {
     
         			wp_schedule_single_event( time() + self::SCHEDULE, 'groups_file_access_session_delete_transients' );
         		}
         ```
     
 7.  It took me a while to understand that [wp_get_schedule()](https://developer.wordpress.org/reference/functions/wp_get_schedule/)
     does not return the actual timestamp like [wp_next_scheduled()](https://developer.wordpress.org/reference/functions/wp_next_scheduled/),
     but the recurrence value, if any (hourly, daily, etc.).
 8.  As such, in the example above, the scheduling of single events was happening on
     every single call, causing for the cron field in the database to become gigantic.
 9.  Since [wp_get_schedule()](https://developer.wordpress.org/reference/functions/wp_get_schedule/)
     seems to not see single events (since they have no recurrence) and will always
     return false for single events, it is somewhat confusing.
 10. I suspect people would expect for [wp_get_schedule()](https://developer.wordpress.org/reference/functions/wp_get_schedule/)
     to work like [wp_next_scheduled()](https://developer.wordpress.org/reference/functions/wp_next_scheduled/),
     but that’s not the case.
 11.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%3Freplytocom%3D944%23feedback-editor-944)
 12.  [Skip to note 4 content](https://developer.wordpress.org/reference/functions/wp_get_schedule/?output_format=md#comment-content-1286)
 13.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_schedule/#comment-1286)
 14. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%23comment-1286)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%23comment-1286)
 15. **Basic Examples**
 16.     ```php
         // If you previously added for example:
         // wp_schedule_event( current_time( 'timestamp' ), 'hourly', 'my_hourly_event' );
     
         $schedule = wp_get_schedule( 'my_hourly_event' );
     
         // $schedule == 'hourly'
     
         // Or this if you created something like this:
         // wp_schedule_single_event( current_time( 'timestamp' ), 'hourly', 'my_hourly_event', array( 'some_arg' ) );
     
         $schedule = wp_get_schedule( 'my_hourly_event', array( 'some_arg' ) );
     
         // $schedule == 'hourly'
         ```
     
 17.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F%3Freplytocom%3D1286%23feedback-editor-1286)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_schedule%2F)
before being able to contribute a note or feedback.