WP HOOKS
filtrod 4.1.0

image_add_caption_text

Args 2Plik wp-admin/includes/media.phpDokumentacja WP ↗

Opis — z kodu źródłowego

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().

Parametry

ParametrTypOpis
$captionstringThe original caption text.
$idintThe attachment ID.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'image_add_caption_text', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii