Add unique class or ID information to tinyMCE

You can filter the TinyMCE body classes to add or change as needed. It’s a string that’s pre-populated with some things like post type, so the easiest thing to do is append your additional classes (with a preceding space). <?php function wpse_128380_tinymce_body_class( $mce ) { // you could do things here to detect whatever you … Read more

How to use the new Dashicons for custom TinyMCE buttons?

Add Dashicon All buttons inside the TinyMCE have a class, also your custom button. Include (use wp_enqueue_style() a stylesheet with styling with Dashicons, like the follow example. .myicon:before { content: ‘\2605’; display: inline-block; -webkit-font-smoothing: antialiased; font: normal 16px/1 ‘dashicons’; vertical-align: top; } On default is the Dashicon active on each edit page, but add the … Read more

How to handle multiple instance of “send_to_editor” js function

only overwrite the send_to_editor function when your link or button is click but store the old function to restore it so try this on a click event: //store old send to editor function window.restore_send_to_editor = window.send_to_editor; //overwrite send to editor function window.send_to_editor = function(html) { var imgurl = jQuery(‘img’,html).attr(‘src’); current_item.siblings(‘.upload_image’).val(imgurl); current_item.parent().prepend(‘<div><img width=”300″ src=”‘+imgurl+'” alt=”banner image” … Read more

WordPress 4.6 link edit dialog is too rudimentary

To disable the inline link tool and revert it back to a pop-up screen instead, do the following: In your child theme directory, add the following to your function.php: add_filter( ‘mce_external_plugins’, ‘wpse_236590_link_editor’ ); function wpse_236590_link_editor( $plugins ) { $plugins[‘full_link_dialog’] = plugins_url( ‘js/’, __FILE__ ) . ‘editor.js’; return $plugins; } Next create a directory inside your … Read more

Show Font Awesome Icons In WP Post Editor

Make sure you’ve registered the stylesheet for the editor: add_editor_style( ‘http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css’ ); This should be in your functions.php https://codex.wordpress.org/Editor_Style

How to display TinyMCE without wp_editor()

If you don’t need wp_editor in front-end, I think its OK. Here a little bit different option settings with your tinymce init. I use this without wp_editor in front-end. <script> jQuery( document ).ready( function( $ ) { tinymce.init( { mode : “exact”, elements : ‘pre-details’, theme: “modern”, skin: “lightgray”, menubar : false, statusbar : false, … Read more

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