wpseo_image_image_weight_limit
Filter: wpseo_image_image_weight_limit Determines what the maximum weight (in bytes) of an image is allowed to be, default is 2 MB.
Использование
add_filter( 'wpseo_image_image_weight_limit', 'wp_kama_wpseo_image_weight_limit_filter' ); /** * Function for `wpseo_image_image_weight_limit` filter-hook. * * @param int $max_bytes The maximum weight (in bytes) of an image. * * @return int */ function wp_kama_wpseo_image_weight_limit_filter( $max_bytes ){ // filter... return $max_bytes; }
- $max_bytes(int)
- The maximum weight (in bytes) of an image.
Где вызывается хук
wpseo_image_image_weight_limit
yoast/inc/class-wpseo-image-utils.php 191
$max_size = apply_filters( 'wpseo_image_image_weight_limit', 2097152 );