WordPress WYSIWYG image links broken

In a custom plugin I invoke a WYSIWYG editor like this:

<?php the_editor(get_option("reminder_text"), 'reminder_text'); ?>

Everything works fine, until I try to insert an image (uploader or external source, no difference).

Read More

Example: I enter the image path and the image is displayed correctly. When i save the form and return to it, the image is displayed as broken and the path is surrounded by escaped quotes, e. g.:

"http://www.my-image-link-here.jpg"

Has someone an idea how to solve this problem?

Related posts

Leave a Reply

1 comment

  1. That’s because the data is sanitized when inserted in the database, you need to clean up the returning results of get_option.

    Take a look at the documentation about Data Validation.

    Use:

    the_editor( esc_attr( get_option( "reminder_text" ) ), 'reminder_text' );
    

    Related answer at WordPress StackExchange.