WordPress.org

Make WordPress Core

Changeset 22858


Ignore:
Timestamp:
11/27/12 02:02:32 (17 months ago)
Author:
nacin
Message:

No AYS or autosave for attachments on post.php. Reverts part of [22725]. fixes #22491.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r22854 r22858  
    435435</script> 
    436436<?php endif; ?> 
    437  
    438 <?php if ( 'attachment' == $post_type ) { ?> 
    439 <script type="text/javascript"> 
    440 (function($){ 
    441     function getFieldsContent() { 
    442         return [ $('#title').val() || '', 
    443             $('#attachment_caption').val() || '', 
    444             $('#attachment_alt').val() || '', 
    445             $('#attachment_content').val() || '', 
    446             $('#post_name').val() || '' ]; 
    447     } 
    448  
    449     var initial = getFieldsContent(); 
    450  
    451     window.onbeforeunload = function() { 
    452         var i, changed, current = getFieldsContent(); 
    453         for ( var i = 0; i < initial.length; i++ ) { 
    454             if ( changed = ( initial[i] !== current[i]) ) 
    455                 break; 
    456         } 
    457         if ( changed ) 
    458             return '<?php _e('The changes you made will be lost if you navigate away from this page.'); ?>'; 
    459     }; 
    460 })(jQuery); 
    461 </script> 
    462 <?php } ?> 
  • trunk/wp-admin/post-new.php

    r22777 r22858  
    4747    wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' ); 
    4848 
    49 if ( 'attachment' !== $post_type ) 
    50     wp_enqueue_script('autosave'); 
     49wp_enqueue_script( 'autosave' ); 
    5150 
    5251// Show post form. 
Note: See TracChangeset for help on using the changeset viewer.