Editor not displaying dynamically after clicking on the button
Editor not displaying dynamically after clicking on the button
Editor not displaying dynamically after clicking on the button
I came across this page — http://wp-snippets.com/set-default-editor/ * — which looks promising, though a little out of date. Instead of their code, I would suggest trying this: add_filter( ‘wp_default_editor’, ‘wpse101200_default_editor’ ); function wpse101200_default_editor( $editor ) { return ‘tinymce’; } Reference WPSeek’s wp_default_editor() page wp_default_editor() in the WordPress core source Unfortunately, the Codex doesn’t currently have … Read more
Found the basic problem! Although a different context than the one you described, the root cause is probably the same. I was trying to allow users to setup a personal page and upload an image to display there. I kept getting the dreaded “You don’t have permission to attach files to this post”. The message … Read more
EDIT The quick and easy method is just a simple setting: style_formats_merge… function myformatTinyMCE($in) { $style_formats = array( array( ‘title’ => ‘Classes’, ‘items’ => array( array( ‘title’ => ‘Blue Color’, ‘selector’ => ‘p,strong,u,em,ol,ul’, ‘classes’ => ‘blueColor’ ) ) ) ); $in[‘style_formats_merge’] = true; $in[‘style_formats’] = json_encode( $style_formats ); return $in; } add_filter(‘tiny_mce_before_init’, ‘myformatTinyMCE’ ); Everything … Read more
To restrict users to just one post, don’t let them create new posts. Just add one wp_editor() instance to their profile. Hook into ‘show_user_profile’ and ‘edit_user_profile’ to show the editor. Hook into ‘personal_options_update’ and ‘edit_user_profile_update’ to save the content to a user meta or a hidden custom post type. Now they don’t have to search … Read more
The editor is hard-coded into the form. It isn’t inserted by add_meta_box. There is a hook called edit_form_after_title which you should be able to use though. Proof of concept: // use the action to create a place for your meta box function add_before_editor($post) { global $post; do_meta_boxes(‘post’, ‘pre_editor’, $post); } add_action(‘edit_form_after_title’,’add_before_editor’); // add a box … Read more
If I remember correctly, this should remove the toolbars on the tinyMCE: function my_format_TinyMCE( $in ) { $in[‘toolbar1’] = ”; $in[‘toolbar2’] = ”; $in[‘toolbar’] = false; return $in; } add_filter( ‘tiny_mce_before_init’, ‘my_format_TinyMCE’ ); References: https://codex.wordpress.org/TinyMCE http://www.tinymce.com/wiki.php/Configuration For the wp_editor, try applying these filter parameters onto your wp_editor() function. Hope it helps. ** Edit Also if … Read more
This is how the tinymce statusbar displays on my intsall: <div id=”mceu_34″ class=”mce-statusbar mce-container mce-panel mce-stack-layout-item mce-last” hidefocus=”1″ tabindex=”-1″ role=”group”> <div id=”mceu_34-body” class=”mce-container-body mce-flow-layout”> <div id=”mceu_35″ class=”mce-path mce-flow-layout-item mce-first mce-last”> <div role=”button” class=”mce-path-item” data-index=”0″ tabindex=”-1″ id=”mceu_35-0″ aria-level=”0″>p</div> <div class=”mce-divider” aria-hidden=”true”> » </div> <div role=”button” class=”mce-path-item mce-last” data-index=”1″ tabindex=”-1″ id=”mceu_35-1″ aria-level=”1″>strong</div> </div> </div> </div> so this … Read more
I found out I needed to add html_entity_decode() around the value so my final code is… /** * Add Copyright text to general settings menu */ $custom_general_settings = new FD_Custom_General_Settings(); class FD_Custom_General_Settings { function __construct() { add_filter(‘admin_init’, array(&$this , ‘register_fields’)); } function register_fields() { register_setting(‘general’, ‘footer_text’, ‘esc_attr’); add_settings_field(‘footer_text’, ‘<label for=”footer_text”>’.__(‘Footer Text’ , ‘footer_text’ ).'</label>’ , … Read more
you can solve this problem by enqueue the following script with the dependency of jQuery jQuery(document).ready(function(){ tinyMCEPreInit.dragDropUpload = false; }); To add the dependency you can refer this link I have tested this solution and it has worked for me. I hope it will work for you too.