2

I have a text area using wp_editor

On first input it works great.

Save via text or visual it saves to mysql just fine this is what is in the text area before I save

<a href="/wp-content/uploads/2014/03/Multi_Leaf_2098.jpg"><img class="alignleft size-medium wp-image-555" alt="Drag Multi Leaf" src="/wp-content/uploads/2014/03/Multi_Leaf_2098-199x300.jpg" width="199" height="300" /></a>Designed with a low arch, which promotes weight transfer by lowering the ride height at the rear of the vehicle.
Very high spring rate which aids in transferring weight quicker and planting the rear tires.

bringing it into the textarea I get curly quotes... text chopped (see alt tag).. ... picture does not load...

<a href="”/wp-content/uploads/2014/03/Multi_Leaf_2098.jpg”"><img class="”alignleft" alt="”Drag" src="”/wp-content/uploads/2014/03/Multi_Leaf_2098-199×300.jpg”" width="”199″" height="”300″" /></a>Designed with a low arch, which promotes weight transfer by lowering the ride height at the rear of the vehicle.

Very high spring rate which aids in transferring weight quicker and planting the rear tires.

&nbsp;

notice the extra lines and a hardspace and extra line also Then if save again and come back to double curly quotes.
notice the extra lines and a hardspace and extra line also

Now and unless I fix everything and redo the picture it is no longer working. So you can't edit you have to redo

So I am pretty sure it is changing when loading to the edit area so I have tried on the wp_editor call

wp_editor(html_entity_decode(stripcslashes($content)), 'content', $settings);
wp_editor(html_entity_decode($content), 'content', $settings);
wp_editor(stripcslashes($content), 'content', $settings);

$settings = array(
    'tinymce'       => array(
        'setup' => 'function (ed) {
            tinymce.documentBaseURL = "' . get_admin_url() . '";
        }',
    ),
    'quicktags'     => TRUE,
    'editor_class'  => 'frontend-article-editor',
    'textarea_rows' => 25,
    'media_buttons' => TRUE,
);

I have tnymce advanced installed. would those setting make this happen.

  • Can you confirm it's definitely TinyMCE causing problems i.e. it's correctly formatted in the database? – TheDeadMedic Apr 3 '14 at 9:25
  • Yes I checked the data base after the first save, – Lynn Appleget Apr 3 '14 at 11:23
  • I am not sure it is tinyMCE, TinyMCE Advance plugin or a wordpress hook or something else. This is my own function otherwise all is well in regular posts/pages – Lynn Appleget Apr 3 '14 at 11:29
  • How are you initialising the editor? It sounds like it may be to do with the encoding when reading back what it has saved. Have you tried calling it with the completely default settings found in class-wp-editor.php on around line 66 to see if you can trace the problem? Also, not sure how you're planning to use the wp_editor but may be worth mentioning that you cannot run it without giving it a unique selector – Bysander Jul 7 '14 at 15:22
-2

Add these two lines in your functions.php:

remove_filter( 'the_content', 'wpautop' ); 
remove_filter( 'the_content', 'wptexturize' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.