Enhanced Media Library - Version 2.0.4.1

Version Description

Release Date - March 07, 2015

Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.4.1

core/eml-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * EML custom upload.php
5
  *
6
- * Based on wp-admin/upload.php
7
  *
8
  * Uses custom media table class WPUXSS_EML_Media_List_Table
9
  *
@@ -14,6 +14,8 @@
14
 
15
  // EML customization here
16
  require_once( ABSPATH . 'wp-admin/admin.php' );
 
 
17
 
18
  if ( !current_user_can('upload_files') )
19
  wp_die( __( 'You do not have permission to upload files.' ) );
@@ -81,12 +83,13 @@ if ( 'grid' === $mode ) {
81
  exit;
82
  }
83
 
84
- // EML customization here
 
85
  if ( isset( $GLOBALS['hook_suffix'] ) )
86
  $args['screen'] = get_current_screen();
87
  else
88
  $args['screen'] = null;
89
-
90
  $wp_list_table = new WPUXSS_EML_Media_List_Table( $args );
91
  // EML customization end
92
 
3
  /**
4
  * EML custom upload.php
5
  *
6
+ * Based on wp-admin/upload.php (4.1.1)
7
  *
8
  * Uses custom media table class WPUXSS_EML_Media_List_Table
9
  *
14
 
15
  // EML customization here
16
  require_once( ABSPATH . 'wp-admin/admin.php' );
17
+ require_once( ABSPATH . 'wp-includes/pluggable.php' );
18
+ // EML customization end
19
 
20
  if ( !current_user_can('upload_files') )
21
  wp_die( __( 'You do not have permission to upload files.' ) );
83
  exit;
84
  }
85
 
86
+
87
+ // EML customization here
88
  if ( isset( $GLOBALS['hook_suffix'] ) )
89
  $args['screen'] = get_current_screen();
90
  else
91
  $args['screen'] = null;
92
+
93
  $wp_list_table = new WPUXSS_EML_Media_List_Table( $args );
94
  // EML customization end
95
 
core/taxonomies.php CHANGED
@@ -363,6 +363,8 @@ if( ! function_exists( 'wpuxss_eml_custom_media' ) ) {
363
 
364
  function wpuxss_eml_custom_media() {
365
 
 
 
366
  require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
367
  require_once( 'class-eml-media-list-table.php' );
368
  require_once( 'eml-upload.php' );
363
 
364
  function wpuxss_eml_custom_media() {
365
 
366
+ global $wpdb;
367
+
368
  require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
369
  require_once( 'class-eml-media-list-table.php' );
370
  require_once( 'eml-upload.php' );
enhanced-media-library.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Enhanced Media Library
4
  Plugin URI: http://wpUXsolutions.com
5
  Description: This plugin will be handy for those who need to manage a lot of media files.
6
- Version: 2.0.4
7
  Author: wpUXsolutions
8
  Author URI: http://wpUXsolutions.com
9
  Text Domain: eml
@@ -23,22 +23,17 @@ global $wp_version,
23
 
24
 
25
 
26
- $wpuxss_eml_version = '2.0.4';
27
 
28
 
29
 
30
-
31
-
32
- register_activation_hook( __FILE__, 'wpuxss_eml_on_activation' );
33
-
34
  include_once( 'core/mime-types.php' );
35
  include_once( 'core/taxonomies.php' );
36
 
37
  if( is_admin() ) {
38
 
39
  include_once( 'core/options-pages.php' );
40
- }
41
-
42
 
43
 
44
 
@@ -63,7 +58,10 @@ if ( ! function_exists( 'wpuxss_eml_on_init' ) ) {
63
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
64
  $wpuxss_eml_path = plugin_dir_path( __FILE__ );
65
 
66
-
 
 
 
67
  $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
68
  if ( empty($wpuxss_eml_taxonomies) ) $wpuxss_eml_taxonomies = array();
69
 
@@ -397,126 +395,129 @@ if ( ! function_exists( 'wpuxss_eml_enqueue_media' ) ) {
397
 
398
 
399
 
 
400
  /**
401
- * wpuxss_eml_on_activation
402
  *
403
  * @since 2.0.4
404
  * @created 30/01/15
405
  */
