Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren

wp_img_tag_add_width_and_height_attr ›

apply_filters( 'wp_img_tag_add_width_and_height_attr', true, $image, $context, $attachment_id )
Parameter: (4)
  • (bool) $value The filtered value, defaults to `true`.
    Erforderlich: Ja
  • (string) $image The HTML `img` tag where the attribute should be added.
    Erforderlich: Ja
  • (string) $context Additional context about how the function was called or where the img tag is.
    Erforderlich: Ja
  • (int) $attachment_id The image attachment ID.
    Erforderlich: Ja
Definiert in:

Filters whether to add the missing `width` and `height` HTML attributes to the img tag. Default `true`.

Returning anything else than true will not add the attributes.


$add = apply_filters( 'wp_img_tag_add_width_and_height_attr', true, $image, $context, $attachment_id );