link = src;
}
- newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" /></a>';
+ newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" alt="" /></a>';
} else {
newContent = '[embed]' + src + '[/embed]';
}
// Publish, Draft and Preview buttons
$( '.post-actions' ).on( 'click.press-this', function( event ) {
- var $target = $( event.target ),
+ var location,
+ $target = $( event.target ),
$button = $target.closest( 'button' );
if ( $button.length ) {
submitPost( 'draft' );
} else if ( $button.hasClass( 'publish-button' ) ) {
$button.addClass( 'is-saving' );
+
+ if ( window.history.replaceState ) {
+ location = window.location.href;
+ location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?';
+ location += 'wp-press-this-reload=true';
+
+ window.history.replaceState( null, null, location );
+ }
+
submitPost( 'publish' );
} else if ( $button.hasClass( 'preview-button' ) ) {
prepareFormData();