Make WordPress Core

Ticket #38221: 38221.diff

File 38221.diff, 672 bytes (added by tomdude, 7 years ago)
  • src/wp-admin/js/media.js

    diff --git a/src/wp-admin/js/media.js b/src/wp-admin/js/media.js
    index 4c1dc58..d404a30 100644
    a b var findPosts; 
    151151                        }).open();
    152152                }
    153153
    154                 // Prevents form submission if no post has been selected.
     154                // Prevents form submission if posts exists to be selected and no post has been selected.
    155155                $( '#find-posts-submit' ).click( function( event ) {
    156                         if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length )
     156                        if ( $( '#find-posts-response input[type="radio"]' ).length && ! $( '#find-posts-response input[type="radio"]:checked' ).length )
    157157                                event.preventDefault();
    158158                });
    159159