Enhanced Media Library - Version 2.1.4

Version Description

Release Date - January 10, 2016

Download this release

Release Info

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

Code changes from version 2.1.3 to 2.1.4

core/eml-upload-4.4.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * EML custom upload.php
5
  *
6
- * Based on wp-admin/upload.php (4.2.2)
7
  *
8
  * Uses custom media table class WPUXSS_EML_Media_List_Table
9
  *
3
  /**
4
  * EML custom upload.php
5
  *
6
+ * Based on wp-admin/upload.php (4.4)
7
  *
8
  * Uses custom media table class WPUXSS_EML_Media_List_Table
9
  *
core/gallery.php CHANGED
@@ -3,39 +3,61 @@
3
 
4
 
5
  /**
6
- * wpuxss_eml_gallery_shortcode
7
  *
8
- * @since 2.1
9
- * @created 24/11/15
 
 
10
  */
11
 
12
- add_filter( 'post_gallery', 'wpuxss_eml_gallery_shortcode', 12, 3 );
13
 
14
- if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
15
 
16
- function wpuxss_eml_gallery_shortcode( $output, $attr, $instance = 0 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  $post = get_post();
19
 
20
  $is_filter_based = false;
21
 
22
-
23
- $html5 = current_theme_supports( 'html5', 'gallery' );
24
- $atts = shortcode_atts( array(
25
  'ids' => '',
26
  'order' => 'ASC',
27
  'orderby' => 'menu_order ID',
28
- 'itemtag' => $html5 ? 'figure' : 'dl',
29
- 'icontag' => $html5 ? 'div' : 'dt',
30
- 'captiontag' => $html5 ? 'figcaption' : 'dd',
31
- 'columns' => 3,
32
- 'size' => 'thumbnail',
33
  'include' => '',
34
- 'exclude' => '',
35
- 'link' => '',
36
- 'unattached' => ''
37
- ), $attr, 'gallery' );
38
 
 
 
 
 
 
 
 
 
39
 
40
  $query = array(
41
  'post_status' => 'inherit',
@@ -43,10 +65,9 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
43
  'post_mime_type' => 'image',
44
  'order' => $atts['order'],
45
  'orderby' => $atts['orderby'],
46
- 'posts_per_page' => -1, //TODO: add limit and pagination
47
  );
48
 
49
-
50
  if ( isset( $attr['monthnum'] ) && isset( $attr['year'] ) ) {
51
 
52
  $query['monthnum'] = $attr['monthnum'];
@@ -76,18 +97,6 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
76
  }
77
 
78
 
79
- if ( isset( $attr['id'] ) ) {
80
- $atts['id'] = intval( $attr['id'] );
81
- $is_filter_based = true;
82
- }
83
- elseif ( /*! isset( $attr['ids'] ) &&*/ ! $is_filter_based ) {
84
- $atts['id'] = $post ? intval( $post->ID ) : 0;
85
- }
86
-
87
- // we need a value for gallery tag attributes
88
- $id = isset( $attr['id'] ) ? $atts['id'] : 0;
89
-
90
-
91
  if ( $is_filter_based ) {
92
 
93
  if ( 'post__in' === $atts['orderby'] ) {
@@ -100,8 +109,8 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
100
  $query['tax_query'] = $tax_query;
101
  }
102
 
103
- if ( isset( $atts['id'] ) ) {
104
- $query['post_parent'] = intval( $atts['id'] );
105
  }
106
 
107
  $_attachments = get_posts( $query );
@@ -127,24 +136,45 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
127
 
128
  $attachments = get_children( $query );
129
  }
130
- else {
131
 
132
- $query['post_parent'] = isset( $atts['id'] ) ? $atts['id'] : 0;
133
 
134
  $attachments = get_children( $query );
135
  }
 
136
 
137
- if ( empty( $attachments ) ) {
138
- return '';
139
  }
140
 
141
- if ( is_feed() ) {
142
- $output = "\n";
143
- foreach ( $attachments as $att_id => $attachment ) {
144
- $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
145
- }
146
- return $output;
147
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
  $itemtag = tag_escape( $atts['itemtag'] );
150
  $captiontag = tag_escape( $atts['captiontag'] );
@@ -168,15 +198,7 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
168
 
169
  $gallery_style = '';
170
 
171
- /**
172
- * Filter whether to print default gallery styles.
173
- *
174
- * @since 3.1.0
175
- *
176
- * @param bool $print Whether to print default gallery styles.
177
- * Defaults to false if the theme supports HTML5 galleries.
178
- * Otherwise, defaults to true.
179
- */
180
  if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
181
  $gallery_style = "
182
  <style type='text/css'>
@@ -200,16 +222,9 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
200
  }
201
 
202
  $size_class = sanitize_html_class( $atts['size'] );
203
- $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
204
-
205
- /**
206
- * Filter the default gallery shortcode CSS styles.
207
- *
208
- * @since 2.5.0
209
- *
210
- * @param string $gallery_style Default CSS styles and opening HTML div container
211
- * for the gallery shortcode output.
212
- */
213
  $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
214
 
215
  $i = 0;
@@ -260,10 +275,70 @@ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
260
 
261
 
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  /**
264
  * wpuxss_eml_jp_carousel_force_enable
265
  *
266
- * Ensure Jetpack Carousel compatibility
267
  *
268
  * @since 2.1
269
  * @created 16/12/15
@@ -280,6 +355,92 @@ if ( ! function_exists( 'wpuxss_eml_jp_carousel_force_enable' ) ) {
280
 
281
 
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  /**
284
  * wpuxss_eml_print_media_gallery_templates
285
  *
@@ -412,9 +573,6 @@ if ( ! function_exists( 'wpuxss_eml_print_media_gallery_templates' ) ) {
412
  else if ( parseInt( uploadedTo ) ) {
413
  #><li>{{window.eml.l10n.uploaded_to}}{{uploadedTo}}</li><#
414
  }
415
- else {
416
- #><li>{{wp.media.view.l10n.unattached}}</li><#
417
- }
418
  }
419
  #>
420
  </ul>
3
 
4
 
5
  /**
6
+ * wpuxss_eml_get_gallery_attachments
7
  *
8
+ * 'eml_gallery_attachments' filter callback
9
+ *
10
+ * @since 2.1.4
11
+ * @created 26/12/15
12
  */
13
 
14
+ add_filter( 'eml_gallery_attachments', 'wpuxss_eml_get_gallery_attachments', 10, 2 );
15
 
16
+ if ( ! function_exists( 'wpuxss_eml_get_gallery_attachments' ) ) {
17
 
18
+ function wpuxss_eml_get_gallery_attachments( $attachments, $attr ) {
19
+
20
+ $attachments = eml_get_gallery_attachments( $attr );
21
+
22
+ return $attachments;
23
+ }
24
+ }
25
+
26
+
27
+
28
+ /**
29
+ * eml_get_gallery_attachments
30
+ *
31
+ * Retrive attachments for a gallery, for future API
32
+ *
33
+ * @since 2.1.4
34
+ * @created 08/01/16
35
+ */
36
+
37
+ if ( ! function_exists( 'eml_get_gallery_attachments' ) ) {
38
+
39
+ function eml_get_gallery_attachments( $attr ) {
40
 
41
  $post = get_post();
42
 
43
  $is_filter_based = false;
44
 
45
+ $atts = array_merge( array(
 
 
46
  'ids' => '',
47
  'order' => 'ASC',
48
  'orderby' => 'menu_order ID',
 
 
 
 
 
49
  'include' => '',
50
+ 'exclude' => ''
51
+ ), $attr );
 
 
52
 
53
+ if ( ! isset( $attr['id'] ) ) {
54
+ $atts['id'] = 0;
55
+ }
56
+ else {
57
+ $atts['id'] = isset( $post->ID ) ? intval( $post->ID ) : 0;
58
+ }
59
+
60
+ $id = intval( $atts['id'] );
61
 
62
  $query = array(
63
  'post_status' => 'inherit',
65
  'post_mime_type' => 'image',
66
  'order' => $atts['order'],
67
  'orderby' => $atts['orderby'],
68
+ 'posts_per_page' => isset( $atts['limit'] ) ? intval( $atts['limit'] ) : -1, //TODO: add pagination
69
  );
70
 
 
71
  if ( isset( $attr['monthnum'] ) && isset( $attr['year'] ) ) {
72
 
73
  $query['monthnum'] = $attr['monthnum'];
97
  }
98
 
99
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  if ( $is_filter_based ) {
101
 
102
  if ( 'post__in' === $atts['orderby'] ) {
109
  $query['tax_query'] = $tax_query;
110
  }
111
 
112
+ if ( $id ) {
113
+ $query['post_parent'] = $id;
114
  }
115
 
116
  $_attachments = get_posts( $query );
136
 
137
  $attachments = get_children( $query );
138
  }
139
+ elseif ( $id ) {
140
 
141
+ $query['post_parent'] = $id;
142
 
143
  $attachments = get_children( $query );
144
  }
145
+ else {
146
 
147
+ $attachments = array();
 
148
  }
149
 
150
+ return $attachments;
151
+ }
152
+ }
153
+
154
+
155
+
156
+ /**
157
+ * wpuxss_eml_get_gallery_html
158
+ *
159
+ * @since 2.1.4
160
+ * @created 26/12/15
161
+ */
162
+
163
+ add_filter( 'eml_gallery_output', 'wpuxss_eml_get_gallery_html', 10, 4 );
164
+
165
+ if ( ! function_exists( 'wpuxss_eml_get_gallery_html' ) ) {
166
+
167
+ function wpuxss_eml_get_gallery_html( $output, $attachments, $attr, $instance ) {
168
+
169
+ $html5 = current_theme_supports( 'html5', 'gallery' );
170
+ $atts = array_merge( array(
171
+ 'itemtag' => $html5 ? 'figure' : 'dl',
172
+ 'icontag' => $html5 ? 'div' : 'dt',
173
+ 'captiontag' => $html5 ? 'figcaption' : 'dd',
174
+ 'columns' => 3,
175
+ 'size' => 'thumbnail',
176
+ 'link' => ''
177
+ ), $attr );
178
 
179
  $itemtag = tag_escape( $atts['itemtag'] );
180
  $captiontag = tag_escape( $atts['captiontag'] );
198
 
199
  $gallery_style = '';
200
 
201
+
 
 
 
 
 
 
 
 
202
  if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) {
203
  $gallery_style = "
204
  <style type='text/css'>
222
  }
223
 
224
  $size_class = sanitize_html_class( $atts['size'] );
225
+ $gallery_div = "<div id='$selector' class='gallery galleryid-{$instance} gallery-columns-{$columns} gallery-size-{$size_class}'>";
226
+
227
+
 
 
 
 
 
 
 
228
  $output = apply_filters( 'gallery_style', $gallery_style . $gallery_div );
229
 
230
  $i = 0;
275
 
276
 
277
 
278
+ /**
279
+ * wpuxss_get_eml_gallery_feed
280
+ *
281
+ * @since 2.1.4
282
+ * @created 26/12/15
283
+ */
284
+
285
+ if ( ! function_exists( 'wpuxss_get_eml_gallery_feed' ) ) {
286
+
287
+ function wpuxss_get_eml_gallery_feed( $attachments, $attr ) {
288
+
289
+ $atts = array_merge( array(
290
+ 'size' => 'thumbnail',
291
+ ), $attr );
292
+
293
+ $output = "\n";
294
+ foreach ( $attachments as $att_id => $attachment ) {
295
+ $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
296
+ }
297
+ return $output;
298
+ }
299
+ }
300
+
301
+
302
+
303
+ /**
304
+ * wpuxss_eml_gallery_shortcode
305
+ *
306
+ * @since 2.1
307
+ * @created 24/11/15
308
+ */
309
+
310
+ add_filter( 'post_gallery', 'wpuxss_eml_gallery_shortcode', 12, 3 );
311
+
312
+ if ( ! function_exists( 'wpuxss_eml_gallery_shortcode' ) ) {
313
+
314
+ function wpuxss_eml_gallery_shortcode( $output, $attr, $instance = 0 ) {
315
+
316
+ $attr = apply_filters( 'eml_gallery_attributes', $attr );
317
+
318
+ $attachments = apply_filters( 'eml_gallery_attachments', array(), $attr );
319
+
320
+
321
+ if ( empty( $attachments ) ) {
322
+ return '';
323
+ }
324
+
325
+ if ( is_feed() ) {
326
+ $output = wpuxss_get_eml_gallery_feed( $attachments, $attr );
327
+ return $output;
328
+ }
329
+
330
+ $output = apply_filters( 'eml_gallery_output', '', $attachments, $attr, $instance );
331
+
332
+ return $output;
333
+ }
334
+ }
335
+
336
+
337
+
338
  /**
339
  * wpuxss_eml_jp_carousel_force_enable
340
  *
341
+ * Jetpack Carousel compatibility
342
  *
343
  * @since 2.1
344
  * @created 16/12/15
355
 
356
 
357
 
358
+ /**
359
+ * wpuxss_eml_jp_tiled_gallery_force_enable
360
+ *
361
+ * Jetpack (3.8.2) Tiled Galleries compatibility
362
+ *
363
+ * @since 2.1
364
+ * @created 16/12/15
365
+ */
366
+
367
+ add_filter( 'eml_gallery_output', 'wpuxss_eml_jp_tiled_gallery_force_enable', 10, 4 );
368
+
369
+ function wpuxss_eml_jp_tiled_gallery_force_enable( $output, $attachments, $attr, $instance ) {
370
+
371
+ if ( ! class_exists( 'Jetpack_Tiled_Gallery' ) ) {
372
+ return $output;
373
+ }
374
+
375
+ $html5 = current_theme_supports( 'html5', 'gallery' );
376
+ $atts = array_merge( array(
377
+ 'itemtag' => $html5 ? 'figure' : 'dl',
378
+ 'icontag' => $html5 ? 'div' : 'dt',
379
+ 'captiontag' => $html5 ? 'figcaption' : 'dd',
380
+ 'columns' => 3,
381
+ 'size' => 'thumbnail',
382
+ 'link' => ''
383
+ ), $attr );
384
+
385
+
386
+ $gallery = new eml_Jetpack_Tiled_Gallery;
387
+ $output = $gallery->gallery_output( $attachments, $atts );
388
+
389
+ return $output;
390
+ }
391
+
392
+
393
+
394
+ add_action( 'init', 'wpuxss_eml_jetpack_tiled_gallery_override' );
395
+
396
+ if ( ! function_exists( 'wpuxss_eml_jetpack_tiled_gallery_override' ) ) {
397
+
398
+ function wpuxss_eml_jetpack_tiled_gallery_override() {
399
+
400
+ if ( ! class_exists( 'Jetpack_Tiled_Gallery' ) ) {
401
+ return;
402
+ }
403
+
404
+ class eml_Jetpack_Tiled_Gallery extends Jetpack_Tiled_Gallery {
405
+
406
+ private static $talaveras = array( 'rectangular', 'square', 'circle', 'rectangle', 'columns' );
407
+
408
+ public function gallery_output( $attachments, $atts ) {
409
+
410
+ $this->set_atts( $atts );
411
+
412
+ if (
413
+ in_array(
414
+ $this->atts['type'],
415
+ $talaveras = apply_filters( 'jetpack_tiled_gallery_types', self::$talaveras )
416
+ )
417
+ ) {
418
+ // Enqueue styles and scripts
419
+ self::default_scripts_and_styles();
420
+
421
+ // Generate gallery HTML
422
+ $gallery_class = 'Jetpack_Tiled_Gallery_Layout_' . ucfirst( $this->atts['type'] );
423
+ $gallery = new $gallery_class( $attachments, $this->atts['link'], $this->atts['grayscale'], (int) $this->atts['columns'] );
424
+ $gallery_html = $gallery->HTML();
425
+
426
+ if ( $gallery_html && class_exists( 'Jetpack' ) && class_exists( 'Jetpack_Photon' ) ) {
427
+ // Tiled Galleries in Jetpack require that Photon be active.
428
+ // If it's not active, run it just on the gallery output.
429
+ if ( ! in_array( 'photon', Jetpack::get_active_modules() ) && ! Jetpack::is_development_mode() )
430
+ $gallery_html = Jetpack_Photon::filter_the_content( $gallery_html );
431
+ }
432
+
433
+ return trim( preg_replace( '/\s+/', ' ', $gallery_html ) ); // remove any new lines from the output so that the reader parses it better
434
+ }
435
+
436
+ return '';
437
+ }
438
+ }
439
+ }
440
+ }
441
+
442
+
443
+
444
  /**
445
  * wpuxss_eml_print_media_gallery_templates
446
  *
573
  else if ( parseInt( uploadedTo ) ) {
574
  #><li>{{window.eml.l10n.uploaded_to}}{{uploadedTo}}</li><#
575
  }
 
 
 
576
  }
577
  #>
578
  </ul>
core/options-pages.php CHANGED
@@ -724,11 +724,13 @@ if ( ! function_exists( 'wpuxss_eml_print_taxonomies_options' ) ) {
724
 
725
  <h2><?php _e('Options','eml'); ?></h2>
726
 
 
 
727
  <div class="postbox">
728
 
729
- <div class="inside">
730
 
731
- <?php $wpuxss_eml_tax_options = get_option( 'wpuxss_eml_tax_options' ); ?>
732
 
733
  <table class="form-table">
734
  <tr>
@@ -751,26 +753,77 @@ if ( ! function_exists( 'wpuxss_eml_print_taxonomies_options' ) ) {
751
  </fieldset>
752
  </td>
753
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
 
755
  <tr>
756
- <th scope="row"><?php _e('Force filters','eml'); ?></th>
757
  <td>
758
- <fieldset>
759
- <legend class="screen-reader-text"><span><?php _e('Force filters','eml'); ?></span></legend>
760
- <label for="wpuxss_eml_tax_options[force_filters]"><input name="wpuxss_eml_tax_options[force_filters]" type="hidden" value="0" /><input name="wpuxss_eml_tax_options[force_filters]" type="checkbox" value="1" <?php checked( true, $wpuxss_eml_tax_options['force_filters'], true ); ?> /> <?php _e('Show media filters for ANY Media Popup','eml'); ?></label>
761
- <p class="description"><?php _e( 'May be useful for those who need forcing filters for third-party plugins or themes.', 'eml' ); ?></p>
762
- </fieldset>
763
  </td>
764
  </tr>
765
 
766
  <tr>
767
- <th scope="row"><?php _e('Turn off enhanced gallery','eml'); ?></th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
768
  <td>
769
  <fieldset>
770
- <legend class="screen-reader-text"><span><?php _e('Turn off enhanced gallery','eml'); ?></span></legend>
771
- <label for="wpuxss_eml_tax_options[turn_off_gallery_shortcode]"><input name="wpuxss_eml_tax_options[turn_off_gallery_shortcode]" type="hidden" value="0" /><input name="wpuxss_eml_tax_options[turn_off_gallery_shortcode]" type="checkbox" value="1" <?php checked( true, $wpuxss_eml_tax_options['turn_off_gallery_shortcode'], true ); ?> /> <?php _e('Do not enhance WordPress native gallery shortcode','eml'); ?></label>
772
- <p class="description"><?php _e( 'May be useful in case of incompatibility with other plugins or themes. Use the option if you think it breaks your galleries in any way.', 'eml' ); ?></p>
773
- <p class="description"><?php _e( 'Please inform plugin authors about the issue. We would like to fix it!', 'eml' ); ?></p>
774
  </fieldset>
775
  </td>
776
  </tr>
724
 
725
  <h2><?php _e('Options','eml'); ?></h2>
726
 
727
+ <?php $wpuxss_eml_tax_options = get_option( 'wpuxss_eml_tax_options' ); ?>
728
+
729
  <div class="postbox">
730
 
731
+ <h3 class="hndle"><?php _e('General','eml'); ?></h3>
732
 
733
+ <div class="inside">
734
 
735
  <table class="form-table">
736
  <tr>
753
  </fieldset>
754
  </td>
755
  </tr>
756
+ </table>
757
+
758
+ <?php submit_button(); ?>
759
+
760
+ </div>
761
+
762
+ </div>
763
+
764
+ <div class="postbox">
765
+
766
+ <h3 class="hndle"><?php _e('Filters','eml'); ?></h3>
767
+
768
+ <div class="inside">
769
+
770
+ <table class="form-table">
771
 
772
  <tr>
773
+ <th scope="row"><label for="wpuxss_eml_tax_options[force_filters]"><?php _e('Force filters','eml'); ?></label></th>
774
  <td>
775
+ <input name="wpuxss_eml_tax_options[force_filters]" type="hidden" value="0" /><input name="wpuxss_eml_tax_options[force_filters]" type="checkbox" value="1" <?php checked( true, $wpuxss_eml_tax_options['force_filters'], true ); ?> /> <?php _e('Show media filters for ANY Media Popup','eml'); ?>
776
+ <p class="description"><?php _e( 'Try this if filters are not shown for third-party plugins or themes.', 'eml' ); ?></p>
 
 
 
777
  </td>
778
  </tr>
779
 
780
  <tr>
781
+ <th scope="row"><label for="wpuxss_eml_tax_options[media_orderby]"><?php _e('Order media items by','eml'); ?></label></th>
782
+ <td>
783
+ <select name="wpuxss_eml_tax_options[media_orderby]" id="wpuxss_eml_tax_options_media_orderby">
784
+ <option value="date" <?php selected( $wpuxss_eml_tax_options['media_orderby'], 'date' ); ?>>Date</option>
785
+ <option value="title" <?php selected( $wpuxss_eml_tax_options['media_orderby'], 'title' ); ?>>Title</option>
786
+ <option value="menuOrder" <?php selected( $wpuxss_eml_tax_options['media_orderby'], 'menuOrder' ); ?>>Custom Order</option>
787
+ </select>
788
+ <?php _e('For media library and media popups','eml'); ?>
789
+ <p class="description"><?php _e( 'Option allows to change order by drag and drop with Custom Order value.', 'eml' ); ?></p>
790
+ </td>
791
+ </tr>
792
+
793
+ <tr>
794
+ <th scope="row"><label for="wpuxss_eml_tax_options[media_order]"><?php _e('Sort order','eml'); ?></label></th>
795
+ <td>
796
+ <select name="wpuxss_eml_tax_options[media_order]" id="wpuxss_eml_tax_options_media_order">
797
+ <option value="ASC" <?php selected( $wpuxss_eml_tax_options['media_order'], 'ASC' ); ?>>Ascending</option>
798
+ <option value="DESC" <?php selected( $wpuxss_eml_tax_options['media_order'], 'DESC' ); ?>>Descending</option>
799
+ </select>
800
+ <?php _e('For media library and media popups','eml'); ?>
801
+ </td>
802
+ </tr>
803
+ </table>
804
+
805
+ <?php submit_button(); ?>
806
+
807
+ </div>
808
+
809
+ </div>
810
+
811
+ <div class="postbox">
812
+
813
+ <h3 class="hndle"><?php _e('Gallery','eml'); ?></h3>
814
+
815
+ <div class="inside">
816
+
817
+ <table class="form-table">
818
+
819
+ <tr>
820
+ <th scope="row"><?php _e('Enhanced gallery','eml'); ?></th>
821
  <td>
822
  <fieldset>
823
+ <legend class="screen-reader-text"><span><?php _e('Enhanced gallery','eml'); ?></span></legend>
824
+ <label for="wpuxss_eml_tax_options[enhance_gallery_shortcode]"><input name="wpuxss_eml_tax_options[enhance_gallery_shortcode]" type="hidden" value="0" /><input name="wpuxss_eml_tax_options[enhance_gallery_shortcode]" type="checkbox" value="1" <?php checked( true, $wpuxss_eml_tax_options['enhance_gallery_shortcode'], true ); ?> /> <?php _e('Enhance WordPress native gallery shortcode to make it understand media taxonomies, date, and image number limit','eml'); ?></label>
825
+ <p class="description"><?php _e( 'The example: [gallery media_category="5" limit="10" monthnum="12" year="2015"]', 'eml' ); ?></p>
826
+ <p class="description"><?php _e( '<strong style="color:red">Warning:</strong> Incompatibility with other gallery plugins or themes possible! <a href="http://www.wpuxsolutions.com/documents/enhanced-media-library/enhanced-gallery-issues/">Learn more.</a> Please check out your gallery front-end and back-end functionality once this option activated. If you find an issue please inform plugin authors at <a href="https://wordpress.org/support/plugin/enhanced-media-library">wordpress.org</a> or <a href="http://www.wpuxsolutions.com/support/create-new-ticket/">wpuxsolutions.com</a>.', 'eml' ); ?></p>
827
  </fieldset>
828
  </td>
829
  </tr>
core/taxonomies.php CHANGED
@@ -61,15 +61,15 @@ if( ! function_exists( 'wpuxss_eml_taxonomies_validate' ) ) {
61
  $taxonomy = $sanitized_taxonomy;
62
  }
63
 
64
- $input[$taxonomy]['hierarchical'] = isset($params['hierarchical']) && !! $params['hierarchical'] ? 1: 0;
65
- $input[$taxonomy]['sort'] = isset($params['sort']) && !! $params['sort'] ? 1: 0;
66
- $input[$taxonomy]['show_admin_column'] = isset($params['show_admin_column']) && !! $params['show_admin_column'] ? 1: 0;
67
- $input[$taxonomy]['show_in_nav_menus'] = isset($params['show_in_nav_menus']) && !! $params['show_in_nav_menus'] ? 1: 0;
68
- $input[$taxonomy]['assigned'] = isset($params['assigned']) && !! $params['assigned'] ? 1: 0;
69
- $input[$taxonomy]['admin_filter'] = isset($params['admin_filter']) && !! $params['admin_filter'] ? 1: 0;
70
- $input[$taxonomy]['media_uploader_filter'] = isset($params['media_uploader_filter']) && !! $params['media_uploader_filter'] ? 1: 0;
71
- $input[$taxonomy]['media_popup_taxonomy_edit'] = isset($params['media_popup_taxonomy_edit']) && !! $params['media_popup_taxonomy_edit'] ? 1: 0;
72
- $input[$taxonomy]['rewrite']['with_front'] = isset($params['rewrite']['with_front']) && !! $params['rewrite']['with_front'] ? 1: 0;
73
  $input[$taxonomy]['rewrite']['slug'] = isset($params['rewrite']['slug']) ? wpuxss_eml_sanitize_slug( $params['rewrite']['slug'], $taxonomy ) : '';
74
 
75
  if ( isset( $params['labels'] ) ) {
@@ -152,7 +152,17 @@ if( ! function_exists( 'wpuxss_eml_tax_options_validate' ) ) {
152
  function wpuxss_eml_tax_options_validate( $input ) {
153
 
154
  foreach ( (array)$input as $key => $option ) {
155
- $input[$key] = intval( $option );
 
 
 
 
 
 
 
 
 
 
156
  }
157
 
158
  return $input;
@@ -344,7 +354,7 @@ if( ! function_exists( 'wpuxss_eml_restrict_manage_posts' ) ) {
344
  'show_count' => false,
345
  'hide_empty' => false,
346
  'hide_if_empty' => true,
347
- 'class' => 'eml-attachment-filters'
348
  )
349
  );
350
  }
@@ -444,7 +454,7 @@ if( ! function_exists( 'wpuxss_eml_custom_media' ) ) {
444
  require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
445
  require_once( 'class-eml-media-list-table.php' );
446
 
447
- if ( version_compare( $wp_version, '4.1', '<=' ) )
448
  require_once( 'eml-upload-4.1.php' );
449
  else
450
  require_once( 'eml-upload-4.4.php' );
@@ -730,10 +740,16 @@ if( ! class_exists('Walker_Media_Taxonomy_Uploader_Filter') ) {
730
 
731
  function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
732
 
733
- extract($args);
734
 
735
  $indent = str_repeat('&nbsp;&nbsp;&nbsp;', $depth);
736
- $output .= $category->term_id . '>' . $indent . esc_html( apply_filters('the_category', $category->name )) . '|';
 
 
 
 
 
 
737
  }
738
 
739
  function end_el( &$output, $category, $depth = 0, $args = array() ) {
@@ -817,6 +833,22 @@ if( ! function_exists('wpuxss_eml_save_attachment_compat') ) {
817
 
818
 
819
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
  /**
821
  * wpuxss_eml_pre_get_posts
822
  *
@@ -832,21 +864,39 @@ if( ! function_exists('wpuxss_eml_pre_get_posts') ) {
832
 
833
  function wpuxss_eml_pre_get_posts( $query ) {
834
 
835
- $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
836
 
837
- if ( $wpuxss_eml_tax_options['tax_archives'] ) {
838
 
839
- $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
 
 
 
 
840
 
841
- foreach ( (array) $wpuxss_eml_taxonomies as $taxonomy => $params ) {
842
 
843
- if ( $params['assigned'] && $params['eml_media'] && $query->is_main_query() && is_tax($taxonomy) && !is_admin() ) {
844
 
845
- $query->set( 'post_type', 'attachment' );
846
- $query->set( 'post_status', 'inherit' );
 
847
  }
848
  }
849
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
850
  }
851
  }
852
 
61
  $taxonomy = $sanitized_taxonomy;
62
  }
63
 
64
+ $input[$taxonomy]['hierarchical'] = isset($params['hierarchical']) && !! $params['hierarchical'] ? 1 : 0;
65
+ $input[$taxonomy]['sort'] = isset($params['sort']) && !! $params['sort'] ? 1 : 0;
66
+ $input[$taxonomy]['show_admin_column'] = isset($params['show_admin_column']) && !! $params['show_admin_column'] ? 1 : 0;
67
+ $input[$taxonomy]['show_in_nav_menus'] = isset($params['show_in_nav_menus']) && !! $params['show_in_nav_menus'] ? 1 : 0;
68
+ $input[$taxonomy]['assigned'] = isset($params['assigned']) && !! $params['assigned'] ? 1 : 0;
69
+ $input[$taxonomy]['admin_filter'] = isset($params['admin_filter']) && !! $params['admin_filter'] ? 1 : 0;
70
+ $input[$taxonomy]['media_uploader_filter'] = isset($params['media_uploader_filter']) && !! $params['media_uploader_filter'] ? 1 : 0;
71
+ $input[$taxonomy]['media_popup_taxonomy_edit'] = isset($params['media_popup_taxonomy_edit']) && !! $params['media_popup_taxonomy_edit'] ? 1 : 0;
72
+ $input[$taxonomy]['rewrite']['with_front'] = isset($params['rewrite']['with_front']) && !! $params['rewrite']['with_front'] ? 1 : 0;
73
  $input[$taxonomy]['rewrite']['slug'] = isset($params['rewrite']['slug']) ? wpuxss_eml_sanitize_slug( $params['rewrite']['slug'], $taxonomy ) : '';
74
 
75
  if ( isset( $params['labels'] ) ) {
152
  function wpuxss_eml_tax_options_validate( $input ) {
153
 
154
  foreach ( (array)$input as $key => $option ) {
155
+
156
+ if ( 'media_orderby' === $key || 'media_order' === $key ) {
157
+ $input[$key] = sanitize_text_field( $option );
158
+ }
159
+ else {
160
+ $input[$key] = intval( $option );
161
+ }
162
+ }
163
+
164
+ if ( ! isset( $input['media_order'] ) ) {
165
+ $input['media_order'] = 'ASC';
166
  }
167
 
168
  return $input;
354
  'show_count' => false,
355
  'hide_empty' => false,
356
  'hide_if_empty' => true,
357
+ 'class' => 'eml-taxonomy-filters'
358
  )
359
  );
360
  }
454
  require_once( ABSPATH . 'wp-admin/includes/class-wp-media-list-table.php' );
455
  require_once( 'class-eml-media-list-table.php' );
456
 
457
+ if ( version_compare( $wp_version, '4.2', '<' ) )
458
  require_once( 'eml-upload-4.1.php' );
459
  else
460
  require_once( 'eml-upload-4.4.php' );
740
 
741
  function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
742
 
743
+ //extract($args);
744
 
745
  $indent = str_repeat('&nbsp;&nbsp;&nbsp;', $depth);
746
+
747
+ $el = array(
748
+ 'term_id' => $category->term_id,
749
+ 'term_name' => $indent . esc_html( apply_filters( 'the_category', $category->name ) )
750
+ );
751
+
752
+ $output .= json_encode( $el );
753
  }
754
 
755
  function end_el( &$output, $category, $depth = 0, $args = array() ) {
833
 
834
 
835
 
836
+ // TODO: Quick Edit for the List mode (MediaFrame.EditAttachments)
837
+ // add_filter( 'media_row_actions', 'wpuxss_eml_media_row_actions', 10, 2 );
838
+ //
839
+ // if( ! function_exists( 'wpuxss_eml_media_row_actions' ) ) {
840
+ //
841
+ // function wpuxss_eml_media_row_actions( $actions, $post ) {
842
+ //
843
+ // $first = array_splice ( $actions, 0, 1 );
844
+ // $actions = array_merge ( $first, array( 'eml_quick_edit' => '<a href="#" data-attachment-id="' . $post->ID . '">Quick Edit</a>' ), $actions );
845
+ //
846
+ // return $actions;
847
+ // }
848
+ // }
849
+
850
+
851
+
852
  /**
853
  * wpuxss_eml_pre_get_posts
854
  *
864
 
865
  function wpuxss_eml_pre_get_posts( $query ) {
866
 
867
+ global $current_screen;
868
 
869
+ if ( ! is_admin() && $query->is_main_query() ) {
870
 
871
+ $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
872
+
873
+ if ( $wpuxss_eml_tax_options['tax_archives'] ) {
874
+
875
+ $wpuxss_eml_taxonomies = get_option('wpuxss_eml_taxonomies');
876
 
877
+ foreach ( (array) $wpuxss_eml_taxonomies as $taxonomy => $params ) {
878
 
879
+ if ( $params['assigned'] && $params['eml_media'] && is_tax( $taxonomy ) ) {
880
 
881
+ $query->set( 'post_type', 'attachment' );
882
+ $query->set( 'post_status', 'inherit' );
883
+ }
884
  }
885
  }
886
  }
887
+
888
+ if ( is_admin() && $query->is_main_query() && 'attachment' === $query->get('post_type') ) {
889
+
890
+ $media_library_mode = get_user_option( 'media_library_mode' ) ? get_user_option( 'media_library_mode' ) : 'grid';
891
+ $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
892
+ $orderby = $query->get('orderby');
893
+ $order = $query->get('order');
894
+
895
+ if ( isset( $current_screen ) && 'upload' === $current_screen->base && 'list' === $media_library_mode && empty( $orderby ) && empty( $order ) ) {
896
+ $query->set('orderby', $wpuxss_eml_tax_options['media_orderby'] );
897
+ $query->set('order', $wpuxss_eml_tax_options['media_order'] );
898
+ }
899
+ }
900
  }
901
  }
902
 
css/eml-admin.css CHANGED
@@ -270,6 +270,10 @@ body.eml-media-css .media-modal.acf-expanded .attachments-browser .media-toolbar
270
  width: 70%;
271
  }
272
 
 
 
 
 
273
 
274
 
275
 
270
  width: 70%;
271
  }
272
 
273
+ #wpuxss-eml-global-options-wrap #poststuff h2 {
274
+ font-size: 23px;
275
+ font-weight: 400;
276
+ }
277
 
278
 
279
 
enhanced-media-library.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
  /*
3
  Plugin Name: Enhanced Media Library
4
- Depends: Toolbar Publish Button
5
  Plugin URI: http://wpUXsolutions.com
6
  Description: This plugin will be handy for those who need to manage a lot of media files.
7
- Version: 2.1.3
8
  Author: wpUXsolutions
9
  Author URI: http://wpUXsolutions.com
10
  Text Domain: eml
11
  Domain Path: /languages
12
  License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13
 
14
- Copyright 2013-2015 wpUXsolutions (email : wpUXsolutions@gmail.com)
15
  */
16
 
17
 
@@ -23,7 +22,7 @@ global $wp_version,
23
 
24
 
25
 
26
- $wpuxss_eml_version = '2.1.3';
27
 
28
 
29
 
@@ -67,20 +66,21 @@ if ( ! function_exists( 'wpuxss_get_eml_basename' ) ) {
67
 
68
 
69
  /**
70
- * wpuxss_eml_use_enhanced_gallery_shortcode
71
  *
72
- * @since 2.1.3
73
- * @created 16/12/15
74
  */
75
 
76
- if ( ! function_exists( 'wpuxss_eml_use_enhanced_gallery_shortcode' ) ) {
77
 
78
- function wpuxss_eml_use_enhanced_gallery_shortcode() {
79
 
80
  $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
81
- $use_gallery = isset( $wpuxss_eml_tax_options['turn_off_gallery_shortcode'] ) ? ! (bool)$wpuxss_eml_tax_options['turn_off_gallery_shortcode'] : true;
82
 
83
- return $use_gallery;
 
 
84
  }
85
  }
86
 
@@ -112,7 +112,7 @@ if ( ! function_exists( 'wpuxss_eml_on_plugins_loaded' ) ) {
112
  include_once( 'core/mime-types.php' );
113
  include_once( 'core/taxonomies.php' );
114
 
115
- if ( wpuxss_eml_use_enhanced_gallery_shortcode() ) {
116
  include_once( 'core/gallery.php' );
117
  }
118
 
@@ -351,20 +351,19 @@ if ( ! function_exists( 'wpuxss_eml_enqueue_media' ) ) {
351
 
352
  ob_end_clean();
353
 
354
- $terms = array_filter( explode('|', $html) );
355
 
356
- if ( ! empty( $terms ) ) {
 
 
 
357
 
358
- foreach ( $terms as $term ) {
359
 
360
- $term = explode('>', $term);
361
- array_push($terms_array, array('term_id' => $term[0], 'term_name' => $term[1]));
362
- }
363
 
364
  $taxonomies_array[$taxonomy->name] = array(
365
  'singular_name' => $taxonomy->labels->singular_name,
366
  'plural_name' => $taxonomy->labels->name,
367
- 'term_list' => $terms_array
368
  );
369
  }
370
  }
@@ -429,6 +428,8 @@ if ( ! function_exists( 'wpuxss_eml_enqueue_media' ) ) {
429
  'compat_taxonomies_to_hide' => $compat_taxonomies_to_hide,
430
  'is_tax_compat' => count( $compat_taxonomies_to_show ) ? 1 : 0,
431
  'force_filters' => $wpuxss_eml_tax_options['force_filters'],
 
 
432
  'wp_version' => $wp_version,
433
  'uncategorized' => __( 'All Uncategorized', 'eml' ),
434
  'filter_by' => __( 'Filter by ', 'eml' ),
@@ -444,7 +445,7 @@ if ( ! function_exists( 'wpuxss_eml_enqueue_media' ) ) {
444
  );
445
 
446
 
447
- if ( wpuxss_eml_use_enhanced_gallery_shortcode() ) {
448
 
449
  wp_enqueue_script(
450
  'wpuxss-eml-enhanced-gallery-script',
@@ -462,15 +463,15 @@ if ( ! function_exists( 'wpuxss_eml_enqueue_media' ) ) {
462
  true
463
  );
464
 
465
- $media_editor_l10n = array(
466
  'all_taxonomies' => $all_taxonomies_array,
467
  'uploaded_to' => __( 'Uploaded to post #', 'eml' )
468
  );
469
 
470
  wp_localize_script(
471
- 'wpuxss-eml-media-editor-script',
472
- 'wpuxss_eml_media_editor_l10n',
473
- $media_editor_l10n
474
  );
475
  }
476
 
@@ -590,7 +591,9 @@ if ( ! function_exists( 'wpuxss_eml_on_activation_update' ) ) {
590
  'tax_archives' => 1,
591
  'edit_all_as_hierarchical' => 0,
592
  'force_filters' => 0,
593
- 'turn_off_gallery_shortcode' => 0
 
 
594
  );
595
 
596
  $allowed_mimes = get_allowed_mime_types();
@@ -653,10 +656,12 @@ if ( ! function_exists( 'wpuxss_eml_on_activation_update' ) ) {
653
  update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
654
  }
655
 
656
- if ( version_compare( $wpuxss_eml_old_version, '2.1.3', '<' ) ) {
657
 
658
  $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
659
- $wpuxss_eml_tax_options['turn_off_gallery_shortcode'] = 0;
 
 
660
 
661
  update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
662
  }
1
  <?php
2
  /*
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.1.4
7
  Author: wpUXsolutions
8
  Author URI: http://wpUXsolutions.com
9
  Text Domain: eml
10
  Domain Path: /languages
11
  License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12
 
13
+ Copyright 2013-2016 wpUXsolutions (email : wpUXsolutions@gmail.com)
14
  */
15
 
16
 
22
 
23
 
24
 
25
+ $wpuxss_eml_version = '2.1.4';
26
 
27
 
28
 
66
 
67
 
68
  /**
69
+ * wpuxss_eml_enhance_gallery_shortcode
70
  *
71
+ * @since 2.1.4
72
+ * @created 08/01/16
73
  */
74
 
75
+ if ( ! function_exists( 'wpuxss_eml_enhance_gallery_shortcode' ) ) {
76
 
77
+ function wpuxss_eml_enhance_gallery_shortcode() {
78
 
79
  $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
 
80
 
81
+ $enhance_gallery_shortcode = isset( $wpuxss_eml_tax_options['enhance_gallery_shortcode'] ) ? (bool)$wpuxss_eml_tax_options['enhance_gallery_shortcode'] : false;
82
+
83
+ return $enhance_gallery_shortcode;
84
  }
85
  }
86
 
112
  include_once( 'core/mime-types.php' );
113
  include_once( 'core/taxonomies.php' );
114
 
115
+ if ( wpuxss_eml_enhance_gallery_shortcode() ) {
116
  include_once( 'core/gallery.php' );
117
  }
118
 
351
 
352
  ob_end_clean();
353
 
 
354
 
355
+ $html = str_replace( '}{', '},{', $html );
356
+ $html = '[' . $html . ']';
357
+ $terms = json_decode( $html, true );
358
+ $terms = array_filter( $terms );
359
 
 
360
 
361
+ if ( ! empty( $terms ) ) {
 
 
362
 
363
  $taxonomies_array[$taxonomy->name] = array(
364
  'singular_name' => $taxonomy->labels->singular_name,
365
  'plural_name' => $taxonomy->labels->name,
366
+ 'term_list' => $terms
367
  );
368
  }
369
  }
428
  'compat_taxonomies_to_hide' => $compat_taxonomies_to_hide,
429
  'is_tax_compat' => count( $compat_taxonomies_to_show ) ? 1 : 0,
430
  'force_filters' => $wpuxss_eml_tax_options['force_filters'],
431
+ 'media_orderby' => $wpuxss_eml_tax_options['media_orderby'],
432
+ 'media_order' => $wpuxss_eml_tax_options['media_order'],
433
  'wp_version' => $wp_version,
434
  'uncategorized' => __( 'All Uncategorized', 'eml' ),
435
  'filter_by' => __( 'Filter by ', 'eml' ),
445
  );
446
 
447
 
448
+ if ( wpuxss_eml_enhance_gallery_shortcode() ) {
449
 
450
  wp_enqueue_script(
451
  'wpuxss-eml-enhanced-gallery-script',
463
  true
464
  );
465
 
466
+ $enhanced_gallery_l10n = array(
467
  'all_taxonomies' => $all_taxonomies_array,
468
  'uploaded_to' => __( 'Uploaded to post #', 'eml' )
469
  );
470
 
471
  wp_localize_script(
472
+ 'wpuxss-eml-enhanced-gallery-script',
473
+ 'wpuxss_eml_enhanced_gallery_l10n',
474
+ $enhanced_gallery_l10n
475
  );
476
  }
477
 
591
  'tax_archives' => 1,
592
  'edit_all_as_hierarchical' => 0,
593
  'force_filters' => 0,
594
+ 'enhance_gallery_shortcode' => 0,
595
+ 'media_orderby' => 'date',
596
+ 'media_order' => 'DESC'
597
  );
598
 
599
  $allowed_mimes = get_allowed_mime_types();
656
  update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
657
  }
658
 
659
+ if ( version_compare( $wpuxss_eml_old_version, '2.1.4', '<' ) ) {
660
 
661
  $wpuxss_eml_tax_options = get_option('wpuxss_eml_tax_options');
662
+ $wpuxss_eml_tax_options['enhance_gallery_shortcode'] = 0;
663
+ $wpuxss_eml_tax_options['media_orderby'] = 'date';
664
+ $wpuxss_eml_tax_options['media_order'] = 'DESC';
665
 
666
  update_option( 'wpuxss_eml_tax_options', $wpuxss_eml_tax_options );
667
  }
js/eml-enhanced-gallery.js CHANGED
@@ -1,34 +1,26 @@
1
  window.wp = window.wp || {};
 
2
 
3
 
4
 
5
- window.emlIsGalleryFilterBased = function( attrs ) {
6
 
7
- var filterBasedFields;
8
-
9
- if ( _.isUndefined( attrs ) ) {
10
  return false;
11
  }
12
 
13
- // because of 0 (unattached) value
14
- if ( ! _.isUndefined( attrs.uploadedTo ) ) {
15
  return true;
16
  }
17
 
18
  if ( _.filter( _.pick( attrs, 'monthnum', 'year' ), _.identity ).length == 2 ) {
19
- filterBasedFields = _.omit( attrs, 'type', 'orderby', 'order', 'query', 'perPage', 'post__in', 'include', 'exclude', 'id', 'ids', 'columns', 'itemtag', 'icontag', 'captiontag', 'link', 'size', '_orderByField', '_orderbyRandom' );
20
- }
21
- else {
22
- filterBasedFields = _.omit( attrs, 'type', 'orderby', 'order', 'query', 'perPage', 'post__in', 'include', 'exclude', 'id', 'ids', 'columns', 'itemtag', 'icontag', 'captiontag', 'link', 'size', '_orderByField', '_orderbyRandom', 'monthnum', 'year' );
23
- }
24
-
25
- // if any of these is set: %taxonomy_name%, monthnum, year
26
- if ( _.filter( _.values( filterBasedFields ), _.identity ).length ) {
27
  return true;
28
  }
29
 
30
- return false;
31
- };
 
 
32
 
33
 
34
 
@@ -37,6 +29,12 @@ window.emlIsGalleryFilterBased = function( attrs ) {
37
  var media = wp.media,
38
  original = {};
39
 
 
 
 
 
 
 
40
  /**
41
  * wp.media.view.MediaFrame.Post
42
  *
1
  window.wp = window.wp || {};
2
+ window.eml = window.eml || { l10n: {} };
3
 
4
 
5
 
6
+ function emlIsGalleryFilterBased( attrs ) {
7
 
8
+ if ( _.isUndefined( attrs ) || _.isEmpty( attrs ) ) {
 
 
9
  return false;
10
  }
11
 
12
+ if ( attrs.uploadedTo ) {
 
13
  return true;
14
  }
15
 
16
  if ( _.filter( _.pick( attrs, 'monthnum', 'year' ), _.identity ).length == 2 ) {
 
 
 
 
 
 
 
 
17
  return true;
18
  }
19
 
20
+ return _.some( eml.l10n.all_taxonomies, function( terms, taxonomy ) {
21
+ return ( ! _.isUndefined( attrs[taxonomy] ) && ! _.isNull( attrs[taxonomy] ) );
22
+ });
23
+ }
24
 
25
 
26
 
29
  var media = wp.media,
30
  original = {};
31
 
32
+
33
+
34
+ _.extend( eml.l10n, wpuxss_eml_enhanced_gallery_l10n );
35
+
36
+
37
+
38
  /**
39
  * wp.media.view.MediaFrame.Post
40
  *
js/eml-media-editor.js CHANGED
@@ -1,16 +1,12 @@
1
  window.wp = window.wp || {};
2
  window.eml = window.eml || { l10n: {} };
3
 
4
- ( function( $, _ ) {
5
-
6
- var media = wp.media,
7
- l10n = media.view.l10n,
8
- original = {},
9
- gallery = wp.mce.views.get('gallery');
10
 
11
 
 
12
 
13
- _.extend( eml.l10n, wpuxss_eml_media_editor_l10n );
 
14
 
15
 
16
 
@@ -24,6 +20,7 @@ window.eml = window.eml || { l10n: {} };
24
 
25
  delete media.gallery.defaults.id;
26
 
 
27
  _.extend( media.gallery, {
28
 
29
  collections: {},
@@ -39,8 +36,7 @@ window.eml = window.eml || { l10n: {} };
39
 
40
  delete collections[ shortcodeString ];
41
 
42
-
43
- if ( result && ! isFilterBased ) {
44
  return result;
45
  }
46
 
@@ -48,8 +44,12 @@ window.eml = window.eml || { l10n: {} };
48
  attrs = _.defaults( shortcode.attrs.named, this.defaults );
49
  args = _.pick( attrs, 'orderby', 'order' );
50
 
 
 
 
 
51
  args.type = this.type;
52
- args.perPage = -1;
53
 
54
 
55
  if ( 'rand' === attrs.orderby ) {
@@ -69,13 +69,13 @@ window.eml = window.eml || { l10n: {} };
69
  args.order = 'ASC';
70
  }
71
 
72
- if ( undefined === attrs.id && ! isFilterBased ) {
73
  attrs.id = media.view.settings.post && media.view.settings.post.id;
74
  }
75
 
76
  if ( isFilterBased ) {
77
 
78
- if ( undefined !== attrs.id ) {
79
  args.uploadedTo = attrs.id;
80
  }
81
 
@@ -160,7 +160,7 @@ window.eml = window.eml || { l10n: {} };
160
  }
161
 
162
  // Copy the `uploadedTo` post ID.
163
- if ( undefined !== props.uploadedTo && null !== props.uploadedTo ) {
164
  attrs.id = props.uploadedTo;
165
  }
166
 
@@ -192,8 +192,11 @@ window.eml = window.eml || { l10n: {} };
192
  delete attrs.order;
193
  }
194
 
195
- attrs = this.setDefaults( attrs );
 
 
196
 
 
197
 
198
  shortcode = new wp.shortcode({
199
  tag: this.tag,
@@ -212,8 +215,8 @@ window.eml = window.eml || { l10n: {} };
212
  },
213
 
214
  edit: function( content ) {
215
-
216
  var shortcode = wp.shortcode.next( this.tag, content ),
 
217
  attachments, selection, state;
218
 
219
  // Bail if we didn't match the shortcode or all of the content.
@@ -224,6 +227,10 @@ window.eml = window.eml || { l10n: {} };
224
  // Ignore the rest of the match object.
225
  shortcode = shortcode.shortcode;
226
 
 
 
 
 
227
  attachments = this.attachments( shortcode );
228
 
229
  selection = new wp.media.model.Selection( attachments.models, {
1
  window.wp = window.wp || {};
2
  window.eml = window.eml || { l10n: {} };
3
 
 
 
 
 
 
 
4
 
5
 
6
+ ( function( $, _ ) {
7
 
8
+ var media = wp.media,
9
+ l10n = media.view.l10n;
10
 
11
 
12
 
20
 
21
  delete media.gallery.defaults.id;
22
 
23
+
24
  _.extend( media.gallery, {
25
 
26
  collections: {},
36
 
37
  delete collections[ shortcodeString ];
38
 
39
+ if ( result && ! isFilterBased && ! shortcode.attrs.named.limit ) {
 
40
  return result;
41
  }
42
 
44
  attrs = _.defaults( shortcode.attrs.named, this.defaults );
45
  args = _.pick( attrs, 'orderby', 'order' );
46
 
47
+ if ( ! attrs.limit || _.isNaN( parseInt( attrs.limit ) ) || parseInt( attrs.limit ) < 1 ) {
48
+ delete attrs.limit;
49
+ }
50
+
51
  args.type = this.type;
52
+ args.perPage = attrs.limit ? attrs.limit : -1;
53
 
54
 
55
  if ( 'rand' === attrs.orderby ) {
69
  args.order = 'ASC';
70
  }
71
 
72
+ if ( _.isUndefined( attrs.id ) && ! isFilterBased ) {
73
  attrs.id = media.view.settings.post && media.view.settings.post.id;
74
  }
75
 
76
  if ( isFilterBased ) {
77
 
78
+ if ( attrs.id ) {
79
  args.uploadedTo = attrs.id;
80
  }
81
 
160
  }
161
 
162
  // Copy the `uploadedTo` post ID.
163
+ if ( props.uploadedTo ) {
164
  attrs.id = props.uploadedTo;
165
  }
166
 
192
  delete attrs.order;
193
  }
194
 
195
+ if ( ! attrs.limit || _.isNaN( parseInt( attrs.limit ) ) || parseInt( attrs.limit ) < 1 ) {
196
+ delete attrs.limit;
197
+ }
198
 
199
+ attrs = this.setDefaults( attrs );
200
 
201
  shortcode = new wp.shortcode({
202
  tag: this.tag,
215
  },
216
 
217
  edit: function( content ) {
 
218
  var shortcode = wp.shortcode.next( this.tag, content ),
219
+ defaultPostId = this.defaults.id,
220
  attachments, selection, state;
221
 
222
  // Bail if we didn't match the shortcode or all of the content.
227
  // Ignore the rest of the match object.
228
  shortcode = shortcode.shortcode;
229
 
230
+ if ( _.isUndefined( shortcode.get('id') ) && ! _.isUndefined( defaultPostId ) ) {
231
+ shortcode.set( 'id', defaultPostId );
232
+ }
233
+
234
  attachments = this.attachments( shortcode );
235
 
236
  selection = new wp.media.model.Selection( attachments.models, {
js/eml-media-list.js CHANGED
@@ -1,44 +1,44 @@
1
- ( function( $ ) {
2
-
3
- $( document ).ready( function()
4
  {
5
  var $mainFilter = $('select[name="attachment-filter"]'),
6
  $dataFilter = $('select#filter-by-date'),
7
- $taxFilters = $('select.eml-attachment-filters'),
8
  $resetFilters = $('#eml-reset-filters-query-submit');
9
-
10
 
11
- if ( ! $mainFilter.prop( 'selectedIndex' ) &&
 
12
  ! $dataFilter.prop( 'selectedIndex' ) &&
13
  ! $taxFilters.filter( function() { return $(this).prop( 'selectedIndex' ) } ).get().length )
14
- {
15
  $resetFilters.prop( 'disabled', true );
16
  }
17
  else
18
  {
19
  $resetFilters.prop( 'disabled', false );
20
  }
21
-
22
-
23
- $( document ).on( 'change', 'select[name="attachment-filter"]', {
24
- checkFilter : $mainFilter,
25
- resetFilter : $taxFilters
26
  }, resetFilters );
27
-
28
- $( document ).on( 'change', 'select.eml-attachment-filters', {
29
- checkFilter : $mainFilter,
30
- resetFilter : $mainFilter
31
  }, resetFilters );
32
-
33
- $( document ).on( 'click', '#eml-reset-filters-query-submit', function() {
34
-
35
  $mainFilter.prop( 'selectedIndex', 0 );
36
  $taxFilters.prop( 'selectedIndex', 0 );
37
  $dataFilter.prop( 'selectedIndex', 0 );
38
  });
39
 
40
  });
41
-
42
  function resetFilters( event )
43
  {
44
  if ( 'uncategorized' == event.data.checkFilter.val() )
@@ -47,4 +47,4 @@
47
  }
48
  }
49
 
50
- })( jQuery );
1
+ ( function( $ ) {
2
+
3
+ $( document ).ready( function()
4
  {
5
  var $mainFilter = $('select[name="attachment-filter"]'),
6
  $dataFilter = $('select#filter-by-date'),
7
+ $taxFilters = $('select.eml-taxonomy-filters'),
8
  $resetFilters = $('#eml-reset-filters-query-submit');
 
9
 
10
+
11
+ if ( ! $mainFilter.prop( 'selectedIndex' ) &&
12
  ! $dataFilter.prop( 'selectedIndex' ) &&
13
  ! $taxFilters.filter( function() { return $(this).prop( 'selectedIndex' ) } ).get().length )
14
+ {
15
  $resetFilters.prop( 'disabled', true );
16
  }
17
  else
18
  {
19
  $resetFilters.prop( 'disabled', false );
20
  }
21
+
22
+
23
+ $( document ).on( 'change', 'select[name="attachment-filter"]', {
24
+ checkFilter : $mainFilter,
25
+ resetFilter : $taxFilters
26
  }, resetFilters );
27
+
28
+ $( document ).on( 'change', 'select.eml-taxonomy-filters', {
29
+ checkFilter : $mainFilter,
30
+ resetFilter : $mainFilter
31
  }, resetFilters );
32
+
33
+ $( document ).on( 'click', '#eml-reset-filters-query-submit', function() {
34
+
35
  $mainFilter.prop( 'selectedIndex', 0 );
36
  $taxFilters.prop( 'selectedIndex', 0 );
37
  $dataFilter.prop( 'selectedIndex', 0 );
38
  });
39
 
40
  });
41
+
42
  function resetFilters( event )
43
  {
44
  if ( 'uncategorized' == event.data.checkFilter.val() )
47
  }
48
  }
49
 
50
+ })( jQuery );
js/eml-media-views.js CHANGED
@@ -152,6 +152,7 @@ window.eml = window.eml || { l10n: {} };
152
  this.model.set( filter.props );
153
  }
154
 
 
155
  if ( filter && selection && selection.length && ! wp.Uploader.queue.length ) {
156
  selection.reset();
157
  }
@@ -161,33 +162,73 @@ window.eml = window.eml || { l10n: {} };
161
  }
162
 
163
  resetFilterButton.model.set( 'disabled', all === unchanged );
164
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  });
166
 
167
 
168
 
169
 
170
  /**
171
- * wp.media.view.AttachmentFilters.All
172
  *
173
  */
174
  original.AttachmentFilters = {
175
 
176
  All: {
177
  createFilters: media.view.AttachmentFilters.All.prototype.createFilters
 
 
 
 
178
  }
179
  };
180
 
 
 
 
 
 
 
181
  _.extend( media.view.AttachmentFilters.All.prototype, {
182
 
183
  createFilters: function() {
184
 
 
 
 
 
185
  original.AttachmentFilters.All.createFilters.apply( this, arguments );
186
 
187
- _.each( this.filters, function( filter, key )
188
- {
189
  filter.props['uncategorized'] = null;
190
- })
 
 
191
 
192
  this.filters.uncategorized = {
193
  text: eml.l10n.uncategorized,
@@ -196,33 +237,41 @@ window.eml = window.eml || { l10n: {} };
196
  uncategorized : true,
197
  status : null,
198
  type : null,
199
- orderby : 'date',
200
- order : 'DESC'
201
  },
202
  priority: 60
203
  };
204
- },
205
 
206
- change: function() {
207
 
208
- var filter = this.filters[ this.el.value ],
209
- content = this.controller.content;
210
 
 
 
 
 
 
211
 
212
- media.view.AttachmentFilters.prototype.change.apply( this, arguments );
213
 
214
 
215
- if ( filter && filter.props.uncategorized ) {
 
 
 
 
216
 
217
- _.each( eml.l10n.taxonomies, function( terms, taxonomy ) {
218
 
219
- taxFilter = content.get().toolbar.get( taxonomy+'-filter' );
 
220
 
221
- if ( ! _.isUndefined( taxFilter ) && 'all' !== taxFilter.$el.val() ) {
222
- taxFilter.$el.val( 'all' ).change();
223
- }
224
- });
225
- }
 
 
226
  }
227
  });
228
 
@@ -242,7 +291,7 @@ window.eml = window.eml || { l10n: {} };
242
  className: function() {
243
 
244
  // TODO: get rid of excess class name that duplicates id
245
- return 'attachment-filters eml-attachment-filters attachment-'+this.options.taxonomy+'-filter';
246
  },
247
 
248
  createFilters: function() {
@@ -250,6 +299,7 @@ window.eml = window.eml || { l10n: {} };
250
  var filters = {},
251
  self = this;
252
 
 
253
  _.each( self.options.termList || {}, function( term, key ) {
254
 
255
  var term_id = term['term_id'],
@@ -259,8 +309,8 @@ window.eml = window.eml || { l10n: {} };
259
  text: term_name,
260
  props: {
261
  uncategorized : null,
262
- orderby : 'menuOrder',
263
- order : 'ASC'
264
  },
265
  priority: key+4
266
  };
@@ -272,8 +322,8 @@ window.eml = window.eml || { l10n: {} };
272
  text: eml.l10n.filter_by + self.options.singularName,
273
  props: {
274
  uncategorized : null,
275
- orderby : 'date',
276
- order : 'DESC'
277
  },
278
  priority: 1
279
  };
@@ -284,8 +334,8 @@ window.eml = window.eml || { l10n: {} };
284
  text: '&#8212; ' + eml.l10n.in + self.options.pluralName + ' &#8212;',
285
  props: {
286
  uncategorized : null,
287
- orderby : 'date',
288
- order : 'DESC'
289
  },
290
  priority: 2
291
  };
@@ -296,8 +346,8 @@ window.eml = window.eml || { l10n: {} };
296
  text: '&#8212; ' + eml.l10n.not_in + self.options.singularName + ' &#8212;',
297
  props: {
298
  uncategorized : null,
299
- orderby : 'date',
300
- order : 'DESC'
301
  },
302
  priority: 3
303
  };
@@ -305,19 +355,6 @@ window.eml = window.eml || { l10n: {} };
305
  filters['not_in']['props'][self.options.taxonomy] = 'not_in';
306
 
307
  this.filters = filters;
308
- },
309
-
310
- change: function() {
311
-
312
- var controller = this.controller,
313
- filter = this.filters[ this.el.value ],
314
- Filters = controller.content.get().toolbar.get( 'filters' );
315
-
316
- media.view.AttachmentFilters.prototype.change.apply( this, arguments );
317
-
318
- if ( filter && 1 != filter.priority && 'uncategorized' == Filters.$el.val() ) {
319
- Filters.$el.val( 'all' ).change();
320
- }
321
  }
