Tag Info

New answers tagged

0

Your first filter isn't correct. 'styleselect' give you and generate a dropdown on the tinyMCE. You can't add information like that. Here is what to do. Nice way: First, create a separate file called 'custom_wp_admin_editor_tinymce.php' (or what ever). Inside the function.php, include your file with the correct path where you created your previous ...


0

I'm not able to test this right now, but try this: $id = htmlentities('theme_options[px_wp_editor]');


0

Try this : Add this code to functions.php file. add_action( 'init', 'droid_buttons' ); function droid_buttons() { add_filter( "mce_external_plugins", "droid_add_buttons" ); add_filter( 'mce_buttons', 'droid_register_buttons' ); } function droid_add_buttons( $plugin_array ) { $plugin_array['droid'] = get_template_directory_uri() . ...


1

This seems to do it: function allow_nbsp_in_tinymce( $mceInit ) { $mceInit['entities'] = '160,nbsp,38,amp,60,lt,62,gt'; $mceInit['entity_encoding'] = 'named'; return $mceInit; } add_filter( 'tiny_mce_before_init', 'allow_nbsp_in_tinymce' ); Any improvement suggestions?


1

I'm not sure if this question is still relevant or not (so I'm posting for future reference for people), but there is a way to define a css file for the TinyMCE editor in your plugin by using the mce_css filter. For a quick example, I'll take an excerpt from the WordPress documentation: function plugin_mce_css( $mce_css ) { if ( ! empty( $mce_css ) ) ...


0

Another method is to insert this script into ADMIN HEAD to add anything to TinyMce: http://stackoverflow.com/a/24907894/2165415


0

YES, IT IS POSSIBLE! insert this script into ADMIN HEAD, which will access TinyMce: http://stackoverflow.com/a/24907894/2165415


0

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.


0

This is not a direct answer to your question but if you have the option, I would restructure the shortcode so that it takes one or more attributes that you then plug in to the correct JSON format. e.g.: [myshortcode zoom="5"] This would not only prevent your site editors from making syntax mistakes (or at least they'd make different ones!) but would ...


0

Since 3.9 some parts of the settings for the original Editor are wrapped in a self::first_init condition. This includes the plugins filter for external tinymce plugins. So, in a subsequent call for an editor, the filter won't run. Solution: One can pass a tinymce settings array to the settings of wp_editor(), that's where I would start. Or enqueue the ...


0

Not sure if this is a bug, but the behaviour is correct, or at least apparently intentional. a) There is only one dragDropUpload setting in the tinyMCEPreInit object, instead of one flag per editor. b) looking at class-wp-editor.php:139: if ( $set['drag_drop_upload'] ) { self::$drag_drop_upload = true; } so, if the setting is set to true once, ...


0

You can control the font size and type in the format dropdown by adding an editor style. WPSE user helgatheviking explained how to add styles to the format dropdown in her post here. I've included the relevant code below with one minor adjustment which allows CSS attributes like color and line-height to be inherited by the dropdown items as well. function ...


0

There is no way to add "placeholder" for TinyMCE, but you can set default content for newly created posts. All you need is just to hook default_content filter and return your formatted paragraphs: add_filter( 'default_content', 'wpse8170_get_default_instructions', 10, 2 ); function wpse8170_get_default_instructions( $content, WP_Post $post ) { if ( ...


0

I've got a class on Gist that will create a full secondary TinyMCE post editor which will look and function exactly like the original editor complete with toolbar, support for shortcodes, etc.. Just drop it into your theme and assign the post_type which should display the editor. You can then call the content saved to the secondary editor with the function ...



Top 50 recent answers are included