Enhanced Media Library - Version 1.0.4

Version Description

  • Fixed: Filter mechanism in Media Library Support Request
  • Fixed: The bug with saving of assigned post categories and tags in Media Uploader
Download this release

Release Info

Developer webbistro
Plugin Icon 128x128 Enhanced Media Library
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.4

Files changed (3) hide show
  1. core/taxonomies.php +34 -40
  2. enhanced-media-library.php +2 -2
  3. readme.txt +7 -2
core/taxonomies.php CHANGED
@@ -196,27 +196,16 @@ function wpuxss_eml_restrict_manage_posts()
196
  {
197
  if ( $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'] )
198
  {
199
- $selected = 0;
200
 
201
  foreach ( $wp_query->tax_query->queries as $taxonomy_var )
202
- {
203
- if ( $taxonomy_var['taxonomy'] == $taxonomy->name && $taxonomy_var['field'] == 'term_id' )
204
  {
205
- $selected = $taxonomy_var['terms'][0];
 
206
  }
207
  }
208
-
209
- if ( ! $selected && isset($wp_query->query[$taxonomy->name]) )
210
- {
211
- $selected = $wp_query->query[$taxonomy->name];
212
- }
213
- elseif ( isset($wp_query->query['taxonomy']) && isset($wp_query->query['term']) )
214
- {
215
- $term = get_term_by( 'slug', $wp_query->query['term'], $taxonomy->name );
216
-
217
- if ( ! empty($term) )
218
- $selected = $term->term_id;
219
- }
220
 
221
  wp_dropdown_categories(
222
  array(
@@ -258,19 +247,35 @@ function wpuxss_eml_parse_query($query)
258
 
259
  foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
260
  {
261
- if ( isset($_REQUEST[$taxonomy->name]) && $_REQUEST[$taxonomy->name] )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  {
263
- switch ($taxonomy->name) {
264
- case 'category':
265
- $qv['category__in'] = array($_REQUEST[$taxonomy->name]);
266
- break;
267
- case 'post_tag':
268
- $qv['tag__in'] = array($_REQUEST[$taxonomy->name]);
269
- break;
270
- default:
271
- $term = get_term_by('id', $_REQUEST[$taxonomy->name], $taxonomy->name);
272
- if ($term) $qv[$taxonomy->name] = $term->slug;
273
- }
 
274
  }
275
  }
276
  }
@@ -375,10 +380,7 @@ class Walker_Media_Taxonomy_Checklist extends Walker
375
  if ( empty($taxonomy) )
376
  $taxonomy = 'category';
377
 
378
- if ( $taxonomy == 'category' )
379
- $name = 'post_category';
380
- else
381
- $name = 'tax_input['.$taxonomy.']';
382
 
383
  $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
384
  $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->slug . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
@@ -420,14 +422,6 @@ class Walker_Media_Taxonomy_Uploader_Filter extends Walker
420
  function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 )
421
  {
422
  extract($args);
423
-
424
- if ( empty($taxonomy) )
425
- $taxonomy = 'category';
426
-
427
- if ( $taxonomy == 'category' )
428
- $name = 'post_category';
429
- else
430
- $name = 'tax_input['.$taxonomy.']';
431
 
432
  $indent = str_repeat('&nbsp;&nbsp;&nbsp;', $depth);
433
  $output .= $category->term_id . '>' . $indent . esc_html( apply_filters('the_category', $category->name )) . '|';
196
  {
197
  if ( $wpuxss_eml_taxonomies[$taxonomy->name]['admin_filter'] )
198
  {
199
+ $selected = 0;
200
 
201
  foreach ( $wp_query->tax_query->queries as $taxonomy_var )
202
+ {
203
+ if ( $taxonomy_var['taxonomy'] == $taxonomy->name && $taxonomy_var['field'] == 'slug' )
204
  {
205
+ $term = get_term_by('slug', $taxonomy_var['terms'][0], $taxonomy->name);
206
+ if ($term) $selected = $term->term_id;
207
  }
208
  }
 
 
 
 
 
 
 
 
 
 
 
 
209
 
210
  wp_dropdown_categories(
211
  array(
247
 
248
  foreach ( get_object_taxonomies('attachment','object') as $taxonomy )
249
  {
250
+ if ( isset( $qv['taxonomy']) && isset($qv['term'] ) )
251
+ {
252
+ $tax = $qv['taxonomy'];
253
+
254
+ if ( $tax == 'category' )
255
+ $tax = 'category_name';
256
+
257
+ if ( $tax == 'post_tag' )
258
+ $tax = 'tag';
259
+
260
+ $qv[$tax] = $qv['term'];
261
+ unset($qv['taxonomy']);
262
+ unset($qv['term']);
263
+ }
264
+
265
+ if ( isset($_REQUEST[$taxonomy->name]) && $_REQUEST[$taxonomy->name] && is_numeric($_REQUEST[$taxonomy->name]) )
266
  {
267
+ $tax = $taxonomy->name;
268
+
269
+ if ( $tax == 'category' )
270
+ $tax = 'category_name';
271
+
272
+ if ( $tax == 'post_tag' )
273
+ $tax = 'tag';
274
+
275
+ $term = get_term_by('id', $_REQUEST[$taxonomy->name], $taxonomy->name);
276
+
277
+ if ($term)
278
+ $qv[$tax] = $term->slug;
279
  }
280
  }
281
  }
380
  if ( empty($taxonomy) )
381
  $taxonomy = 'category';
382
 
383
+ $name = 'tax_input['.$taxonomy.']';
 
 
 
384
 
385
  $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
386
  $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->slug . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
422
  function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 )
423
  {
424
  extract($args);
 
 
 
 
 
 
 
 
425
 
426
  $indent = str_repeat('&nbsp;&nbsp;&nbsp;', $depth);
427
  $output .= $category->term_id . '>' . $indent . esc_html( apply_filters('the_category', $category->name )) . '|';
enhanced-media-library.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Enhanced Media Library
4
  Plugin URI: http://wordpressuxsolutions.com
5
  Description: This plugin will be handy for those who need to manage a lot of media files.
6
- Version: 1.0.3
7
  Author: WordPress UX Solutions
8
  Author URI: http://wordpressuxsolutions.com
9
  License: GPLv2 or later
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
 
32
 
33
 
34
- $wpuxss_eml_version = '1.0.3';
35
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
36
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
37
 
3
  Plugin Name: Enhanced Media Library
4
  Plugin URI: http://wordpressuxsolutions.com
5
  Description: This plugin will be handy for those who need to manage a lot of media files.
6
+ Version: 1.0.4
7
  Author: WordPress UX Solutions
8
  Author URI: http://wordpressuxsolutions.com
9
  License: GPLv2 or later
31
 
32
 
33
 
34
+ $wpuxss_eml_version = '1.0.4';
35
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
36
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
37
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: webbistro
3
  Tags: media library, taxonomy, taxonomies, mime, mime type, attachment, media category, media categories, media tag, media tags, media taxonomy, media taxonomies, media filter, media organizer, file types, media types, media uploader, custom, media management, attachment management, files management, ux, user experience, wp-admin, admin
4
  Requires at least: 3.5
5
- Tested up to: 3.7.1
6
- Stable tag: 1.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -79,6 +79,11 @@ New features and improvements coming...
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
82
  = 1.0.3 =
83
 
84
  * Update: Better term sorting in Media Uploader
2
  Contributors: webbistro
3
  Tags: media library, taxonomy, taxonomies, mime, mime type, attachment, media category, media categories, media tag, media tags, media taxonomy, media taxonomies, media filter, media organizer, file types, media types, media uploader, custom, media management, attachment management, files management, ux, user experience, wp-admin, admin
4
  Requires at least: 3.5
5
+ Tested up to: 3.8
6
+ Stable tag: 1.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.0.4 =
83
+
84
+ * Fixed: Filter mechanism in Media Library [Support Request](http://wordpress.org/support/topic/filter-in-media-not-working-properly)
85
+ * Fixed: The bug with saving of assigned post categories and tags in Media Uploader
86
+
87
  = 1.0.3 =
88
 
89
  * Update: Better term sorting in Media Uploader