6

I'm trying to add the visual editor to image captions in wordpress. I'm somewhat able to but there are a few issues.

Here is a screenshot of what I currently have: a busy cat http://www.pba-online.net/001.jpg

You can see "Visual" and "Text" there but no text editor buttons and the font is white.

I edited a core template file, which I know is not advisable but in this case, necessary:

the original code was :

<textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>

and I replaced it with

$settings = array( 'media_buttons' => false, 'wpautop' => true );
wp_editor( $content, $editor_id, $settings );

The issue are: - no text editor buttons - caption text is white - when saved, it does not show the caption

On the post page and when I click edit on the image, the caption is there as you can see in the image below:

a busy cat http://www.pba-online.net/002.jpg

I'm looking at solving the 3 issues I have.

Thanks!

closed as unclear what you're asking by Howdy_McGee Aug 28 '18 at 1:54

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    I've seen your question on here for some time now and it appears that what you are trying to do would result in an incorrect use of an image caption (<figcaption>). Why do you want to use a visual editor for image captions? What are you trying to achieve? – Mat Mar 19 '18 at 22:57
  • Your linked image returns "404 Page Not Found!" Would be good to amend or remove the link. – Invariant Change Aug 28 '18 at 1:43

Browse other questions tagged or ask your own question.