• Hello,

    I need to update a JS function that needs to check if an image has a specific class or not and then change something.

    The behavior must be different for images that link to other pages/subpages, and for images that link to media files.

    I see that image_default_link_type seems to have only 2 parameters, none and file. Is that true?

    How can I add a class only to images that link to other pages (not to files)?

Viewing 1 replies (of 1 total)
  • The default is unrelated to the end result.

    Images don’t link anywhere, so you must be checking if there is a link wrapping the image.
    The link is to a file if it has certain extensions, and is a page otherwise.

Viewing 1 replies (of 1 total)
  • The topic ‘get_option( ‘image_default_link_type’ – how to detect if the image is linked?’ is closed to new replies.