How to customize the symbols that appear in the Visual Editor insert custom character

This has to do with your character map for tinyMCE it’s located inside: wp-includes/js/tinymce/themes/advanced/js/charmap.js Although I wouldn’t recommend editing the WP-Core you could theoretically just add new characters there like so: [‘Ī’, ‘Ī’, true,’I kahako’], [‘Ō’, ‘Ō’, true,’O kahako’], and so on… However when you update WordPress this will overwrite those changes. So it’s not … Read more

Creating button next to “add media” that allows you to choose a single post

For WP versions before 3.5.0, use the media_buttons_context filter: add_filter( ‘media_buttons_context’, function($context ) { global $pagenow; if ( in_array( $pagenow, array( ‘post.php’, ‘page.php’, ‘post-new.php’, ‘post-edit.php’ ) ) ) { $context .= ‘<a href=”#” class=”button”>Button</a>’; } return $context; } ); For 3.5.0+, use the media_buttons action: add_action( ‘media_buttons’, function($editor_id){ echo ‘<a href=”#” class=”button”>Button</a>’; } ); Both … Read more

How to disable TinyMCE 4 keyboard shortcuts

Re answer cited by the OP: Edited to add meta and access and other. The custom_shortcuts flags mentioned was in tinymce 3.x (see here) but was removed from 4.x, and on scanning the source nothing equivalent seems to have been substituted. The foo function method mentioned can still be used. In your theme’s “functions.php”: add_action( … Read more

Add warning to edit slug/permalink button on editor screen.

WordPress has already hooked jQuery events to that button which you could omit with off() method, or keep things simple and add an overlay above that button and act as the button, prompting users to confirm the editing action at first place: jQuery(document).ready(function($){ var c = $(‘#edit-slug-buttons’) , b = $(‘button’,c).first(); c.css({ position: ‘relative’ }).append(‘<span … Read more

Snippet: Use classes instead of inline styles for text alignment

Note This answer was originally included in @bitstarr‘s question above and was included as a separate answer here to comply with WPSE’s Q&A model. Maybe someone else will have this issue and so i will share my solution here with you folks. function make_mce_awesome( $init ) { /* There are easier things than make ‘left/center/right … Read more

Resizing the width of the WYSIWYG editor

The WYSIWYG uses the .wp-editor-container class. So the easiest way would be to change this in your CSS. If your style is being overwritten then just add !important. .wp-editor-container { width:50%; // What ever size you want } the wp_editor() function also allows us to add a class to the textarea tag, I’m not sure … Read more

Add button in TinyMCE editor to insert text

Add this to your plugin file or in functions.php file in the theme directory add_action( ‘admin_enqueue_scripts’, ‘wpse_141344_admin_enqueue_scripts’ ); add_action( ‘admin_head’, ‘wpse_141344_add_mce_button’ ); function wpse_141344_admin_enqueue_scripts() { wp_enqueue_script( ‘wpse_141344-tinymce-scipt’, ‘url/to/your/custom-tinymce.js’ ); } function wpse_141344_add_mce_button() { if ( ! current_user_can( ‘edit_posts’ ) && ! current_user_can( ‘edit_pages’ ) ) { return; } add_filter( ‘mce_external_plugins’, ‘wpse_141344_add_tinymce_plugin’ ); add_filter( ‘mce_buttons’, ‘wpse_141344_register_mce_button’ … Read more

Disable text tab on WordPress text-editor

For disabling the text tab for all users except administrators, you can add the following: function my_editor_settings($settings) { if ( ! current_user_can(‘administrator’) ) { $settings[‘quicktags’] = false; return $settings; } else { $settings[‘quicktags’] = true; return $settings; } } add_filter(‘wp_editor_settings’, ‘my_editor_settings’);

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