Overriding Gallery Margin

The simplest method is to remove the WordPress-injected inline style definitions, so that you can control style completely via the Theme: /** * Remove default gallery shortcode inline styles */ add_filter( ‘use_default_gallery_style’, ‘__return_false’ ); Note that this will remove ALL WordPress-injected gallery CSS definitions, so you may need to port some of the original style … Read more

Width 100%: Aspect ratio of image

A + C: img.resize-proportionally { max-width: 100%; height: auto; } As an aside, for the above to work, you shouldn’t attempt B. Having width and height attributes in the img tag is good.

Hiding certain panels in dashboard

@joesk isn’t quite correct. If you simply want to hide a meta box or two on the post-editing screen, you can do that via the Screen Options tab at the top of most screens. If it’s not aesthetic to your personal preferences and you’d like to remove the ability to edit the Excerpt at all, … 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