Quantcast
Channel: Vector Solution
Viewing all articles
Browse latest Browse all 10

WordPress WYSIWYG image links broken

$
0
0

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

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

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

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?

 

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' );

 


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images