322
  });
323
 
@@ -333,10 +370,7 @@ window.eml = window.eml || { l10n: {} };
333
  event.preventDefault();
334
  }
335
 
336
- $.each( $('select.attachment-filters'), function() {
337
- if ( this.value != 'all' )
338
- $(this).val( 'all' ).change();
339
- });
340
  }
341
  });
342
 
@@ -443,7 +477,7 @@ window.eml = window.eml || { l10n: {} };
443
 
444
 
445
  if ( -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ) ||
446
- parseInt( eml.l10n.force_filters ) ) {
447
 
448
 
449
  this.toolbar.set( 'filtersLabel', new media.view.Label({
@@ -578,9 +612,24 @@ window.eml = window.eml || { l10n: {} };
578
 
579
  original.MediaFrame.Post.activate.apply( this, arguments );
580
 
581
- var content = this.content.get();
 
 
 
 
 
582
 
583
  this.on( 'open', content.fixLayout, content );
 
 
 
 
 
 
 
 
 
 
584
  }
585
  });
586
 
152
  this.model.set( filter.props );
153
  }
154
 
155
+
156
  if ( filter && selection && selection.length && ! wp.Uploader.queue.length ) {
157
  selection.reset();
158
  }
162
  }
163
 
164
  resetFilterButton.model.set( 'disabled', all === unchanged );
