WP HOOKS
filtrod 2.7.0

wp_get_attachment_link

Args 7Plik wp-includes/post-template.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters a retrieved attachment page link.

Parametry

ParametrTypOpis
$link_htmlstringThe page link HTML output.
$postint | \WP_PostPost ID or object. Can be 0 for the current global post.
$sizestring | int[]Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
$permalinkboolWhether to add permalink to image. Default false.
$iconboolWhether to include an icon.
$textstring | falseIf string, will be link text.
$attrarray | stringArray or string of attributes.

Wywołanie

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

function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5, $param_6, $param_7) {
	// Twój kod
}

Popularne w tej kategorii