406
 
407
- if ( ! function_exists( 'wpuxss_eml_on_activation' ) ) {
408
 
409
- function wpuxss_eml_on_activation() {
410
 
411
  global $wpuxss_eml_version;
412
-
413
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
414
 
415
  if ( version_compare( $wpuxss_eml_version, $wpuxss_eml_old_version, '<>' ) )
416
  {
417
  update_option('wpuxss_eml_version', $wpuxss_eml_version );
418
- }
419
 
420
- if ( empty($wpuxss_eml_old_version) )
421
- {
422
- $wpuxss_eml_taxonomies['media_category'] = array(
423
- 'assigned' => 1,
424
- 'eml_media' => 1,
425
- 'public' => 1,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
 
427
- 'labels' => array(
428
- 'name' => 'Media Categories',
429
- 'singular_name' => 'Media Category',
430
- 'menu_name' => 'Media Categories',
431
- 'all_items' => 'All Media Categories',
432
- 'edit_item' => 'Edit Media Category',
433
- 'view_item' => 'View Media Category',
434
- 'update_item' => 'Update Media Category',
435
- 'add_new_item' => 'Add New Media Category',
436
- 'new_item_name' => 'New Media Category Name',
437
- 'parent_item' => 'Parent Media Category',
438
- 'parent_item_colon' => 'Parent Media Category:',
439
- 'search_items' => 'Search Media Categories'
440
- ),
441
 
442
- 'hierarchical' => 1,
443
 
444
- 'show_admin_column' => 1,
445
- 'admin_filter' => 1, // list view filter
446
- 'media_uploader_filter' => 1, // grid view filter
447
- 'media_popup_taxonomy_edit' => 0,
 
 
 
 
 
 
448
 
449
- 'show_in_nav_menus' => 1,
450
- 'sort' => 0,
451
- 'rewrite' => array(
452
- 'slug' => 'media_category',
453
- 'with_front' => 1
454
- )
455
- );
456
-
457
- $wpuxss_eml_tax_options = array(
458
- 'tax_archives' => 1,
459
- 'edit_all_as_hierarchical' => 0,
460
- 'force_filters' => 0
461
- );
462
-
463
- $allowed_mimes = get_allowed_mime_types();
464
-
465
- foreach ( wp_get_mime_types() as $type => $mime )
466
- {
467
- $wpuxss_eml_mimes[$type] = array(
468
- 'mime' => $mime,
469
- 'singular' => $mime,
470
- 'plural' => $mime,
471
- 'filter' => 0,
472
- 'upload' => isset($allowed_mimes[$type]) ? 1 : 0
473
- );
474
  }
475
 
476
- $wpuxss_eml_mimes['pdf']['singular'] = 'PDF';
477
- $wpuxss_eml_mimes['pdf']['plural'] = 'PDFs';
478
- $wpuxss_eml_mimes['pdf']['filter'] = 1;
479
-
480
- update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
481
- update_option( 'wpuxss_eml_mimes', $wpuxss_eml_mimes );
482
- update_option( 'wpuxss_eml_mimes_backup', $wpuxss_eml_mimes );
483
-
484
- return;
485
- }
486
-
487
- if ( version_compare( $wpuxss_eml_old_version, '2.0.2', '<' ) )
488
- {
489
- $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
490
-
491
- foreach( (array) $wpuxss_eml_taxonomies as $taxonomy => $params )
492
- {
493
- if ( $params['eml_media'] )
494
- {
495
- $wpuxss_eml_taxonomies[$taxonomy]['rewrite']['with_front'] = 1;
496
  }
 
 
497
  }
498
 
499
- update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
500
- }
501
-
502
- if ( version_compare( $wpuxss_eml_old_version, '2.0.4', '<' ) )
503
- {
504
- $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
505
-
506
- foreach( (array) $wpuxss_eml_taxonomies as $taxonomy => $params )
507
- {
508
- $wpuxss_eml_taxonomies[$taxonomy]['media_popup_taxonomy_edit'] = 0;
 
 
 
 
 
 
 
509
  }
510
-
511
- $wpuxss_eml_tax_options = array(
512
- 'tax_archives' => 1,
513
- 'edit_all_as_hierarchical' => 0,
514
- 'force_filters' => 0
515
- );
516
-
517
- update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
518
- update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
519
- }
520
  }
521
  }
