From b68a4e3da60f9f3d195cc84dcbabebd3ad8dda7d Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 12 Mar 2016 17:21:52 +0000 Subject: [PATCH] Editor: hide the Move to Trash link for auto-drafts until they are auto-saved. Props iseulde. Fixes #16116. git-svn-id: https://develop.svn.wordpress.org/trunk@36972 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/edit.css | 4 ++++ src/wp-admin/js/post.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css index 06297f9581..f1bf46d4b6 100644 --- a/src/wp-admin/css/edit.css +++ b/src/wp-admin/css/edit.css @@ -134,6 +134,10 @@ input#link_url { padding: 1px 2px; } +body.post-new-php .submitbox .submitdelete { + display: none; +} + /* @todo: do we really need this? word on the street is we don't and this stray rule may actually be compensated for elsewhere. */ #normal-sortables .submitbox .submitdelete:hover { diff --git a/src/wp-admin/js/post.js b/src/wp-admin/js/post.js index 0d7bf0359c..a4011b449d 100644 --- a/src/wp-admin/js/post.js +++ b/src/wp-admin/js/post.js @@ -374,6 +374,10 @@ jQuery(document).ready( function($) { $( '.autosave-message' ).text( postL10n.savingText ); }).on( 'after-autosave.edit-post', function( event, data ) { $( '.autosave-message' ).text( data.message ); + + if ( $( document.body ).hasClass( 'post-new-php' ) ) { + $( '.submitbox .submitdelete' ).show(); + } }); $(window).on( 'beforeunload.edit-post', function() {