X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/dc1231b7312fbdca99e9e887cc2bb35a28f85cdc..refs/tags/wordpress-4.4:/wp-admin/js/press-this.js diff --git a/wp-admin/js/press-this.js b/wp-admin/js/press-this.js index beaca672..bf2e8300 100644 --- a/wp-admin/js/press-this.js +++ b/wp-admin/js/press-this.js @@ -323,7 +323,7 @@ link = src; } - newContent = ''; + newContent = ''; } else { newContent = '[embed]' + src + '[/embed]'; } @@ -773,7 +773,8 @@ // 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 ) { @@ -782,6 +783,15 @@ 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();