522
 
3
  Plugin Name: Enhanced Media Library
4
  Plugin URI: http://wpUXsolutions.com
5
  Description: This plugin will be handy for those who need to manage a lot of media files.
6
+ Version: 2.0.4.1
7
  Author: wpUXsolutions
8
  Author URI: http://wpUXsolutions.com
9
  Text Domain: eml
23
 
24
 
25
 
26
+ $wpuxss_eml_version = '2.0.4.1';
27
 
28
 
29
 
 
 
 
 
30
  include_once( 'core/mime-types.php' );
31
  include_once( 'core/taxonomies.php' );
32
 
33
  if( is_admin() ) {
34
 
35
  include_once( 'core/options-pages.php' );
36
+ }
 
37
 
38
 
39
 
58
  $wpuxss_eml_dir = plugin_dir_url( __FILE__ );
59
  $wpuxss_eml_path = plugin_dir_path( __FILE__ );
60
 
61
+ load_textdomain( 'eml', $wpuxss_eml_path . 'languages/eml-' . get_locale() . '.mo' );
62
+ wpuxss_eml_on_activation_update();
63
+
64
+
65
  $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
66
  if ( empty($wpuxss_eml_taxonomies) ) $wpuxss_eml_taxonomies = array();
67
 
395
 
396
 
397
 
398
+
399
  /**
400
+ * wpuxss_eml_on_activation_update
401
  *
402
  * @since 2.0.4
403
  * @created 30/01/15
404
  */
405
 
