image_make_intermediate_size

FUNCTION wp-includes\media.php (ligne 553) github
Filters whether to preempt calculating the image resize dimensions. Returning a non-null value from the filter will effectively short-circuit image_resize_dimensions(), returning that value instead.

Paramètres

Entrée :
$file, $width, $height, $crop = false
Sortie :
@param null|mixed $null   Whether to preempt output of the resize dimensions.
@param int        $orig_w Original width in pixels.
@param int        $orig_h Original height in pixels.
@param int        $dest_w New width in pixels.
@param int        $dest_h New height in pixels.
@param bool|array $crop   Whether to crop image to specified width and height or resize.
@param bool $proceed The filtered value.
@param int  $orig_w  Original image width.
@param int  $orig_h  Original image height.
@param string     $file   File path.
@param int        $width  Image width.
@param int        $height Image height.
@param bool|array $crop   {
@return array|false Metadata array on success. False if no image was created.

Utilisation

// Utilisation de la fonction image_make_intermediate_size
$result = image_make_intermediate_size($file, $width, $height, $crop = false);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...