diff --git a/src/js/_enqueues/admin/media.js b/src/js/_enqueues/admin/media.js
index 8b603205f6..b66d5e349f 100644
|
a
|
b
|
|
| 157 | 157 | $mediaGridWrap.trigger( 'wp-media-grid-ready', frame ); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | | // Prevents form submission if no post has been selected. |
| | 160 | // Prevents form submission if posts exists to be selected and no post has been selected. |
| 161 | 161 | $( '#find-posts-submit' ).click( function( event ) { |
| 162 | | if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length ) |
| | 162 | if ( $( '#find-posts-response input[type="radio"]' ).length && ! $( '#find-posts-response input[type="radio"]:checked' ).length ) { |
| 163 | 163 | event.preventDefault(); |
| | 164 | } |
| 164 | 165 | }); |
| 165 | 166 | |
| 166 | 167 | // Submits the search query when hitting the enter key in the search input. |