Ticket #17180: 17180.5.diff

File 17180.5.diff, 737 bytes (added by jkudish, 8 months ago)

Adjust the js originally introduced [21921] and reverted in [21947] to detect wether or not the date fields are present on the page or not, and only provide validation when the fields are present

  • wp-admin/js/post.js

     
    528528                        return false; 
    529529                }); 
    530530 
     531                $('#post').submit(function(e){ 
     532                        if ( $('#timestampdiv').length && ! updateText() ) { 
     533                                e.preventDefault(); 
     534                                $('#timestampdiv').show(); 
     535                                $('#publishing-action .ajax-loading').css('visibility', 'hidden'); 
     536                                $('#publish').prop('disabled', false).removeClass('button-primary-disabled'); 
     537                                return false; 
     538                        } 
     539                }); 
     540 
    531541                $('#post-status-select').siblings('a.edit-post-status').click(function() { 
    532542                        if ($('#post-status-select').is(":hidden")) { 
    533543                                $('#post-status-select').slideDown('fast');