165
+ },
166
+
167
+ select: function() {
168
+
169
+ var model = this.model,
170
+ value = 'all',
171
+ props = model.toJSON();
172
+
173
+
174
+ props = _.omit( props, 'orderby', 'order' );
175
+
176
+ _.find( this.filters, function( filter, id ) {
177
+
178
+ var filterProps = _.omit( filter.props, 'orderby', 'order' );
179
+
180
+ var equal = _.all( filterProps, function( prop, key ) {
181
+ return prop === ( _.isUndefined( props[ key ] ) ? null : props[ key ] );
182
+ });
183
+
184
+ if ( equal ) {
185
+ return value = id;
186
+ }
187
+ });
188
+
189
+ this.$el.val( value );
190
+ }
191
  });
192
 
193
 
194
 
195
 
196
  /**
197
+ * wp.media.view.AttachmentFilters
198
  *
199
  */
200
  original.AttachmentFilters = {
201
 
202
  All: {
203
  createFilters: media.view.AttachmentFilters.All.prototype.createFilters
204
+ },
205
+
206
+ Uploaded: {
207
+ createFilters: media.view.AttachmentFilters.Uploaded.prototype.createFilters
208
  }
209
  };
210
 
211
+
212
+
213
+ /**
214
+ * wp.media.view.AttachmentFilters.All
215
+ *
216
+ */
217
  _.extend( media.view.AttachmentFilters.All.prototype, {
218
 
219
  createFilters: function() {
220
 
221
+ var uncategorizedProps,
222
+ taxonomies = _.keys( eml.l10n.taxonomies );
223
+
224
+
225
  original.AttachmentFilters.All.createFilters.apply( this, arguments );
226
 
227
+ _.each( this.filters, function( filter, key ) {
 
228
  filter.props['uncategorized'] = null;
229
+ filter.props['orderby'] = eml.l10n.media_orderby;
230
+ filter.props['order'] = eml.l10n.media_order;
231
+ });
232
 
233
  this.filters.uncategorized = {
234
  text: eml.l10n.uncategorized,
237
  uncategorized : true,
238
  status : null,
239
  type : null,
240
+ orderby : eml.l10n.media_orderby,
241
+ order : eml.l10n.media_order
242
  },
243
  priority: 60
244
  };
 
245
 
 
246
 
247
+ uncategorizedProps = this.filters.uncategorized.props;
 
248
 
249
+ _.each( taxonomies, function( taxonomy ) {
250
+ uncategorizedProps[taxonomy] = null;
251
+ });
252
+ }
253
+ });
254
 
 
255
 
