Shortcode to insert

Best solution for what you want to accomplish which is essentially to make the next page feature more user friendly for your authors is to add a TinyMCE button that will do this for you. This may be a bit complicated so hold your hat. To avoid this answer being the length of a thesis, … Read more

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

Visual Tab Missing From Editor

Just in case anyone else is having this problem, I’ve found that a pretty reliable way to get your visual editor tab back after upgrading to WordPress 4.0 is: disable all plugins Change the theme to one of the defaults (e.g. TwentyFourteen) Go to “my profile” and check the “disable visual editor” box. Save Go … Read more

How to add a class to ul tags created by the WordPress editor Tinymce?

It’s always a good idea to look at WordPress Codex before asking. TinyMCE Custom Styles <?php // Insert ‘styleselect’ into the $buttons array function my_mce_buttons_2( $buttons ) { array_unshift( $buttons, ‘styleselect’ ); return $buttons; } // Use ‘mce_buttons’ for button row #1, mce_buttons_3′ for button row #3 add_filter(‘mce_buttons_2’, ‘my_mce_buttons_2’); function my_mce_before_init_insert_formats( $init_array ) { $style_formats … Read more

Markup of oEmbed codes in the editor?

I think this might be a step in the right direction: http://codex.wordpress.org/Plugin_API/Filter_Reference Specifically the the_editor_content filter which is “applied to post content before putting it into a rich editor window.” Sorry I can’t flesh it out more for you but I am just starting to play around with filters myself and have miles to go … Read more

Is it possible to re-use the image details popup?

Let me answer in the most simple way. It depends on the situation and sometimes you might want to create your own MediaFrame, but i think this would be slightly out of the questions scope and would need much more explanation: Assuming all there is is an ID of the attachment to edit, following code … Read more

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