filtrod 5.6.0
wp_get_attachment_image
Opis — z kodu źródłowego
Filters the HTML img element representing an image attachment.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$html | string | HTML img element or empty string on failure. |
$attachment_id | int | Image attachment ID. |
$size | string | int[] | Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). |
$icon | bool | Whether the image should be treated as an icon. |
$attr | string[] | Array of attribute values for the image markup, keyed by attribute name. See wp_get_attachment_image(). |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_get_attachment_image', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_get_attachment_image', 'twoja_funkcja', 10, 5 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4, $param_5) {
// Twój kod
}Popularne w tej kategorii