How to add custom tinymce plugin to new text widget

I found the solution with help from Jacob Peattie and the article from https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/ Here’s a quick walkthrough on what i did: I made a new js file container the code of my original button, but modified it to the event listener of the widget tinymce jQuery( document ).on( ‘tinymce-editor-setup’, function( event, editor ) { … Read more

How to apply a custom skin to WP_Editor / TinyMCE?

Apparently, the default WordPress style files overwrite a custom TinyMCE skin. So what you need to do is deregister WordPress’s TinyMCE skin. Since I needed the custom skin to only apply on the front-end on my website, I wrapped it inside an !is_admin() conditional. function remove_editor_buttons_style() { // If not on wp-admin if ( !is_admin() … Read more

Show class from css in format dropdown

Array value ‘content_css’ is not enough, TinyMCE can’t simply get the classes from the custom.css file. You need to define the list of styles you want in the dropdown: function my_format_TinyMCE( $in ) { $in[‘content_css’] = get_template_directory_uri() . “/custom.css”; $in[‘importcss_append’] = TRUE; $in[‘style_formats’] = json_encode(array( array(‘title’ => ‘Title for Style #1’, ‘classes’ => ‘example-class’), array(‘title’ … Read more

How to add table class for tables of TinyMCE advanced wordpress plugin? [closed]

Add this code in your theme’s functions.php file //wp-content/themes/my-theme/functions.php function bootstrap_classes_tinymce($settings) { $styles = array( array( ‘title’ => ‘None’, ‘value’ => ” ), array( ‘title’ => ‘Table’, ‘value’ => ‘table’, ), array( ‘title’ => ‘Striped’, ‘value’ => ‘table table-striped table-hover’, ), array( ‘title’ => ‘Bordered’, ‘value’ => ‘table table-bordered table-hover’, ), ); $settings[‘table_class_list’] = json_encode($styles); … Read more

How can a TinyMCE modal return formatted/visual text?

(Revised answer) You can use tinymce.DOM.encode() to convert all HTML tags to their entities, e.g. &lt; for < and &gt; for >: var html = tinymce.DOM.encode(e.data.code); Then to preserve trailing white-spaces: html = html.replace(/(^ +| +$)/gm, function(match, p1){ return p1.replace(/ /g, ‘&nbsp;’); }); And this to convert all line breaks to <br>: html = html.replace(/(?:\r\n|\r|\n)/g, … Read more

How do I use jQuery to add the TinyMCE WYSIWYG editor to a textarea?

I would just use the WordPress JavaScript API for TinyMCE — wp.editor. The steps in brief: PHP: Enqueue the editor scripts (and styles) via wp_enqueue_editor(). JS: Call wp.editor.initialize() from your script. And do take note of this: (the “this function” refers to wp.editor.initialize) If this function does nothing, please make sure that wp.editor.getDefaultSettings is a … Read more

HTML formatting issues when switching between editor tabs

I was finally able to get this fixed after some more debugging. I had previously disabled TinyMCE emojis which is what was causing the issue. After removing this code from functions.php the editor started working as it normally does. function disable_emojis() { add_filter( ‘tiny_mce_plugins’, ‘disable_emojis_tinymce’ ); } add_action( ‘init’, ‘disable_emojis’ );

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