Load tinyMCE / wp_editor() via AJAX [duplicate]

your post here helped me figure a solution. Along with the mceInit property, I also had to retrieve the qtInit that wp_editor generates as well. The following is the relevant code within my class. Basically I have wp_editor run so that the javascript is generated. I use hooks to retrieve the javascript, so that I … Read more

Cite-Tag for blockquotes

The TinyMCE Custom Styles Codex Page should get you through this. There are code snippets on that page, but, as an overview, the process requires two steps: Add the TinyMCE “styleselect” element to the first or second row of icons. Add one or more elements to that styleselect menu. If this were me, I would … Read more

Add post class to the TinyMCE iframe?

The filter you’re after is tiny_mce_before_init. Using this, we can hook into TinyMCE’s ‘init_array’ and add body classes: add_filter( ‘tiny_mce_before_init’, ‘wpse_235194_tiny_mce_classes’ ); function wpse_235194_tiny_mce_classes( $init_array ){ global $post; if( is_a( $post, ‘WP_Post’ ) ){ $init_array[‘body_class’] .= ‘ ‘ . join( ‘ ‘, get_post_class( ”, $post->ID ) ); } return $init_array; } We’re joining the post … Read more

Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

You could over-ride the CSS by using the admin_print_scripts admin_head-media-upload-popup and add css to match your needs. This can be done via the functions.php file or by creating a plugin. Here is the code in a plugin format to begin adding style: <?php /* Plugin Name: Some Name Description: Custom Thickbox Styles */ add_action(‘admin_head-media-upload-popup’, ‘custom_tb_styles’); … Read more

Hook the Keydown Event in the TinyMCE Post Editor

the TinyMCE Editor has its own keydown event handler and its hooked to a function on initiation so to do that you can create a tinymce plugin or use the wordpress initiation of it with tiny_mce_before_init hook like this: add_filter( ‘tiny_mce_before_init’, ‘wpse24113_tiny_mce_before_init’ ); function wpse24113_tiny_mce_before_init( $initArray ) { $initArray[‘setup’] = <<<JS [function(ed) { ed.onKeyDown.add(function(ed, e) … Read more

How to keep   non-breaking spaces in the visual editor?

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’ ); Also see: https://www.tinymce.com/docs/configure/content-filtering/#entities Any improvement suggestions?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)