Wicked Alt Text AI Guide

Wicked Alt Text AI Filters

Use these filters to modify be behavior of Wicked Alt Text AI.

wicked_alt_text_ai_generated_alt_text

This filter an be used to modify the alt text that was generated by AI.

apply_filters( 'wicked_alt_text_ai_generated_alt_text', $alt_text, $id )

Parameters

  • $alt_text
    (string) The alt text that was generated by AI.
  • $id
    (int) The ID of the image that the alt text was generated for.

wicked_alt_text_ai_generate_alt_text_language

Use to override the language that the alt text should be generated in.  Defaults to the site’s current language.

apply_filters( 'wicked_alt_text_ai_generate_alt_text_language', $language, $id )

Parameters

  • $language
    (string) The site’s current language.
  • $id
    (int) The ID of the image that the alt text is being generated for.

wicked_alt_text_ai_generate_alt_text_prompt

Use to override the prompt sent to AI to generate the alt text. The default prompt is as follows:

Provide a brief description of the image. Limit the description to no more than 30 words. Use the following language: <site’s currently configured language>

apply_filters( 'wicked_alt_text_ai_generate_alt_text_prompt', $prompt, $id )

Parameters

  • $prompt
    (string) The prompt sent to AI requesting alt text to be generated.
  • $id
    (int) The ID of the image that the alt text is being generated for.

wicked_alt_text_ai_should_generate_alt_text

Use this filter to control whether or not to generate alt text for a specific image.

apply_filters( 'wicked_alt_text_ai_should_generate_alt_text', $generate = true, $id )

Parameters

  • $generate
    (bool) Whether or not to generate alt text. Return false to prevent alt text from being generated for the image.
  • $id
    (int) The ID of the image.