wp_editor() in content that was loaded with ajax [duplicate]

Solution: Add wp_editor() in somewhere that works perfectly and hide it. <div class=”hidden-editor-container” style=”display:none;”> <?php wp_editor( ”, ‘editor’ ); ?> </div> after that assign editor contents to the global JS variable. EDITOR = $(‘.hidden-editor-container’).contents(); Finally when the ajax page is loaded append editor contents $(‘.editor’).append( EDITOR ); tinymce.execCommand( ‘mceRemoveEditor’, false, ‘editor’ ); tinymce.execCommand( ‘mceAddEditor’, false, … Read more

Replace TinyMCE with Custom Built Editor

You can do that with js/jquery if you want : $(‘#postdivrich’).hide().after(your custom editor div); You can add inputs with jquery and save them with : add_action(‘save_post’, ‘save_the_post’); function save_the_post(){ global $post; update_post_meta($post->ID, ‘field_name’, $_POST[‘field_name’]); } Or use a metabox and replace standard editor with it (width jquery). Hope this help someone 🙂

WordPress and TinyMCE Advanced: Failed to load javascript

WP_PLUGIN_DIR customizes the location of files in filesystem. Most likely you also need to customize WP_PLUGIN_URL, which customizes client–facing URL location. If you omit this one, WP will decide it based on WP_CONTENT_URL, which might not at all point to your new location. Another possibility is that plugin/code in question simply cannot handle a custom … Read more

How to insert image from link in TinyMCE

here is a link on the code page. I can’t write the code for some reason my browser is not accepting the code tags will try another computer when possible but the link explains all. here is the link. http://codex.wordpress.org/TinyMCE_Custom_Buttons

Preventing tinyMCE from auto formatting selected blocks of content

You can try adding this to your functions.php file: <?php function my_formatter($content) { $new_content=””; $pattern_full=”{(\[raw\].*?\[/raw\])}is”; $pattern_contents=”{\[raw\](.*?)\[/raw\]}is”; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { $new_content .= wptexturize(wpautop($piece)); } } return $new_content; } remove_filter(‘the_content’, ‘wpautop’); remove_filter(‘the_content’, ‘wptexturize’); add_filter(‘the_content’, ‘my_formatter’, 99); ?> Once … Read more

Cannot get tags working from a WPAlchemy metabox with wp_editor()

sorry you were having trouble with my “Holy Grail”. It looks like you missed an important part in my functions.php sample: apply_filters(‘meta_content’,$simple_textarea->get_the_value(‘test_editor’)); You weren’t using WP Alchemy’s get_the_value method. So instead of: $richtextcontent = $page_type_richtext->the_value( ‘richfield’ ); yours should have been: $richtextcontent = $page_type_richtext->get_the_value( ‘richfield’ ); You were using the_value which echos out the value … Read more