256
 
257
+ /**
258
+ * wp.media.view.AttachmentFilters.Uploaded
259
+ *
260
+ */
261
+ _.extend( media.view.AttachmentFilters.Uploaded.prototype, {
262
 
263
+ createFilters: function() {
264
 
265
+ var uncategorizedProps,
266
+ taxonomies = _.keys( eml.l10n.taxonomies );
267
 
268
+
269
+ original.AttachmentFilters.Uploaded.createFilters.apply( this, arguments );
270
+
271
+ _.each( this.filters, function( filter, key ) {
272
+ filter.props['orderby'] = eml.l10n.media_orderby;
273
+ filter.props['order'] = eml.l10n.media_order;
274
+ });
275
  }
276
  });
277
 
291
  className: function() {
292
 
293
  // TODO: get rid of excess class name that duplicates id
294
+ return 'attachment-filters eml-taxonomy-filters attachment-'+this.options.taxonomy+'-filter';
295
  },
296
 
297
  createFilters: function() {
299
  var filters = {},
300
  self = this;
301
 
302
+
303
  _.each( self.options.termList || {}, function( term, key ) {
304
 
305
  var term_id = term['term_id'],
309
  text: term_name,
310
  props: {
311
  uncategorized : null,
312
+ orderby : eml.l10n.media_orderby,
313
+ order : eml.l10n.media_order
314
  },
315
  priority: key+4
316
  };
322
  text: eml.l10n.filter_by + self.options.singularName,
323
  props: {
324
  uncategorized : null,
325
+ orderby : eml.l10n.media_orderby,
326
+ order : eml.l10n.media_order
327
  },
328
  priority: 1
329
  };
334
  text: '&#8212; ' + eml.l10n.in + self.options.pluralName + ' &#8212;',
335
  props: {
336
  uncategorized : null,
337
+ orderby : eml.l10n.media_orderby,
338
+ order : eml.l10n.media_order
339
  },
340
  priority: 2
341
  };
346
  text: '&#8212; ' + eml.l10n.not_in + self.options.singularName + ' &#8212;',
347
  props: {
348
  uncategorized : null,
349
+ orderby : eml.l10n.media_orderby,
350
+ order : eml.l10n.media_order
351
  },
352
  priority: 3
353
  };
355
  filters['not_in']['props'][self.options.taxonomy] = 'not_in';
356
 
357
  this.filters = filters;
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  }
359
  });
360
 
370
  event.preventDefault();
371
  }
372
 
373
+ $('.attachment-filters:has(option[value!="all"]:selected)').val( 'all' ).change();
 
 
 
374
  }
375
  });
376
 
477
 
478
 
479
  if ( -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ) ||
480
+ parseInt( eml.l10n.force_filters ) && 'gallery-edit' !== this.controller._state ) {
481
 
482
 
483
  this.toolbar.set( 'filtersLabel', new media.view.Label({
612
 
613
  original.MediaFrame.Post.activate.apply( this, arguments );
614
 
615
+ var content = this.content.get(),
616
+ galleryLibrary = this.state( 'gallery' ).get( 'library' ),
617
+ mainFilter = content.toolbar.get( 'filters' ),
618
+ resetFilterButton = content.toolbar.get( 'resetFilterButton' ),
619
+ props;
620
+
621
 
622
  this.on( 'open', content.fixLayout, content );
623
+
624
+
625
+ // TODO: reconsider this
626
+ if ( mainFilter ) {
627
+
628
+ props = _.extend( { type: 'image' }, mainFilter.filters.all.props );
629
+ galleryLibrary.reset( wp.media.query( props ).models );
630
+
631
+ resetFilterButton.click();
632
+ }
633
  }
634
  });
635
 
js/eml-options.js CHANGED
@@ -1,10 +1,14 @@
1
  ( function( $ ) {
2
-
 
 
 
 
3
  // remove taxonomy
4
  $( document ).on('click', 'li .wpuxss-eml-button-remove', function() {
5
-
6
  target = $(this).parent();
7
-
8
  if ( target.hasClass('wpuxss-eml-clone-taxonomy') )
9
  {
10
  target.hide( 300, function() {
@@ -20,7 +24,7 @@
20
  });
21
  }
22
  }
23
-
24
  return false;
25
  });
26
 
@@ -28,7 +32,7 @@
28
  $(document).on('click', '.wpuxss-eml-button-create-taxonomy', function()
29
  {
30
  $('.wpuxss-eml-media-taxonomy-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-taxonomy').appendTo('.wpuxss-eml-media-taxonomy-list').show(300);
31
-
32
  return false;
33
  });
34
 
@@ -36,28 +40,28 @@
36
  $(document).on('click', '.wpuxss-eml-button-edit', function()
37
  {
38
  $(this).parent().find('.wpuxss-eml-taxonomy-edit').toggle(300);
39
-
40
  $(this).html(function(i, html)
41
  {
42
  return html == wpuxss_eml_i18n_data.edit+' \u2193' ? wpuxss_eml_i18n_data.close+' \u2191' : wpuxss_eml_i18n_data.edit+' \u2193';
43
  });
44
-
45
  return false;
46
  });
47
-
48
  // on change of a singular taxonomy name during creation
49
  $(document).on('blur', '.wpuxss-eml-clone-taxonomy .wpuxss-eml-singular_name', function()
50
  {
51
  var dictionary,
52
  taxonomy_name = $(this).val().toLowerCase(),
53
  taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
54
-
55
  taxonomy_name = taxonomy_name.replace(/(<([^>]+)>)/g,'');
56
-
57
  if ( taxonomy_name != '' )
58
  {
59
- // thanks to
60
- // https://github.com/borodean/jquery-translit
61
  // https://gist.github.com/richardsweeney/5317392
62
  // http://www.advancedcustomfields.com/
63
  // for the 'dictionary' code!
@@ -113,24 +117,24 @@
113
  ' ' : '_',
114
  '-' : '_',
115
  '\'' : '',
116
- '&' : '_'
117
  };
118
-
119
  $.each( dictionary, function(k, v)
120
  {
121
  var regex = new RegExp( k, 'g' );
122
  taxonomy_name = taxonomy_name.replace( regex, v );
123
  });
124
-
125
  taxonomy_name = taxonomy_name.replace(/[^a-z0-9_\s]/g, '');
126
-
127
  $(this).closest('.wpuxss-eml-clone-taxonomy').attr('id',taxonomy_name);
128
-
129
  if ( $('.wpuxss-eml-clone-taxonomy[id='+taxonomy_name+'], .wpuxss-eml-taxonomy[id='+taxonomy_name+'], .wpuxss-non-eml-taxonomy[id='+taxonomy_name+']').length > 1 )
130
  {
131
  alert(wpuxss_eml_i18n_data.tax_error_duplicate);
132
  }
133
-
134
  $(this).attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][singular_name]');
135
  taxonomy_edit_box.find('.wpuxss-eml-name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][name]');
136
  taxonomy_edit_box.find('.wpuxss-eml-menu_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][menu_name]');
@@ -142,40 +146,40 @@
142
  taxonomy_edit_box.find('.wpuxss-eml-new_item_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][new_item_name]');
143
  taxonomy_edit_box.find('.wpuxss-eml-parent_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][parent_item]');
144
  taxonomy_edit_box.find('.wpuxss-eml-search_items').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][search_items]');
145
-
146
  if( taxonomy_edit_box.find('.wpuxss-eml-edit_item').val() == '' )
147
  taxonomy_edit_box.find('.wpuxss-eml-edit_item').val(wpuxss_eml_i18n_data.edit+' '+$(this).val());
148
-
149
  if( taxonomy_edit_box.find('.wpuxss-eml-view_item').val() == '' )
150
  taxonomy_edit_box.find('.wpuxss-eml-view_item').val(wpuxss_eml_i18n_data.view+' '+$(this).val());
151
-
152
  if( taxonomy_edit_box.find('.wpuxss-eml-update_item').val() == '' )
153
  taxonomy_edit_box.find('.wpuxss-eml-update_item').val(wpuxss_eml_i18n_data.update+' '+$(this).val());
154
-
155
  if( taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val() == '' )
156
  taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val(wpuxss_eml_i18n_data.add_new+' '+$(this).val());
157
-
158
  if( taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val() == '' )
159
  taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val(wpuxss_eml_i18n_data.new+' '+$(this).val()+' '+wpuxss_eml_i18n_data.name);
160
-
161
  if( taxonomy_edit_box.find('.wpuxss-eml-parent_item').val() == '' )
162
  taxonomy_edit_box.find('.wpuxss-eml-parent_item').val(wpuxss_eml_i18n_data.parent+' '+$(this).val());
163
-
164
  taxonomy_edit_box.find('.wpuxss-eml-taxonomy-name').val(taxonomy_name);
165
-
166
  taxonomy_edit_box.find('.wpuxss-eml-hierarchical').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][hierarchical]');
167
  taxonomy_edit_box.find('.wpuxss-eml-public').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][public]');
