image_add_caption_text

FILTER wp-admin\includes\media.php (ligne 204) github
Filters the caption text. Note: If the caption text is empty, the caption shortcode will not be appended to the image HTML when inserted into the editor. Passing an empty value also prevents the {@see 'image_add_caption_shortcode'} Filters from being evaluated at the end of image_add_caption().

Paramètres

Entrée :
$caption, $id
Sortie :
@param string $caption The original caption text.
@param int    $id      The attachment ID.

Utilisation

// Modifier la valeur avec le filtre 'image_add_caption_text'
add_filter('image_add_caption_text', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($caption) {
    // Modifier la valeur
    return $caption;
}

Actualités

Chargement des actualités...