(context)_memory_limit
Filters the memory limit allocated for arbitrary contexts.
The dynamic portion of the hook name, $context, refers to an arbitrary context passed on calling the function. This allows for plugins to define their own contexts for raising the memory limit.
Использование
add_filter( '(context)_memory_limit', 'wp_kama_context_memory_limit_filter' ); /** * Function for `(context)_memory_limit` filter-hook. * * @param int|string $filtered_limit Maximum memory limit to allocate for images. or the original php.ini `memory_limit`, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'. * * @return int|string */ function wp_kama_context_memory_limit_filter( $filtered_limit ){ // filter... return $filtered_limit; }
- $filtered_limit(int|строка)
- Maximum memory limit to allocate for images. or the original php.ini memory_limit, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
По умолчанию: '256M'
Список изменений
С версии 4.6.0 | Введена. |
Где вызывается хук
wp-includes/functions.php 7537
$filtered_limit = apply_filters( "{$context}_memory_limit", $filtered_limit );