Support » Fixing WordPress » WP2.6 Captions question

  • So version 2.6 has added this automatic captions to images. Not sure if I like that. Of course all images need an alt tag, but why is this automatically providing a caption to the image as well? Seems to me that a caption should be its own field, not tied to the alt tag field.

    Is there no way to remove a caption but via the HTML editor? Is there no way to prevent a caption from being added to an image in the first place?

Viewing 5 replies - 1 through 5 (of 5 total)
  • don’t put captions and images won’t have captions.

    Images need alt tags to be compliant with standards. WP uses the alt tag to also generate a caption. This is not desirable. There should be a separate caption field if you want a caption. You should not have to have remove the caption code manually in order to ensure that you have an alt tag without an unwanted caption.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    One line of code disables all captions as of 2.6.2. Put it in a plugin or in your theme’s functions.php file.

    add_filter('disable_captions', create_function('$a','return true;'));

    Thanks Otto42. That’ll work for me for the time being.

    However, I’d would like to see separate fields in the Add Media interface to deal with this issue rather than be forced to disable all captions. There may be an instance where I want a caption.

    I’ll leave this as unsolved since your suggestion is a workaround rather than the more usable solution I seek.

    add_filter(‘disable_captions’, create_function(‘$a’,’return true;’));

    Does this have the same problem as the 2.6.1 hack* i.e. you lose the align class with it?

    *function no_caption($deprecated, $attr, $content) { return $content; };
    add_filter(‘img_caption_shortcode’, ‘no_caption’, 10, 3);

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP2.6 Captions question’ is closed to new replies.