Permalink
Browse files

No AYS or autosave for attachments on post.php. Reverts part of [2272…

…5]. fixes #22491.

git-svn-id: http://core.svn.wordpress.org/trunk@22858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 3fd9321 commit 902314ad3c2054d6950013db5ad8788ab82bf8c3 @nacin nacin committed Nov 27, 2012
Showing with 1 addition and 28 deletions.
  1. +0 −26 wp-admin/edit-form-advanced.php
  2. +1 −2 wp-admin/post-new.php
View
26 wp-admin/edit-form-advanced.php
@@ -434,29 +434,3 @@
try{document.post.title.focus();}catch(e){}
</script>
<?php endif; ?>
-
-<?php if ( 'attachment' == $post_type ) { ?>
-<script type="text/javascript">
-(function($){
- function getFieldsContent() {
- return [ $('#title').val() || '',
- $('#attachment_caption').val() || '',
- $('#attachment_alt').val() || '',
- $('#attachment_content').val() || '',
- $('#post_name').val() || '' ];
- }
-
- var initial = getFieldsContent();
-
- window.onbeforeunload = function() {
- var i, changed, current = getFieldsContent();
- for ( var i = 0; i < initial.length; i++ ) {
- if ( changed = ( initial[i] !== current[i]) )
- break;
- }
- if ( changed )
- return '<?php _e('The changes you made will be lost if you navigate away from this page.'); ?>';
- };
-})(jQuery);
-</script>
-<?php } ?>
View
3 wp-admin/post-new.php
@@ -46,8 +46,7 @@
if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
-if ( 'attachment' !== $post_type )
- wp_enqueue_script('autosave');
+wp_enqueue_script( 'autosave' );
// Show post form.
$post = get_default_post_to_edit( $post_type, true );

0 comments on commit 902314a

Please sign in to comment.