cron_memory_limit
Filter HookDescription
Filters the memory limit allocated for WP-Cron event processing.Hook Information
File Location |
wp-includes/functions.php
View on GitHub
|
Hook Type | Filter |
Line Number | 7890 |
Hook Parameters
Type | Name | Description |
---|---|---|
int|string
|
$filtered_limit
|
Maximum memory limit to allocate for WP-Cron. Default `WP_MAX_MEMORY_LIMIT` or the original php.ini `memory_limit`, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'. |
Usage Examples
Basic Usage
<?php
// Hook into cron_memory_limit
add_filter('cron_memory_limit', 'my_custom_filter', 10, 1);
function my_custom_filter($filtered_limit) {
// Your custom filtering logic here
return $filtered_limit;
}
Source Code Context
wp-includes/functions.php:7890
- How this hook is used in WordPress core
<?php
7885 * Default `WP_MAX_MEMORY_LIMIT` or the original
7886 * php.ini `memory_limit`, whichever is higher.
7887 * Accepts an integer (bytes), or a shorthand string
7888 * notation, such as '256M'.
7889 */
7890 $filtered_limit = apply_filters( 'cron_memory_limit', $filtered_limit );
7891 break;
7892
7893 default:
7894 /**
7895 * Filters the memory limit allocated for an arbitrary context.
PHP Documentation
<?php
/**
* Filters the memory limit allocated for WP-Cron event processing.
*
* @since 6.3.0
*
* @param int|string $filtered_limit Maximum memory limit to allocate for WP-Cron.
* Default `WP_MAX_MEMORY_LIMIT` or the original
* php.ini `memory_limit`, whichever is higher.
* Accepts an integer (bytes), or a shorthand string
* notation, such as '256M'.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/functions.php
Related Hooks
Related hooks will be displayed here in future updates.