image_memory_limit
Filters the memory limit allocated for image manipulation.
Использование
add_filter( 'image_memory_limit', 'wp_kama_image_memory_limit_filter' );
/**
* Function for `image_memory_limit` filter-hook.
*
* @param int|string $filtered_limit Maximum memory limit to allocate for image processing.ini `memory_limit`, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
*
* @return int|string
*/
function wp_kama_image_memory_limit_filter( $filtered_limit ){
// filter...
return $filtered_limit;
}
- $filtered_limit(int|строка)
- Maximum memory limit to allocate for image processing.ini memory_limit, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
По умолчанию: WP_MAX_MEMORY_LIMIT or the original php
Список изменений
| С версии 3.5.0 | Введена. |
| С версии 4.6.0 | The default now takes the original memory_limit into account. |
Где вызывается хук
wp-includes/functions.php 7895
$filtered_limit = apply_filters( 'image_memory_limit', $filtered_limit );