Commit a9ff794a authored by John James Jacoby's avatar John James Jacoby
Browse files

Fix filter not showing "No categories" selected option.

parent 0a95ef24
...@@ -72,10 +72,17 @@ function wp_media_categories_add_category_filter() { ...@@ -72,10 +72,17 @@ function wp_media_categories_add_category_filter() {
return; return;
} }
// Get media taxonomy // Looking at specific term
$selected_value = isset( $_GET[ 'term' ] ) $selected_value = isset( $_GET[ 'term' ] )
? $_GET[ 'term' ] ? $_GET[ 'term' ]
: ''; ?> : '';
// Maybe looking for attachments with no terms
if ( empty( $selected_value ) ) {
$selected_value = isset( $_GET[ 'media_category' ] )
? $_GET[ 'media_category' ]
: '';
} ?>
<label for="media_category" class="screen-reader-text"><?php esc_html_e( 'Filter by Category', 'wp-media-categories' ); ?></label> <label for="media_category" class="screen-reader-text"><?php esc_html_e( 'Filter by Category', 'wp-media-categories' ); ?></label>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment