wpalchemy icon indicating copy to clipboard operation
wpalchemy copied to clipboard

WP 3.3 and wp_editor()

Open shawnsandy opened this issue 13 years ago • 5 comments

Just wondering about WP3.3 compatibility and using the new wp_editor() function with wpalchemy

shawnsandy avatar Nov 09 '11 15:11 shawnsandy

Correct me if im wrong... but check this

http://pastebin.com/cHHFYwnj

Should work right?

mackehansson avatar Jan 11 '12 09:01 mackehansson

the problem with this solution is that if you use the "docopy" feature, the copied editor does not work. Has anyone found a solution to this?

armandmorin avatar Jan 30 '12 00:01 armandmorin

for single text areas that don't need to repeat you can use the wp_editor function. though i think you need to adjust the textarea's name to match the alchemy naming scheme.

http://pastebin.com/L25qGD9R

$mb->the_field('additional-content');   
$content = $mb->get_the_value();
$id = $mb->get_the_name();
$settings = array('textarea_name'=>$mb->get_the_name(),'textarea_rows'=>10); 

wp_editor( $content, $id, $settings );

the problem i am facing is that it rich text is being converted to html characters on save.

so something in bold, becomes

<strong>will this work?</strong>

helgatheviking avatar Feb 10 '12 18:02 helgatheviking

@helgatheviking -

Read an article on this. The solution was as follows:

$content = utf8_encode(html_entity_decode($mb->get_the_value()));

Using utf8_encode and html_entity_decode solved the issue for me. Hope that helps. You might still have the characters once you add the code, just remove them and then update the post

iamdangavin avatar Aug 09 '12 16:08 iamdangavin

hi dan, i want to say i solved this somehow, but i haven't used alchemy much lately. thanks for the share! i will have to update my files... https://github.com/helgatheviking/WP-Alchemy-Holy-Grail-Theme

helgatheviking avatar Aug 09 '12 17:08 helgatheviking