168
  taxonomy_edit_box.find('.wpuxss-eml-show_admin_column').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_admin_column]');
169
  taxonomy_edit_box.find('.wpuxss-eml-show_in_nav_menus').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_in_nav_menus]');
170
  taxonomy_edit_box.find('.wpuxss-eml-sort').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][sort]');
171
  taxonomy_edit_box.find('.wpuxss-eml-slug').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][rewrite][slug]').val(taxonomy_name);
172
-
173
- taxonomy_edit_box.find('.wpuxss-eml-admin_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][admin_filter]');
174
  taxonomy_edit_box.find('.wpuxss-eml-media_uploader_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][media_uploader_filter]');
175
  taxonomy_edit_box.find('.wpuxss-eml-media_popup_taxonomy_edit').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][media_popup_taxonomy_edit]');
176
-
177
  $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-assigned').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][assigned]');
178
- $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-eml_media').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][eml_media]');
179
  }
180
  else
181
  {
@@ -195,20 +199,20 @@
195
  {
196
  var taxonomy_plural_name = $(this).val();
197
  taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
198
-
199
  taxonomy_plural_name = taxonomy_plural_name.replace(/(<([^>]+)>)/g,'');
200
-
201
  if ( taxonomy_plural_name != '' )
202
  {
203
  if( taxonomy_edit_box.find('.wpuxss-eml-menu_name').val() == '' )
204
  taxonomy_edit_box.find('.wpuxss-eml-menu_name').val($(this).val());
205
-
206
  if( taxonomy_edit_box.find('.wpuxss-eml-all_items').val() == '' )
207
  taxonomy_edit_box.find('.wpuxss-eml-all_items').val(wpuxss_eml_i18n_data.all+' '+$(this).val());
208
-
209
  if( taxonomy_edit_box.find('.wpuxss-eml-search_items').val() == '' )
210
  taxonomy_edit_box.find('.wpuxss-eml-search_items').val(wpuxss_eml_i18n_data.search+' '+$(this).val());
211
-
212
  $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-taxonomy-label').text($(this).val());
213
  }
214
  else
@@ -226,17 +230,17 @@
226
  {
227
  submit_it = true;
228
  alert_text = '';
229
-
230
  $('.wpuxss-eml-clone-taxonomy, .wpuxss-eml-taxonomy').each(function( index )
231
  {
232
  current_taxonomy = $(this).attr('id');
233
-
234
  if ( !$('.wpuxss-eml-singular_name',this).val() && !$('.wpuxss-eml-name',this).val() )
235
  {
236
  submit_it = false;
237
  alert_text = wpuxss_eml_i18n_data.tax_error_empty_both;
238
  }
239
- else if ( !$('.wpuxss-eml-singular_name',this).val() )
240
  {
241
  submit_it = false;
242
  alert_text = wpuxss_eml_i18n_data.tax_error_empty_singular;
@@ -252,29 +256,50 @@
252
  alert_text = wpuxss_eml_i18n_data.tax_error_duplicate;
253
  }
254
  });
255
-
256
  if ( !submit_it ) alert(alert_text);
257
-
258
  return submit_it;
259
  });
260
-
261
-
262
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  // create new mime type
264
  $(document).on('click', '.wpuxss-eml-button-create-mime', function()
265
  {
266
  $('.wpuxss-eml-mime-type-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-mime').prependTo('.wpuxss-eml-mime-type-list tbody').show(300);
267
-
268
  return false;
269
  });
270
-
271
  // remove mime type
272
  $(document).on('click', 'tr .wpuxss-eml-button-remove', function()
273
  {
274
  $(this).closest('tr').hide( 300, function() {
275
  $(this).remove();
276
  });
277
-
278
  return false;
279
  });
280
 
@@ -283,26 +308,26 @@
283
  {
284
  var extension = $(this).val().toLowerCase(),
285
  mime_type_tr = $(this).closest('tr');
286
-
287
  $(this).val(extension);
288
-
289
  mime_type_tr.find('.wpuxss-eml-mime').attr('name','wpuxss_eml_mimes['+extension+'][mime]');
290
  mime_type_tr.find('.wpuxss-eml-singular').attr('name','wpuxss_eml_mimes['+extension+'][singular]');
291
  mime_type_tr.find('.wpuxss-eml-plural').attr('name','wpuxss_eml_mimes['+extension+'][plural]');
292
  mime_type_tr.find('.wpuxss-eml-filter').attr('name','wpuxss_eml_mimes['+extension+'][filter]');
293
  mime_type_tr.find('.wpuxss-eml-upload').attr('name','wpuxss_eml_mimes['+extension+'][upload]');
294
  });
295
-
296
-
297
  // on change of a mime type during creation
298
  $(document).on('blur', '.wpuxss-eml-clone-mime .wpuxss-eml-mime', function()
299
  {
300
  var mime_type = $(this).val().toLowerCase(),
301
  mime_type_tr = $(this).closest('tr');
302
-
303
  $(this).val(mime_type);
304
  });
305
-
306
  // mime types restoration warning
307
  $(document).on('click', '#wpuxss_eml_restore_mimes_backup', function()
308
  {
@@ -310,7 +335,7 @@
310
  {
311
  return true;
312
  }
313
-
314
  return false;
315
  });
316
 
@@ -319,30 +344,30 @@
319
  {
320
  submit_it = true;
321
  alert_text = '';
322
-
323
  $('.wpuxss-eml-clone-mime').each(function( index )
324
  {
325
  if ( !$('.wpuxss-eml-type',this).val() || $('.wpuxss-eml-type',this).val() == '' || !$('.wpuxss-eml-mime',this).val() || $('.wpuxss-eml-mime',this).val() == '' )
326
  {
327
  submit_it = false;
328
  alert_text = wpuxss_eml_i18n_data.mime_error_empty_fields;
329
- }
330
  else if ( $('[id="'+$('.wpuxss-eml-type',this).val()+'"]').length > 0 || $('.wpuxss-eml-mime[value="'+$('.wpuxss-eml-mime',this).val()+'"]').length > 0 )
331
  {
332
  submit_it = false;
333
  alert_text = wpuxss_eml_i18n_data.mime_error_duplicate;
334
  }
335
-
336
  if ( !$('.wpuxss-eml-singular',this).val() || $('.wpuxss-eml-singular',this).val() == '' || !$('.wpuxss-eml-plural',this).val() || $('.wpuxss-eml-plural',this).val() == '' )
337
  {
338
  $('.wpuxss-eml-singular',this).val($('.wpuxss-eml-mime',this).val());
339
  $('.wpuxss-eml-plural',this).val($('.wpuxss-eml-mime',this).val());
340
  }
341
  });
342
-
343
  if ( !submit_it && alert_text != '' ) alert(alert_text);
344
-
345
  return submit_it;
346
  });
347
-
348
- })( jQuery );
1
  ( function( $ ) {
2
+
3
+ var orderValue;
4
+
5
+
6
+
7
  // remove taxonomy
8
  $( document ).on('click', 'li .wpuxss-eml-button-remove', function() {
9
+
10
  target = $(this).parent();
11
+
12
  if ( target.hasClass('wpuxss-eml-clone-taxonomy') )
13
  {
14
  target.hide( 300, function() {
24
  });
25
  }
26
  }
27
+
28
  return false;
29
  });
30
 
32
  $(document).on('click', '.wpuxss-eml-button-create-taxonomy', function()
33
  {
34
  $('.wpuxss-eml-media-taxonomy-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-taxonomy').appendTo('.wpuxss-eml-media-taxonomy-list').show(300);
35
+
36
  return false;
37
  });
38
 
40
  $(document).on('click', '.wpuxss-eml-button-edit', function()
41
  {
42
  $(this).parent().find('.wpuxss-eml-taxonomy-edit').toggle(300);
43
+
44
  $(this).html(function(i, html)
45
  {
46
  return html == wpuxss_eml_i18n_data.edit+' \u2193' ? wpuxss_eml_i18n_data.close+' \u2191' : wpuxss_eml_i18n_data.edit+' \u2193';
47
  });
48
+
49
  return false;
50
  });
51
+
52
  // on change of a singular taxonomy name during creation
53
  $(document).on('blur', '.wpuxss-eml-clone-taxonomy .wpuxss-eml-singular_name', function()
54
  {
55
  var dictionary,
56
  taxonomy_name = $(this).val().toLowerCase(),
57
  taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
58
+
59
  taxonomy_name = taxonomy_name.replace(/(<([^>]+)>)/g,'');
60
+
61
  if ( taxonomy_name != '' )
62
  {
63
+ // thanks to
64
+ // https://github.com/borodean/jquery-translit
65
  // https://gist.github.com/richardsweeney/5317392
66
  // http://www.advancedcustomfields.com/
67
  // for the 'dictionary' code!
117
  ' ' : '_',
118
  '-' : '_',
119
  '\'' : '',
120
+ '&' : '_'
121
  };
122
+
123
  $.each( dictionary, function(k, v)
124
  {
125
  var regex = new RegExp( k, 'g' );
126
  taxonomy_name = taxonomy_name.replace( regex, v );
127
  });
128
+
129
  taxonomy_name = taxonomy_name.replace(/[^a-z0-9_\s]/g, '');
130
+
131
  $(this).closest('.wpuxss-eml-clone-taxonomy').attr('id',taxonomy_name);
132
+
133
  if ( $('.wpuxss-eml-clone-taxonomy[id='+taxonomy_name+'], .wpuxss-eml-taxonomy[id='+taxonomy_name+'], .wpuxss-non-eml-taxonomy[id='+taxonomy_name+']').length > 1 )
134
  {
135
  alert(wpuxss_eml_i18n_data.tax_error_duplicate);
136
  }
137
+
138
  $(this).attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][singular_name]');
139
  taxonomy_edit_box.find('.wpuxss-eml-name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][name]');
140
  taxonomy_edit_box.find('.wpuxss-eml-menu_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][menu_name]');
146
  taxonomy_edit_box.find('.wpuxss-eml-new_item_name').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][new_item_name]');
147
  taxonomy_edit_box.find('.wpuxss-eml-parent_item').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][parent_item]');
148
  taxonomy_edit_box.find('.wpuxss-eml-search_items').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][labels][search_items]');
149
+
150
  if( taxonomy_edit_box.find('.wpuxss-eml-edit_item').val() == '' )
151
  taxonomy_edit_box.find('.wpuxss-eml-edit_item').val(wpuxss_eml_i18n_data.edit+' '+$(this).val());
152
+
153
  if( taxonomy_edit_box.find('.wpuxss-eml-view_item').val() == '' )
154
  taxonomy_edit_box.find('.wpuxss-eml-view_item').val(wpuxss_eml_i18n_data.view+' '+$(this).val());
155
+
156
  if( taxonomy_edit_box.find('.wpuxss-eml-update_item').val() == '' )
157
  taxonomy_edit_box.find('.wpuxss-eml-update_item').val(wpuxss_eml_i18n_data.update+' '+$(this).val());
158
+
159
  if( taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val() == '' )
160
  taxonomy_edit_box.find('.wpuxss-eml-add_new_item').val(wpuxss_eml_i18n_data.add_new+' '+$(this).val());
161
+
162
  if( taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val() == '' )
163
  taxonomy_edit_box.find('.wpuxss-eml-new_item_name').val(wpuxss_eml_i18n_data.new+' '+$(this).val()+' '+wpuxss_eml_i18n_data.name);
164
+
165
  if( taxonomy_edit_box.find('.wpuxss-eml-parent_item').val() == '' )
166
  taxonomy_edit_box.find('.wpuxss-eml-parent_item').val(wpuxss_eml_i18n_data.parent+' '+$(this).val());
167
+
168
  taxonomy_edit_box.find('.wpuxss-eml-taxonomy-name').val(taxonomy_name);
169
+
170
  taxonomy_edit_box.find('.wpuxss-eml-hierarchical').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][hierarchical]');
171
  taxonomy_edit_box.find('.wpuxss-eml-public').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][public]');
172
  taxonomy_edit_box.find('.wpuxss-eml-show_admin_column').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_admin_column]');
173
  taxonomy_edit_box.find('.wpuxss-eml-show_in_nav_menus').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][show_in_nav_menus]');
174
  taxonomy_edit_box.find('.wpuxss-eml-sort').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][sort]');
175
  taxonomy_edit_box.find('.wpuxss-eml-slug').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][rewrite][slug]').val(taxonomy_name);
176
+
177
+ taxonomy_edit_box.find('.wpuxss-eml-admin_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][admin_filter]');
178
  taxonomy_edit_box.find('.wpuxss-eml-media_uploader_filter').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][media_uploader_filter]');
179
  taxonomy_edit_box.find('.wpuxss-eml-media_popup_taxonomy_edit').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][media_popup_taxonomy_edit]');
180
+
181
  $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-assigned').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][assigned]');
182
+ $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-eml_media').attr('name','wpuxss_eml_taxonomies['+taxonomy_name+'][eml_media]');
183
  }
184
  else
185
  {
199
  {
200
  var taxonomy_plural_name = $(this).val();
201
  taxonomy_edit_box = $(this).parents('.wpuxss-eml-taxonomy-edit');
202
+
203
  taxonomy_plural_name = taxonomy_plural_name.replace(/(<([^>]+)>)/g,'');
204
+
205
  if ( taxonomy_plural_name != '' )
206
  {
207
  if( taxonomy_edit_box.find('.wpuxss-eml-menu_name').val() == '' )
208
  taxonomy_edit_box.find('.wpuxss-eml-menu_name').val($(this).val());
209
+
210
  if( taxonomy_edit_box.find('.wpuxss-eml-all_items').val() == '' )
211
  taxonomy_edit_box.find('.wpuxss-eml-all_items').val(wpuxss_eml_i18n_data.all+' '+$(this).val());
212
+
213
  if( taxonomy_edit_box.find('.wpuxss-eml-search_items').val() == '' )
214
  taxonomy_edit_box.find('.wpuxss-eml-search_items').val(wpuxss_eml_i18n_data.search+' '+$(this).val());
215
+
216
  $(this).closest('.wpuxss-eml-clone-taxonomy').find('.wpuxss-eml-taxonomy-label').text($(this).val());
217
  }
218
  else
230
  {
231
  submit_it = true;
232
  alert_text = '';
233
+
234
  $('.wpuxss-eml-clone-taxonomy, .wpuxss-eml-taxonomy').each(function( index )
235
  {
236
  current_taxonomy = $(this).attr('id');
237
+
238
  if ( !$('.wpuxss-eml-singular_name',this).val() && !$('.wpuxss-eml-name',this).val() )
239
  {
240
  submit_it = false;
241
  alert_text = wpuxss_eml_i18n_data.tax_error_empty_both;
242
  }
243
+ else if ( !$('.wpuxss-eml-singular_name',this).val() )
244
  {
245
  submit_it = false;
246
  alert_text = wpuxss_eml_i18n_data.tax_error_empty_singular;
256
  alert_text = wpuxss_eml_i18n_data.tax_error_duplicate;
257
  }
258
  });
259
+
260
  if ( !submit_it ) alert(alert_text);
261
+
262
  return submit_it;
263
  });
264
+
265
+
266
+
267
+ $( document ).ready( function() {
268
+
269
+ orderValue = $('#wpuxss_eml_tax_options_media_order').val();
270
+ $('#wpuxss_eml_tax_options_media_orderby').change();
271
+ });
272
+
273
+
274
+
275
+ $( document ).on('change', '#wpuxss_eml_tax_options_media_orderby', function( event ) {
276
+
277
+ var isMenuOrder = 'menuOrder' === $( event.target ).val(),
278
+ value;
279
+
280
+ orderValue = isMenuOrder ? $('#wpuxss_eml_tax_options_media_order').val() : orderValue;
281
+ value = isMenuOrder ? 'ASC' : orderValue;
282
+
283
+ $('#wpuxss_eml_tax_options_media_order').prop( 'disabled', isMenuOrder ).val( value );
284
+ });
285
+
286
+
287
+
288
  // create new mime type
289
  $(document).on('click', '.wpuxss-eml-button-create-mime', function()
290
  {
291
  $('.wpuxss-eml-mime-type-list').find('.wpuxss-eml-clone').clone().attr('class','wpuxss-eml-clone-mime').prependTo('.wpuxss-eml-mime-type-list tbody').show(300);
292
+
293
  return false;
294
  });
295
+
296
  // remove mime type
297
  $(document).on('click', 'tr .wpuxss-eml-button-remove', function()
298
  {
299
  $(this).closest('tr').hide( 300, function() {
300
  $(this).remove();
301
  });
302
+
303
  return false;
304
  });
305
 
308
  {
309
  var extension = $(this).val().toLowerCase(),
310
  mime_type_tr = $(this).closest('tr');
311
+
312
  $(this).val(extension);
313
+
314
  mime_type_tr.find('.wpuxss-eml-mime').attr('name','wpuxss_eml_mimes['+extension+'][mime]');
315
  mime_type_tr.find('.wpuxss-eml-singular').attr('name','wpuxss_eml_mimes['+extension+'][singular]');
316
  mime_type_tr.find('.wpuxss-eml-plural').attr('name','wpuxss_eml_mimes['+extension+'][plural]');
317
  mime_type_tr.find('.wpuxss-eml-filter').attr('name','wpuxss_eml_mimes['+extension+'][filter]');
318
  mime_type_tr.find('.wpuxss-eml-upload').attr('name','wpuxss_eml_mimes['+extension+'][upload]');
319
  });
