( function($) { $(window).load( function() { $( '.editor-post-format select' ).change( function() { var post_format = $(this).val(); add_post_format( post_format ); } ).change(); } ); function add_post_format( post_format ) { post_format = ( 0 === post_format ) ? 'standard' : post_format; $( '.editor-styles-wrapper' ).removeClass().addClass( 'editor-styles-wrapper format-' + post_format ); } } )(jQuery);