406
+ if ( ! function_exists( 'wpuxss_eml_on_activation_update' ) ) {
407
 
408
+ function wpuxss_eml_on_activation_update() {
409
 
410
  global $wpuxss_eml_version;
411
+
412
  $wpuxss_eml_old_version = get_option('wpuxss_eml_version', false);
413
 
414
  if ( version_compare( $wpuxss_eml_version, $wpuxss_eml_old_version, '<>' ) )
415
  {
416
  update_option('wpuxss_eml_version', $wpuxss_eml_version );
 
417
 
418
+ if ( empty($wpuxss_eml_old_version) )
419
+ {
420
+ $wpuxss_eml_taxonomies['media_category'] = array(
421
+ 'assigned' => 1,
422
+ 'eml_media' => 1,
423
+ 'public' => 1,
424
+
425
+ 'labels' => array(
426
+ 'name' => 'Media Categories',
427
+ 'singular_name' => 'Media Category',
428
+ 'menu_name' => 'Media Categories',
429
+ 'all_items' => 'All Media Categories',
430
+ 'edit_item' => 'Edit Media Category',
431
+ 'view_item' => 'View Media Category',
432
+ 'update_item' => 'Update Media Category',
433
+ 'add_new_item' => 'Add New Media Category',
434
+ 'new_item_name' => 'New Media Category Name',
435
+ 'parent_item' => 'Parent Media Category',
436
+ 'parent_item_colon' => 'Parent Media Category:',
437
+ 'search_items' => 'Search Media Categories'
438
+ ),
439
+
440
+ 'hierarchical' => 1,
441
+
442
+ 'show_admin_column' => 1,
443
+ 'admin_filter' => 1, // list view filter
444
+ 'media_uploader_filter' => 1, // grid view filter
445
+ 'media_popup_taxonomy_edit' => 0,
446
+
447
+ 'show_in_nav_menus' => 1,
448
+ 'sort' => 0,
449
+ 'rewrite' => array(
450
+ 'slug' => 'media_category',
451
+ 'with_front' => 1
452
+ )
453
+ );
454
 
455
+ $wpuxss_eml_tax_options = array(
456
+ 'tax_archives' => 1,
457
+ 'edit_all_as_hierarchical' => 0,
458
+ 'force_filters' => 0
459
+ );
 
 
 
 
 
 
 
 
 
460
 
461
+ $allowed_mimes = get_allowed_mime_types();
462
 
463
+ foreach ( wp_get_mime_types() as $type => $mime )
464
+ {
465
+ $wpuxss_eml_mimes[$type] = array(
466
+ 'mime' => $mime,
467
+ 'singular' => $mime,
468
+ 'plural' => $mime,
469
+ 'filter' => 0,
470
+ 'upload' => isset($allowed_mimes[$type]) ? 1 : 0
471
+ );
472
+ }
473
 
474
+ $wpuxss_eml_mimes['pdf']['singular'] = 'PDF';
475
+ $wpuxss_eml_mimes['pdf']['plural'] = 'PDFs';
476
+ $wpuxss_eml_mimes['pdf']['filter'] = 1;
477
+
478
+ update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
479
+ update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
480
+
481
+ update_option( 'wpuxss_eml_mimes', $wpuxss_eml_mimes );
482
+ update_option( 'wpuxss_eml_mimes_backup', $wpuxss_eml_mimes );
483
+
484
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
  }
486
 
487
+ if ( version_compare( $wpuxss_eml_old_version, '2.0.2', '<' ) )
488
+ {
489
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
490
+
491
+ foreach( (array) $wpuxss_eml_taxonomies as $taxonomy => $params )
492
+ {
493
+ if ( $params['eml_media'] )
494
+ {
495
+ $wpuxss_eml_taxonomies[$taxonomy]['rewrite']['with_front'] = 1;
496
+ }
 
 
 
 
 
 
 
 
 
 
497
  }
498
+
499
+ update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
500
  }
501
 
502
+ if ( version_compare( $wpuxss_eml_old_version, '2.0.4', '<' ) )
503
+ {
504
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
505
+
506
+ foreach( (array) $wpuxss_eml_taxonomies as $taxonomy => $params )
507
+ {
508
+ $wpuxss_eml_taxonomies[$taxonomy]['media_popup_taxonomy_edit'] = 1;
509
+ }
510
+
511
+ $wpuxss_eml_tax_options = array(
512
+ 'tax_archives' => 1,
513
+ 'edit_all_as_hierarchical' => 0,
514
+ 'force_filters' => 0
515
+ );
516
+
517
+ update_option( 'wpuxss_eml_taxonomies', $wpuxss_eml_taxonomies );
518
+ update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
519
  }
520
+ } // endif
 
 
 
 
 
 
 
 
 
521
  }
522
  }
523
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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, categories, category, filter, image, images, media, upload
4
  Requires at least: 4.0
5
  Tested up to: 4.1.1
6
- Stable tag: 2.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -58,6 +58,7 @@ This plugin will be handy for those who need to manage a lot of media files.
58
 
59
  * Advanced Custom Fields / Advanced Custom Fields PRO
60
  * WooCommerce
 
61
 
62
  Please let us know if you find any issue with the plugins from the list above or others.
63
 
@@ -90,7 +91,7 @@ Try to just re-save permalinks settings. Go to Settings >> Permalinks and push "
90
 
91
  = Why Media Popup of some theme/plugin does not show taxonomy filters? =
92
 
93
- **UPD:** Since EML 2.0.4 there is an option 'Force filters' (see Media Settings > Taxonomies) that allows forcing media filters for ANY Media Popup regardless of what was intended by the author of a third-party plugin or theme.
94
 