320
+
321
+
322
  // on change of a mime type during creation
323
  $(document).on('blur', '.wpuxss-eml-clone-mime .wpuxss-eml-mime', function()
324
  {
325
  var mime_type = $(this).val().toLowerCase(),
326
  mime_type_tr = $(this).closest('tr');
327
+
328
  $(this).val(mime_type);
329
  });
330
+
331
  // mime types restoration warning
332
  $(document).on('click', '#wpuxss_eml_restore_mimes_backup', function()
333
  {
335
  {
336
  return true;
337
  }
338
+
339
  return false;
340
  });
341
 
344
  {
345
  submit_it = true;
346
  alert_text = '';
347
+
348
  $('.wpuxss-eml-clone-mime').each(function( index )
349
  {
350
  if ( !$('.wpuxss-eml-type',this).val() || $('.wpuxss-eml-type',this).val() == '' || !$('.wpuxss-eml-mime',this).val() || $('.wpuxss-eml-mime',this).val() == '' )
351
  {
352
  submit_it = false;
353
  alert_text = wpuxss_eml_i18n_data.mime_error_empty_fields;
354
+ }
355
  else if ( $('[id="'+$('.wpuxss-eml-type',this).val()+'"]').length > 0 || $('.wpuxss-eml-mime[value="'+$('.wpuxss-eml-mime',this).val()+'"]').length > 0 )
356
  {
357
  submit_it = false;
358
  alert_text = wpuxss_eml_i18n_data.mime_error_duplicate;
359
  }
360
+
361
  if ( !$('.wpuxss-eml-singular',this).val() || $('.wpuxss-eml-singular',this).val() == '' || !$('.wpuxss-eml-plural',this).val() || $('.wpuxss-eml-plural',this).val() == '' )
362
  {
363
  $('.wpuxss-eml-singular',this).val($('.wpuxss-eml-mime',this).val());
364
  $('.wpuxss-eml-plural',this).val($('.wpuxss-eml-mime',this).val());
365
  }
366
  });
367
+
368
  if ( !submit_it && alert_text != '' ) alert(alert_text);
369
+
370
  return submit_it;
371
  });
372
+
373
+ })( jQuery );
languages/eml.pot CHANGED
@@ -4,7 +4,7 @@
4
  msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Enhanced Media Library PRO\n"
7
- "POT-Creation-Date: 2015-12-17 04:55+0200\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
@@ -36,7 +36,7 @@ msgid_plural "Unattached (%s)"
36
  msgstr[0] ""
37
  msgstr[1] ""
38
 
39
- #: core/class-eml-media-list-table.php:65 enhanced-media-library.php:447
40
  msgid "All Uncategorized"
41
  msgstr ""
42
 
@@ -52,7 +52,7 @@ msgstr[1] ""
52
  msgid "Filter"
53
  msgstr ""
54
 
55
- #: core/class-eml-media-list-table.php:90 enhanced-media-library.php:451
56
  msgid "Reset All Filters"
57
  msgstr ""
58
 
@@ -340,55 +340,55 @@ msgid_plural "%d media attachments restored from the trash."
340
  msgstr[0] ""
341
  msgstr[1] ""
342
 
343
- #: core/gallery.php:300 pro/core/gallery.php:22
344
  msgid "Gallery Settings"
345
  msgstr ""
346
 
347
- #: core/gallery.php:303 pro/core/gallery.php:25
348
  msgid "Link To"
349
  msgstr ""
350
 
351
- #: core/gallery.php:313 pro/core/gallery.php:34
352
  msgid "Attachment Page"
353
  msgstr ""
354
 
355
- #: core/gallery.php:316 pro/core/gallery.php:37
356
  msgid "Media File"
357
  msgstr ""
358
 
359
- #: core/gallery.php:319 pro/core/gallery.php:40
360
  msgid "None"
361
  msgstr ""
362
 
363
- #: core/gallery.php:325 pro/core/gallery.php:46
364
  msgid "Columns"
365
  msgstr ""
366
 
367
- #: core/gallery.php:339
368
  msgid "Random Order"
369
  msgstr ""
370
 
371
- #: core/gallery.php:344 pro/core/gallery.php:102
372
  msgid "Size"
373
  msgstr ""
374
 
375
- #: core/gallery.php:354 pro/core/gallery.php:112
376
  msgid "Thumbnail"
377
  msgstr ""
378
 
379
- #: core/gallery.php:355 pro/core/gallery.php:113
380
  msgid "Medium"
381
  msgstr ""
382
 
383
- #: core/gallery.php:356 pro/core/gallery.php:114
384
  msgid "Large"
385
  msgstr ""
386
 
387
- #: core/gallery.php:357 pro/core/gallery.php:115
388
  msgid "Full Size"
389
  msgstr ""
390
 
391
- #: core/gallery.php:378 pro/core/gallery.php:134
392
  msgid "Based On"
393
  msgstr ""
394
 
@@ -418,7 +418,7 @@ msgstr ""
418
 
419
  #: core/options-pages.php:90 core/options-pages.php:561
420
  #: core/options-pages.php:583 core/options-pages.php:629
421
- #: core/options-pages.php:694 core/options-pages.php:996
422
  msgid "Settings"
423
  msgstr ""
424
 
@@ -428,7 +428,7 @@ msgid "Taxonomies"
428
  msgstr ""
429
 
430
  #: core/options-pages.php:106 core/options-pages.php:107
431
- #: core/options-pages.php:824
432
  msgid "MIME Types"
433
  msgstr ""
434
 
@@ -438,7 +438,7 @@ msgstr ""
438
  msgid "Edit"
439
  msgstr ""
440
 
441
- #: core/options-pages.php:144 pro/enhanced-media-library-pro.php:179
442
  msgid "Close"
443
  msgstr ""
444
 
@@ -520,7 +520,7 @@ msgid "Duplicate extensions or MIME types. Please chose other one."
520
  msgstr ""
521
 
522
  #: core/options-pages.php:189 core/options-pages.php:486
523
- #: core/options-pages.php:816
524
  msgid "You do not have sufficient permissions to access this page."
525
  msgstr ""
526
 
@@ -692,99 +692,135 @@ msgstr ""
692
  msgid "Options"
693
  msgstr ""
694
 
695
- #: core/options-pages.php:735 core/options-pages.php:738
 
 
 
 
696
  msgid "Taxonomy archive pages"
697
  msgstr ""
698
 
699
- #: core/options-pages.php:739
700
  msgid "Turn on media taxonomy archive pages on the front-end"
701
  msgstr ""
702
 
703
- #: core/options-pages.php:740
704
  msgid ""
705
  "Re-save your permalink settings after this option change to make it work."
706
  msgstr ""
707
 
708
- #: core/options-pages.php:746
709
  msgid "Assign all like hierarchical"
710
  msgstr ""
711
 
712
- #: core/options-pages.php:749 core/options-pages.php:750
713
  msgid ""
714
  "Show non-hierarchical taxonomies like hierarchical in Grid View / Media Popup"
715
  msgstr ""
716
 
717
- #: core/options-pages.php:756 core/options-pages.php:759
 
 
 
 
718
  msgid "Force filters"
719
  msgstr ""
720
 
721
- #: core/options-pages.php:760
722
  msgid "Show media filters for ANY Media Popup"
723
  msgstr ""
724
 
725
- #: core/options-pages.php:761
726
- msgid ""
727
- "May be useful for those who need forcing filters for third-party plugins or "
728
- "themes."
729
  msgstr ""
730
 
731
- #: core/options-pages.php:767 core/options-pages.php:770
732
- msgid "Turn off enhanced gallery"
733
  msgstr ""
734
 
735
- #: core/options-pages.php:771
736
- msgid "Do not enhance WordPress native gallery shortcode"
737
  msgstr ""
738
 
739
- #: core/options-pages.php:772
740
- msgid ""
741
- "May be useful in case of incompatibility with other plugins or themes. Use "
742
- "the option if you think it breaks your galleries in any way."
743
  msgstr ""
744
 
745
- #: core/options-pages.php:773
746
- msgid "Please inform plugin authors about the issue. We would like to fix it!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
  msgstr ""
748
 
749
  #: core/options-pages.php:825
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
  msgid "Add New MIME Type"
751
  msgstr ""
752
 
753
- #: core/options-pages.php:843 core/options-pages.php:898
754
  msgid "Extension"
755
  msgstr ""
756
 
757
- #: core/options-pages.php:844 core/options-pages.php:899
758
  msgid "MIME Type"
759
  msgstr ""
760
 
761
- #: core/options-pages.php:845 core/options-pages.php:900
762
  msgid "Singular Label"
763
  msgstr ""
764
 
765
- #: core/options-pages.php:846 core/options-pages.php:901
766
  msgid "Plural Label"
767
  msgstr ""
768
 
769
- #: core/options-pages.php:847 core/options-pages.php:877
770
- #: core/options-pages.php:890 core/options-pages.php:902
771
  msgid "Add Filter"
772
  msgstr ""
773
 
774
- #: core/options-pages.php:848 core/options-pages.php:878
775
- #: core/options-pages.php:891 core/options-pages.php:903
776
  msgid "Allow Upload"
777
  msgstr ""
778
 
779
- #: core/options-pages.php:892
780
  msgid "Delete MIME Type"
781
  msgstr ""
782
 
783
- #: core/options-pages.php:909
784
  msgid "Restore WordPress default MIME Types"
785
  msgstr ""
786
 
787
- #: core/options-pages.php:911 pro/enhanced-media-library-pro.php:178
788
  msgid "Save Changes"
789
  msgstr ""
790
 
@@ -792,20 +828,20 @@ msgstr ""
792
  msgid "Taxonomy settings saved."
793
  msgstr ""
794
 
795
- #: core/taxonomies.php:330 core/taxonomies.php:336
796
- #: enhanced-media-library.php:448
797
  msgid "Filter by "
798
  msgstr ""
799
 
800
- #: core/taxonomies.php:337 enhanced-media-library.php:449
801
  msgid "All "
802
  msgstr ""
803
 
804
- #: core/taxonomies.php:338 enhanced-media-library.php:450
805
  msgid "Not in "
806
  msgstr ""
807
 
808
- #: enhanced-media-library.php:481
809
  msgid "Uploaded to post #"
810
  msgstr ""
811
 
@@ -853,38 +889,42 @@ msgstr ""
853
  msgid "Delete Selected"
854
  msgstr ""
855
 
856
- #: pro/core/gallery.php:60
857
  msgid "Order By"
858
  msgstr ""
859
 
860
- #: pro/core/gallery.php:64
861
  msgid "Date"
862
  msgstr ""
863
 
864
- #: pro/core/gallery.php:67
865
  msgid "Title"
866
  msgstr ""
867
 
868
- #: pro/core/gallery.php:70
869
  msgid "Custom Order"
870
  msgstr ""
871
 
872
- #: pro/core/gallery.php:73
873
  msgid "Random"
874
  msgstr ""
875
 
876
- #: pro/core/gallery.php:89
877
  msgid "Order"
878
  msgstr ""
879
 
880
- #: pro/core/gallery.php:93
881
  msgid "Ascending"
882
  msgstr ""
883
 
884
- #: pro/core/gallery.php:96
885
  msgid "Descending"
886
  msgstr ""
887
 
 
 
 
 
888
  #: pro/core/options-pages.php:72
889
  msgid "Your license has been deactivated."
890
  msgstr ""
@@ -903,7 +943,7 @@ msgstr ""
903
  msgid "You license has been activated."
904
  msgstr ""
905
 
906
- #: pro/core/options-pages.php:130 pro/enhanced-media-library-pro.php:181
907
  msgid "Bulk Edit"
908
  msgstr ""
909
 
@@ -975,64 +1015,64 @@ msgid ""
975
  "a license, you are welcome to <a href=\"%s\">purchase it</a>."
976
  msgstr ""
977
 
978
- #: pro/enhanced-media-library-pro.php:100
979
- #: pro/enhanced-media-library-pro.php:112
980
  msgid "Expand Details"
981
  msgstr ""
982
 
983
- #: pro/enhanced-media-library-pro.php:101
984
- #: pro/enhanced-media-library-pro.php:113
985
  msgid "Collapse Details"
986
  msgstr ""
987
 
988
- #: pro/enhanced-media-library-pro.php:104
989
  msgid "Validation Failed. One or more fields below are required."
990
  msgstr ""
991
 
992
- #: pro/enhanced-media-library-pro.php:111
993
  msgid "The changes you made will be lost if you navigate away from this page"
994
  msgstr ""
995
 
996
- #: pro/enhanced-media-library-pro.php:173
997
  msgid "ALL files belong to this item"
998
  msgstr ""
999
 
1000
- #: pro/enhanced-media-library-pro.php:174
1001
  msgid "SOME files belong to this item"
1002
  msgstr ""
1003
 
1004
- #: pro/enhanced-media-library-pro.php:175
1005
  msgid "NO files belong to this item"
1006
  msgstr ""
1007
 
1008
- #: pro/enhanced-media-library-pro.php:176
1009
  msgid "Changes saved."
1010
  msgstr ""
1011
 
1012
- #: pro/enhanced-media-library-pro.php:177
1013
  msgid "Something went wrong."
1014
  msgstr ""
1015
 
1016
- #: pro/enhanced-media-library-pro.php:180
1017
  msgid "Edit Media Files"
1018
  msgstr ""
1019
 
1020
- #: pro/enhanced-media-library-pro.php:205
1021
  msgid "Create a filter-based gallery"
1022
  msgstr ""
1023
 
1024
- #: pro/enhanced-media-library-pro.php:279
1025
  msgid ""
1026
  "Please deactivate and <strong>remove</strong> the old FREE version prior to "
1027
  "the <strong>Enhanced Media Library PRO</strong> activation. All your data "
1028
  "will remain intact."
1029
  msgstr ""
1030
 
1031
- #: pro/enhanced-media-library-pro.php:279
1032
  msgid "Return to Plugins"
1033
  msgstr ""
1034
 
1035
- #: pro/enhanced-media-library-pro.php:321
1036
  msgid ""
1037
  "Both FREE and PRO versions of the Enhanced Media Library are network active. "
1038
  "<strong>Enhanced Media Library PRO</strong> does not require free version to "
@@ -1040,14 +1080,14 @@ msgid ""
1040
  "plugin. All your data will remail intact."
1041
  msgstr ""
1042
 
1043
- #: pro/enhanced-media-library-pro.php:338
1044
  msgid ""
1045
  "<strong>Enhanced Media Library PRO</strong> does not require free version to "
1046
  "be active. Please deactivate and delete the free version of the plugin. All "
1047
  "your data will remain intact."
1048
  msgstr ""
1049
 
1050
- #: pro/enhanced-media-library-pro.php:354
1051
  msgid ""
1052
  "Both FREE and PRO versions of the Enhanced Media Library are active for this "
1053
  "site. <strong>Enhanced Media Library PRO</strong> does not require free "
4
  msgid ""
5
  msgstr ""
6
  "Project-Id-Version: Enhanced Media Library PRO\n"
7
+ "POT-Creation-Date: 2016-01-10 01:44+0200\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
36
  msgstr[0] ""
37
  msgstr[1] ""
38
 
39
+ #: core/class-eml-media-list-table.php:65 enhanced-media-library.php:449
40
  msgid "All Uncategorized"
41
  msgstr ""
42
 
52
  msgid "Filter"
53
  msgstr ""
54
 
55
+ #: core/class-eml-media-list-table.php:90 enhanced-media-library.php:453
56
  msgid "Reset All Filters"
57
  msgstr ""
58
 
340
  msgstr[0] ""
341
  msgstr[1] ""
342
 
343
+ #: core/gallery.php:461 pro/core/gallery.php:22
344
  msgid "Gallery Settings"
345
  msgstr ""
346
 
347
+ #: core/gallery.php:464 pro/core/gallery.php:25
348
  msgid "Link To"
349
  msgstr ""
350
 
351
+ #: core/gallery.php:474 pro/core/gallery.php:34
352
  msgid "Attachment Page"
353
  msgstr ""
354
 
355
+ #: core/gallery.php:477 pro/core/gallery.php:37
356
  msgid "Media File"
357
  msgstr ""
358
 
359
+ #: core/gallery.php:480 pro/core/gallery.php:40
360
  msgid "None"
361
  msgstr ""
362
 
363
+ #: core/gallery.php:486 pro/core/gallery.php:46
364
  msgid "Columns"
365
  msgstr ""
366
 
367
+ #: core/gallery.php:500
368
  msgid "Random Order"
369
  msgstr ""
370
 
371
+ #: core/gallery.php:505 pro/core/gallery.php:106
372
  msgid "Size"
373
  msgstr ""
374
 
375
+ #: core/gallery.php:515 pro/core/gallery.php:116
376
  msgid "Thumbnail"
377
  msgstr ""
378
 
379
+ #: core/gallery.php:516 pro/core/gallery.php:117
380
  msgid "Medium"
381
  msgstr ""
382
 
383
+ #: core/gallery.php:517 pro/core/gallery.php:118
384
  msgid "Large"
385
  msgstr ""
386
 
387
+ #: core/gallery.php:518 pro/core/gallery.php:119
388
  msgid "Full Size"
389
  msgstr ""
390
 
391
+ #: core/gallery.php:539 pro/core/gallery.php:143
392
  msgid "Based On"
393
  msgstr ""
394
 
418
 
419
  #: core/options-pages.php:90 core/options-pages.php:561
420
  #: core/options-pages.php:583 core/options-pages.php:629
421
+ #: core/options-pages.php:694 core/options-pages.php:1049
422
  msgid "Settings"
423
  msgstr ""
424
 
428
  msgstr ""
429
 
430
  #: core/options-pages.php:106 core/options-pages.php:107
431
+ #: core/options-pages.php:877
432
  msgid "MIME Types"
433
  msgstr ""
434
 
438
  msgid "Edit"
439
  msgstr ""
440
 
441
+ #: core/options-pages.php:144 pro/enhanced-media-library-pro.php:180
442
  msgid "Close"
443
  msgstr ""
444
 
520
  msgstr ""
