Add Item to Custom TinyMCE Menu

addMenuItem() adds to tinymce’s toolbar, which isn’t used by WP by default, and uses context to add to the particular (sub)menu. You’re adding a MenuButton, and you can access the button through the editor’s buttons array, keyed by the button name: add_action( ‘admin_print_footer_scripts’, function () { ?> <script type=”text/javascript”> jQuery(function ($) { tinymce.on(‘SetupEditor’, function (editor) … Read more

Is there a way to disable formatting shortcuts in 4.3?

Yes, there is very well a way to disable these formatting shortcuts. You can do so by using this simple little piece of PHP code. <?php function disable_mce_wptextpattern( $opt ) { if ( isset( $opt[‘plugins’] ) && $opt[‘plugins’] ) { $opt[‘plugins’] = explode( ‘,’, $opt[‘plugins’] ); $opt[‘plugins’] = array_diff( $opt[‘plugins’] , array( ‘wptextpattern’ ) ); … Read more

Customising the WordPress TinyMce editor and it’s buttons

I think theme_advanced_buttons1, theme_advanced_buttons2 etc were part of the TinyMCE advanced theme which is no longer available in TinyMCE 4. WordPress 4.9.7 is using TinyMCE version 4.7.11. The two rows of controls are now referred to with: mce_buttons mce_buttons_2 Here is a good example, taken from https://www.kevinleary.net/customizing-tinymce-wysiwyg-editor-wordpress/ which allows easy customisation of the buttons on … Read more

Visual Editor Background

You can either create a plugin or a child theme. Since the black background on your site is most likely coming from a theme, a child theme seems like a good fit here – so if you ever changed your theme, the black background in the Editor would also go away. To create a child … Read more

WordPress visual editor broke due to non standard port?

I had exactly same issue with Visual Editor but my site was working on port 80. This is what I did : Edited wp-config.php and added the following : define( ‘CONCATENATE_SCRIPTS’, false ); and everything worked fine. Additionally you can check if wp-includes/js/tinymce/wp-tinymce.js.gz file exists or not. If not, then upload it via FTP

Working With Visual Composer VC_Single_Image

It’s not easy to trace trough the code behind [vc_single_image], because for start it uses the extract, that’s not recommended in WordPress or PHP in general. The image attribute value is stripped for non-integers into the $img_id variable. With your setup, there’s a call to wpb_getImageBySize( array( ‘attach_id’ => $img_id, … ), that seems to … Read more

How to check if “media_send_to_editor” is audio?

We can simplify the mime type checks, with the following boolean functions: wp_attachment_is( ‘image’, $id ) wp_attachment_is( ‘video’, $id ) wp_attachment_is( ‘audio’, $id ) where $id is the attachment ID. The attachment’s ID is actually one of the input arguments for the media_send_to_editor filter callback. We also have: wp_attachment_is_image( $id ) that’s a wrapper for … Read more

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