95
  EML adds its filters to ANY media popup that already contains native WordPress filters. We chose NOT to force adding filters to ANY media popup because there are a lot of cases when filters are not acceptable and theme's/plugin's author did not add them intentionally.
96
 
@@ -126,16 +127,24 @@ Right now it is possible via WP_Query ([example of the code](http://wordpress.or
126
 
127
  == Changelog ==
128
 
 
 
129
 
 
 
 
 
 
 
130
  = 2.0.4 =
131
  *Release Date - March 05, 2015*
132
 
133
  = New =
134
  * Filters by 'All Uncategorized', 'All Media Categories', 'Not in Media Category' added to both List and Grid views and to Media Popup
135
- * New Media Taxonomy option: 'Edit in Media Popup' - Allows to show/hide taxonomy checkboxes in Media Popup per taxonomy
136
  * New Media Taxonomy option: 'Taxonomy archive pages' - Turn on/off taxonomy archive pages on the front-end
137
  * New Media Taxonomy option: 'Assign all like hierarchical' - Allows editing of non-hierarchical taxonomies like hierarchical (checkbox list) in Grid View / Media Popup
138
- * New Media Taxonomy option: 'Force filters' - Shows media filters for ANY Media Popup. May be useful for those who need to force filters for third-party plugins or themes.
139
 
140
  = Improvements =
141
  * Admin Menu: All Media Settings including native 'Settings > Media' are now under common 'Media Settings' admin menu
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, categories, category, filter, image, images, media, upload
4
  Requires at least: 4.0
5
  Tested up to: 4.1.1
6
+ Stable tag: 2.0.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
58
 
59
  * Advanced Custom Fields / Advanced Custom Fields PRO
60
  * WooCommerce
61
+ * Meta Slider
62
 
63
  Please let us know if you find any issue with the plugins from the list above or others.
64
 
91
 
92
  = Why Media Popup of some theme/plugin does not show taxonomy filters? =
93
 
94
+ [**UPD:** Since EML 2.0.4 there is an option 'Force filters' (see Media Settings > Taxonomies) that allows forcing media filters for ANY Media Popup regardless of what was intended by the author of a third-party plugin or theme.]
95
 
96
  EML adds its filters to ANY media popup that already contains native WordPress filters. We chose NOT to force adding filters to ANY media popup because there are a lot of cases when filters are not acceptable and theme's/plugin's author did not add them intentionally.
97
 
127
 
128
  == Changelog ==
129
 
130
+ = 2.0.4.1 =
131
+ *Release Date - March 07, 2015*
132
 
133
+ = Bugfixes =
134
+ * Plugin's options incorrect setting during update fixed. If your front-end media taxonomy archive pages were broken by the recent two updates, please re-save your Settings > Permalinks options
135
+ * The bug with "Fatal error: Call to undefined function ..." for Media Library List View fixed
136
+
137
+
138
+ &nbsp;
139
  = 2.0.4 =
140
  *Release Date - March 05, 2015*
141
 
142
  = New =
143
  * Filters by 'All Uncategorized', 'All Media Categories', 'Not in Media Category' added to both List and Grid views and to Media Popup
144
+ * New Media Taxonomy option: 'Edit in Media Popup' - Allows to show/hide taxonomy checkboxes in Media Popup per taxonomy.
145
  * New Media Taxonomy option: 'Taxonomy archive pages' - Turn on/off taxonomy archive pages on the front-end
146
  * New Media Taxonomy option: 'Assign all like hierarchical' - Allows editing of non-hierarchical taxonomies like hierarchical (checkbox list) in Grid View / Media Popup
147
+ * New Media Taxonomy option: 'Force filters' - Shows media filters for ANY Media Popup. May be useful for those who need to force filters for third-party plugins or themes
148
 
149
  = Improvements =
150
  * Admin Menu: All Media Settings including native 'Settings > Media' are now under common 'Media Settings' admin menu