521
 
522
  #: core/options-pages.php:189 core/options-pages.php:486
523
+ #: core/options-pages.php:869
524
  msgid "You do not have sufficient permissions to access this page."
525
  msgstr ""
526
 
692
  msgid "Options"
693
  msgstr ""
694
 
695
+ #: core/options-pages.php:731
696
+ msgid "General"
697
+ msgstr ""
698
+
699
+ #: core/options-pages.php:737 core/options-pages.php:740
700
  msgid "Taxonomy archive pages"
701
  msgstr ""
702
 
703
+ #: core/options-pages.php:741
704
  msgid "Turn on media taxonomy archive pages on the front-end"
705
  msgstr ""
706
 
707
+ #: core/options-pages.php:742
708
  msgid ""
709
  "Re-save your permalink settings after this option change to make it work."
710
  msgstr ""
711
 
712
+ #: core/options-pages.php:748
713
  msgid "Assign all like hierarchical"
714
  msgstr ""
715
 
716
+ #: core/options-pages.php:751 core/options-pages.php:752
717
  msgid ""
718
  "Show non-hierarchical taxonomies like hierarchical in Grid View / Media Popup"
719
  msgstr ""
720
 
721
+ #: core/options-pages.php:766
722
+ msgid "Filters"
723
+ msgstr ""
724
+
725
+ #: core/options-pages.php:773
726
  msgid "Force filters"
727
  msgstr ""
728
 
729
+ #: core/options-pages.php:775
730
  msgid "Show media filters for ANY Media Popup"
731
  msgstr ""
732
 
733
+ #: core/options-pages.php:776
734
+ msgid "Try this if filters are not shown for third-party plugins or themes."
 
 
735
  msgstr ""
736
 
737
+ #: core/options-pages.php:781
738
+ msgid "Order media items by"
739
  msgstr ""
740
 
741
+ #: core/options-pages.php:788 core/options-pages.php:800
742
+ msgid "For media library and media popups"
743
  msgstr ""
744
 
745
+ #: core/options-pages.php:789
746
+ msgid "Option allows to change order by drag and drop with Custom Order value."
 
 
747
  msgstr ""
748
 
749
+ #: core/options-pages.php:794
750
+ msgid "Sort order"
751
+ msgstr ""
752
+
753
+ #: core/options-pages.php:813
754
+ msgid "Gallery"
755
+ msgstr ""
756
+
757
+ #: core/options-pages.php:820 core/options-pages.php:823
758
+ msgid "Enhanced gallery"
759
+ msgstr ""
760
+
761
+ #: core/options-pages.php:824
762
+ msgid ""
763
+ "Enhance WordPress native gallery shortcode to make it understand media "
764
+ "taxonomies, date, and image number limit"
765
  msgstr ""
766
 
767
  #: core/options-pages.php:825
768
+ msgid ""
769
+ "The example: [gallery media_category=\"5\" limit=\"10\" monthnum=\"12\" year="
770
+ "\"2015\"]"
771
+ msgstr ""
772
+
773
+ #: core/options-pages.php:826
774
+ msgid ""
775
+ "<strong style=\"color:red\">Warning:</strong> Incompatibility with other "
776
+ "gallery plugins or themes possible! <a href=\"http://www.wpuxsolutions.com/"
777
+ "documents/enhanced-media-library/enhanced-gallery-issues/\">Learn more.</a> "
778
+ "Please check out your gallery front-end and back-end functionality once this "
779
+ "option activated. If you find an issue please inform plugin authors at <a "
780
+ "href=\"https://wordpress.org/support/plugin/enhanced-media-library"
781
+ "\">wordpress.org</a> or <a href=\"http://www.wpuxsolutions.com/support/"
782
+ "create-new-ticket/\">wpuxsolutions.com</a>."
783
+ msgstr ""
784
+
785
+ #: core/options-pages.php:878
786
  msgid "Add New MIME Type"
787
  msgstr ""
788
 
789
+ #: core/options-pages.php:896 core/options-pages.php:951
790
  msgid "Extension"
791
  msgstr ""
792
 
793
+ #: core/options-pages.php:897 core/options-pages.php:952
794
  msgid "MIME Type"
795
  msgstr ""
796
 
797
+ #: core/options-pages.php:898 core/options-pages.php:953
798
  msgid "Singular Label"
799
  msgstr ""
800
 
801
+ #: core/options-pages.php:899 core/options-pages.php:954
802
  msgid "Plural Label"
803
  msgstr ""
804
 
805
+ #: core/options-pages.php:900 core/options-pages.php:930
806
+ #: core/options-pages.php:943 core/options-pages.php:955
807
  msgid "Add Filter"
808
  msgstr ""
809
 
810
+ #: core/options-pages.php:901 core/options-pages.php:931
811
+ #: core/options-pages.php:944 core/options-pages.php:956
812
  msgid "Allow Upload"
813
  msgstr ""
814
 
815
+ #: core/options-pages.php:945
816
  msgid "Delete MIME Type"
817
  msgstr ""
818
 
819
+ #: core/options-pages.php:962
820
  msgid "Restore WordPress default MIME Types"
821
  msgstr ""
822
 
823
+ #: core/options-pages.php:964 pro/enhanced-media-library-pro.php:179
824
  msgid "Save Changes"
825
  msgstr ""
826
 
828
  msgid "Taxonomy settings saved."
829
  msgstr ""
830
 
831
+ #: core/taxonomies.php:340 core/taxonomies.php:346
832
+ #: enhanced-media-library.php:450
833
  msgid "Filter by "
834
  msgstr ""
835
 
836
+ #: core/taxonomies.php:347 enhanced-media-library.php:451
837
  msgid "All "
838
  msgstr ""
839
 
840
+ #: core/taxonomies.php:348 enhanced-media-library.php:452
841
  msgid "Not in "
842
  msgstr ""
843
 
844
+ #: enhanced-media-library.php:483
845
  msgid "Uploaded to post #"
846
  msgstr ""
847
 
889
  msgid "Delete Selected"
890
  msgstr ""
891
 
892
+ #: pro/core/gallery.php:68
893
  msgid "Order By"
894
  msgstr ""
895
 
896
+ #: pro/core/gallery.php:72
897
  msgid "Date"
898
  msgstr ""
899
 
900
+ #: pro/core/gallery.php:75
901
  msgid "Title"
902
  msgstr ""
903
 
904
+ #: pro/core/gallery.php:78
905
  msgid "Custom Order"
906
  msgstr ""
907
 
908
+ #: pro/core/gallery.php:81
909
  msgid "Random"
910
  msgstr ""
911
 
912
+ #: pro/core/gallery.php:93
913
  msgid "Order"
914
  msgstr ""
915
 
916
+ #: pro/core/gallery.php:97
917
  msgid "Ascending"
918
  msgstr ""
919
 
920
+ #: pro/core/gallery.php:100
921
  msgid "Descending"
922
  msgstr ""
923
 
924
+ #: pro/core/gallery.php:131
925
+ msgid "Limit"
926
+ msgstr ""
927
+
928
  #: pro/core/options-pages.php:72
929
  msgid "Your license has been deactivated."
930
  msgstr ""
943
  msgid "You license has been activated."
944
  msgstr ""
945
 
946
+ #: pro/core/options-pages.php:130 pro/enhanced-media-library-pro.php:182
947
  msgid "Bulk Edit"
948
  msgstr ""
949
 
1015
  "a license, you are welcome to <a href=\"%s\">purchase it</a>."
1016
  msgstr ""
1017
 
1018
+ #: pro/enhanced-media-library-pro.php:101
1019
+ #: pro/enhanced-media-library-pro.php:113
1020
  msgid "Expand Details"
1021
  msgstr ""
1022
 
1023
+ #: pro/enhanced-media-library-pro.php:102
1024
+ #: pro/enhanced-media-library-pro.php:114
1025
  msgid "Collapse Details"
1026
  msgstr ""
1027
 
1028
+ #: pro/enhanced-media-library-pro.php:105
1029
  msgid "Validation Failed. One or more fields below are required."
1030
  msgstr ""
1031
 
1032
+ #: pro/enhanced-media-library-pro.php:112
1033
  msgid "The changes you made will be lost if you navigate away from this page"
1034
  msgstr ""
1035
 
1036
+ #: pro/enhanced-media-library-pro.php:174
1037
  msgid "ALL files belong to this item"
1038
  msgstr ""
1039
 
1040
+ #: pro/enhanced-media-library-pro.php:175
1041
  msgid "SOME files belong to this item"
1042
  msgstr ""
1043
 
1044
+ #: pro/enhanced-media-library-pro.php:176
1045
  msgid "NO files belong to this item"
1046
  msgstr ""
1047
 
1048
+ #: pro/enhanced-media-library-pro.php:177
1049
  msgid "Changes saved."
1050
  msgstr ""
1051
 
1052
+ #: pro/enhanced-media-library-pro.php:178
1053
  msgid "Something went wrong."
1054
  msgstr ""
1055
 
1056
+ #: pro/enhanced-media-library-pro.php:181
1057
  msgid "Edit Media Files"
1058
  msgstr ""
1059
 
1060
+ #: pro/enhanced-media-library-pro.php:206
1061
  msgid "Create a filter-based gallery"
1062
  msgstr ""
1063
 
1064
+ #: pro/enhanced-media-library-pro.php:280
1065
  msgid ""
1066
  "Please deactivate and <strong>remove</strong> the old FREE version prior to "
1067
  "the <strong>Enhanced Media Library PRO</strong> activation. All your data "
1068
  "will remain intact."
1069
  msgstr ""
1070
 
1071
+ #: pro/enhanced-media-library-pro.php:280
1072
  msgid "Return to Plugins"
1073
  msgstr ""
1074
 
1075
+ #: pro/enhanced-media-library-pro.php:331
1076
  msgid ""
1077
  "Both FREE and PRO versions of the Enhanced Media Library are network active. "
1078
  "<strong>Enhanced Media Library PRO</strong> does not require free version to "
1080
  "plugin. All your data will remail intact."
1081
  msgstr ""
1082
 
1083
+ #: pro/enhanced-media-library-pro.php:348
1084
  msgid ""
1085
  "<strong>Enhanced Media Library PRO</strong> does not require free version to "
1086
  "be active. Please deactivate and delete the free version of the plugin. All "
1087
  "your data will remain intact."
1088
  msgstr ""
1089
 
1090
+ #: pro/enhanced-media-library-pro.php:364
1091
  msgid ""
1092
  "Both FREE and PRO versions of the Enhanced Media Library are active for this "
1093
  "site. <strong>Enhanced Media Library PRO</strong> does not require free "
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Enhanced Media Library ===
2
  Contributors: webbistro
3
- Tags: media library, media category, media categories, media management, media organizer, media gallery, gallery shortcode, media tag, media tags, media taxonomy, media taxonomies, media uploader, mime type, mime, mime types, file types, media types, media filter, attachment, gallery, image, images, media, ux, user experience, wp-admin, admin, taxonomy, taxonomies
4
- Requires at least: 4.0
5
- Tested up to: 4.4
6
- Stable tag: 2.1.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -18,24 +18,38 @@ A better management for WordPress Media Library
18
  The plugin will be handy for those who need to manage a lot of media files.
19
 
20
 
21
- = Media Taxonomies (Categories and Tags for media files) =
22
 
23
- With the plugin installed you will immediately obtain Media Categories that will be useful for categorizing and filtering media items in the WordPress admin. This feature alone will save you hours of searching through a media library with even as few as 100 images.
24
 
25
- Whether you have a lot of images that need to be organized into complex structures or simply dislike the name of the default taxonomy - Media Categories - you can create and (un)assign to the media library as many taxonomies as you wish without writing a single line of code. Even in case the only taxonomy is totally enough for you, you may prefer to call it "Photo Categories" or simply "Photos".
26
 
27
- You can also assign to the media library built-in WordPress taxonomies - Categories and Tags - as well as any other taxonomy created by third-party plugin, theme, or hand-coded with only plugin's UI.
28
 
29
- The plugin will allow you to categorize both new and existing media items. You can assign a category to a media item during the upload process, in the media library (preferably Grid Mode), in the post/page editor media popup ("Add Media" button). If you need to manage a lot of media items at once, there is the PRO version of the plugin that allows to do it in bulk.
30
 
31
- Every media library window is enhanced with the plugin's filters to search and sort your media files. With the flexible plugin's options you can adjust what filters you will see in the Grid and List modes of the media library and in the post/page editor media popups, and what taxonomies you would like to be able to edit when inserting media to posts/pages. The plugin will work with custom post types as well. The options will also help you to force plugin's filters for third-party plugins or themes, manage media taxonomies archive pages, etc.
32
 
33
- Since the version 2.1 you can change the order of media items within a category with drag and drop. This order will be used, in particular, for the gallery based on this category.
34
 
35
 
36
  = Filter-Based Image Galleries (Fully compatible with WordPress native gallery shortcode) =
37
 
38
- Image categorizing can be useful for the front-end, of course. To insert media galleries based on media categories you have to use the familiar format like `[gallery media_category="5" category="2" monthnum="12" year="2015" orderby="title" order="DESC"]`. The PRO version of the plugin allows to manage gallery shortcode without "coding" at all. Just choose the settings with the plugin's UI in the familiar gallery edit popup and see your gallery live immediately in the post/page editor.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
 
41
  = MIME Types (Media File Types) =
@@ -74,9 +88,12 @@ Many thanks to the authors of the translations! If you wish to be credited here
74
 
75
  * Advanced Custom Fields
76
  * Search & Filter
77
- * Jetpack Carousel
78
  * WooCommerce
79
  * Meta Slider
 
 
 
 
80
 
81
  Please let us know if you find any issue with the plugins from the list above or others.
82
 
@@ -99,6 +116,7 @@ Please notice that you use the Enhanced Media Library with other plugins that ad
99
  = Useful Links =
100
 
