Modifying the main editor priority

The editor is hard-coded into the form. It isn’t inserted by add_meta_box. There is a hook called edit_form_after_title which you should be able to use though. Proof of concept: // use the action to create a place for your meta box function add_before_editor($post) { global $post; do_meta_boxes(‘post’, ‘pre_editor’, $post); } add_action(‘edit_form_after_title’,’add_before_editor’); // add a box … Read more

Change padding to text indent in “Increase indent” TinyMCE

You need to modify the TinyMCE settings object on instantiation: Reference: TinyMCE documentation – content formatting WordPress provides a filter for this very purpose called tiny_mce_before_init which you can use as follows: function modify_tinymce_settings($settings) { $settings[‘indentation’] = ’10px’; return $settings; } add_filter(‘tiny_mce_before_init’, ‘modify_tinymce_settings’); If that does not work precisely, then dump the output of $settings … Read more

How to retain HTML5 Attributes on Markup

It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more

Restrict access to post if it is currently being edited

The warning notice gets dispatched by the function wp_check_post_lock. The following redirects the user back to the post listing screen if someone else is editing it. add_action( ‘load-post.php’, ‘redirect_locked_post_wpse_95718’ ); function redirect_locked_post_wpse_95718() { if( isset($_GET[‘post’] ) && wp_check_post_lock( $_GET[‘post’] ) ) { global $typenow; $goto = ( ‘post’ == $typenow ) ? ” : “?post_type=$typenow”; … Read more

How can I insert HTML attributes with an existing TinyMCE button?

The following workaround is based on the wpeditimage/plugin.js file in the core. You could enqueue it or test it with: add_action( ‘admin_footer-post.php’, function() {?><script> jQuery(window).load( function( $ ) { if( ! $( “#wp-content-wrap”).hasClass(“tmce-active” ) ) return; var editor = tinyMCE.activeEditor; editor.on( ‘BeforeExecCommand’, function( event ) { var node, DL, cmd = event.command; if ( cmd … Read more

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