cron_schedules
Filter HookDescription
Filters the non-default cron schedules. Cron schedule information. } }Hook Information
File Location |
wp-includes/cron.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1136 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$new_schedules
|
{ An array of non-default cron schedules keyed by the schedule name. Default empty array. |
Usage Examples
Basic Usage
<?php
// Hook into cron_schedules
add_filter('cron_schedules', 'my_custom_filter', 10, 1);
function my_custom_filter($new_schedules) {
// Your custom filtering logic here
return $new_schedules;
}
Source Code Context
wp-includes/cron.php:1136
- How this hook is used in WordPress core
<?php
1131 * @type int $interval The schedule interval in seconds.
1132 * @type string $display The schedule display name.
1133 * }
1134 * }
1135 */
1136 return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
1137 }
1138
1139 /**
1140 * Retrieves the name of the recurrence schedule for an event.
1141 *
PHP Documentation
<?php
/**
* Filters the non-default cron schedules.
*
* @since 2.1.0
*
* @param array $new_schedules {
* An array of non-default cron schedules keyed by the schedule name. Default empty array.
*
* @type array ...$0 {
* Cron schedule information.
*
* @type int $interval The schedule interval in seconds.
* @type string $display The schedule display name.
* }
* }
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/cron.php
Related Hooks
Related hooks will be displayed here in future updates.