101
  * [Where to start? (The complete beginners guide)](http://wpuxsolutions.com/documents/enhanced-media-library/eml-where-to-start/)
 
102
 
103
 
104
 
@@ -108,7 +126,7 @@ Please notice that you use the Enhanced Media Library with other plugins that ad
108
 
109
  2. Activate the plugin through 'Plugins' menu in WordPress admin
110
 
111
- 3. Adjust plugin's settings on **Media Settings >> Taxonomies** or **Media Settings >> MIME Types**
112
 
113
  4. Enjoy Enhanced Media Library!
114
 
@@ -122,25 +140,27 @@ Try to just re-save permalinks settings. Go to Settings >> Permalinks and push "
122
 
123
  = Why Media Popup of some theme/plugin does not show taxonomy filters? =
124
 
125
- [**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.]
126
-
127
- 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.
128
 
129
- If you believe that a third-party plugin should have filters in its Media Popup please contact its author with a request to add NATIVE WordPress filters ([example of the code](http://wordpress.org/support/topic/how-can-we-use-this-plugin-features-in-my-custom-plugin-media-uploader?replies=15#post-5753212) for theme's/plugin's authors).
130
 
131
  = How to show images per media category on a webpage? =
132
 
133
- [**UPD:** Since EML 2.1 you can use gallery shortcode with taxonomy parameters like this: `[gallery media_category="5" category="2" monthnum="12" year="2015" orderby="title" order="DESC"]` to show filter-based gallery on the front-end.]
134
 
135
- Right now it is possible via WP_Query ([example of the code](http://wordpress.org/support/topic/php-displaying-an-array-of-images-per-category-or-categories)). We are working on a gallery based on EML taxonomies.
136
 
137
  = My gallery behavior is strange | My ligthbox/carousel plugin no longer works =
138
 
139
  The Enhanced Media Library enhances the WordPress gallery shortcode with the 'post_gallery' filter. It does this in the most gentle manner possible. It overrides the database query and leaves HTML/CSS code generating intact.
140
 
141
- But many other plugins do the same. Since, currently in WordPress it is not possible to separate a pure database request and generating gallery's HTML/CSS, the plugin conflicts are inevitable.
 
 
 
 
142
 
143
- The solution: please visit Media Settings > Taxonomies > Optons and set "Turn off enhanced gallery". This will deactivate the gallery feature only without deactivating all other plugin's functionality. Then please let us know what functionality was broken. We would like to find a solution!
144
 
145
  = Will I lose media categories I’ve created if I upgrade from free to PRO? =
146
 
@@ -172,6 +192,29 @@ No, all your data will remain intact. Your created media categories and their ti
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  = 2.1.3 =
176
  *Release Date - December 17, 2015*
177
 
@@ -225,276 +268,4 @@ No, all your data will remain intact. Your created media categories and their ti
225
 
226
 
227
  &nbsp;
228
- = 2.0.4.8 =
229
- *Release Date - September 14, 2015*
230
-
231
- = Bugfixes =
232
- * The bug with empty taxonomy drop down fixed
233
- * WordPress 4.3 gallery's template issue fixed [Support Request](https://wordpress.org/support/topic/unable-to-remove-images-from-gallery)
234
- * The bug with plugin's folder name fixed (PRO only)
235
- * Minor WP 4.3 CSS compatibility issues fixed
236
-
237
-
238
- &nbsp;
239
- = 2.0.4.7 =
240
- *Release Date - August 11, 2015*
241
-
242
- = Bugfixes =
243
- * Detach issue fixed [Support Request](https://wordpress.org/support/topic/cannot-detach-image-from-custom-post-type)
244
- * The bug of load-upload.php hook fixed, please use any priority less than 999 for this hook
245
- * Visual Composer incompatibility fixed (PRO only)
246
-
247
- = Improvements =
248
- * Better CSS for the Media Library grid mode (PRO only)
249
- * Better localization [Support Request](https://wordpress.org/support/topic/the-plugin-codestyling-localization-was-forced-to-protect-its-own-page)
250
-
251
- = Compatibility =
252
- * Wordpress 4.3 compatibility ensured
253
- * Visual Composer incompatibility fixed (PRO only)
254
-
255
- = Languages =
256
- * Hebrew translation added
257
- * German translation added
258
- * Swedish translation added
259
-
260
-
261
- &nbsp;
262
- = 2.0.4.6 =
263
- *Release Date - April 29, 2015*
264
-
265
- = Bugfixes =
266
- * wp_dropdown_categories bug fixed [Support Request](https://wordpress.org/support/topic/wp_dropdown_categories-broken-with-2045)
267
- * Few minor bug fixes
268
-
269
-
270
- &nbsp;
271
- = 2.0.4.5 =
272
- *Release Date - April 24, 2015*
273
-
274
- = Compatibility =
275
- * Wordpress 4.2 compatibility ensured
276
-
277
- = Bugfixes =
278
- * Blank (empty) media library screen fixed for List and Grid views
279
-
280
-
281
- &nbsp;
282
- = 2.0.4.3 =
283
- *Release Date - March 21, 2015*
284
-
285
- = Bugfixes =
286
- * List View: Incorrect filtration for post tags fixed
287
- * Media > Add New: Incorrect media files selection (multiple uploading) fixed (PRO only)
288
- * Edit details for all media file types fixed (PRO only) [Support Request](https://wordpress.org/support/topic/edit-video-detail-missing)
289
- * Other minor bug fixes
290
-
291
-
292
- &nbsp;
293
- = 2.0.4.2 =
294
- *Release Date - March 09, 2015*
295
-
296
- = Bugfixes =
297
- * The bug with "Fatal error: Call to undefined function get_userdata() in /wp-includes/user.php on line 360" fixed [Support Request](https://wordpress.org/support/topic/error-message-after-updating-3)
298
- * The bug with incorrect filtering in Media Library List View fixed (when clicking directly on a media category name)
299
-
300
-
301
- &nbsp;
302
- = 2.0.4.1 =
303
- *Release Date - March 07, 2015*
304
-
305
- = Bugfixes =
306
- * 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
307
- * The bug with "Fatal error: Call to undefined function ..." for Media Library List View fixed
308
-
309
-
310
- &nbsp;
311
- = 2.0.4 =
312
- *Release Date - March 05, 2015*
313
-
314
- = New =
315
- * Filters by 'All Uncategorized', 'All Media Categories', 'Not in Media Category' added to both List and Grid views and to Media Popup
316
- * New Media Taxonomy option: 'Edit in Media Popup' - Allows to show/hide taxonomy checkboxes in Media Popup per taxonomy.
317
- * New Media Taxonomy option: 'Taxonomy archive pages' - Turn on/off taxonomy archive pages on the front-end
318
- * New Media Taxonomy option: 'Assign all like hierarchical' - Allows editing of non-hierarchical taxonomies like hierarchical (checkbox list) in Grid View / Media Popup
319
- * 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
320
-
321
- = Improvements =
322
- * Admin Menu: All Media Settings including native 'Settings > Media' are now under common 'Media Settings' admin menu
323
- * Bulk Edit options are now on 'Media Settings > Taxonomies' admin page
324
- * CSS: Media taxonomies column extended for Media Popup, and few more minor CSS improvements
325
- * Taxonomy Saving: Saving changes on the fly displays changes more correctly now (PRO only)
326
- * Taxonomy Saving: Improved media taxonomies saving mechanism (better compatibility with other plugins, etc.)
327
- * Numerous minor code and performance improvements
328
-
329
- = Bugfixes =
330
- * Taxonomy Saving: Fixed a big issue with incorrect bulk saving for media taxonomies (wrong clean-up for non-heirarchical taxonomies, PRO only)
331
- * Taxonomy slug: Bug with the incorrect saving of a taxonomy slug fixed [Support Request](https://wordpress.org/support/topic/not-work-slug)
332
- * Meta Slider plugin compatibility ensured [Support Request](https://wordpress.org/support/topic/filter-not-appearing-when-adding-slides-to-meta-slider)
333
- * Localization: small localization bug fixed (PRO only)
334
- * CSS: Admin notices layout fixed for the Grid View (PRO only)
335
- * CSS: Incorrect checkbox styling for mobile devices fixed
336
- * CSS: Few more minor CSS fixes
337
-
338
-
339
- &nbsp;
340
- = 2.0.3 =
341
- *Release Date - December 19, 2014*
342
-
343
- = Improvements (PRO only) =
344
- * Bulk Edit added to the List View of Media Library
345
- * Bulk Edit Media Popup (for Media Library > List View and Media Library > Add New page) is now being opened with pre-selected multiple media files
346
-
347
- = Compatibility =
348
- * Wordpress 4.1 compatibility ensured
349
- * Improved compatibility with other plugins and custom taxonomies
350
-
351
- = Bugfixes =
352
- * "PHP Fatal Error: Call to undefined function get_current_screen()" issue fixed
353
- * Minor bugs fixed
354
-
355
-
356
- &nbsp;
357
- = 2.0.2.3 (PRO only) =
358
- *Release Date - November 27, 2014*
359
-
360
- = Bugfixes =
361
- * ACF: Fixed the bug with ACF < 5.0 compatibility
362
-
363
-
364
- &nbsp;
365
- = 2.0.2.2 =
366
- *Release Date - November 23, 2014*
367
-
368
- = Bugfixes =
369
- * Minor JS bug of v2.0 fixed [Support Request](https://wordpress.org/support/topic/upload-hangs-2)
370
-
371
-
372
- &nbsp;
373
- = 2.0.2.1 =
374
- *Release Date - November 20, 2014*
375
-
376
- = Bugfixes =
377
- * Minor JS bug of v2.0.2 fixed
378
-
379
-
380
- &nbsp;
381
- = 2.0.2 =
382
- *Release Date - November 19, 2014*
383
-
384
- = Improvements =
385
- * Taxonomy Settings: you can now rewrite taxonomy slug and permalinks front base
386
-
387
- = Bugfixes =
388
- * PRO: fixed a bug preventing repeat saving categories with "Save Changes" button for same set of media files
389
-
390
-
391
- &nbsp;
392
- = 2.0.1 =
393
- *Release Date - November 16, 2014*
394
-
395
- = Bugfixes =
396
- * Front-end: scripts conflict fixed, update if EML breaks your front-end features
397
-
398
-
399
-
400
- &nbsp;
401
- = 2.0 =
402
- *Release Date - November 15, 2014*
403
-
404
- = New =
405
- * [PRO vesrion](http://wpuxsolutions.com/plugins/enhanced-media-library/) with long-awaited bulk edit feature is finally released!
406
-
407
- = Improvements =
408
- * Media Popup: Filters reset automatically as soon as new media files upload process started
409
- * Media Popup: Selection resets automatically as soon as filter is changed
410
- * Media Popup: WordPress 4.0 date filter added
411
- * Compatibility: general compatibility with other plugins improved, please [let me know](http://wpuxsolutions.com/support/create-new-ticket/) if you have any issue with EML and other plugins
412
-
413
- = Bugfixes =
414
- * Media Popup: No delay or glitches anymore when checking media taxonomy checkboxes [Support Request](https://wordpress.org/support/topic/any-way-to-bulk-edit-images/page/2#post-6051963)
415
- * Media Popup: Fixed the bug with non-hierarchical taxonomies (accidentally, only in 1.1.2)
416
- * Media Popup: Filters added to custom posts media popup
417
- * Media Trash: Fixed the incorrect work with MEDIA_TRASH (WordPress 4.0)
418
- * Advanced Custom Fields: Fixed the bug with ACF compatibility [Support Request](https://wordpress.org/support/topic/acf-file-field-conflict-with-eml) and some other minor bugs
419
-
420
-
421
-
422
- &nbsp;
423
- = 1.1.2 =
424
-
425
- = Improvements =
426
- * Wordpress 4.0 compatibility ensured
427
-
428
-
429
- &nbsp;
430
- = 1.1.1 =
431
-
432
- = Improvements =
433
- * Filters added for Appearance -> Header and Appearance -> Background [Support Request](https://wordpress.org/support/topic/missing-category-filter-on-media-select-window)
434
-
435
- = Bugfixes =
436
- * Fixed EML 1.1 bug with disappearing widgets on Appearance -> Customize [Support Request](http://wordpress.org/support/topic/customize-missing-widgets)
437
- * Fixed EML 1.1 bug with disappearing scrollbar [Support Request](http://wordpress.org/support/topic/scroll-bar-disappeared-in-media-window)
438
-
439
-
440
- &nbsp;
441
- = 1.1 =
442
-
443
- = Improvements =
444
- * Filters added to /wp-admin/customize.php page [Support Request](https://wordpress.org/support/topic/missing-category-filter-on-media-select-window)
445
- * Reconsidered the mechanism of checkboxes' checking in Media Uploader for more stable operation [Support Request](https://wordpress.org/support/topic/instability-in-the-media-insertion-panel)
446
- * Media Uploader filters now work without page refreshing when you change category for you images
447
-
448
- = Bugfixes =
449
- * Fixed "Uploads not showing" issue [Support Request](http://wordpress.org/support/topic/uploads-not-showing)
450
- * Reconsidered CSS for filters area [Support Request](http://wordpress.org/support/topic/missing-search-box)
451
- * Fixed CSS and JS files wrong path definitions [Support Request](http://wordpress.org/support/topic/little-bug-2)
452
-
453
-
454
- &nbsp;
455
- = 1.0.5 =
456
-
457
- = Bugfixes =
458
- * Fixed disappearing filter in Media Uploader [Support Request](https://wordpress.org/support/topic/any-chance-of-adding-a-drop-down-in-the-insert-media-screen)
459
- * Added WP 3.9 compatibility [Support Request](https://wordpress.org/support/topic/great-plugin-but-breaks-the-new-add-media-in-39)
460
-
461
-
462
- &nbsp;
463
- = 1.0.4 =
464
-
465
- = Bugfixes =
466
- * Fixed filter mechanism in Media Library [Support Request](http://wordpress.org/support/topic/filter-in-media-not-working-properly)
467
- * Fixed the bug with saving of assigned post categories and tags in Media Uploader
468
-
469
-
470
- &nbsp;
471
- = 1.0.3 =
472
-
473
- = Improvements =
474
- * Better term sorting in Media Uploader
475
- * Minor code improvements
476
-
477
- = Bugfixes =
478
- * Fixed the bug with sorting of post categories and tags assigned to Media Library
479
-
480
-
481
- &nbsp;
482
- = 1.0.2 =
483
-
484
- = Bugfixes =
485
- * Fixed assigned non-media taxonomies archive page [Support Request](http://wordpress.org/support/topic/plugin-woocommerce-products-stopped-displaying)
486
-
487
-
488
- &nbsp;
489
- = 1.0.1 =
490
-
491
- = Bugfixes =
492
- * Media Uploader filter now shows nested terms.
493
- * Media Uploader filter now works correctly with multiple taxonomies.
494
-
495
-
496
- &nbsp;
497
- = 1.0 =
498
-
499
- = New =
500
- * Enhanced Media Library initial release.
1
  === Enhanced Media Library ===
2
  Contributors: webbistro
3
+ Tags: media library, media category, media categories, media gallery, gallery shortcode, media tag, media tags, media taxonomy, media taxonomies, media uploader, mime type, mime, mime types, file types, media types, media filter, attachment, gallery, image, images, media, ux, user experience, wp-admin, admin, taxonomy, taxonomies
4
+ Requires at least: 4.4
5
+ Tested up to: 4.4.1
6
+ Stable tag: 2.1.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
18
  The plugin will be handy for those who need to manage a lot of media files.
19
 
20
 
21
+ = Media Taxonomies (Categories and Tags for media items) =
22
 
23
+ **Various media categories.** With the plugin installed you immediately obtain Media Categories for categorizing and filtering media items in WordPress admin. This feature alone will save you hours of searching through a media library with even as few as 100 images.
24
 
25
+ Whether you have a lot of images that need to be organized into complex structures or simply dislike the name of the default taxonomy - Media Categories - you can create and (un)assign to the media library as many taxonomies as you wish without writing a single line of code.
26
 
27
+ You can also assign to the media library built-in WordPress taxonomies - Categories and Tags - as well as any other taxonomy created by third-party plugin, theme, or hand-coded - with only plugin's UI.
28
 
29
+ **For both new and existing media items.** Categorize both new and existing media items. You can assign a category to a media item during the upload process, in the media library (preferably in the Grid Mode), in post/page editor media popup ("Add Media" button). If you need to manage a lot of media items at once, there is the PRO version of the plugin that allows to do it in bulk.
30
 
31
+ **Filter media items in WP admin.** Every media library screen is enhanced with the plugin's filters to search and sort your media files. With flexible plugin's options you can adjust what filters you will see in Grid and List modes of the media library and in post/page editor media popups, and what taxonomies you would like to edit when inserting media to posts/pages. The plugin works with custom post types as well. The options can also help you to force plugin's filters for third-party plugins or themes, manage media taxonomies archive pages, etc.
32
 
33
+ **Order options.** Since version 2.1.4 you can control the orderby and order options for your media library. With "Custom Order" you can re-order media items within a category with drag and drop. This order will be used, in particular, for the gallery based on this category.
34
 
35
 
36
  = Filter-Based Image Galleries (Fully compatible with WordPress native gallery shortcode) =
37
 
38
+ Image categorizing can be useful for the front-end as well. To insert media galleries based on media categories you have to use the familiar format like `[gallery media_category="5" category="2" limit="10" monthnum="12" year="2015" orderby="title" order="DESC"]`. The PRO version of the plugin allows to manage gallery shortcode without "coding" at all. Just choose the settings with the plugin's UI in the familiar gallery edit popup and see your gallery live immediately in the post/page editor.
39
+
40
+ To turn on the feature set "Enhanced gallery" option from Media Settings > Taxonomies > Options > Gallery. Please be advised that conflicts with other gallery plugins or themes are possible. Check your front-end and back-end gallery functionality after activating the feature.
41
+
42
+ Compatibility ensured for plugins:
43
+
44
+ * Jetpack Carousel
45
+ * Jetpack Tiled Galleries
46
+ * Simple Lightbox
47
+ * Responsive Lightbox by dFactory
48
+
49
+ Compatibility's possible with additional code ([learn more](http://www.wpuxsolutions.com/documents/enhanced-media-library/enhanced-gallery-issues/#s5)):
50
+
51
+ * Photoswipe Masonry Gallery
52
+ * Lightbox Gallery
53
 
54
 
55
  = MIME Types (Media File Types) =
88
 
89
  * Advanced Custom Fields
90
  * Search & Filter
 
91
  * WooCommerce
92
  * Meta Slider
93
+ * Jetpack Carousel
94
+ * Jetpack Tiled Galleries
95
+ * Simple Lightbox
96
+ * Responsive Lightbox by dFactory
97
 
98
  Please let us know if you find any issue with the plugins from the list above or others.
99
 
116
  = Useful Links =
117
 
118
  * [Where to start? (The complete beginners guide)](http://wpuxsolutions.com/documents/enhanced-media-library/eml-where-to-start/)
119
+ * [Enhanced Gallery Issues](http://www.wpuxsolutions.com/documents/enhanced-media-library/enhanced-gallery-issues/)
120
 
121
 
122
 
126
 
127
  2. Activate the plugin through 'Plugins' menu in WordPress admin
128
 
129
+ 3. Adjust plugin's settings on **Media Settings > Taxonomies** or **Media Settings > MIME Types**
130
 
131
  4. Enjoy Enhanced Media Library!
132
 
140
 
141
  = Why Media Popup of some theme/plugin does not show taxonomy filters? =
142
 
143
+ By default EML adds its filters to ANY media popup that already contains native WordPress filters. If a third-party plugin or theme supports native WordPress filters, EML will enhances them.
 
 
144
 
145
+ If a third-party plugin or theme does not support WordPress native filters, but you believe that you need them, try 'Force filters' option (Media Settings > Taxonomies > Options > Filters). It allows forcing media filters for ANY media popup regardless of what was intended by the author of a third-party plugin or theme.
146
 
147
  = How to show images per media category on a webpage? =
148
 
149
+ Since EML 2.1 you can use gallery shortcode with taxonomy parameters like this: `[gallery media_category="5" category="2" limit="10" monthnum="12" year="2015" orderby="title" order="DESC"]` to show filter-based gallery on the front-end. The feature should be activated on Media Settings > Taxonomies > Options > Gallery.
150
 
151
+ Also, you can use WP_Query ([example of the code](http://wordpress.org/support/topic/php-displaying-an-array-of-images-per-category-or-categories)).
152
 
153
  = My gallery behavior is strange | My ligthbox/carousel plugin no longer works =
154
 
155
  The Enhanced Media Library enhances the WordPress gallery shortcode with the 'post_gallery' filter. It does this in the most gentle manner possible. It overrides the database query and leaves HTML/CSS code generating intact.
156
 
157
+ But many other plugins do the same. Since, currently in WordPress it is not possible to separate a pure database request and generating gallery's HTML/CSS, the plugin conflicts are inevitable ([learn more](http://www.wpuxsolutions.com/documents/enhanced-media-library/enhanced-gallery-issues)).
158
+
159
+ The solution: If your version is less than 2.1.4 please upgrade to 2.1.4. Unset "Enhanced gallery" option on Media Settings > Taxonomies > Options > Gallery and let us know what functionality was broken. We would like to find a solution!
160
+
161
+ = I get "Something went wrong" error when bulk-editing in PRO =
162
 
163
+ Your server can simply not have enough time when processing a lot of media items. Increase `max_execution_time` to 300 (5 minutes) and try again. Increasing memory_limit could help as well.
164
 
165
  = Will I lose media categories I’ve created if I upgrade from free to PRO? =
166
 
192
 
193
  == Changelog ==
194
 
195
+ = 2.1.4 =
196
+ *Release Date - January 10, 2016*
197
+
198
+ = New =
199
+ * Option "limit" added to the gallery shortcode
200
+ * Options "Order media items by" (orderby) and "Sort order" (order) added to admin
201
+
202
+ = Improvements =
203
+ * Bulk edit is now 3 times faster and less server resources consuming! [PRO only]
204
+ * Filter "eml_gallery_output" added ([learn more](http://www.wpuxsolutions.com/documents/enhanced-media-library/enhanced-gallery-issues/#s4))
205
+ * Gallery feature are now turned off by default. Option "Turn off enhanced gallery" replaced with "Enhanced gallery"
206
+ * Minor CSS improvements
207
+
208
+ = Compatibility =
209
+ * Jetpack Tiled Galleries compatibility ensured
210
+ * We are going to abandon support for older versions of WordPress. EML 2.1.4 is still compatible with WP 4.0, but from the next release we stop testing it with older versions.
211
+
212
+ = Bugfixes =
213
+ * Characters | and > are no longer delimiters (there are no delimiters any more) and can be used for media category name.
214
+ * Few minor bugs fixed
215
+
216
+
217
+ &nbsp;
218
  = 2.1.3 =
219
  *Release Date - December 17, 2015*
220
 
268
 
269
 
270
  &nbsp;
271
+ = Previous releases... =