Skip to content

wpt_uploaded_image_alt

github-actions[bot] edited this page Jun 14, 2026 · 1 revision

Add alt attributes to uploaded images.

Auto-generated Example

add_filter(
   'wpt_uploaded_image_alt',
    function(
        string $alt_text,
        int $attachment
    ) {
        // Your code here.
        return $alt_text;
    },
    10,
    2
);

Parameters

  • string $alt_text Text stored in media library as alt.
  • int $attachment Attachment ID.

Returns

string

Files

apply_filters( 'wpt_uploaded_image_alt', $alt_text, $attachment )
apply_filters( 'wpt_uploaded_image_alt', $alt_text, $attachment )
apply_filters( 'wpt_uploaded_image_alt', $alt_text, $attachment )

← All Hooks

Clone this wiki locally