filtrod 5.5.0
wp_img_tag_add_srcset_and_sizes_attr
Opis — z kodu źródłowego
Filters whether to add the `srcset` and `sizes` HTML attributes to the img tag. Default `true`.
Returning anything else than true will not add the attributes.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | bool | The filtered value, defaults to <code>true</code>. |
$image | string | The HTML <code>img</code> tag where the attribute should be added. |
$context | string | Additional context about how the function was called or where the img tag is. |
$attachment_id | int | The image attachment ID. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_img_tag_add_srcset_and_sizes_attr', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'wp_img_tag_add_srcset_and_sizes_attr', 'twoja_funkcja', 10, 4 );
function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
// Twój kod
}Popularne w tej kategorii