Media Library Assistant - Version 2.90

Version Description

  • New: A new example plugin, "MLA Parent Custom Field Mapping", allows IPTC/EXIF and Custom Field mapping rules to update custom fields in the item's parent post/page rather than the items's own fields. Support for Advanced Custom Fields and WP/LR Sync is included.
  • New: The "MLA Randon Galleries Example" plugin has been greatly enhanced. The new version has many more parameters and a new plugin options page. A Documentation tab on the settings page contains all the information you need to understand and use the new version.
  • New: Three new field level data sources have been added for use in mapping rules, etc. They are site_url, base_url and base_dir. The last two give the location of the uploads directory.
  • New: For the [mla_gallery] shortcode, a new size=icon_feature parameter value will display item icons or the "Featured Image" associated with an item. This can be used to suppress the thumbnails and "PDF Thumbnails" that appear when size=icon is specified, but retain the explicitly assigned Featured Images.
  • New: For Advanced Custom Fields Pro "Gallery" Fields, restrictions such as minimum/maximum dimensions and sizes are now respected when adding items to the gallery.
  • New: For Custom Field or IPTC/EXIF mapping rules, a new "mla_purge_custom_field_values" filter lets you override the default "Purge Values" processing, and a new "mla_mapping_old_custom_value" filter lets you replace the current target value for "Existing Text" processing.
  • New: Added support for applying mapping rules to attachments created by "Postie" cron jobs.
  • Fix: Systematic review and update of all files for validating, sanitizing and escaping user data to reduce the risk of security exploits.
  • Fix: Allow IPTC and XMP metadata extraction from images that fail the WordPress getimagesize( $path, $info ) logic.
  • Fix: For the [mla_gallery] shortcode, the default style and markup templates have been adjusted for greater compatibility with the styles and markup used in the WordPress [gallery] shortcode.
  • Fix: For the Media Manager Modal (popup) Window, changing term assignment(s) for Media Library items no longer changes the corresponding checkbox(s) in the underlying post/page.
  • Fix: For Media/Assistant submenu table filtering by a custom field value, dropdown setting is now retained and pagination controls have been repaired.
  • Fix: Deprecated reference to postL10n.dateFormat has been replaced with wp.i18n.__.
  • Fix: Handling of [mla_gallery] shortcodes with a blank but non-empty parameter string has been corrected.
Download this release

Release Info

Developer dglingren
Plugin Icon 128x128 Media Library Assistant
Version 2.90
Comparing to
See all releases

Code changes from version 2.84 to 2.90

Files changed (52) hide show
  1. examples/plugins/mla-jhdean-mapping-hooks-example.php +1 -1
  2. examples/plugins/mla-mapping-hooks-example.php +68 -15
  3. examples/plugins/mla-parent-custom-field-mapping/admin-settings-page.tpl +395 -0
  4. examples/plugins/mla-parent-custom-field-mapping/mla-parent-custom-field-mapping.php +1403 -0
  5. examples/plugins/mla-parent-search-example.php +11 -11
  6. examples/plugins/mla-random-galleries-example.php +0 -180
  7. examples/plugins/mla-random-galleries-example/admin-settings-page.tpl +405 -0
  8. examples/plugins/mla-random-galleries-example/mla-random-galleries-example.php +727 -0
  9. includes/class-mla-ajax.php +23 -18
  10. includes/class-mla-core.php +88 -52
  11. includes/class-mla-data-references.php +2 -2
  12. includes/class-mla-data-source.php +16 -3
  13. includes/class-mla-data.php +15 -10
  14. includes/class-mla-edit-media.php +46 -44
  15. includes/class-mla-file-downloader.php +1 -1
  16. includes/class-mla-image-processor.php +4 -4
  17. includes/class-mla-list-table.php +44 -41
  18. includes/class-mla-main.php +143 -124
  19. includes/class-mla-media-modal-ajax.php +52 -30
  20. includes/class-mla-media-modal.php +1 -1
  21. includes/class-mla-mime-types.php +24 -43
  22. includes/class-mla-objects.php +13 -13
  23. includes/class-mla-options.php +5 -1
  24. includes/class-mla-polylang-support.php +82 -66
  25. includes/class-mla-settings-custom-fields-tab.php +245 -235
  26. includes/class-mla-settings-documentation-tab.php +67 -93
  27. includes/class-mla-settings-iptc-exif-tab.php +197 -180
  28. includes/class-mla-settings-shortcodes-tab.php +79 -66
  29. includes/class-mla-settings-upload-tab.php +99 -93
  30. includes/class-mla-settings-view-tab.php +83 -77
  31. includes/class-mla-settings.php +68 -76
  32. includes/class-mla-shortcode-support.php +63 -66
  33. includes/class-mla-thumbnail-generation.php +23 -3
  34. includes/class-mla-wpml-support.php +68 -35
  35. includes/mla-main-search-box-template.php +16 -16
  36. includes/mla-media-modal-js-template.php +14 -14
  37. includes/mla-plugin-loader.php +5 -5
  38. index.php +2 -2
  39. js/mla-edit-media-scripts.js +17 -6
  40. js/mla-edit-media-scripts.min.js +1 -1
  41. js/mla-media-modal-scripts.js +12 -3
  42. js/mla-media-modal-scripts.min.js +1 -1
  43. languages/media-library-assistant-en_US - References.pot +1480 -1472
  44. languages/media-library-assistant-en_US.po +11 -6
  45. languages/media-library-assistant-en_US.pot +10 -5
  46. readme.txt +22 -32
  47. tpls/admin-display-settings-iptc-exif-tab.tpl +1 -1
  48. tpls/documentation-settings-tab.tpl +24 -0
  49. tpls/help-for-thumbnail_generation.tpl +0 -4
  50. tpls/mla-custom-templates.tpl +2 -3
  51. tpls/mla-option-templates.tpl +1 -1
  52. tpls/mla-thumbnail-generation.tpl +1 -1
examples/plugins/mla-jhdean-mapping-hooks-example.php CHANGED
@@ -59,7 +59,7 @@ class MLAjhdeanMappingHooksExample {
59
  *
60
  * @var string
61
  */
62
- const CURRENT_VERSION = '1.04';
63
 
64
  /**
65
  * Slug prefix for registering and enqueueing submenu pages, style sheets and scripts
59
  *
60
  * @var string
61
  */
62
+ const CURRENT_VERSION = '1.05';
63
 
64
  /**
65
  * Slug prefix for registering and enqueueing submenu pages, style sheets and scripts
examples/plugins/mla-mapping-hooks-example.php CHANGED
@@ -9,7 +9,7 @@
9
  * a supporting function "_export_this_item" and the "mla_end_mapping" action.
10
  *
11
  * @package MLA Mapping Hooks Example
12
- * @version 1.04
13
  */
14
 
15
  /*
@@ -17,10 +17,10 @@ Plugin Name: MLA Mapping Hooks Example
17
  Plugin URI: http://davidlingren.com/
18
  Description: Provides an example of the filters provided by the IPTC/EXIF and Custom Field mapping features
19
  Author: David Lingren
20
- Version: 1.04
21
  Author URI: http://davidlingren.com/
22
 
23
- Copyright 2014 David Lingren
24
 
25
  This program is free software; you can redistribute it and/or modify
26
  it under the terms of the GNU General Public License as published by
@@ -56,9 +56,7 @@ class MLAMappingHooksExample {
56
  * @return void
57
  */
58
  public static function initialize() {
59
- /*
60
- * The filters are only useful in the admin section; exit if in the "front-end" posts/pages.
61
- */
62
  if ( ! is_admin() )
63
  return;
64
 
@@ -84,12 +82,15 @@ class MLAMappingHooksExample {
84
  add_filter( 'mla_mapping_settings', 'MLAMappingHooksExample::mla_mapping_settings', 10, 4 );
85
  add_filter( 'mla_mapping_rule', 'MLAMappingHooksExample::mla_mapping_rule', 10, 4 );
86
  add_filter( 'mla_mapping_custom_value', 'MLAMappingHooksExample::mla_mapping_custom_value', 10, 5 );
 
87
  add_filter( 'mla_mapping_iptc_value', 'MLAMappingHooksExample::mla_mapping_iptc_value', 10, 5 );
88
  add_filter( 'mla_mapping_exif_value', 'MLAMappingHooksExample::mla_mapping_exif_value', 10, 5 );
89
  add_filter( 'mla_mapping_new_text', 'MLAMappingHooksExample::mla_mapping_new_text', 10, 5 );
90
  add_filter( 'mla_mapping_updates', 'MLAMappingHooksExample::mla_mapping_updates', 10, 5 );
91
  add_action( 'mla_end_mapping', 'MLAMappingHooksExample::mla_end_mapping', 10, 0 );
92
 
 
 
93
  add_filter( 'mla_get_options_tablist', 'MLAMappingHooksExample::mla_get_options_tablist', 10, 3 );
94
  }
95
 
@@ -428,12 +429,46 @@ class MLAMappingHooksExample {
428
  //$size_names = MLAOptions::mla_get_data_source($post_id, $category, $my_setting, $attachment_metadata);
429
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_mapping_custom_value_filter $size_names = ' . var_export( $size_names, true ), 0 );
430
 
431
- /*
432
- * For "empty" values, return ' '.
433
- */
434
  return $new_text;
435
  } // mla_mapping_custom_value_filter
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  /**
438
  * MLA Mapping IPTC Value Filter
439
  *
@@ -738,6 +773,28 @@ class MLAMappingHooksExample {
738
  }
739
  } // mla_end_mapping_action
740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  /**
742
  * MLA Settings Tab List Filter
743
  *
@@ -757,14 +814,10 @@ class MLAMappingHooksExample {
757
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_get_options_tablist_filter $mla_tablist = ' . var_export( $mla_tablist, true ), 0 );
758
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_get_options_tablist_filter $tab = ' . var_export( $tab, true ), 0 );
759
 
760
- /*
761
- * Return an updated $mla_tablist ( $tab = NULL ), an updated single element or false
762
- */
763
  return $results;
764
 
765
- /*
766
- * Comment out the above return statement to fall through to the example, which removes the "Uploads" tab.
767
- */
768
  if ( NULL == $tab ) {
769
  unset( $results['upload'] );
770
  }
9
  * a supporting function "_export_this_item" and the "mla_end_mapping" action.
10
  *
11
  * @package MLA Mapping Hooks Example
12
+ * @version 1.05
13
  */
14
 
15
  /*
17
  Plugin URI: http://davidlingren.com/
18
  Description: Provides an example of the filters provided by the IPTC/EXIF and Custom Field mapping features
19
  Author: David Lingren
20
+ Version: 1.05
21
  Author URI: http://davidlingren.com/
22
 
23
+ Copyright 2014-2020 David Lingren
24
 
25
  This program is free software; you can redistribute it and/or modify
26
  it under the terms of the GNU General Public License as published by
56
  * @return void
57
  */
58
  public static function initialize() {
59
+ // The filters are only useful in the admin section; exit if in the "front-end" posts/pages.
 
 
60
  if ( ! is_admin() )
61
  return;
62
 
82
  add_filter( 'mla_mapping_settings', 'MLAMappingHooksExample::mla_mapping_settings', 10, 4 );
83
  add_filter( 'mla_mapping_rule', 'MLAMappingHooksExample::mla_mapping_rule', 10, 4 );
84
  add_filter( 'mla_mapping_custom_value', 'MLAMappingHooksExample::mla_mapping_custom_value', 10, 5 );
85
+ add_filter( 'mla_mapping_old_custom_value', 'MLAMappingHooksExample::mla_mapping_old_custom_value', 10, 5 );
86
  add_filter( 'mla_mapping_iptc_value', 'MLAMappingHooksExample::mla_mapping_iptc_value', 10, 5 );
87
  add_filter( 'mla_mapping_exif_value', 'MLAMappingHooksExample::mla_mapping_exif_value', 10, 5 );
88
  add_filter( 'mla_mapping_new_text', 'MLAMappingHooksExample::mla_mapping_new_text', 10, 5 );
89
  add_filter( 'mla_mapping_updates', 'MLAMappingHooksExample::mla_mapping_updates', 10, 5 );
90
  add_action( 'mla_end_mapping', 'MLAMappingHooksExample::mla_end_mapping', 10, 0 );
91
 
92
+ add_filter( 'mla_purge_custom_field_values', 'MLAMappingHooksExample::mla_purge_custom_field_values', 10, 4 );
93
+
94
  add_filter( 'mla_get_options_tablist', 'MLAMappingHooksExample::mla_get_options_tablist', 10, 3 );
95
  }
96
 
429
  //$size_names = MLAOptions::mla_get_data_source($post_id, $category, $my_setting, $attachment_metadata);
430
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_mapping_custom_value_filter $size_names = ' . var_export( $size_names, true ), 0 );
431
 
432
+ // For "empty" values, return ' '.
 
 
433
  return $new_text;
434
  } // mla_mapping_custom_value_filter
435
 
436
+ /**
437
+ * MLA Mapping Old Value Filter
438
+ *
439
+ * This filter is called once for each Custom Field mapping rule, after the "old text"
440
+ * portion of the rule is evaluated. You can change the old value produced by the rule.
441
+ *
442
+ * @since 1.00
443
+ *
444
+ * @param mixed current target value returned by the rule
445
+ * @param array rule slug
446
+ * @param integer post ID to be evaluated
447
+ * @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
448
+ * @param array attachment_metadata, default NULL
449
+ *
450
+ * @return array updated current target value
451
+ */
452
+ public static function mla_mapping_old_custom_value( $old_text, $setting_value, $post_id, $category, $attachment_metadata ) {
453
+ //error_log( __LINE__ . " MLAMappingHooksExample::mla_mapping_custom_value_filter( {$post_id}, {$category} ) new_text = " . var_export( $old_text, true ), 0 );
454
+ //error_log( __LINE__ . " MLAMappingHooksExample::mla_mapping_custom_value_filter( {$post_id}, {$category} ) setting_value = " . var_export( $setting_value, true ), 0 );
455
+ //error_log( __LINE__ . " MLAMappingHooksExample::mla_mapping_custom_value_filter( {$post_id}, {$category} ) attachment_metadata = " . var_export( $attachment_metadata, true ), 0 );
456
+
457
+ /*
458
+ * You can use MLAOptions::mla_get_data_source() to get anything available;
459
+ * for example:
460
+ * /
461
+ $my_setting = array(
462
+ 'data_source' => 'size_names',
463
+ 'option' => 'array'
464
+ ); // */
465
+ //$size_names = MLAOptions::mla_get_data_source($post_id, $category, $my_setting, $attachment_metadata);
466
+ //error_log( __LINE__ . ' MLAMappingHooksExample::mla_mapping_custom_value_filter $size_names = ' . var_export( $size_names, true ), 0 );
467
+
468
+ // For "empty" values, return ' '.
469
+ return $old_text;
470
+ } // mla_mapping_old_custom_value_filter
471
+
472
  /**
473
  * MLA Mapping IPTC Value Filter
474
  *
773
  }
774
  } // mla_end_mapping_action
775
 
776
+ /**
777
+ * MLA Settings Purge Custom Field Values Filter
778
+ *
779
+ * This filter is applied for each rule before the default processing takes place.
780
+ * You can apply your own logic or prevent the purge.
781
+ *
782
+ * @since 1.05
783
+ *
784
+ * @param string|NULL Text message describing the results of applying the purge. Default NULL.
785
+ * @param string Category; 'custom_field_mapping' or 'iptc_exif_custom_mapping'
786
+ * @param string Name/slug of the rule
787
+ * @param array Rule parameters
788
+ *
789
+ * @return string|NULL Updated text message describing the results of applying the purge
790
+ */
791
+ public static function mla_purge_custom_field_values( $results, $category, $rule_name, $rule ) {
792
+ //error_log( __LINE__ . " MLAMappingHooksExample::mla_purge_custom_field_values( {$category}, {$rule_name} ) rule = " . var_export( $rule, true ), 0 );
793
+
794
+ // Return processing result or NULL (the default) to allow default processing
795
+ return $results;
796
+ } // mla_purge_custom_field_values_filter
797
+
798
  /**
799
  * MLA Settings Tab List Filter
800
  *
814
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_get_options_tablist_filter $mla_tablist = ' . var_export( $mla_tablist, true ), 0 );
815
  //error_log( __LINE__ . ' MLAMappingHooksExample::mla_get_options_tablist_filter $tab = ' . var_export( $tab, true ), 0 );
816
 
817
+ // Return an updated $mla_tablist ( $tab = NULL ), an updated single element or false
 
 
818
  return $results;
819
 
820
+ // Comment out the above return statement to fall through to the example, which removes the "Uploads" tab.
 
 
821
  if ( NULL == $tab ) {
822
  unset( $results['upload'] );
823
  }
examples/plugins/mla-parent-custom-field-mapping/admin-settings-page.tpl ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- template="page" -->
2
+ <a name="backtotop"></a>
3
+ &nbsp;
4
+ <div class="wrap">
5
+ <h1 class="wp-heading-inline">MLA Parent Custom Field Mapping [+version+] Settings</h1>
6
+ [+messages+]
7
+ [+tablist+]
8
+ [+tab_content+]
9
+ </div><!-- wrap -->
10
+
11
+ <!-- template="tablist" -->
12
+ <h2 class="nav-tab-wrapper">
13
+ [+tablist+]
14
+ </h2>
15
+ <!-- template="tablist-item" -->
16
+ <a data-tab-id="[+data-tab-id+]" class="nav-tab [+nav-tab-active+]" href="?page=[+settings-page+]&amp;mla_tab=[+data-tab-id+]">[+title+]</a>
17
+
18
+ <!-- template="messages" -->
19
+ <div class="[+mla_messages_class+]">
20
+ <p>
21
+ [+messages+]
22
+ </p>
23
+ [+dismiss_button+]
24
+ </div>
25
+
26
+ <!-- template="page-level-options" -->
27
+ <tr valign="top">
28
+ <td class="textright">
29
+ <input name="mla_parent_custom_field_mapping_options[acf_support]" id="mla_parent_custom_field_mapping_acf_support" type="checkbox" [+acf_support_checked+] value="1" />
30
+ </td>
31
+ <td>
32
+ &nbsp;<strong>ACF Support</strong>
33
+ <div class="mla-settings-help">&nbsp;&nbsp;Check this option to activate support for Advanced Custom Fields and ACF Pro.</div>
34
+ </td>
35
+ </tr>
36
+ <tr valign="top">
37
+ <td class="textright">
38
+ <input name="mla_parent_custom_field_mapping_options[wplr_support]" id="mla_parent_custom_field_mapping_wplr_support" type="checkbox" [+wplr_support_checked+] value="1" />
39
+ </td>
40
+ <td>
41
+ &nbsp;<strong>Wp/LR Sync Support</strong>
42
+ <div class="mla-settings-help">&nbsp;&nbsp;Check this option to activate support for WP/LR Sync.</div>
43
+ </td>
44
+ </tr>
45
+
46
+
47
+ <!-- template="general-tab" -->
48
+ <style type='text/css'>
49
+ .mla-settings-help {
50
+ font-size: 8pt;
51
+ padding-bottom: 5px
52
+ }
53
+
54
+ .mla-page-level-options-form {
55
+ margin-left: 0px;
56
+ margin-top: 10px;
57
+ padding-bottom: 10px;
58
+ border-bottom:thin solid #888888;
59
+ }
60
+
61
+ span.submit.mla-settings-submit,
62
+ p.submit.mla-settings-submit {
63
+ padding-bottom: 0px
64
+ }
65
+ </style>
66
+ <h2>Plugin Options</h2>
67
+ <p>In this tab you can add or remove support for the Advanced Custom Fields, ACF Pro and WP/LR Sync plugins. You can leave these options checked unless you find a specific problem they cause (unlikely).</p>
68
+ <p>You can find more information about using all of the features of this plugin in the Documentation tab on this page.</p>
69
+ <div class="mla-page-level-options-form">
70
+ <form action="[+form_url+]" method="post" class="mla-display-settings-page" id="mla-display-settings-parent-custom-field-mapping-tab">
71
+ <table class="optiontable">
72
+ <tbody>
73
+ [+options_list+]
74
+ </tbody>
75
+ </table>
76
+ <span class="submit mla-settings-submit">
77
+ <input name="mla-parent-custom-field-mapping-options-save" class="button-primary" id="mla-parent-custom-field-mapping-options-save" type="submit" value="Save Changes" />
78
+ </span>
79
+ [+_wpnonce+]
80
+ </form>
81
+ </div>
82
+
83
+ <!-- template="documentation-tab" -->
84
+ <style type='text/css'>
85
+ .mla-doc-toc-list {
86
+ list-style-position:inside;
87
+ list-style:disc;
88
+ line-height: 15px;
89
+ padding-left: 20px
90
+ }
91
+
92
+ .mla-doc-hook-label {
93
+ text-align: right;
94
+ padding: 0 1em 2em 0;
95
+ vertical-align: top;
96
+ font-weight:bold
97
+ }
98
+
99
+ .mla-doc-hook-definition {
100
+ vertical-align: top;
101
+ }
102
+
103
+ .mla-doc-table-label {
104
+ text-align: right;
105
+ padding-right: 10px;
106
+ vertical-align: top;
107
+ font-weight:bold
108
+ }
109
+
110
+ .mla-doc-table-sublabel {
111
+ padding-right: 10px;
112
+ vertical-align: top
113
+ }
114
+
115
+ .mla-doc-table-reverse {
116
+ text-align: right;
117
+ padding-right: 10px;
118
+ vertical-align:top
119
+ }
120
+
121
+ .mla-doc-table-definition {
122
+ vertical-align: top;
123
+ }
124
+
125
+ .mla-doc-bold-link {
126
+ font-size:14px;
127
+ font-weight:bold
128
+ }
129
+ </style>
130
+ <h2>Plugin Documentation. In this tab, jump to:</h2>
131
+ <div class="mla-display-settings-page" id="mla-display-settings-documentation-tab" style="width:700px">
132
+ <ul class="mla-doc-toc-list">
133
+ <li><a href="#introduction"><strong>Introduction</strong></a></li>
134
+ <li><a href="#processing"><strong>How the Plugin Works</strong></a></li>
135
+ <li><a href="#composing_rules"><strong>Composing Mapping Rules</strong></a></li>
136
+ <li><a href="#applying_rules"><strong>Applying Mapping Rules</strong></a></li>
137
+ <li><a href="#rollover_actions"><strong>Mapping Rule Rollover Actions</strong></a></li>
138
+ <li><a href="#acf"><strong>Advanced Custom Fields (ACF) Features</strong></a></li>
139
+ <li><a href="#wplr_sync"><strong>WP/LR Sync Features</strong></a></li>
140
+ <li><a href="#plugin_options"><strong>Plugin Options</strong></a></li>
141
+ <li><a href="#debugging"><strong>Debugging and Troubleshooting</strong></a></li>
142
+ <li><a href="#examples"><strong>Examples</strong></a></li>
143
+ </ul>
144
+ <p>
145
+ &nbsp;
146
+ <a name="introduction"></a>
147
+ </p>
148
+ <p>
149
+ <a href="#backtotop">Go to Top</a>
150
+ </p>
151
+ <h3>Introduction</h3>
152
+ <p>
153
+ Many sites that "attach" Media Library items to a post or page also display information about those items in the post/page content. The MLA Parent Custom Field Mapping example plugin provides a convenient way to access such information by mapping item values to custom fields in the parent post/page. The example plugin was developed in response to this MLA support topic:
154
+ </p>
155
+ <ul class="mla-doc-toc-list">
156
+ <li><a href="https://wordpress.org/support/topic/https://wordpress.org/support/topic/iptc-exif-mapping-on-picture-upload-to-parent-posts-custom-fields/" title="View the topic" target="_blank">IPTC/EXIF Mapping on picture upload to parent post&rsquo;s custom fields</a></li>
157
+ </ul>
158
+ <p>
159
+ To use the plugin you must create Custom Field or IPTC/EXIF mapping rules that name the parent custom fields and specify where their values come from. Once the rules are defined they can run automatically when items are added to the Media Library or you can execute them manually.
160
+ </p>
161
+ <p>
162
+ More details on composing and applying rules are in the sections of this Documentation page.
163
+ <a name="processing"></a>
164
+ </p>
165
+ <p>
166
+ <a href="#backtotop">Go to Top</a>
167
+ </p>
168
+ <h3>How the Plugin Works</h3>
169
+ <p>
170
+ The example plugin makes no changes or additions to the MLA core code; it hooks some of the actions and filters provided by MLA (and ACF and WP/LR Sync). The plugin works by detecting the presence of the <code>parent:</code> prefix in a mapping rule name at the beginning of any mapping rule(s) execution. When the prefix is present, the rule is applied to the custom fields of the item&rsquo;s parent post/page (if present) instead of the item itself. Mapping rules are executed when:
171
+ </p>
172
+ <ul class="mla-doc-toc-list">
173
+ <li>Items are uploaded to the Media Library from the MMMW Add Media.</li>
174
+ <li>MLA&rsquo;s "Map Custom Field Metadata" or "Map IPTC/EXIF metadata" link is clicked on the Media/Edit Media screen.</li>
175
+ <li>MLA&rsquo;s "Map Custom Field Metadata" or "Map IPTC/EXIF metadata" link is clicked in the Media/Assistant Bulk Edit area.</li>
176
+ <li>The "Execute" rollover action or "Execute" Bulk Action is applied in the Settings/Media Library Assistant Custom Fields or IPTC/EXIF tab.</li>
177
+ <li>The WP/LR Theme Assistant plugin creates a new post/page to host a gallery for a Lightroom collection.</li>
178
+ <li>The WP/LR Sync plugin adds Media Library items during syncronization.</li>
179
+ </ul>
180
+ <p>
181
+ Some of the actions above are performed on just one item for a WordPress "page load". For example, when new items are uploaded each item is processed in a separate WordPress page load, even if you drag & drop or select multiple files at one time. Other actions, such as the Media/Assistant Bulk Edit or Execute Bulk Action operate on multiple items in a single page load.
182
+ </p>
183
+ <p>
184
+ The outline that follows is somewhat technical, but should give you an idea of the sequence of events and actions that allow the plugin to do its work. When the post/page is loaded this plugin is initialized, setting two MLA "hooks" that may be called to start the plugin&rsquo;s processing:
185
+ </p>
186
+ <ul class="mla-doc-toc-list">
187
+ <li><strong>mla_purge_custom_field_values</strong> - called when the "Purge Values" rollover action is clicked</li>
188
+ <li><strong>mla_mapping_settings</strong> - called when a mapping execution starts to inspect/modify rule definitions</li>
189
+ </ul>
190
+ <p>
191
+ When the "mla_purge_custom_field_values" filter is called for a "parent:" rule this plugin will delete the values for the named custom field in all posts and pages. Logic is included to delete all of the rows present for an ACF Repeater field.
192
+ </p>
193
+ <p>
194
+ When the "mla_mapping_settings" filter is called for the first time in a post/page load this plugin inspects all of the rules, looking for "parent:" rules. If any are found, this plugin 1) filters out any ACF Repeater and Subfield rules, 2) prepares a cache for WP/LR Sync processing and 3) adds filters to be called for each item&rsquo;s processsing:
195
+ </p>
196
+ <ul class="mla-doc-toc-list">
197
+ <li><strong>mla_mapping_old_custom_value</strong> - supplies the existing custom field value, if any, from the parent post/page rather than the item itself.</li>
198
+ <li><strong>mla_mapping_updates</strong> - called when the rules generate updates for the item. Filters out the "parent:" updates and applies them to the parent post/page rather than the item itself.</li>
199
+ <li><strong>acf/update_value - called when ACF tries to store new values, preventing ACF from overwriting values already stored by MLA&rsquo;s mapping rules</strong></li>
200
+ <li><strong>wplr_add_media_to_collection</strong> - called when WP/LR Sync attaches an item to a parent "collection" post. Applies updates from MLA&rsquo;s mapping rules when the parent post ID is finally known.</li>
201
+ </ul>
202
+ <p>
203
+ Once the above filters are in place they are called repeatedly as mapping rules are excuted for each item. You can find more details on the ACF and WP/LR Sync filters in the sections below.
204
+ &nbsp;
205
+ <a name="composing_rules"></a>
206
+ </p>
207
+ <p>
208
+ <a href="#backtotop">Go to Top</a>
209
+ </p>
210
+ <h3>Composing Mapping Rules</h3>
211
+ <p>
212
+ Parent mapping is activated by adding a <code>parent:</code> prefix to the Name field of a mapping rule. You can add the prefix when you create the rule or by clicking the "Change Name" and then "Enter new field" links below the Name on the Edit Rule screen (click the rule&rsquo;s "Edit" rollover action). For example, a rule named &ldquo;parent:Camera Used&rdquo; would create or update the &ldquo;Camera Used&rdquo; custom field in the parent post/page of an attached item. The rule can use any of the data sources available, including IPTC/EXIF/XMP metadata. You can add the prefix to rules on the Settings/Media Library Assistant "Custom Fields" and/or "IPTC/EXIF" tabs.
213
+ </p>
214
+ <p>
215
+ When composing a "parent:" rule in the Custom Fields tab, always leave the "MLA Column", "Quick Edit" and "Bulk Edit" boxes <strong>unchecked</strong>. These three options apply to the Media Library item itself and they have no meaning when the custom field is stored in a parent post/page.
216
+ </p>
217
+ </p>
218
+ The "Existing Text" Keep/Replace choice is meaningful when multiple items are attached to a given post/page. If you select "Keep", the field value will be set when the first item is attached. If you select "Replace", the field value will be replaced each time an additional item is attached, so the current value will always be that of the last/most recent item attached to the post/page. The Existing Text setting is not used for Repeater Fields or Subfields, which are handled differently.
219
+ </p>
220
+ <p>
221
+ The "Option" choice ...
222
+ </p>
223
+ <p>
224
+ When you are using Advanced Custom Fields some additional information is required to make sure MLA&rsquo;s mapping updates are properly recorded for use by ACF. This additional information is coded in a special <strong><code>,acf()</code></strong> option field that is appended to the field name. You can find more information about this topic in the "Advanced Custom Fields (ACF) Features" section below.
225
+ <a name="applying_rules"></a>
226
+ </p>
227
+ <p>
228
+ <a href="#backtotop">Go to Top</a>
229
+ </p>
230
+ <h3>Applying Mapping Rules</h3>
231
+ <p>
232
+ As outlined in "How the Plugin Works", MLA mapping rules are executed when new items are added to the Media Library (assuming the "Enable ... mapping when adding new media" box is checked). If a parent post/page is known at that time the "parent:" rules will be applied automatically. For example, when you fill a Gutenberg "Image" or "Gallery" block by uploading new items the parent is assigned and the rules will be applied. The Classic Editor "Add Media..." popup window works in the same way.
233
+ </p>
234
+ <p>
235
+ If you are using the WP/LR Sync (and the optional Theme Assistant) plugin, adding new items to the Media Library with a sync action or creating a new post/page to host a collection gallery will apply the rules.
236
+ </p>
237
+ <p>
238
+ The current version of this plugin will <strong>not</strong> apply the rules when an item is attached to a post/page by manually setting the Post Parent value. If you need this feature, contact me at my web site.
239
+ </p>
240
+ <p>
241
+ There are a number of ways to manually apply the mapping rules to one, several or all of your items:
242
+ </p>
243
+ <ul class="mla-doc-toc-list">
244
+ <li>To map a single item, go to the Media/Assistant submenu and click the thumbnail of the item you want (or click the &ldquo;Edit&rdquo; rollover action) to get the Media/Edit Media screen. You can click the &ldquo;Map Custom Field metadata&rdquo; or "Map IPTC/EXIF metadata" links to run your rules on this item, then go to the parent post and scroll down and look at the custom field to inspect the results. Note: The Edit Post screen does not show custom fields by default; you may have to add them to your display.</li>
245
+ <li>To map two or more items, go to the Media/Assistant submenu and click the checkbox next to the items you want. Then, select &ldquo;Edit&rdquo; from the &ldquo;Bulk Actions&rdquo; dropdown above the checkboxes and click &ldquo;Apply&rdquo; to open the Bulk Edit area. Click the &ldquo;Map Custom Field metadata&rdquo; or "Map IPTC/EXIF metadata" button to run your rules on the selected items.</li>
246
+ <li>To map all of your items, stay on the Settings/Media Library Assistant tab and use the &ldquo;Execute&rdquo; rollover action as defined in the next section. This may take a while.</li>
247
+ <li>The Settings/Media Library Assistant tabs also have an &ldquo;Execute&rdquo; Bulk Action you can use to apply several rules to all of your items at once, and an &ldquo;Execute All Rules&rdquo; button to run all of the rules against all of your items.</li>
248
+ </ul>
249
+ <p>
250
+ There are a couple of techniques you can use to make manual mapping more convenient. First, on the Custom Fields and IPTC/EXIF tabs you can enter &ldquo;parent:&rdquo; in the search box and click &ldquo;Search Rules&rdquo; to filter the display, showing all and only the parent mapping rules. You can then check the rule(s) you want and use the &ldquo;Execute&rdquo; bulk action to apply them to all your items. Second, on the Media/Assistant admin submenu you can enter the ID number of a parent post/page in the Search Media Box to show all items attached to it. You can also click on the &ldquo;(Parent: xxxx)&rdquo; link in the ID/Parent column to filter the display. Once the display is filtered you can select all the attached items and then use the Bulk Edit area to apply your rules.
251
+ <a name="rollover_actions"></a>
252
+ </p>
253
+ <p>
254
+ <a href="#backtotop">Go to Top</a>
255
+ </p>
256
+ <h3>Mapping Rule Rollover Actions</h3>
257
+ <p>
258
+ When you hover over the rule name in the Name column of the rules table a list of rollover actions will appear. These can help you manage your parent mapping rules:
259
+ </p>
260
+ <ul class="mla-doc-toc-list">
261
+ <li><strong>Edit</strong> - activates the full-screen version of the rule editing feature. On this screen you can change the rule name to add or remove the &ldquo;parent:&rdquo; prefix, the custom field name and/or the &ldquo;,acf()&rdquo; option. It&rsquo;s a bit cumbersome but it works. It&rsquo;s helpful to copy the existing value before you click &ldquo;Change Name&rdquo; and then &ldquo;Enter new field&rdquo; because the current name is deleted and the text box is empty when you start.</li>
262
+ <li><strong>Quick Edit</strong> - activates the inline version of the rule editing feature. In this area you can change the rule settings but not the rule name.</li>
263
+ <li><strong>Execute</strong> - applies the rule to <strong>all</strong> of your items, using a series of AJAX requests to break the processing up into chunks and avoid script timeouts.<br />&nbsp;<br />While the process is running you can click the &ldquo;Pause&rdquo; button to suspend the process. Then, you can click the &ldquo;Cancel&rdquo; button to stop the process or the &ldquo;Resume&rdquo; button to carry on. To the right of the Resume button is a text box with the number of the next item to be processed. You can change this number to, for example, skip over items you know are already processed; this is handy if something goes wrong and you need to get around an error.<br />&nbsp;<br />For ACF Repeater Fields, the execute function applies to all of the Repeater's Subfields. Individual Subfield executes are not supported and are ignored.</li>
264
+ <li><strong>Purge Values</strong> - deletes all of the existing values for the custom field named in the rule. This can be handy if you are experimenting with a new rule, or if you change the definition of a rule and want to ensure that all of your items or posts/pages have consistent values.<br />&nbsp;<br />For ACF Repeater Fields, the purge values function eliminates all rows assigned to the field. Individual Subfield purges are not supported.</li>
265
+ <li><strong>Delete Permanently</strong> - deletes the rule from the table. Note that existing custom field values are <strong>not</strong> deleted, so be sure to run Purge Values first if you want to clean things up.</li>
266
+ </ul>
267
+ <p>
268
+ &nbsp;
269
+ <a name="acf"></a>
270
+ </p>
271
+ <p>
272
+ <a href="#backtotop">Go to Top</a>
273
+ </p>
274
+ <h3>Advanced Custom Fields (ACF) Features</h3>
275
+ <p>
276
+ ACF provides a rich set of field data types and display formats. To do this it replaces the core WordPress user interface for custom fields, using custom logic to store, load and format field values. This MLA example plugin works well with the simple ACF field types, such as text and date fields. More complex ACF types such as checkboxes require additional logic to encode them for database storage; the example plugin does not contain equivalent logic and you will be disappointed in the results. You can contact me about the possibility of extending the example plugin for these needs.
277
+ </p>
278
+ <p>
279
+ When you are using Advanced Custom Fields some additional information is required to make sure MLA&rsquo;s mapping updates are properly recorded for use by ACF. This additional information is coded in a special <strong><code>,acf()</code></strong> option field that is appended to the field name. There are two ACF features that must be accomodated:
280
+ </p>
281
+ <ul class="mla-doc-toc-list">
282
+ <li>If and when ACF can be used to manually edit values supplied by MLA</li>
283
+ <li>For ACF Pro, how Repeater Fields and their Subfields are handled</li>
284
+ </ul>
285
+ <p>
286
+ Since ACF is not aware of MLA&rsquo;s mapping rule process it will often overwrite the values MLA stores with empty or obsolete values. MLA can prevent this problem with one of three options:
287
+ </p>
288
+ <ul class="mla-doc-toc-list">
289
+ <li><strong><code>,acf(read_only)</code></strong> - means ACF will never alter the value of the field. This is the most useful setting, and the one to use if you want only MLA to populate the field.</li>
290
+ <li><strong><code>,acf(empty)</code></strong> - means ACF will only alter the value of the field if its current value is empty. This means that any value you enter in the Edit Post/Page screen will be stored in the database if there is no current value in the database.</li>
291
+ <li><strong><code>,acf(default_value)</code></strong> - means ACF will only alter the value of the field if the current database value matches the Default Value set in the ACF Field definition. This would let you delete the field if its currrent value matched the ACF Default Value.</li>
292
+ </ul>
293
+ <p>
294
+ The "read_only" option is usually the right choice. To specify one of these options, code something like <strong><code>parent:Camera Used,acf(read_only)</code></strong> as your field name.
295
+ </p>
296
+ <p>
297
+ ACF Pro Repeater Field values are stored as "rows" containing "subfields" in multiple WordPress custom fields tied togeter by a naming convention. Each subfield can be populated by a separate MLA mapping rule. To tie MLA&rsquo;s rules back to ACF Repeaters and Subfields two ",acf()" options are added to the rule names:
298
+ </p>
299
+ <ul class="mla-doc-toc-list">
300
+ <li><strong><code>,acf(repeater)</code></strong> - is appended to the name of the Repeater Field.</li>
301
+ <li><strong><code>,acf(subfield.<em>repeater-name</em>)"</code></strong> - is appended to each repeater subfield, where <strong><em>repeater-name</em></strong> is the name of the Repeater Field of which each Subfield is a part. You don&rsquo;t have to have a rule for all Sub Fields; any missing values are replaced by an empty string.</li>
302
+ </ul>
303
+ <p>
304
+ For example, you might code three rules for <strong><code>parent:Camera Settings,acf(repeater)</code></strong>, <strong><code>parent:Shutter Speed,acf(subfield.Camera Settings)</code></strong> and <strong><code>parent:Focal Length,acf(subfield.Camera Settings)</code></strong>.
305
+ </p>
306
+ <p>
307
+ Repeater fields are useful because a given post/page can have multiple attached items. For example, a post/page might have a gallery of images each of which contains camera and GPS location information. This information could be added to the post/page content or used to display a map containing pins for each image&rsquo;s location. The MLA example plugin will copy item values to Repeater fields and ensure that there is exactly one row for each <strong>unique combination</strong> of subfields. In the above example, there would be one row for each combination of Shutter Speed and Focal Length. If two or more images had the same combination, only one row would be added to the Repeater.
308
+ </p>
309
+ <p>
310
+ In the above example you may see a particular Shutter Speed value appear multiple times, paired with different Focal Length values. If you want exactly one occurance of each Shutter Speed and each Focal Length, make each one a subfield of its own separate Repeater field.
311
+ </p>
312
+ <p>
313
+ There is no explicit way to match a Repeater row to the attached item(s) that created it, so if you add or remove attached items the Repeater field content might become incomplete or inaccurate. You may have to delete the field value and reapply the mapping rules to clean things up.
314
+ <a name="wplr_sync"></a>
315
+ </p>
316
+ <p>
317
+ <a href="#backtotop">Go to Top</a>
318
+ </p>
319
+ <h3>WP/LR Sync Features</h3>
320
+ <p>
321
+ This example plugin supports WP/LR Sync and the optional Theme Assistant. WP/LR Theme Assistant is an extension for WP/LR Sync that allows you to create mappings between the WP/LR Sync API and the technical structure of your theme in order to automate content creation. Typically, it is used to create a page containing a gallery for each of your collections in Lightroom.
322
+ </p>
323
+ <p>
324
+ When WP/LR Theme Assistant adds images to a page containing a collection's gallery it attaches the items to the page. This example plugin will apply all the &ldquo;parent:&rdquo; mapping rules when that occurs.
325
+ <a name="plugin_options"></a>
326
+ </p>
327
+ <p>
328
+ <a href="#backtotop">Go to Top</a>
329
+ </p>
330
+ <h3>Plugin Options</h3>
331
+ <p>
332
+ The current plugin version has just two option settings; checkboxes for ACF and WP/LR Sync support. They are only used if one or both of the respective plugins is installed and active on the site.
333
+ </p>
334
+ <p>
335
+ You can leave the default (checked) setting in place unless you are having a specific problem that might be caused by this plugin interfering in some way with one of the other plugins.
336
+ <a name="debugging"></a>
337
+ </p>
338
+ <p>
339
+ <a href="#backtotop">Go to Top</a>
340
+ </p>
341
+ <h3>Debugging and Troubleshooting</h3>
342
+ <p>
343
+ When you are creating a new rule testing it out on one or a few posts/pages and carefully inspecting the results can be a valuable exercise. YOu may have to delete the field values, modify the rule and reapply it a few times to get the expected results.
344
+ </p>
345
+ <p>
346
+ If a problem persists you can activate the debug logging, run a test and insoect the log file for more information about what's going on. To activate MLA’s debug logging:
347
+ </p>
348
+ <ol>
349
+ <li>Navigate to the Settings/Media Library Assistant Debug tab.</li>
350
+ <li>Scroll down to the “MLA Reporting” text box and enter “0x8013”. This will turn on MLA debug logging for the example plugin, AJAX operations (such as WP/LR Sync) and the IPTC/EXIF metadata mapping rules.</li>
351
+ <li>Click the Save Changes button to record your new setting.</li>
352
+ <li>Optionally, scroll to the bottom of the screen and click “Reset” to clear the error log. You may not want to do this depending on how you manage your error log.</li>
353
+ </ol>
354
+ <p>
355
+ Once that’s done you can run a test. The debug log will be very detailed, so restricting the test as best you can will be very helpful. To can often update one post and then collect the test results. One way to do that:
356
+ </p>
357
+ <ol>
358
+ <li>Manually delete the Repeater Field content for one of your posts.</li>
359
+ <li>Go to the Media/Assistant admin submenu table and find one of the attachments for that post.</li>
360
+ <li>Click on the “(Parent:xxxx)” link in the ID/Parent column to filter the display showing all the attachments for that one post.</li>
361
+ <li>Click the box next to the ID/Parent column title to select all the attachments.</li>
362
+ <li>Select “Edit” from the Bulk Actions dropdown and click “Apply”.</li>
363
+ <li>Click the “Map IPTC/EXIF metadata” button in the bottom-right corner of the Bulk Edit area.</li>
364
+ </ol>
365
+ <p>
366
+ When you’ve finished testing, go back to the Debug screen and:
367
+ </p>
368
+ <ol>
369
+ <li>Enter “0” in the MLA Reporting text box to turn debug logic off.</li>
370
+ <li>Click the Save Changes button to record your new setting.</li>
371
+ <li>Scroll to the bottom and click “Download” to get the log content in a text file.</li>
372
+ </ol>
373
+ <p>
374
+ There should be a lot of messages written to the log, so limit the amount of activity during the logging period. You should see messages in the log like these:
375
+ </p>
376
+ <blockquote>
377
+ [27-Jun-2020 23:09:30 UTC] 610 MLACore::mla_plugins_loaded_action() MLA 2.83 (20200621) mla_debug_level 0x13<br />
378
+ [27-Jun-2020 23:09:30 UTC] 37 MLA_Ajax::initialize( false ) $_REQUEST = array (<br />
379
+ 'action' => 'mla-inline-edit-scripts',<br />
380
+ 'mla_admin_nonce' => 'b09f9d91ed',<br />
381
+ 'bulk_action' => 'bulk_map',<br />
382
+ )<br />
383
+ </blockquote>
384
+ <p>
385
+ Of course, the details will be different. If you discover a defect in the plugin (or in MLA) you can <a href="http://wordpress.org/support/plugin/media-library-assistant" target="_blank">open a support topic</a> or <a href="http://davidlingren.com/#two" target="_blank">contact me at my web site</a> so it can be investigated further. I may ask for a copy of the log file from your tests.
386
+ <a name="examples"></a>
387
+ </p>
388
+ <p>
389
+ <a href="#backtotop">Go to Top</a>
390
+ </p>
391
+ <h3>Examples</h3>
392
+ <p>
393
+ To be added...
394
+ </p>
395
+ </div>
examples/plugins/mla-parent-custom-field-mapping/mla-parent-custom-field-mapping.php ADDED
@@ -0,0 +1,1403 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Uses a Custom Field mapping rule to map data sources for an "attached" item to custom fields of the parent page/post.
4
+ *
5
+ * This plugin looks for a "parent:" prefix in the slug/name field for a custom field rule.
6
+ * When the prefix is present, the rule is applied to the parent page/post (if present)
7
+ * of the item instead of the item itself.
8
+ *
9
+ * Detailed information is in the Settings/MLA Parent Custom Field Mapping Documentation tab.
10
+ *
11
+ * Created for support topic "IPTC/EXIF Mapping on picture upload to parent post’s custom fields"
12
+ * opened on 7/29 2020 by "fusselfrosch":
13
+ * https://wordpress.org/support/topic/iptc-exif-mapping-on-picture-upload-to-parent-posts-custom-fields/
14
+ *
15
+ * @package MLA Parent Custom Field Mapping
16
+ * @version 1.07
17
+ */
18
+
19
+ /*
20
+ Plugin Name: MLA Parent Custom Field Mapping
21
+ Plugin URI: http://davidlingren.com/
22
+ Description: Uses a Custom Field mapping rule to map data sources for an "attached" item to custom fields of the parent page/post
23
+ Author: David Lingren
24
+ Version: 1.07
25
+ Author URI: http://davidlingren.com/
26
+
27
+ Copyright 2020 David Lingren
28
+
29
+ This program is free software; you can redistribute it and/or modify
30
+ it under the terms of the GNU General Public License as published by
31
+ the Free Software Foundation; either version 2 of the License, or
32
+ (at your option) any later version.
33
+
34
+ This program is distributed in the hope that it will be useful,
35
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
36
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37
+ GNU General Public License for more details.
38
+
39
+ You can get a copy of the GNU General Public License by writing to the
40
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
41
+ */
42
+
43
+ /**
44
+ * Class MLA Parent Custom Field Mapping hooks some of the filters provided by the IPTC/EXIF and Custom Field mapping features
45
+ *
46
+ * @package MLA Parent Custom Field Mapping
47
+ * @since 1.00
48
+ */
49
+ class MLAParentCustomFieldMapping {
50
+ /**
51
+ * Plugin version number for debug logging
52
+ *
53
+ * @since 1.01
54
+ *
55
+ * @var integer
56
+ */
57
+ const PLUGIN_VERSION = '1.07';
58
+
59
+ /**
60
+ * Constant to log this plugin's debug activity
61
+ *
62
+ * @since 1.00
63
+ *
64
+ * @var integer
65
+ */
66
+ const MLA_DEBUG_CATEGORY = 0x00008000;
67
+
68
+ /**
69
+ * Slug prefix for registering and enqueueing submenu pages, style sheets, scripts and settings
70
+ *
71
+ * @since 1.07
72
+ *
73
+ * @var string
74
+ */
75
+ const SLUG_PREFIX = 'mlaparentcustomfieldmapping';
76
+
77
+ /**
78
+ * Include support for Advanced Custom Fields
79
+ *
80
+ * @since 1.07
81
+ *
82
+ * @var booean
83
+ */
84
+ public static $acf_active = false;
85
+
86
+ /**
87
+ * Include support for WP/LR Sync
88
+ *
89
+ * @since 1.07
90
+ *
91
+ * @var boolean
92
+ */
93
+ public static $wplr_active = false;
94
+
95
+ /**
96
+ * Initialization function, similar to __construct()
97
+ *
98
+ * Installs filters and actions that handle the MLA hooks for uploading and mapping.
99
+ *
100
+ * @since 1.00
101
+ *
102
+ * @return void
103
+ */
104
+ public static function initialize() {
105
+ $plugin_version = 'MLAParentCustomFieldMapping::initialize( version ' . self::PLUGIN_VERSION . ' )';
106
+ $skip_filters = true;
107
+
108
+ // This plugin requires MLA
109
+ if ( ! class_exists( 'MLACore', false ) ) {
110
+ return;
111
+ }
112
+
113
+ if ( is_admin() ) {
114
+ // Add submenu page in the "Settings" section
115
+ add_action( 'admin_menu', 'MLAParentCustomFieldMapping::admin_menu' );
116
+
117
+ MLACore::mla_debug_add( __LINE__ . " {$plugin_version} is_admin", self::MLA_DEBUG_CATEGORY );
118
+ $skip_filters = false;
119
+ }
120
+
121
+ if ( isset( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], '/?wplr-sync-api' ) ) {
122
+ MLACore::mla_debug_add( __LINE__ . " {$plugin_version} is_wplr_sync", self::MLA_DEBUG_CATEGORY );
123
+ $skip_filters = false;
124
+ }
125
+
126
+ if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json/' ) ) {
127
+ MLACore::mla_debug_add( __LINE__ . " {$plugin_version} WP REST API", self::MLA_DEBUG_CATEGORY );
128
+ $skip_filters = false;
129
+ }
130
+
131
+ if ( true === $skip_filters ) {
132
+ MLACore::mla_debug_add( __LINE__ . " {$plugin_version} override skip_filters", self::MLA_DEBUG_CATEGORY );
133
+ $skip_filters = false;
134
+ }
135
+
136
+ // The filters are only useful in the admin section, REST API or wplr-sync-api
137
+ if ( $skip_filters ) {
138
+ return;
139
+ }
140
+
141
+ // Determine Advanced Custom Fields support; default false
142
+ if ( class_exists( 'ACF', false ) ) {
143
+ self::$acf_active = self::_get_plugin_option('acf_support');
144
+ }
145
+
146
+ // Determine WP/LR Sync support; default false
147
+ if ( class_exists( 'Meow_WPLR_Sync_Core', false ) ) {
148
+ self::$wplr_active = self::_get_plugin_option('wplr_support');
149
+ }
150
+
151
+ add_filter( 'mla_mapping_settings', 'MLAParentCustomFieldMapping::mla_mapping_settings', 10, 4 );
152
+ add_filter( 'mla_purge_custom_field_values', 'MLAParentCustomFieldMapping::mla_purge_custom_field_values', 10, 4 );
153
+ } // initialize
154
+
155
+ /**
156
+ * Add submenu page in the "Settings" section
157
+ *
158
+ * @since 1.07
159
+ */
160
+ public static function admin_menu( ) {
161
+ /*
162
+ * We need a tab-specific page ID to manage the screen options on the General tab.
163
+ * Use the URL suffix, if present. If the URL doesn't have a tab suffix, use '-general'.
164
+ * This hack is required to pass the WordPress "referer" validation.
165
+ */
166
+ if ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) && ( self::SLUG_PREFIX . '-settings-' == substr( $_REQUEST['page'], 0, strlen( self::SLUG_PREFIX . '-settings-' ) ) ) ) {
167
+ $tab = substr( $_REQUEST['page'], strlen( self::SLUG_PREFIX . '-settings-' ) );
168
+ } else {
169
+ $tab = 'general';
170
+ }
171
+
172
+ $tab = self::_get_options_tablist( $tab ) ? '-' . $tab : '-general';
173
+ add_submenu_page( 'options-general.php', 'MLA Parent Custom Field Mapping', 'MLA Parent Mapping', 'manage_options', self::SLUG_PREFIX . '-settings' . $tab, 'MLAParentCustomFieldMapping::add_submenu_page' );
174
+ add_filter( 'plugin_action_links', 'MLAParentCustomFieldMapping::plugin_action_links', 10, 2 );
175
+ }
176
+
177
+ /**
178
+ * Add the "Settings" and "Guide" links to the Plugins section entry
179
+ *
180
+ * @since 1.07
181
+ *
182
+ * @param array array of links for the Plugin, e.g., "Activate"
183
+ * @param string Directory and name of the plugin Index file
184
+ *
185
+ * @return array Updated array of links for the Plugin
186
+ */
187
+ public static function plugin_action_links( $links, $file ) {
188
+ if ( $file == 'mla-parent-custom-field-mapping/mla-parent-custom-field-mapping.php' ) {
189
+ $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=' . self::SLUG_PREFIX . '-settings-documentation&mla_tab=documentation' ), 'Guide' );
190
+ array_unshift( $links, $settings_link );
191
+ $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=' . self::SLUG_PREFIX . '-settings-general' ), 'Settings' );
192
+ array_unshift( $links, $settings_link );
193
+ }
194
+
195
+ return $links;
196
+ }
197
+
198
+ /**
199
+ * Render (echo) the "MLA Parent Mapping" submenu in the Settings section
200
+ *
201
+ * @since 1.07
202
+ *
203
+ * @return void Echoes HTML markup for the submenu page
204
+ */
205
+ public static function add_submenu_page() {
206
+ if ( !current_user_can( 'manage_options' ) ) {
207
+ echo "<h2>MLA Parent Custom Field Mapping - Error</h2>\n";
208
+ wp_die( 'You do not have permission to manage plugin settings.' );
209
+ }
210
+
211
+ // Load template array and initialize page-level values.
212
+ self::$page_template_array = MLACore::mla_load_template( dirname( __FILE__ ) . '/admin-settings-page.tpl', 'path' );
213
+ $current_tab_slug = isset( $_REQUEST['mla_tab'] ) ? $_REQUEST['mla_tab']: 'general';
214
+ $current_tab = self::_get_options_tablist( $current_tab_slug );
215
+ $page_values = array(
216
+ 'version' => 'v' . self::PLUGIN_VERSION,
217
+ 'messages' => '',
218
+ 'tablist' => self::_compose_settings_tabs( $current_tab_slug ),
219
+ 'tab_content' => '',
220
+ );
221
+
222
+ // Compose tab content
223
+ if ( $current_tab ) {
224
+ if ( isset( $current_tab['render'] ) ) {
225
+ $handler = $current_tab['render'];
226
+ $page_content = call_user_func( $handler );
227
+ } else {
228
+ $page_content = array( 'message' => 'ERROR: Cannot render content tab', 'body' => '' );
229
+ }
230
+ } else {
231
+ $page_content = array( 'message' => 'ERROR: Unknown content tab', 'body' => '' );
232
+ }
233
+
234
+ if ( ! empty( $page_content['message'] ) ) {
235
+ if ( false !== strpos( $page_content['message'], 'ERROR' ) ) {
236
+ $messages_class = 'updated error';
237
+ $dismiss_button = '';
238
+ } else {
239
+ $messages_class = 'updated notice is-dismissible';
240
+ $dismiss_button = " <button class=\"notice-dismiss\" type=\"button\"><span class=\"screen-reader-text\">[+dismiss_text+].</span></button>\n";
241
+ }
242
+
243
+ $page_values['messages'] = MLAData::mla_parse_template( self::$page_template_array['messages'], array(
244
+ 'mla_messages_class' => $messages_class ,
245
+ 'messages' => $page_content['message'],
246
+ 'dismiss_button' => $dismiss_button,
247
+ 'dismiss_text' => 'Dismiss this notice',
248
+ ) );
249
+ }
250
+
251
+ $page_values['tab_content'] = $page_content['body'];
252
+
253
+ echo MLAData::mla_parse_template( self::$page_template_array['page'], $page_values );
254
+ }
255
+
256
+ /**
257
+ * Template file for the Settings page(s) and parts
258
+ *
259
+ * This array contains all of the template parts for the Settings page(s). The array is built once
260
+ * each page load and cached for subsequent use.
261
+ *
262
+ * @since 1.07
263
+ *
264
+ * @var array
265
+ */
266
+ public static $page_template_array = NULL;
267
+
268
+ /**
269
+ * Definitions for Settings page tab ids, titles and handlers
270
+ * Each tab is defined by an array with the following elements:
271
+ *
272
+ * array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
273
+ *
274
+ * title => tab label / heading text
275
+ * render => rendering function for tab messages and content. Usage:
276
+ * $tab_content = ['render']( );
277
+ *
278
+ * @since 1.07
279
+ *
280
+ * @var array
281
+ */
282
+ private static $mla_tablist = array(
283
+ 'general' => array( 'title' => 'General', 'render' => array( 'MLAParentCustomFieldMapping', '_compose_general_tab' ) ),
284
+ 'documentation' => array( 'title' => 'Documentation', 'render' => array( 'MLAParentCustomFieldMapping', '_compose_documentation_tab' ) ),
285
+ );
286
+
287
+ /**
288
+ * Retrieve the list of options tabs or a specific tab value
289
+ *
290
+ * @since 1.07
291
+ *
292
+ * @param string Tab slug, to retrieve a single entry
293
+ *
294
+ * @return array|false The entire tablist ( $tab = NULL ), a single tab entry or false if not found/not allowed
295
+ */
296
+ private static function _get_options_tablist( $tab = NULL ) {
297
+ if ( is_string( $tab ) ) {
298
+ if ( isset( self::$mla_tablist[ $tab ] ) ) {
299
+ $results = self::$mla_tablist[ $tab ];
300
+ } else {
301
+ $results = false;
302
+ }
303
+ } else {
304
+ $results = self::$mla_tablist;
305
+ }
306
+
307
+ return $results;
308
+ }
309
+
310
+ /**
311
+ * Compose the navigation tabs for the Settings subpage
312
+ *
313
+ * @since 1.07
314
+ * @uses $page_template_array contains tablist and tablist-item templates
315
+ *
316
+ * @param string Optional data-tab-id value for the active tab, default 'general'
317
+ *
318
+ * @return string HTML markup for the Settings subpage navigation tabs
319
+ */
320
+ private static function _compose_settings_tabs( $active_tab = 'general' ) {
321
+ $tablist_item = self::$page_template_array['tablist-item'];
322
+ $tabs = '';
323
+ foreach ( self::_get_options_tablist() as $key => $item ) {
324
+ $item_values = array(
325
+ 'data-tab-id' => $key,
326
+ 'nav-tab-active' => ( $active_tab == $key ) ? 'nav-tab-active' : '',
327
+ 'settings-page' => self::SLUG_PREFIX . '-settings-' . $key,
328
+ 'title' => $item['title']
329
+ );
330
+
331
+ $tabs .= MLAData::mla_parse_template( $tablist_item, $item_values );
332
+ } // foreach $item
333
+
334
+ $tablist_values = array( 'tablist' => $tabs );
335
+ return MLAData::mla_parse_template( self::$page_template_array['tablist'], $tablist_values );
336
+ }
337
+
338
+ /**
339
+ * Compose the General tab content for the Settings subpage
340
+ *
341
+ * @since 1.07
342
+ * @uses $page_template_array contains tab content template(s)
343
+ *
344
+ * @return array 'message' => status/error messages, 'body' => tab content
345
+ */
346
+ private static function _compose_general_tab( ) {
347
+ $page_content = array( 'message' => '', 'body' => '' );
348
+
349
+ // Initialize page messages and content, check for page-level Save Changes
350
+ if ( !empty( $_REQUEST['mla-parent-custom-field-mapping-options-save'] ) ) {
351
+ check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
352
+ $page_content = self::_save_setting_changes( );
353
+ }
354
+
355
+ if ( !empty( $page_content['body'] ) ) {
356
+ return $page_content;
357
+ }
358
+
359
+ // Display the General tab
360
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array(
361
+ 'mla_parent_custom_field_mapping_options',
362
+ '_wpnonce',
363
+ '_wp_http_referer',
364
+ 'mla-parent-custom-field-mapping-options-save',
365
+ ), $_SERVER['REQUEST_URI'] );
366
+
367
+ // Compose page-level options
368
+ $page_values = array(
369
+ 'acf_support_checked' => self::_get_plugin_option('acf_support') ? 'checked="checked" ' : '',
370
+ 'wplr_support_checked' => self::_get_plugin_option('wplr_support') ? 'checked="checked" ' : '',
371
+ );
372
+ $options_list = MLAData::mla_parse_template( self::$page_template_array['page-level-options'], $page_values );
373
+
374
+ $form_arguments = '?page=' . self::SLUG_PREFIX . '-settings-general&mla_tab=general';
375
+
376
+ $page_values = array(
377
+ 'form_url' => admin_url( 'options-general.php' ) . $form_arguments,
378
+ '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
379
+ 'options_list' => $options_list,
380
+ );
381
+
382
+ $page_content['body'] .= MLAData::mla_parse_template( self::$page_template_array['general-tab'], $page_values );
383
+
384
+ return $page_content;
385
+ }
386
+
387
+ /**
388
+ * Compose the General tab content for the Settings subpage
389
+ *
390
+ * @since 1.07
391
+ * @uses $page_template_array contains tab content template(s)
392
+ *
393
+ * @return array 'message' => status/error messages, 'body' => tab content
394
+ */
395
+ private static function _compose_documentation_tab( ) {
396
+ $page_content = array( 'message' => '', 'body' => '' );
397
+ $page_values = array(
398
+ );
399
+
400
+ $page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['documentation-tab'], $page_values );
401
+ return $page_content;
402
+ }
403
+
404
+ /**
405
+ * Save settings as a WordPress wp_options entry
406
+ *
407
+ * @since 1.07
408
+ *
409
+ * @return array 'message' => status/error messages, 'body' => tab content
410
+ */
411
+ private static function _save_setting_changes() {
412
+ $page_content = array( 'message' => 'Settings unchanged.', 'body' => '' );
413
+
414
+ $changed = self::_update_plugin_option( 'acf_support', isset( $_REQUEST[ 'mla_parent_custom_field_mapping_options' ]['acf_support'] ) );
415
+ $changed |= self::_update_plugin_option( 'wplr_support', isset( $_REQUEST[ 'mla_parent_custom_field_mapping_options' ]['wplr_support'] ) );
416
+
417
+ if ( $changed ) {
418
+ // No reason to save defaults in the database
419
+ if ( self::$_settings === self::$_default_settings ) {
420
+ delete_option( self::SLUG_PREFIX . '-settings' );
421
+ } else {
422
+ $changed = update_option( self::SLUG_PREFIX . '-settings', self::$_settings, false );
423
+ }
424
+
425
+ if ( $changed ) {
426
+ $page_content['message'] = "Settings have been updated.";
427
+ } else {
428
+ $page_content['message'] = "Settings updated failed.";
429
+ }
430
+ }
431
+
432
+ return $page_content;
433
+ } // _save_setting_changes
434
+
435
+ /**
436
+ * Assemble the in-memory representation of the plugin settings
437
+ *
438
+ * @since 1.07
439
+ *
440
+ * @param boolean $force_refresh Optional. Force a reload of rules. Default false.
441
+ *
442
+ * @return boolean Success (true) or failure (false) of the operation
443
+ */
444
+ private static function _get_plugin_settings( $force_refresh = false ) {
445
+ if ( false == $force_refresh && NULL != self::$_settings ) {
446
+ return true;
447
+ }
448
+
449
+ // Update the plugin options from the wp_options table or set defaults
450
+ self::$_settings = get_option( self::SLUG_PREFIX . '-settings' );
451
+ if ( !is_array( self::$_settings ) ) {
452
+ self::$_settings = self::$_default_settings;
453
+ }
454
+
455
+ return true;
456
+ }
457
+
458
+ /**
459
+ * In-memory representation of the option settings
460
+ *
461
+ * @since 1.07
462
+ *
463
+ * @var array $_settings {
464
+ * @type boolean $acf_support True to add support for ACF and ACF Pro
465
+ * @type boolean $verify_post_type True to add support for WP/LR Sync
466
+ * }
467
+ */
468
+ private static $_settings = NULL;
469
+
470
+ /**
471
+ * Default processing options
472
+ *
473
+ * @since 1.07
474
+ *
475
+ * @var array
476
+ */
477
+ private static $_default_settings = array (
478
+ 'acf_support' => true,
479
+ 'wplr_support' => true,
480
+ );
481
+
482
+ /**
483
+ * Get a plugin option setting
484
+ *
485
+ * @since 1.07
486
+ *
487
+ * @param string $name Option name
488
+ *
489
+ * @return mixed Option value, if it exists else NULL
490
+ */
491
+ private static function _get_plugin_option( $name ) {
492
+ if ( !self::_get_plugin_settings() ) {
493
+ return NULL;
494
+ }
495
+
496
+ if ( !isset( self::$_settings[ $name ] ) ) {
497
+ return NULL;
498
+ }
499
+
500
+ return self::$_settings[ $name ];
501
+ }
502
+
503
+ /**
504
+ * Update a plugin option setting
505
+ *
506
+ * @since 1.07
507
+ *
508
+ * @param string $name Option name
509
+ * @param mixed $new_value Option value
510
+ *
511
+ * @return mixed True if option value changed, false if value unchanged, NULL if failure
512
+ */
513
+ private static function _update_plugin_option( $name, $new_value ) {
514
+ if ( !self::_get_plugin_settings() ) {
515
+ return NULL;
516
+ }
517
+
518
+ $old_value = isset( self::$_settings[ $name ] ) ? self::$_settings[ $name ] : NULL;
519
+
520
+ if ( $new_value === $old_value ) {
521
+ return false;
522
+ }
523
+
524
+ self::$_settings[ $name ] = $new_value;
525
+ return true;
526
+ }
527
+
528
+ /**
529
+ * Cache the "parent:" rules
530
+ *
531
+ * Array elements are:
532
+ * 'name' => string
533
+ * 'data_source' => string
534
+ * 'meta_name' => string
535
+ * 'format' => 'native', 'commas' or 'raw'
536
+ * 'option' => 'text', 'single', 'export', 'array' or 'multi'
537
+ * 'keep_existing' => boolean
538
+ * 'no_null' => boolean
539
+ * 'mla_column' => boolean
540
+ * 'quick_edit' => boolean
541
+ * 'bulk_edit' => boolean
542
+ * 'active' => boolean
543
+ *
544
+ * @since 1.00
545
+ *
546
+ * @var array ( 'rule_slug' => array( rule elements ) )
547
+ */
548
+ private static $parent_rules = NULL;
549
+
550
+ /**
551
+ * Cache post_parent
552
+ *
553
+ * @since 1.00
554
+ *
555
+ * @var integer
556
+ */
557
+ private static $post_parent = 0;
558
+
559
+ /**
560
+ * Cache updates for parent post for wplr processing
561
+ *
562
+ * @since 1.03
563
+ *
564
+ * @var array ( post_id => array( parent_field => new_value ) )
565
+ */
566
+ private static $parent_updates = array();
567
+
568
+ /**
569
+ * Copy rules with the "parent:" prefix to the self::$parent_rules array
570
+ *
571
+ * @since 1.01
572
+ *
573
+ * @param array mapping rules
574
+ * @param boolean Optional, default false. True to add rules to an existing self::$parent_rules array
575
+ *
576
+ * @uses array self::$parent_rules
577
+ */
578
+ private static function _load_parent_rules( $settings, $append = false ) {
579
+ if ( false === $append ) {
580
+ self::$parent_rules = array();
581
+ }
582
+
583
+ foreach( $settings as $slug => $rule ) {
584
+ if ( $rule['active'] && ( 0 === strpos( $rule['name'], 'parent:' ) ) ) {
585
+ $placeholder = current( MLAData::mla_get_template_placeholders( '[+' . $rule['name'] . '+]', $rule['option'] ) );
586
+ //MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_load_parent_rules( {$slug} ) placeholder = " . var_export( $placeholder, true ), self::MLA_DEBUG_CATEGORY );
587
+ $rule['parent_field'] = $placeholder['value'];
588
+ $rule['parent_format'] = $placeholder['format'];
589
+ $rule['parent_action'] = '';
590
+ $rule['repeater_field'] = '';
591
+
592
+ if ( in_array( $placeholder['format'], array( 'acf', ) ) ) {
593
+ if ( !empty( $placeholder['args'] ) ) {
594
+ $args = explode( '.', $placeholder['args'] );
595
+ if ( 1 < count( $args ) ) {
596
+ $rule['parent_action'] = $args[0];
597
+ $rule['repeater_field'] = $args[1];
598
+ } else {
599
+ $rule['parent_action'] = $placeholder['args'];
600
+ }
601
+ }
602
+ }
603
+
604
+ self::$parent_rules[ $slug ] = $rule;
605
+ }
606
+ } // foreach rule
607
+ } // _load_parent_rules
608
+
609
+ /**
610
+ * Remove explicit subield rules from self::$parent_rulles and
611
+ * replace repeater rules with all defined subfield rules
612
+ *
613
+ * @since 1.05
614
+ *
615
+ * @param array $settings mapping rules
616
+ * @param string $category scope to evaluate against, e.g., iptc_exif_mapping, custom_field_mapping or single_attachment_mapping
617
+ *
618
+ * @uses array self::$parent_rules
619
+ *
620
+ * @return array updated mapping rules
621
+ */
622
+ private static function _filter_repeater_rules( $settings, $category ) {
623
+ // Remove explicit subfield rules, extract repeater rules
624
+ $repeater_rules = array();
625
+ $no_changes = true;
626
+ foreach( self::$parent_rules as $slug => $rule ) {
627
+ if ( 'subfield' === $rule['parent_action'] ) {
628
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_filter_repeater_rules( {$slug} ) removing subfield rule", self::MLA_DEBUG_CATEGORY );
629
+ unset( $settings[ $slug ] );
630
+ $no_changes = false;
631
+ } elseif ( 'repeater' === $rule['parent_action'] ) {
632
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_filter_repeater_rules( {$slug} ) caching repeater rule", self::MLA_DEBUG_CATEGORY );
633
+ $repeater_rules[ $slug ] = $rule;
634
+ unset( $settings[ $slug ] );
635
+ $no_changes = false;
636
+ }
637
+ } // foreach rule
638
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_filter_repeater_rules( {$category} ) repeater_rules = " . var_export( $repeater_rules, true ), self::MLA_DEBUG_CATEGORY );
639
+
640
+ // If nothing changed, NULL leaves the original rules intact
641
+ if ( $no_changes ) {
642
+ return NULL;
643
+ }
644
+
645
+ if ( empty( $repeater_rules ) ) {
646
+ self::_load_parent_rules( $settings );
647
+ return $settings;
648
+ }
649
+
650
+ // Convert repeater rules to a complete set of subfield rules
651
+ if ( 'iptc_exif_mapping' === $category ) {
652
+ $all_settings = MLACore::mla_get_option( 'iptc_exif_mapping' );
653
+ self::_load_parent_rules( $all_settings['custom'] );
654
+ } else {
655
+ self::_load_parent_rules( MLACore::mla_get_option( 'custom_field_mapping' ) );
656
+ }
657
+
658
+ foreach( $repeater_rules as $slug => $rule ) {
659
+ foreach( self::$parent_rules as $parent_slug => $parent_rule ) {
660
+ if ( 'subfield' === $parent_rule['parent_action'] && $parent_rule['repeater_field'] === $rule['parent_field'] ) {
661
+ $settings[ $parent_slug ] = $parent_rule;
662
+ }
663
+ }
664
+ } // foreach parent_rule
665
+
666
+ // Reload parent_rules, reflecting our changes
667
+ self::_load_parent_rules( $settings );
668
+ return $settings;
669
+ } // _filter_repeater_rules
670
+
671
+ /**
672
+ * MLA Mapping Settings Filter
673
+ *
674
+ * This filter is called before any mapping rules are executed.
675
+ * You can add, change or delete rules from the array.
676
+ *
677
+ * @since 1.00
678
+ *
679
+ * @param array mapping rules
680
+ * @param integer post ID to be evaluated
681
+ * @param string category/scope to evaluate against, e.g., iptc_exif_mapping, custom_field_mapping or single_attachment_mapping
682
+ * @param array attachment_metadata, default NULL
683
+ *
684
+ * @return array updated mapping rules
685
+ */
686
+ public static function mla_mapping_settings( $settings, $post_id, $category, $attachment_metadata ) {
687
+ static $current_category = '', $filtered_settings = NULL;
688
+
689
+ if ( $current_category !== $category ) {
690
+ //MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_settings( {$post_id}, {$category} ) settings = " . var_export( $settings, true ), self::MLA_DEBUG_CATEGORY );
691
+ $current_category = $category;
692
+ $filtered_settings = NULL;
693
+
694
+ // Prepare to cache updates for wplr processing
695
+ self::$parent_updates = array();
696
+
697
+ // Install our filters only if one or more rules contain the "parent:" prefix
698
+ if ( 'iptc_exif_mapping' === $category ) {
699
+ self::_load_parent_rules( $settings['custom'] );
700
+ } else {
701
+ self::_load_parent_rules( $settings );
702
+ }
703
+
704
+ if ( !empty( self::$parent_rules ) ) {
705
+ // Modify settings if repeater and/or subfield rules are included
706
+ if ( 'iptc_exif_mapping' === $category ) {
707
+ $filtered_settings = self::_filter_repeater_rules( $settings['custom'], $category );
708
+ } else {
709
+ $filtered_settings = self::_filter_repeater_rules( $settings, $category );
710
+ }
711
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_settings( {$category} ) filtered_settings = " . var_export( $filtered_settings, true ), self::MLA_DEBUG_CATEGORY );
712
+
713
+ //add_filter( 'mla_mapping_custom_value', 'MLAParentCustomFieldMapping::mla_mapping_custom_value', 10, 5 );
714
+ add_filter( 'mla_mapping_old_custom_value', 'MLAParentCustomFieldMapping::mla_mapping_old_custom_value', 10, 5 );
715
+ add_filter( 'mla_mapping_updates', 'MLAParentCustomFieldMapping::mla_mapping_updates', 10, 5 );
716
+
717
+ if ( self::$acf_active ) {
718
+ //add_filter( 'acf/update_field', 'MLAParentCustomFieldMapping::acf_update_field', 10, 1 );
719
+ add_filter( 'acf/update_value', 'MLAParentCustomFieldMapping::acf_update_value', 10, 3 );
720
+ }
721
+
722
+ if ( self::$wplr_active ) {
723
+ // Use priority 11 to run our filters after wplr runs theirs
724
+ //add_action( 'wplr_add_media', 'MLAParentCustomFieldMapping::wplr_add_media', 11, 1 );
725
+ add_action( 'wplr_add_media_to_collection', 'MLAParentCustomFieldMapping::wplr_add_media_to_collection', 11, 2 );
726
+ //add_action( 'wplr_sync_media', 'MLAParentCustomFieldMapping::wplr_sync_media', 11, 1 );
727
+ }
728
+ } else {
729
+ // Remove filters from a possible previous mapping run
730
+ //remove_filter( 'mla_mapping_custom_value', 'MLAParentCustomFieldMapping::mla_mapping_custom_value', 10 );
731
+ remove_filter( 'mla_mapping_old_custom_value', 'MLAParentCustomFieldMapping::mla_mapping_old_custom_value', 10 );
732
+ remove_filter( 'mla_mapping_updates', 'MLAParentCustomFieldMapping::mla_mapping_updates', 10 );
733
+
734
+ if ( self::$acf_active ) {
735
+ //remove_filter( 'acf/update_field', 'MLAParentCustomFieldMapping::acf_update_field', 10 );
736
+ remove_filter( 'acf/update_value', 'MLAParentCustomFieldMapping::acf_update_value', 10 );
737
+ }
738
+
739
+ if ( self::$wplr_active ) {
740
+ //remove_action( 'wplr_add_media', 'MLAParentCustomFieldMapping::wplr_add_media', 11 );
741
+ remove_action( 'wplr_add_media_to_collection', 'MLAParentCustomFieldMapping::wplr_add_media_to_collection', 11 );
742
+ //remove_action( 'wplr_sync_media', 'MLAParentCustomFieldMapping::wplr_sync_media', 11 );
743
+ }
744
+ }
745
+
746
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_settings( {$category} ) parent_rules = " . var_export( self::$parent_rules, true ), self::MLA_DEBUG_CATEGORY );
747
+ }
748
+
749
+ // Find and cache the post_parent for use in the rule filters
750
+ $item = get_post( $post_id );
751
+ self::$post_parent = $item->post_parent;
752
+
753
+ if ( !empty( $filtered_settings ) ) {
754
+ if ( 'iptc_exif_mapping' === $category ) {
755
+ $settings['custom'] = $filtered_settings;
756
+ } else {
757
+ $settings = $filtered_settings;
758
+ }
759
+ }
760
+
761
+ //MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_settings( {$post_id}, {$category} ) settings = " . var_export( $settings, true ), self::MLA_DEBUG_CATEGORY );
762
+ return $settings;
763
+ } // mla_mapping_settings_filter
764
+
765
+ /**
766
+ * MLA Mapping New Value Filter
767
+ *
768
+ * This filter is called once for each Custom Field mapping rule, after the Data Source
769
+ * portion of the rule is evaluated. You can change the new value produced by the rule.
770
+ *
771
+ * @since 1.00
772
+ *
773
+ * @param mixed data source value returned by the rule
774
+ * @param array rule slug
775
+ * @param integer post ID to be evaluated
776
+ * @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
777
+ * @param array attachment_metadata, default NULL
778
+ *
779
+ * @return array updated rule data source value
780
+ */
781
+ public static function mla_mapping_custom_value( $new_value, $setting_key, $post_id, $category, $attachment_metadata ) {
782
+ if ( 0 === strpos( $setting_key, 'parent:' ) ) {
783
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_custom_value( {$setting_key}, {$post_id}, {$category} ) new_value = " . var_export( $new_value, true ), self::MLA_DEBUG_CATEGORY );
784
+ }
785
+
786
+ return $new_value;
787
+ } // mla_mapping_custom_value
788
+
789
+ /**
790
+ * MLA Mapping Old Value Filter
791
+ *
792
+ * This filter is called once for each Custom Field mapping rule, after the "old text"
793
+ * portion of the rule is evaluated. You can change the old value produced by the rule.
794
+ *
795
+ * @since 1.00
796
+ *
797
+ * @param mixed current target value returned by the rule
798
+ * @param array rule slug
799
+ * @param integer post ID to be evaluated
800
+ * @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
801
+ * @param array attachment_metadata, default NULL
802
+ *
803
+ * @return array updated current target value
804
+ */
805
+ public static function mla_mapping_old_custom_value( $old_value, $setting_key, $post_id, $category, $attachment_metadata ) {
806
+ if ( 0 === strpos( $setting_key, 'parent:' ) ) {
807
+ $old_value = '';
808
+ if ( self::$post_parent ) {
809
+ $rule = !empty( self::$parent_rules[ $setting_key ] ) ? self::$parent_rules[ $setting_key ] : NULL;
810
+ if ( !empty( $rule['parent_field'] ) ) {
811
+ if ( 'subfield' === $rule[ 'parent_action' ] ) {
812
+ // There is no sensible way to determine the existing value
813
+ } elseif ( 'repeater' === $rule[ 'parent_action' ] ) {
814
+ if ( self::$acf_active ) {
815
+ $old_value = get_field( $rule['parent_field'], self::$post_parent );
816
+ }
817
+ } elseif ( is_string( $old_value = get_metadata( 'post', self::$post_parent, $rule['parent_field'], true ) ) ) {
818
+ $old_value = trim( $old_value );
819
+ }
820
+ }
821
+
822
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_old_custom_value( {$setting_key}, {$post_id}, {$category} ) parent old_value = " . var_export( $old_value, true ), self::MLA_DEBUG_CATEGORY );
823
+ }
824
+ }
825
+
826
+ return $old_value;
827
+ } // mla_mapping_old_custom_value
828
+
829
+ /**
830
+ * MLA Mapping Updates Filter
831
+ *
832
+ * This filter is called AFTER all mapping rules are applied.
833
+ * You can add, change or remove updates for the attachment's
834
+ * standard fields, taxonomies and/or custom fields.
835
+ *
836
+ * @since 1.00
837
+ *
838
+ * @param array updates for the attachment's standard fields, taxonomies and/or custom fields
839
+ * @param integer post ID to be evaluated
840
+ * @param string category/scope to evaluate against: custom_field_mapping or single_attachment_mapping
841
+ * @param array mapping rules
842
+ * @param array attachment_metadata, default NULL
843
+ *
844
+ * @return array updated attachment's updates
845
+ */
846
+ public static function mla_mapping_updates( $updates, $post_id, $category, $settings, $attachment_metadata ) {
847
+ $results = '';
848
+
849
+ if ( !empty( $updates['custom_updates'] ) ) {
850
+ $parent_updates = array();
851
+ foreach( $updates['custom_updates'] as $name => $value ) {
852
+ if ( array_key_exists( $name, self::$parent_rules ) ) {
853
+ //MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_updates( {$post_id}, {$category}, {$name} ) value = " . var_export( $value, true ), self::MLA_DEBUG_CATEGORY );
854
+ unset( $updates['custom_updates'][ $name ] );
855
+ $parent_updates[ self::$parent_rules[ $name ]['parent_field'] ] = array (
856
+ 'value' => $value,
857
+ 'option' => self::$parent_rules[ $name ]['option'],
858
+ 'keep_existing' => self::$parent_rules[ $name ]['keep_existing'],
859
+ 'no_null' => self::$parent_rules[ $name ]['no_null'],
860
+ 'parent_action' => self::$parent_rules[ $name ]['parent_action'],
861
+ 'repeater_field' => self::$parent_rules[ $name ]['repeater_field'],
862
+ );
863
+ }
864
+ } // foreach
865
+
866
+ if ( !empty( $parent_updates ) ) {
867
+ $post_parent = self::$post_parent;
868
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_updates( {$post_id}, {$category}, {$post_parent} ) parent_updates = " . var_export( $parent_updates, true ), self::MLA_DEBUG_CATEGORY );
869
+ if ( $post_parent ) {
870
+ $results = self::_update_parent_postmeta( $post_parent, $parent_updates );
871
+ } else {
872
+ // Cache updates for later wplr processing
873
+ self::$parent_updates[ $post_id ] = $parent_updates;
874
+ }
875
+ }
876
+ } // !empty
877
+
878
+ if ( !empty( $results ) ) {
879
+ // Pass the results to MLAData::mla_update_item_postmeta()
880
+ $updates['custom_updates'][0x80000000] = $results;
881
+ }
882
+
883
+ if ( empty( $updates['custom_updates'] ) ) {
884
+ unset( $updates['custom_updates'] );
885
+ }
886
+
887
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_mapping_updates( {$post_id}, {$category} ) updates = " . var_export( $updates, true ), self::MLA_DEBUG_CATEGORY );
888
+ return $updates;
889
+ } // mla_mapping_updates
890
+
891
+ /**
892
+ * Purge Custom Field Values Filter
893
+ *
894
+ * Custom processing for rules with "parent:" prefix.
895
+ *
896
+ * @since 1.00
897
+ *
898
+ * @param string|NULL Text message describing the results of applying the purge. Default NULL.
899
+ * @param string Category; 'custom_field_mapping' or 'iptc_exif_custom_mapping'
900
+ * @param string Name/slug of the rule
901
+ * @param array Rule parameters
902
+ *
903
+ * @return string|NULL Updated text message describing the results of applying the purge
904
+ */
905
+ public static function mla_purge_custom_field_values( $results, $category, $rule_name, $rule ) {
906
+ global $wpdb;
907
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) rule = " . var_export( $rule, true ), 0 );
908
+
909
+ if ( 0 === strpos( $rule['name'], 'parent:' ) ) {
910
+ $post_types = "'post','page'";
911
+
912
+ // Parse the rule to find format and arguments
913
+ self::_load_parent_rules( array( $rule_name => $rule ) );
914
+ $rule = self::$parent_rules[ $rule_name ];
915
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) parsed rule = " . var_export( $rule, true ), 0 );
916
+ //MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) parsed rule = " . var_export( $rule, true ), self::MLA_DEBUG_CATEGORY );
917
+
918
+ // Handle ACF Repeater Field and Sub Fields
919
+ if ( 'acf' === $rule['parent_format'] ) {
920
+ if ( 'repeater' === $rule['parent_action'] ) {
921
+ if ( !self::$acf_active ) {
922
+ return 'ACF Repeater purge is not supported; ACF is not active.';
923
+ }
924
+
925
+ $WP_Query_args = array(
926
+ 'posts_per_page' => -1,
927
+ 'post_type' => explode( ',', $post_types ),
928
+ 'meta_key' => $rule['parent_field'],
929
+ 'ignore_sticky_posts' => true,
930
+ 'no_found_rows' => true,
931
+ 'fields' => 'ids'
932
+ );
933
+ $get_posts = new WP_Query;
934
+ $post_ids = $get_posts->query( $WP_Query_args );
935
+
936
+ $field = acf_maybe_get_field( $rule['parent_field'], false, false );
937
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) field = " . var_export( $field, true ), 0 );
938
+ $field = $field['key'];
939
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) field = " . var_export( $field, true ), 0 );
940
+
941
+ $failures = 0;
942
+ $successes = 0;
943
+ foreach( $post_ids as $id ) {
944
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) deleting from {$id}", 0 );
945
+ if ( delete_field( $field, $id ) ) {
946
+ $successes++;
947
+ } else {
948
+ $failures++;
949
+ }
950
+ }
951
+ $count = count( $post_ids );
952
+ $count_text = sprintf( _n( '%s Repeater Field value', '%s Repeater Field values', $count, 'MLAParentCustomFieldMapping' ), $count );
953
+ return sprintf( 'Found %1$s in %2$s items. Deleted %3$d; there were %4$d failures.<br />', $count_text, $post_types, $successes, $failures );
954
+ } elseif ( 'subfield' === $rule['parent_action'] ) {
955
+ return 'ACF Sub Field purge is not supported.';
956
+ }
957
+ }
958
+
959
+ $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->postmeta} LEFT JOIN {$wpdb->posts} ON ( {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id ) WHERE {$wpdb->postmeta}.meta_key = '%s' AND {$wpdb->posts}.post_type IN ( " . $post_types . " )", $rule['parent_field'] ) );
960
+ //error_log( __LINE__ . " MLAParentCustomFieldMapping::mla_purge_custom_field_values( {$category}, {$rule_name} ) post_meta_ids = " . var_export( $post_meta_ids, true ), 0 );
961
+ foreach ( $post_meta_ids as $mid ) {
962
+ delete_metadata_by_mid( 'post', $mid );
963
+ }
964
+
965
+ $count = count( $post_meta_ids );
966
+ if ( $count ) {
967
+ $count_text = sprintf( _n( '%s custom field value', '%s custom field values', $count, 'MLAParentCustomFieldMapping' ), $count ) . ' from ' . $post_types . ' items';
968
+
969
+ return sprintf( 'Deleted %1$s.<br />', $count_text );
970
+ }
971
+
972
+ return sprintf( 'No %1$s items contained this custom field.<br />', $post_types );
973
+ }
974
+
975
+ // Return processing result or NULL (the default) to allow default processing
976
+ return $results;
977
+ } // mla_purge_custom_field_values_filter
978
+
979
+ /**
980
+ * Fetch and filter meta data for an attachment's parent
981
+ * Adapted from mla_fetch_attachment_metadata() in /includes/class-mla-data-query.php
982
+ *
983
+ * Returns a filtered array of a post's meta data. Internal values beginning with '_'
984
+ * are stripped out or converted to an 'mla_' equivalent.
985
+ *
986
+ * @since 0.1
987
+ *
988
+ * @param int post ID of attachment's parent
989
+ *
990
+ * @return array Meta data variables
991
+ */
992
+ private static function _fetch_parent_metadata( $parent_id ) {
993
+ /* static $save_id = -1, $results;
994
+
995
+ if ( $save_id == $parent_id ) {
996
+ return $results;
997
+ } elseif ( $parent_id == -1 ) {
998
+ $save_id = -1;
999
+ return NULL;
1000
+ } // results are cached in WordPress */
1001
+
1002
+ $results = array();
1003
+ $post_meta = get_metadata( 'post', $parent_id );
1004
+
1005
+ if ( is_array( $post_meta ) ) {
1006
+ foreach ( $post_meta as $post_meta_key => $post_meta_value ) {
1007
+ if ( empty( $post_meta_key ) ) {
1008
+ continue;
1009
+ }
1010
+
1011
+ /*
1012
+ * At this point, every value is an array; one element per instance of the key.
1013
+ * We'll test anyway, just to be sure, then convert single-instance values to a scalar.
1014
+ * Metadata array values are serialized for storage in the database.
1015
+ */
1016
+ if ( is_array( $post_meta_value ) ) {
1017
+ if ( count( $post_meta_value ) == 1 ) {
1018
+ $post_meta_value = maybe_unserialize( $post_meta_value[0] );
1019
+ } else {
1020
+ foreach ( $post_meta_value as $single_key => $single_value ) {
1021
+ $post_meta_value[ $single_key ] = maybe_unserialize( $single_value );
1022
+ }
1023
+ }
1024
+ }
1025
+
1026
+ $results[ $post_meta_key ] = $post_meta_value;
1027
+ } // foreach $post_meta
1028
+ } // is_array($post_meta)
1029
+
1030
+ $save_id = $parent_id;
1031
+ return $results;
1032
+ }
1033
+
1034
+ /**
1035
+ * Update parent's Repeater field data for a single attachment.
1036
+ *
1037
+ * @since 1.04
1038
+ *
1039
+ * @param integer $parent_id The ID of the attachment whose parent's data are to be updated
1040
+ * @param array $subfield_updates (
1041
+ * repeater_field => array( meta_key => new_meta, )
1042
+ * )
1043
+ *
1044
+ * @return string Updates made, if any, else empty string.
1045
+ */
1046
+ private static function _apply_subfield_updates( $parent_id, $subfield_updates ) {
1047
+ // MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$parent_id} ) subfield_updates = " . var_export( $subfield_updates, true ), self::MLA_DEBUG_CATEGORY );
1048
+ if ( !self::$acf_active ) {
1049
+ return 'ACF subfield updates not supported; ACF is not active.';
1050
+ }
1051
+
1052
+ $message = '';
1053
+ foreach ( $subfield_updates as $repeater_field => $updates ) {
1054
+ $field_object = acf_get_field( $repeater_field );
1055
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) field_object = " . var_export( $field_object, true ), self::MLA_DEBUG_CATEGORY );
1056
+
1057
+ // Field may not be defined for the parent's post_type
1058
+ if ( empty( $field_object ) ) {
1059
+ continue;
1060
+ }
1061
+
1062
+ // Make value acceptable to foreach
1063
+ $field_values = get_field( $repeater_field, $parent_id );
1064
+ if ( NULL === $field_values ) {
1065
+ $field_values = array();
1066
+ }
1067
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) field_value = " . var_export( $field_values, true ), self::MLA_DEBUG_CATEGORY );
1068
+
1069
+ // Assemble a complete, empty row for the repeater
1070
+ $new_row = array();
1071
+ foreach ( $field_object['sub_fields'] as $index => $subfield_object ) {
1072
+ $new_row[ $subfield_object['_name'] ] = '';
1073
+ } // foreach $sub_fields
1074
+
1075
+ // Fill in the values we have
1076
+ foreach ( $updates as $name => $update ) {
1077
+ $new_row[ $name ] = $update['value'];
1078
+ } // foreach $updates
1079
+ // MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) new_row = " . var_export( $new_row, true ), self::MLA_DEBUG_CATEGORY );
1080
+
1081
+ // See if this row is already in the repeater field
1082
+ $is_new = true;
1083
+ foreach ( $field_values as $index => $row_value ) {
1084
+ // MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) testing row_value[ {$index} ] = " . var_export( $row_value, true ), self::MLA_DEBUG_CATEGORY );
1085
+ if ( $row_value == $new_row ) {
1086
+ // MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) matched to row_value[ {$index} ] = " . var_export( $row_value, true ), self::MLA_DEBUG_CATEGORY );
1087
+ $is_new = false;
1088
+ break;
1089
+ }
1090
+ } // foreach value
1091
+
1092
+ if ( $is_new ) {
1093
+ $message .= sprintf( __( 'Adding %1$s = %2$s', 'media-library-assistant' ) . '<br>', $repeater_field, var_export( $new_row, true ) );
1094
+ $row_count = add_row( $repeater_field, $new_row, $parent_id );
1095
+ if ( false === $row_count ) {
1096
+ $message .= sprintf( __( 'Adding %1$s = %2$s', 'media-library-assistant' ) . '<br>', $repeater_field, 'add_row() FAILED' );
1097
+ }
1098
+ $field_values = get_field( $repeater_field, $parent_id );
1099
+ // MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_apply_subfield_updates( {$repeater_field}, {$parent_id} ) field_value = " . var_export( $field_values, true ), self::MLA_DEBUG_CATEGORY );
1100
+ } else {
1101
+ $message .= sprintf( __( 'Duplicate %1$s = %2$s', 'media-library-assistant' ) . '<br>', $repeater_field, var_export( $new_row, true ) );
1102
+ } // add new row
1103
+ } // foreach repeater updates
1104
+
1105
+ return $message;
1106
+ } // _apply_subfield_updates
1107
+
1108
+ /**
1109
+ * Update parent's custom field data for a single attachment.
1110
+ * Adapted from mla_update_item_postmeta() in /includes/class-mla-data.php
1111
+ *
1112
+ * @since 1.00
1113
+ *
1114
+ * @param integer $parent_id The ID of the attachment whose parent's data are to be updated
1115
+ * @param array $new_meta ( meta_key => array(
1116
+ * 'value' => $value,
1117
+ * 'option' => $rule['option'],
1118
+ * 'keep_existing' => $rule['keep_existing'],
1119
+ * 'no_null' => $rule['no_null'],
1120
+ * 'parent_action' => $rule['parent_action'],
1121
+ * 'repeater_field' => $rule['repeater_field'],
1122
+ * )
1123
+ * )
1124
+ *
1125
+ * @return string Updates made, if any, else empty string.
1126
+ */
1127
+ private static function _update_parent_postmeta( $parent_id, $new_meta ) {
1128
+ $post_data = self::_fetch_parent_metadata( $parent_id );
1129
+ $message = '';
1130
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_update_parent_postmeta( {$parent_id} ) post_data = " . var_export( $post_data, true ), self::MLA_DEBUG_CATEGORY );
1131
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_update_parent_postmeta( {$parent_id} ) new_meta = " . var_export( $new_meta, true ), self::MLA_DEBUG_CATEGORY );
1132
+
1133
+ $subfield_updates = array();
1134
+ foreach ( $new_meta as $meta_key => $new_value ) {
1135
+ // Accumulate all subfield updates for later, consolidated processing
1136
+ if ( 'subfield' === $new_value['parent_action'] ) {
1137
+ $subfield_updates[ $new_value['repeater_field'] ][ $meta_key ] = $new_value;
1138
+ continue;
1139
+ }
1140
+
1141
+ $meta_value = $new_value['value'];
1142
+ $multi_key = 'multi' === $new_value['option'];
1143
+ $keep_existing = (boolean) $new_value['keep_existing'];
1144
+ $no_null = (boolean) $new_value['no_null'];
1145
+
1146
+ if ( isset( $post_data[ $meta_key ] ) ) {
1147
+ $old_meta_value = $post_data[ $meta_key ];
1148
+
1149
+ if ( $multi_key && $no_null ) {
1150
+ if ( is_string( $old_meta_value ) ) {
1151
+ $old_meta_value = trim( $old_meta_value );
1152
+ }
1153
+
1154
+ $delete = empty( $old_meta_value );
1155
+ } else {
1156
+ $delete = NULL === $meta_value;
1157
+ }
1158
+
1159
+ if ( $delete) {
1160
+ if ( delete_post_meta( $parent_id, $meta_key ) ) {
1161
+ /* translators: 1: meta_key */
1162
+ $message .= sprintf( __( 'Deleting %1$s', 'media-library-assistant' ) . '<br>', $meta_key );
1163
+ }
1164
+
1165
+ continue;
1166
+ }
1167
+ } else {
1168
+ if ( NULL !== $meta_value ) {
1169
+ if ( $multi_key ) {
1170
+ foreach ( $meta_value as $new_value ) {
1171
+ if ( add_post_meta( $parent_id, $meta_key, $new_value ) ) {
1172
+ /* translators: 1: meta_key 2: new_value */
1173
+ $message .= sprintf( __( 'Adding %1$s = %2$s', 'media-library-assistant' ) . '<br>', $meta_key, '[' . $new_value . ']' );
1174
+ }
1175
+ }
1176
+ } else {
1177
+ if ( add_post_meta( $parent_id, $meta_key, $meta_value ) ) {
1178
+ if ( is_array( $meta_value ) ) {
1179
+ $new_text = var_export( $meta_value, true );
1180
+ } else {
1181
+ $new_text = $meta_value;
1182
+ }
1183
+
1184
+ /* translators: 1: meta_key 2: meta_value */
1185
+ $message .= sprintf( __( 'Adding %1$s = %2$s', 'media-library-assistant' ) . '<br>', $meta_key, $new_text );
1186
+ }
1187
+ }
1188
+ }
1189
+
1190
+ continue; // no change or message if old and new are both NULL
1191
+ } // no old value
1192
+
1193
+ $old_text = ( is_array( $old_meta_value ) ) ? var_export( $old_meta_value, true ) : $old_meta_value;
1194
+
1195
+ // Multi-key change from existing values to new values
1196
+ if ( $multi_key ) {
1197
+ // Test for "no changes"
1198
+ if ( $meta_value == (array) $old_meta_value ) {
1199
+ continue;
1200
+ }
1201
+
1202
+ if ( ! $keep_existing ) {
1203
+ if ( delete_post_meta( $parent_id, $meta_key ) ) {
1204
+ /* translators: 1: meta_key */
1205
+ $message .= sprintf( __( 'Deleting old %1$s values', 'media-library-assistant' ) . '<br>', $meta_key );
1206
+ }
1207
+
1208
+ $old_meta_value = array();
1209
+ } elseif ( $old_text == $old_meta_value ) { // single value
1210
+ $old_meta_value = array( $old_meta_value );
1211
+ }
1212
+
1213
+ $updated = 0;
1214
+ foreach ( $meta_value as $new_value ) {
1215
+ if ( ! in_array( $new_value, $old_meta_value ) ) {
1216
+ add_post_meta( $parent_id, $meta_key, $new_value );
1217
+ $old_meta_value[] = $new_value; // prevent duplicates
1218
+ $updated++;
1219
+ }
1220
+ }
1221
+
1222
+ if ( $updated ) {
1223
+ $meta_value = get_post_meta( $parent_id, $meta_key );
1224
+ if ( is_array( $meta_value ) ) {
1225
+ if ( 1 == count( $meta_value ) ) {
1226
+ $new_text = $meta_value[0];
1227
+ } else {
1228
+ $new_text = var_export( $meta_value, true );
1229
+ }
1230
+ } else {
1231
+ $new_text = $meta_value;
1232
+ }
1233
+
1234
+ /* translators: 1: meta_key 2: old_value 3: new_value 4: update count*/
1235
+ $message .= sprintf( __( 'Changing %1$s from "%2$s" to "%3$s"; %4$d updates', 'media-library-assistant' ) . '<br>', 'meta:' . $meta_key, $old_text, $new_text, $updated );
1236
+ }
1237
+ } elseif ( $old_meta_value !== $meta_value ) {
1238
+ $new_text = ( is_array( $meta_value ) ) ? var_export( $meta_value, true ) : $meta_value;
1239
+
1240
+ if ( $keep_existing ) {
1241
+ /* translators: 1: element name 2: old_value 3: new_value */
1242
+ $message .= sprintf( __( 'For %1$s retaining "%2$s", discarding "%3$s"', 'media-library-assistant' ) . '<br>', 'meta:' . $meta_key, $old_text, $new_text );
1243
+ continue;
1244
+ }
1245
+
1246
+ if ( is_array( $old_meta_value ) ) {
1247
+ delete_post_meta( $parent_id, $meta_key );
1248
+ }
1249
+
1250
+ if ( update_post_meta( $parent_id, $meta_key, $meta_value ) ) {
1251
+ /* translators: 1: element name 2: old_value 3: new_value */
1252
+ $message .= sprintf( __( 'Changing %1$s from "%2$s" to "%3$s"', 'media-library-assistant' ) . '<br>', 'meta:' . $meta_key, $old_text, $new_text );
1253
+ }
1254
+ }
1255
+ } // foreach $new_meta
1256
+
1257
+ // Apply all subfield updates
1258
+ if ( !empty( $subfield_updates ) ) {
1259
+ $message .= self::_apply_subfield_updates( $parent_id, $subfield_updates );
1260
+ }
1261
+
1262
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::_update_parent_postmeta( {$parent_id} ) message = " . var_export( $message, true ), self::MLA_DEBUG_CATEGORY );
1263
+ return $message;
1264
+ } // _update_parent_postmeta
1265
+
1266
+ /**
1267
+ * Used to modify the ACF $field settings array before it is saved into the database
1268
+ *
1269
+ * @since 1.01
1270
+ *
1271
+ * @param array $field The field array containing all settings
1272
+ *
1273
+ * @return array updated $field settings
1274
+ */
1275
+ public static function acf_update_field( $field ) {
1276
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_field field = " . var_export( $field, true ), self::MLA_DEBUG_CATEGORY );
1277
+ return $field;
1278
+ } // acf_update_field
1279
+
1280
+ /**
1281
+ * Used to modify the field’s $value before it is saved into the database
1282
+ *
1283
+ * @since 1.01
1284
+ *
1285
+ * @param mixed $value The field value
1286
+ * @param int|string $post_id The post ID where the value is saved
1287
+ * @param array $field The field array containing all settings
1288
+ *
1289
+ * @return array updated field $value
1290
+ */
1291
+ public static function acf_update_value( $value, $post_id, $field ) {
1292
+ static $parent_fields = array();
1293
+
1294
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( $post_id} ) value = " . var_export( $value, true ), self::MLA_DEBUG_CATEGORY );
1295
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( $post_id} ) field = " . var_export( $field, true ), self::MLA_DEBUG_CATEGORY );
1296
+
1297
+ // Initialize the parent rules once per page load
1298
+ if ( NULL === self::$parent_rules ) {
1299
+ self::$parent_rules = array();
1300
+
1301
+ if ( 'checked' === MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_CUSTOM_FIELD_MAPPING ) ) {
1302
+ self::_load_parent_rules( MLACore::mla_get_option( 'custom_field_mapping' ), true );
1303
+ }
1304
+
1305
+ if ( 'checked' === MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_IPTC_EXIF_MAPPING ) ) {
1306
+ $settings = MLACore::mla_get_option( 'iptc_exif_mapping' );
1307
+ self::_load_parent_rules( $settings['custom'], true );
1308
+ }
1309
+
1310
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( $post_id} ) parent_rules = " . var_export( self::$parent_rules, true ), self::MLA_DEBUG_CATEGORY );
1311
+ foreach( self::$parent_rules as $slug => $rule ) {
1312
+ $parent_fields[ $rule['parent_field'] ] = $slug;
1313
+ }
1314
+
1315
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( $post_id} ) parent_fields = " . var_export( $parent_fields, true ), self::MLA_DEBUG_CATEGORY );
1316
+ }
1317
+
1318
+ // Look for special handling of MLA parent: fields
1319
+ if ( array_key_exists( $field['_name'], $parent_fields ) ) {
1320
+ $rule = self::$parent_rules[ $parent_fields[ $field['_name'] ] ];
1321
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( $post_id} ) rule = " . var_export( $rule, true ), self::MLA_DEBUG_CATEGORY );
1322
+ if ( isset( $rule['parent_format'] ) && ( 'acf' === $rule['parent_format'] ) ) {
1323
+ $current_value = get_field( $field['key'], $post_id );
1324
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::acf_update_value( {$post_id}, {$field['key']} ) current_value = " . var_export( $current_value, true ), self::MLA_DEBUG_CATEGORY );
1325
+
1326
+ switch ( $rule[ 'parent_action' ] ) {
1327
+ case 'repeater':
1328
+ break;
1329
+ case 'subfield':
1330
+ break;
1331
+ case 'read_only':
1332
+ $value = $current_value;
1333
+ break;
1334
+ case 'default_value':
1335
+ if ( $value === $field['default_value'] ) {
1336
+ $value = $current_value;
1337
+ }
1338
+ break;
1339
+ case 'empty':
1340
+ if ( empty( $value ) ) {
1341
+ $value = $current_value;
1342
+ }
1343
+ break;
1344
+ default:
1345
+ } // switch parent_action
1346
+ }
1347
+ }
1348
+
1349
+ // return NULL to delete the field
1350
+ return $value;
1351
+ } // acf_update_value
1352
+
1353
+ /**
1354
+ * Called after lysync_core.php function sync_media_add() inserts a new attachment
1355
+ *
1356
+ * @since 1.02
1357
+ *
1358
+ * @param integer $mediaId The ID of the inserted attachment
1359
+ */
1360
+ public static function wplr_add_media( $mediaId ) {
1361
+ $post_parent = get_post_field( 'post_parent', $mediaId );
1362
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::wplr_add_media mediaId = {$mediaId}, post_parent = {$post_parent}", self::MLA_DEBUG_CATEGORY );
1363
+ } // wplr_add_media
1364
+
1365
+ /**
1366
+ * Called after lysync_core.php function add_media_to_collection() adds the attachment ID to the Collection
1367
+ *
1368
+ * @since 1.02
1369
+ *
1370
+ * @param integer $mediaId The ID of the inserted attachment
1371
+ * @param integer $collectionId The ID of the wplr Collection
1372
+ */
1373
+ public static function wplr_add_media_to_collection( $mediaId, $collectionId ) {
1374
+ // lysync_core.php function set_media_to_collection_one() should have set post_parent by now
1375
+ $post_parent = get_post_field( 'post_parent', $mediaId );
1376
+
1377
+ if ( $post_parent && !empty( self::$parent_updates[ $mediaId ] ) ) {
1378
+ $message = self::_update_parent_postmeta( $post_parent, self::$parent_updates[ $mediaId ] );
1379
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::wplr_add_media_to_collection mediaId = {$mediaId}, collectionId = {$collectionId}, post_parent = {$post_parent} message = " . var_export( $message, true ), self::MLA_DEBUG_CATEGORY );
1380
+ } else {
1381
+ $parent_updates = NULL;
1382
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::wplr_add_media_to_collection mediaId = {$mediaId}, collectionId = {$collectionId}, post_parent = {$post_parent} no parent_updates", self::MLA_DEBUG_CATEGORY );
1383
+ }
1384
+ } // wplr_add_media_to_collection
1385
+
1386
+ /**
1387
+ * Called after lysync_core.php function sync_media() completes processing the attachment and the Collection
1388
+ *
1389
+ * @since 1.02
1390
+ *
1391
+ * @param object $sync The lrsync table row for this item
1392
+ */
1393
+ public static function wplr_sync_media( $sync ) {
1394
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::wplr_sync_media sync = " . var_export( $sync, true ), self::MLA_DEBUG_CATEGORY );
1395
+ $info = Meow_WPLR_LRInfo::fromRow( $sync );
1396
+ $post_parent = get_post_field( 'post_parent', $sync->wp_id );
1397
+ MLACore::mla_debug_add( __LINE__ . " MLAParentCustomFieldMapping::wplr_sync_media post_parent = {$post_parent}, info = " . var_export( $info, true ), self::MLA_DEBUG_CATEGORY );
1398
+ } // wplr_sync_media
1399
+ } //MLAParentCustomFieldMapping
1400
+
1401
+ // Install the filters at an early opportunity
1402
+ add_action('init', 'MLAParentCustomFieldMapping::initialize');
1403
+ ?>
examples/plugins/mla-parent-search-example.php CHANGED
@@ -15,15 +15,15 @@
15
  * https://wordpress.org/support/topic/search-wordpress-media-library-by-attached-post-title/
16
  *
17
  * @package MLA Parent Search Example
18
- * @version 1.01
19
  */
20
 
21
  /*
22
  Plugin Name: MLA Parent Search Example
23
  Plugin URI: http://davidlingren.com/
24
- Description: Extends the Media/Assistant "Search Media" box to custom field values
25
  Author: David Lingren
26
- Version: 1.01
27
  Author URI: http://davidlingren.com/
28
 
29
  Copyright 2018 David Lingren
@@ -123,8 +123,8 @@ class MLAParentSearchExample {
123
  self::$parent_search_parameters = array();
124
  }
125
  } // isset s=parent:
126
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_new_instance parent_search_parameters = ' . var_export( self::$parent_search_parameters, true ), 0 );
127
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_new_instance _REQUEST = ' . var_export( $_REQUEST, true ), 0 );
128
 
129
  return $mla_list_table;
130
  } // mla_list_table_new_instance
@@ -161,7 +161,7 @@ error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_new_instance _REQ
161
  if ( ! ( isset( $request['offset'] ) && isset( $request['posts_per_page'] ) ) ) {
162
  return $request;
163
  }
164
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms request = ' . var_export( $request, true ), 0 );
165
 
166
  if ( empty( self::$parent_search_parameters ) ) {
167
  return $request;
@@ -184,15 +184,15 @@ error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms
184
  'mla_search_connector' => self::$parent_search_parameters['mla_search_connector'],
185
  'mla_search_fields' => implode( ',', self::$parent_search_parameters['mla_search_fields'] ),
186
  );
187
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms parent_query = ' . var_export( $parent_query, true ), 0 );
188
  $parents = MLAShortcodes::mla_get_shortcode_attachments( 0, $parent_query );
189
  $ids = array();
190
  foreach( $parents as $parent ) {
191
  $ids[] = $parent->ID;
192
  }
193
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms ids = ' . var_export( $ids, true ), 0 );
194
  $request['post_parent__in'] = $ids;
195
- error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms request = ' . var_export( $request, true ), 0 );
196
 
197
  return $request;
198
  } // mla_list_table_query_final_terms
@@ -239,8 +239,8 @@ error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms
239
  self::$parent_search_parameters = array();
240
  }
241
  } // isset mla_search_value=parent:
242
- error_log( __LINE__ . ' MLAParentSearchExample::mla_media_modal_query_initial_terms query = ' . var_export( $query, true ), 0 );
243
- error_log( __LINE__ . ' MLAParentSearchExample::mla_media_modal_query_initial_terms parent_search_parameters = ' . var_export( self::$parent_search_parameters, true ), 0 );
244
 
245
  return $query;
246
  }
15
  * https://wordpress.org/support/topic/search-wordpress-media-library-by-attached-post-title/
16
  *
17
  * @package MLA Parent Search Example
18
+ * @version 1.02
19
  */
20
 
21
  /*
22
  Plugin Name: MLA Parent Search Example
23
  Plugin URI: http://davidlingren.com/
24
+ Description: Extends the Media/Assistant "Search Media" box the parent elements of attached items
25
  Author: David Lingren
26
+ Version: 1.02
27
  Author URI: http://davidlingren.com/
28
 
29
  Copyright 2018 David Lingren
123
  self::$parent_search_parameters = array();
124
  }
125
  } // isset s=parent:
126
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_new_instance parent_search_parameters = ' . var_export( self::$parent_search_parameters, true ), 0 );
127
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_new_instance _REQUEST = ' . var_export( $_REQUEST, true ), 0 );
128
 
129
  return $mla_list_table;
130
  } // mla_list_table_new_instance
161
  if ( ! ( isset( $request['offset'] ) && isset( $request['posts_per_page'] ) ) ) {
162
  return $request;
163
  }
164
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms request = ' . var_export( $request, true ), 0 );
165
 
166
  if ( empty( self::$parent_search_parameters ) ) {
167
  return $request;
184
  'mla_search_connector' => self::$parent_search_parameters['mla_search_connector'],
185
  'mla_search_fields' => implode( ',', self::$parent_search_parameters['mla_search_fields'] ),
186
  );
187
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms parent_query = ' . var_export( $parent_query, true ), 0 );
188
  $parents = MLAShortcodes::mla_get_shortcode_attachments( 0, $parent_query );
189
  $ids = array();
190
  foreach( $parents as $parent ) {
191
  $ids[] = $parent->ID;
192
  }
193
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms ids = ' . var_export( $ids, true ), 0 );
194
  $request['post_parent__in'] = $ids;
195
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_list_table_query_final_terms request = ' . var_export( $request, true ), 0 );
196
 
197
  return $request;
198
  } // mla_list_table_query_final_terms
239
  self::$parent_search_parameters = array();
240
  }
241
  } // isset mla_search_value=parent:
242
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_media_modal_query_initial_terms query = ' . var_export( $query, true ), 0 );
243
+ //error_log( __LINE__ . ' MLAParentSearchExample::mla_media_modal_query_initial_terms parent_search_parameters = ' . var_export( self::$parent_search_parameters, true ), 0 );
244
 
245
  return $query;
246
  }
examples/plugins/mla-random-galleries-example.php DELETED
@@ -1,180 +0,0 @@
1
- <?php
2
- /**
3
- * Provides an [mla_gallery] parameter to select random items from a collection of Att. Category terms
4
- *
5
- * In this example, a custom "random_category" parameter names an Att. Category term.
6
- * The value is matched to a list of terms in the $gallery_terms array in the plugin source code.
7
- * If the term is in the list items assigned to the term are returned in random order.
8
- * The 'numberposts' parameter can be added to limit the number of items returned. For example:
9
- *
10
- * [mla_gallery random_category=admin numberposts=1]
11
- *
12
- * NOTE: You must enter the name or slug values for your application's terms in the $gallery_terms array below.
13
- *
14
- * This example plugin uses one of the many filters available in the [mla_gallery] shortcode
15
- * and illustrates a technique you can use to customize the gallery display.
16
- *
17
- * Created for support topic "multiple calls to a smaller amount"
18
- * opened on 1/16/2016 by "luigsm".
19
- * https://wordpress.org/support/topic/multiple-calls-to-a-smaller-amount
20
- *
21
- * @package MLA Random Galleries Example
22
- * @version 1.01
23
- */
24
-
25
- /*
26
- Plugin Name: MLA Random Galleries Example
27
- Plugin URI: http://davidlingren.com/
28
- Description: High performance queries for random items from a list of Att. Categories
29
- Author: David Lingren
30
- Version: 1.01
31
- Author URI: http://davidlingren.com/
32
-
33
- Copyright 2016 David Lingren
34
-
35
- This program is free software; you can redistribute it and/or modify
36
- it under the terms of the GNU General Public License as published by
37
- the Free Software Foundation; either version 2 of the License, or
38
- (at your option) any later version.
39
-
40
- This program is distributed in the hope that it will be useful,
41
- but WITHOUT ANY WARRANTY; without even the implied warranty of
42
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43
- GNU General Public License for more details.
44
-
45
- You can get a copy of the GNU General Public License by writing to the
46
- Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
47
- */
48
-
49
- /**
50
- * Class MLA Random Galleries Example supplies random items from a collection of Att. Category terms
51
- *
52
- * NOTE: You must enter the name or slug values for your application's terms in the $gallery_terms array below.
53
- *
54
- * @package MLA Random Galleries Example
55
- * @since 1.00
56
- */
57
- class MLARandomGalleriesExample {
58
- /**
59
- * Initialization function, similar to __construct()
60
- *
61
- * @since 1.00
62
- */
63
- public static function initialize() {
64
- // The filters are only useful for front-end posts/pages; exit if in the admin section
65
- if ( is_admin() )
66
- return;
67
-
68
- add_filter( 'mla_gallery_attributes', 'MLARandomGalleriesExample::mla_gallery_attributes_filter', 10, 1 );
69
- }
70
-
71
- /**
72
- * Save the random galleries
73
- *
74
- * @since 1.00
75
- *
76
- * @var array
77
- */
78
- private static $random_galleries = NULL;
79
-
80
- /**
81
- * List of term names/slugs for the galleries
82
- *
83
- * Replace the three example terms with the appropriate values
84
- * for your application/site
85
- *
86
- * @since 1.00
87
- *
88
- * @var array
89
- */
90
- private static $gallery_terms = array(
91
- 'Colorado River', 'admin', 'abc',
92
- );
93
-
94
- /**
95
- * MLA Gallery (Display) Attributes
96
- *
97
- * The $shortcode_attributes array is where you will find any of your own parameters that are coded in the
98
- * shortcode, e.g., [mla_gallery random_category="abc"].
99
- *
100
- * @since 1.00
101
- *
102
- * @param array the shortcode parameters passed in to the shortcode
103
- */
104
- public static function mla_gallery_attributes_filter( $shortcode_attributes ) {
105
- global $wpdb;
106
-
107
- // ignore shortcodes without the random_category parameter
108
- if ( empty( $shortcode_attributes['random_category'] ) ) {
109
- return $shortcode_attributes;
110
- }
111
-
112
- // Once each page load, compute the random galleries
113
- if ( is_null( self::$random_galleries ) ) {
114
- self::$random_galleries = array();
115
-
116
- // Get slug values
117
- $slugs = array();
118
- foreach ( self::$gallery_terms as $term ) {
119
- $slugs[] = "'" . esc_sql( sanitize_term_field( 'slug', $term, 0, 'attachment_category', 'db' ) ) . "'";
120
- }
121
- $slugs = implode( ',', $slugs );
122
-
123
- // Build an array of ( slug => term_taxonomy_id )
124
- $terms_query = sprintf( 'SELECT term_id, slug FROM %1$s WHERE ( slug IN ( %2$s ) ) ORDER BY term_id', $wpdb->terms, $slugs );
125
- $_terms_taxonomy_query = sprintf( 'SELECT term_taxonomy_id, term_id FROM %1$s WHERE ( taxonomy=\'attachment_category\' ) ORDER BY term_id', $wpdb->term_taxonomy );
126
-
127
- $query = sprintf( 'SELECT tt.term_taxonomy_id, t.term_id, t.slug FROM ( %1$s ) as tt JOIN ( %2$s ) as t ON ( tt.term_id = t.term_id ) ORDER BY term_taxonomy_id', $_terms_taxonomy_query, $terms_query, $slugs );
128
- $results = $wpdb->get_results( $query );
129
-
130
- self::$gallery_terms = array();
131
- foreach ( $results as $result ) {
132
- self::$gallery_terms[ absint( $result->term_taxonomy_id ) ] = $result->slug;
133
- }
134
- unset( $results );
135
- self::$gallery_terms = array_flip( self::$gallery_terms );
136
-
137
- // Build an array of ( term_taxonomy_id => array( IDs of items assigned to the term )
138
- $term_taxonomy_ids = implode( ',', array_values( self::$gallery_terms ) );
139
- $query = sprintf( 'SELECT object_id, term_taxonomy_id FROM %1$s WHERE ( term_taxonomy_id IN ( %2$s ) ) ORDER BY RAND()', $wpdb->term_relationships, $term_taxonomy_ids );
140
- $results = $wpdb->get_results( $query );
141
-
142
- foreach ( $results as $result ) {
143
- self::$random_galleries[ absint( $result->term_taxonomy_id ) ][] = absint( $result->object_id );
144
- }
145
- unset( $results );
146
- }
147
-
148
- // Convert the parameter value to a sanitized slug value
149
- $random_slug = esc_sql( sanitize_term_field( 'slug', $shortcode_attributes['random_category'], 0, 'attachment_category', 'db' ) );
150
-
151
- // Make sure the parameter matches a value in the galleries
152
- if ( ! $random_key = ( isset( self::$gallery_terms[ $random_slug ] ) ? self::$gallery_terms[ $random_slug ] : 0 ) ) {
153
- $shortcode_attributes['numberposts'] = 0;
154
- return $shortcode_attributes;
155
- }
156
-
157
- // Limit the result set if numberposts is present
158
- if ( $numberposts = ( isset( $shortcode_attributes['numberposts'] ) ? absint( $shortcode_attributes['numberposts'] ) : 0 ) ) {
159
- if ( $numberposts < count( self::$random_galleries[ $random_key ] ) ) {
160
- $ids = array_slice( self::$random_galleries[ $random_key ], 0, $numberposts, true );
161
- } else {
162
- $ids = self::$random_galleries[ $random_key ];
163
- }
164
- } else {
165
- $ids = self::$random_galleries[ $random_key ];
166
- }
167
-
168
- $shortcode_attributes['ids'] = implode( ',', $ids );
169
- unset( $shortcode_attributes['random_category'] );
170
- unset( $shortcode_attributes['numberposts'] );
171
-
172
- return $shortcode_attributes;
173
- } // mla_gallery_attributes_filter
174
- } // Class MLARandomGalleriesExample
175
-
176
- /*
177
- * Install the filters at an early opportunity
178
- */
179
- add_action('init', 'MLARandomGalleriesExample::initialize');
180
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
examples/plugins/mla-random-galleries-example/admin-settings-page.tpl ADDED
@@ -0,0 +1,405 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- template="page" -->
2
+ <a name="backtotop"></a>
3
+ &nbsp;
4
+ <div class="wrap">
5
+ <h1 class="wp-heading-inline">MLA Random Galleries Example [+version+] Settings</h1>
6
+ [+messages+]
7
+ [+tablist+]
8
+ [+tab_content+]
9
+ </div><!-- wrap -->
10
+
11
+ <!-- template="tablist" -->
12
+ <h2 class="nav-tab-wrapper">
13
+ [+tablist+]
14
+ </h2>
15
+ <!-- template="tablist-item" -->
16
+ <a data-tab-id="[+data-tab-id+]" class="nav-tab [+nav-tab-active+]" href="?page=[+settings-page+]&amp;mla_tab=[+data-tab-id+]">[+title+]</a>
17
+
18
+ <!-- template="messages" -->
19
+ <div class="[+mla_messages_class+]">
20
+ <p>
21
+ [+messages+]
22
+ </p>
23
+ [+dismiss_button+]
24
+ </div>
25
+
26
+ <!-- template="page-level-options" -->
27
+ <tr valign="top">
28
+ <td class="textright">
29
+ <strong>Random Taxonomy</strong>
30
+ </td>
31
+ <td>
32
+ <input name="mla_random_galleries_options[random_taxonomy]" id="mla_random_galleries_random_taxonomy" type="text" size="40" value="[+random_taxonomy+]" />
33
+ <div class="mla-settings-help">&nbsp;&nbsp;Enter the slug of the taxonomy to select terms from. Must be present.</div>
34
+ </td>
35
+ </tr>
36
+ <tr valign="top">
37
+ <td class="textright">
38
+ <strong>Random Term List</strong>
39
+ </td>
40
+ <td>
41
+ <input name="mla_random_galleries_options[random_term_list]" id="mla_random_galleries_random_term_list" type="text" size="80" value="[+random_term_list+]" />
42
+ <div class="mla-settings-help">&nbsp;&nbsp;Enter the complete comma-delimited list of terms from which to select items for display.<br />&nbsp;&nbsp;Leave the box empty to make all terms eligible for selection/display.</div>
43
+ </td>
44
+ </tr>
45
+ <tr valign="top">
46
+ <td class="textright">
47
+ <input name="mla_random_galleries_options[verify_post_attributes]" id="mla_random_galleries_verify_post_attributes" type="checkbox" [+verify_post_attributes_checked+] value="1" />
48
+ </td>
49
+ <td>
50
+ &nbsp;<strong>Verify Post Attributes</strong>
51
+ <div class="mla-settings-help">&nbsp;&nbsp;Check this option to enforce <code>post_type=attachment</code>, <code>post_status=inherit</code> and <code>post_mime_type=image</code> restrictions.<br />&nbsp;&nbsp;These require an additional database query, and can impact performance.<br />&nbsp;&nbsp;You can overide any of these parameters with shortcode parameters.</div>
52
+ </td>
53
+ </tr>
54
+
55
+
56
+ <!-- template="general-tab" -->
57
+ <style type='text/css'>
58
+ .mla-settings-help {
59
+ font-size: 8pt;
60
+ padding-bottom: 5px
61
+ }
62
+
63
+ .mla-page-level-options-form {
64
+ margin-left: 0px;
65
+ margin-top: 10px;
66
+ padding-bottom: 10px;
67
+ border-bottom:thin solid #888888;
68
+ }
69
+
70
+ span.submit.mla-settings-submit,
71
+ p.submit.mla-settings-submit {
72
+ padding-bottom: 0px
73
+ }
74
+ </style>
75
+ <h2>Plugin Options</h2>
76
+ <p>In this tab you can specify the default taxonomy from which to select terms and the list of all terms eligible for processing.</p>
77
+ <p>You can find more information about using the features of this plugin in the Documentation tab on this page.</p>
78
+ <div class="mla-page-level-options-form">
79
+ <form action="[+form_url+]" method="post" class="mla-display-settings-page" id="mla-display-settings-random-galleries-tab">
80
+ <table class="optiontable">
81
+ <tbody>
82
+ [+options_list+]
83
+ </tbody>
84
+ </table>
85
+ <span class="submit mla-settings-submit">
86
+ <input name="mla-random-galleries-options-save" class="button-primary" id="mla-random-galleries-options-save" type="submit" value="Save Changes" />
87
+ </span>
88
+ [+_wpnonce+]
89
+ </form>
90
+ </div>
91
+
92
+ <!-- template="documentation-tab" -->
93
+ <style type='text/css'>
94
+ .mla-doc-toc-list {
95
+ list-style-position:inside;
96
+ list-style:disc;
97
+ line-height: 15px;
98
+ padding-left: 20px
99
+ }
100
+
101
+ .mla-doc-hook-label {
102
+ text-align: right;
103
+ padding: 0 1em 2em 0;
104
+ vertical-align: top;
105
+ font-weight:bold
106
+ }
107
+
108
+ .mla-doc-hook-definition {
109
+ vertical-align: top;
110
+ }
111
+
112
+ .mla-doc-table-label {
113
+ text-align: right;
114
+ padding-right: 10px;
115
+ vertical-align: top;
116
+ font-weight:bold
117
+ }
118
+
119
+ .mla-doc-table-sublabel {
120
+ padding-right: 10px;
121
+ vertical-align: top
122
+ }
123
+
124
+ .mla-doc-table-reverse {
125
+ text-align: right;
126
+ padding-right: 10px;
127
+ vertical-align:top
128
+ }
129
+
130
+ .mla-doc-table-definition {
131
+ vertical-align: top;
132
+ }
133
+
134
+ .mla-doc-bold-link {
135
+ font-size:14px;
136
+ font-weight:bold
137
+ }
138
+ </style>
139
+ <h2>Plugin Documentation. In this tab, jump to:</h2>
140
+ <div class="mla-display-settings-page" id="mla-display-settings-documentation-tab" style="width:700px">
141
+ <ul class="mla-doc-toc-list">
142
+ <li><a href="#introduction"><strong>Introduction</strong></a></li>
143
+ <li><a href="#processing"><strong>How the Plugin Works</strong></a></li>
144
+ <li><a href="#parameters"><strong>Shortcode Parameters</strong></a></li>
145
+ <li><a href="#random_taxonomy"><strong>Specifying a Random Taxonomy</strong></a></li>
146
+ <li><a href="#random_term_list"><strong>Specifying a Random Term List</strong></a></li>
147
+ <li><a href="#verify_post_attributes"><strong>Database Query - Verify Post Attributes</strong></a></li>
148
+ <li><a href="#random_term"><strong>Specifying the Random Term(s)</strong></a></li>
149
+ <li><a href="#posts_per_term"><strong>Limiting Items per Term</strong></a></li>
150
+ <li><a href="#shuffle_gallery"><strong>Ordering the Items - Shuffle Gallery</strong></a></li>
151
+ <li><a href="#posts_per_page"><strong>Limiting Total Gallery Items</strong></a></li>
152
+ <li><a href="#examples"><strong>Examples</strong></a></li>
153
+ </ul>
154
+ <p>
155
+ &nbsp;
156
+ <a name="introduction"></a>
157
+ </p>
158
+ <p>
159
+ <a href="#backtotop">Go to Top</a>
160
+ </p>
161
+ <h3>Introduction</h3>
162
+ <p>
163
+ For many sites that divide Media Library items into categories or group items with tags, some sort of overview or portfolio page displays a random sampling of items assigned to one or more category/tag terms. The MLA Random Galleries Example plugin provides a convenient way to organize these displays and a much more efficient database query technique to assemble the items for display. The example plugin was developed in response to these MLA support topics:
164
+ </p>
165
+ <ul class="mla-doc-toc-list">
166
+ <li><a href="https://wordpress.org/support/topic/multiple-calls-to-a-smaller-amount/" title="View the topic" target="_blank">multiple calls to a smaller amount</a></li>
167
+ <li><a href="https://wordpress.org/support/topic/gallery-incl-control-break/" title="View the topic" target="_blank">Gallery incl control break</a></li>
168
+ </ul>
169
+ <p>
170
+ To use the plugin you must specify one taxonomy from which to select terms and a list of terms to draw from. This can be done by setting plugin options or adding parameters to an <code>[mla_gallery]</code> shortcode. Then, add a <code>random_term</code> parameter to an <code>[mla_gallery]</code> shortcode to choose one or more terms to filter the items for a gallery display. Often you will have several such shortcodes on a given post/page to show a sampling of items from different parts of the site.
171
+ </p>
172
+ <p>
173
+ More details on each option setting and shortcode parameter are in the sections of this Documentation page.
174
+ <a name="processing"></a>
175
+ </p>
176
+ <p>
177
+ <a href="#backtotop">Go to Top</a>
178
+ </p>
179
+ <h3>How the Plugin Works</h3>
180
+ <p>
181
+ The plugin works by detecting the presence of its parameters in one or more <code>[mla_gallery]</code> shortcodes on a post/page. When the parameter(s) are present, two tasks are performed:</p>
182
+ <ul class="mla-doc-toc-list">
183
+ <li><strong>Generate the random galleries</strong> - This is usually done once per page load, for performance reasons. It happens when the first shortcode containing the parameters is processed. If you add taxnonmy or term list parameters to a subsequent shortcode, the random galleries are regenerated with the new parameter values.</li>
184
+ <li><strong>Populate the random gallery</strong> - This happens once for each shortcode that contains the plugin parameters. It uses the results of the first task to select items for display.</li>
185
+ </ul>
186
+ <p>
187
+ The first task executes just one or two database queries to fetch all of the items assigned to the term(s) in the random term list. First, if the random term list is empty, an optional query is executed to fetch all of the terms in the taxonomy to populate a default list. The primary query in this task: 1) converts the slug values to term_id values using the wp_terms table, 2) converts the term_id values to taxonomy-specific term_taxonomy_id values using the wp_term_taxonomy table and then 3) uses the term_taxonomy_id values to fetch the term assignments ( item ID values) from the wp_term_relationship table. This is much more efficient than the normal WordPress queries, which require a separate query for each term and accesses the wp_posts table as well.
188
+ </p>
189
+ <p>
190
+ If the Verify Post Attributes option is active the primary query is a bit different. In the third step of the query the wp_term_relationship table is joined to the wp_posts table so the post_type, post_status and post_mime_type restrictions are enforced. This step is not necessary if the random taxonomy is used only to assign terms to Media Library image items. That&rsquo;s normally the case when the Att. Categories or Att. Tags taxonomies are used.
191
+ </p>
192
+ <p>
193
+ The final step of the first task builds an in-memory table of all the items assigned to each term in the random term list. For each term the items are stored in random order, and the order will change on each page load or each time the table is regenerated.
194
+ </p>
195
+ <p>
196
+ The second task is performed for each shortcode on the post/page that contains the plugin&rsquo;s parameters. The centerpiece of this task is the <code>random_term</code> parameter that names the term(s) used to select items for the gallery display. For each term in the parameter, the in-memory table is accessed to find the items assigned to that term. Once all of the terms named in the random term parameter have been processed the order of the consolidated list of items is again randomized, unless <code>shuffle_gallery</code> is false. The selected items are passed back to the <code>[mla_gallery]</code> shortcode as an <code>ids=</code> list to generate the gallery display.
197
+ </p>
198
+ <p>
199
+ The <code>posts_per_term</code> or <code>numberposts</code> parameter can be used to limit the total number of items displayed, but these are processed in the <code>[mla_gallery]</code> shortcode, not in this plugin.
200
+ <a name="parameters"></a>
201
+ </p>
202
+ <p>
203
+ <a href="#backtotop">Go to Top</a>
204
+ </p>
205
+ <h3>Shortcode Parameters</h3>
206
+ <p>
207
+ You can use shortcode parameters to control all aspects of random gallery processing. For convenience, you can also set default values for the first three parameters in the list in the General tab on this Settings page. Each of the parameters in the list below will be covered in more detail in the Documentation sections following this summary.
208
+ </p>
209
+ <ul class="mla-doc-toc-list">
210
+ <li><code>random_taxonomy</code> - Gives the slug for the taxonomy in which the &ldquo;random terms&rdquo; are defined. If not supplied, a plugin option gives a default value.</li>
211
+ <li><code>random_term_list</code> - A comma-separated list of <strong>all</strong> the term names or slugs that will be used to select items for display in all of the shortcodes on the post/page. If not supplied, a plugin option gives a default value. If the parameter is present but empty, all terms in the random taxonomy are processed.</li>
212
+ <li><code>verify_post_attributes</code> - A boolean value (default false) that, when true, adds <code>post_type</code>, <code>post_status</code> and <code>post_mime_type</code> tests to the selection of items for display. This extra step can cause slower performance, but is useful if the taxonomy assignments include posts, pages and non-image items.</li>
213
+ <li><code>random_term</code> - A comma-separated list of the term names or slugs that will be used to select items for display by the current shortcode. If the parameter is present but empty, all terms in the random term list are displayed. If the parameter is missing the gallery will be empty.</li>
214
+ <li><code>shuffle_gallery</code> - A boolean value (default true) that, when false, disables the final re-ordering of selected items in all terms for the gallery display. The items are grouped by term value and displayed in the term order of the random terms list.</li>
215
+ </ul>
216
+ <p>
217
+ The first three parameters are processed when the first shortcode containing random gallery parameters is encountered. The results are stored for use in subsequent random gallery shortcodes on the post/page. If a subsequent shortcode contains a different value for the taxonomy or term list, the parameters are processed again for the new combination of values. See the Examples section for, well, an example.
218
+ <p>
219
+ Any additional shortcode parameters are simply passed along to the <code>[mla_gallery]</code> logic that composes the gallery display. When <code>verify_post_attributes=true</code>, three additional parameters are used by this plugin to ensure that all of the items selected will be displayed in the gallery:
220
+ </p>
221
+ <ul class="mla-doc-toc-list">
222
+ <li><code>post_type</code> - Names the post type(s) that filter the gallery display. The default value, "attachment" is compatible with <code>[mla_gallery]</code>.</li>
223
+ <li><code>post_status</code> - Names the post status value(s) that filter the gallery display. The default value, "inherit" is compatible with <code>[mla_gallery]</code>.</li>
224
+ <li><code>post_mime_type</code> - Names the MIME type(s) that filter the gallery display. The default value, "image" is compatible with <code>[mla_gallery]</code>. You can specify "all" to remove this filter criterion.</li>
225
+ </ul>
226
+ <p>
227
+ &nbsp;
228
+ <a name="random_taxonomy"></a>
229
+ </p>
230
+ <p>
231
+ <a href="#backtotop">Go to Top</a>
232
+ </p>
233
+ <h3>Specifying a Random Taxonomy</h3>
234
+ <p>
235
+ You must specify exactly one taxonomy from which to select terms for your random galleries, either as a plugin option setting or as a parameter of the first shortcode in which random gallery parameters are coded. This allows the plugin to perform one set of efficient database queries for all of the terms in the random term list. Subsequent shortcodes on the post/page can display items from other terms in the list without additional database activity. The value must be a taxonomy slug, e.g., <code>attachment_category</code>, not the name, e.g., &ldquo;Att. Categories&rdquo;. The default value is <code>attachment_category</code>.
236
+ </p>
237
+ <p>
238
+ You can change the random taxonomy by coding the parameter in one of the subsequent shortcodes on the post/page. This causes a fresh set of database queries to be executed, giving a new collection of terms and item assignments. If you change the taxonomy you will also want to change the random term list, unless you are using an empty list to use all of the terms in the taxonomy.
239
+ </p>
240
+ <p>
241
+ It is best to use a taxonomy that assigns terms only to Media Library, or &ldquo;attachment&rdquo; items. If you use a taxonomy such as the WordPress <code>category</code> or <code>post_tag</code> taxonomy and assign terms to posts and pages as well as attachments you can activate <code>verify_post_attributes</code>. This adds a check to filter out posts, pages and non-image MIME types but can significantly slow down the queries required to generate the random term assignments. If you do not add the check your gallery display will probably contain fewer items than you intended.
242
+ </p>
243
+ <p>
244
+ It is also better if the terms in your random term list are assigned only to image items, not to other items such as PDF documents. If you want to include non-image items in your display be sure to add an appropriate <code>post_mime_type</code> parameter to your shortcode. Otherwise your gallery display will probably contain fewer items than you intended.
245
+ </p>
246
+ <p>
247
+ Finally, if an item is assigned to more than one term in your random term list there is a chance it will displace some other item, resulting in fewer items than you expect. This is less likely if all of the terms in your list contain more items (per term) than you want to display.
248
+ <a name="random_term_list"></a>
249
+ </p>
250
+ <p>
251
+ <a href="#backtotop">Go to Top</a>
252
+ </p>
253
+ <h3>Specifying a Random Term List</h3>
254
+ <p>
255
+ The random term list is the master list of all terms that are used for random gallery display on a given post/page. You can set a defulat list as a plugin option and overide it by coding a shortcode parameter. The list is processed when the first shortcode containing random gallery parameters is processed to find all items assigned to each of the terms in the list. You can have subsequent shortcodes on the post/page using different terms from the list to organize the galleries, but they all must use one or more terms from the master list.
256
+ </p>
257
+ <p>
258
+ Typically you will set the term list once, in the General tab on this Settings page. If you want different lists on different posts/pages, specify the most common list as an option setting and then use a shortcode parameter for the less common list(s).
259
+ </p>
260
+ <p>
261
+ You can change the random term list by coding the parameter in one of the subsequent shortcodes on the post/page. This causes a fresh set of database queries to be executed, giving a new collection of terms and item assignments.
262
+ </p>
263
+ <p>
264
+ If your random taxonomy contains a modest number of terms you can leave the random term list empty. This will cause the plugin to generate a list of all taxonomy terms and use that to find item assignments. Processing all taxonomy terms is convenient but can take a lot of time and memory if your random taxonomy has dozens or hundreds of terms.
265
+ <a name="verify_post_attributes"></a>
266
+ &nbsp;
267
+ </p>
268
+ <p>
269
+ <a href="#backtotop">Go to Top</a>
270
+ </p>
271
+ <h3><strong>Database Query - Verify Post Attributes</strong></h3>
272
+ <p>
273
+ One of the main advantages this plugin provides is a performace gain when multiple random terms and/or random galleries appear on a given post/page. The plugin queries the database once each page load to process all of the terms in the random term list. The default queries do not access the <code>wp_posts</code> table at all, which avoids a lot of time and memory consumption.
274
+ </p>
275
+ <p>
276
+ These shortcuts work best when two assumptions are true: 1) only attachment items are assigned to terms in the random taxonomy, and 2) the items assigned to terms in the random term list all have one of the image MIME types. If either assumption is false, some of the items selected by this plugin will be filtered out of the final display. You can relax the &ldquo;image MIME type&rdquo; assumption by adding <code>post_mime_type=all</code> to your shortcode(s).
277
+ </p>
278
+ <p>
279
+ If you want to exclude posts, pages and other post types from this plugin's processing you can activate the &ldquo;Verify Post Attributes&rdquo; action by checking the option setting box or by adding <code>verify_post_attributes=true</code> to the shortcode that processes the random term list. This action will add the <code>wp_posts</code> table to the database query that selects the items.
280
+ <a name="random_term"></a>
281
+ </p>
282
+ <p>
283
+ <a href="#backtotop">Go to Top</a>
284
+ </p>
285
+ <h3>Specifying the Random Term(s)</h3>
286
+ <p>
287
+ For each random gallery shortcode on the post/page you must specify one or more terms from which to select the items for display. There is no default for this parameter and if it is missing your random gallery will be empty. Each term name or slug value you add to this parameter must also appear in the random (master) term list.
288
+ </p>
289
+ <p>
290
+ If this parameter is present, but empty, e.g., <code>random_term=''</code>, all of the terms in the random term list will be used to select items for display.
291
+ <a name="posts_per_term"></a>
292
+ </p>
293
+ <p>
294
+ <a href="#backtotop">Go to Top</a>
295
+ </p>
296
+ <h3>Limiting Items per Term</h3>
297
+ <p>
298
+ You can set an upper bound for the number of items selected from each of the terms in the <code>random_term</code> parameter. For example, to select just one item for each term, code <code>posts_per_term=1</code>.
299
+ </p>
300
+ <p>
301
+ Within each term the order of assigned items is randomized. If you display only some of the assigned items the selection drawn from a given term will change each time the post/page is loaded.
302
+ <a name="shuffle_gallery"></a>
303
+ </p>
304
+ <p>
305
+ <a href="#backtotop">Go to Top</a>
306
+ </p>
307
+ <h3><strong>Ordering the Items - Shuffle Gallery</strong></h3>
308
+ <p>
309
+ Within each random gallery the order of items assigned to a given term is always randomized. In addition, the final order of displayed items across all term values is randomized unless you add a <code>shuffle_gallery=false</code> parameter to the shortcode.
310
+ </p>
311
+ <p>
312
+ When <code>shuffle_gallery=false</code>, The final order of items assigned to different terms is determined in one of three ways:.
313
+ </p>
314
+ <ol class="mla-doc-toc-list">
315
+ <li>If the <code>random_term</code> parameter includes two or more term names, items are displayed in the order of the terms in the list.</li>
316
+ <li>If the <code>random_term</code> parameter is empty, items are displayed in the order of the terms specified in the current random term list.</li>
317
+ <li>If the <code>random_term_list</code> is empty, items are displayed in the order of the term_taxonomy_id values for the random taxonomy.</li>
318
+ </ol>
319
+ <p>
320
+ Of course, you can add <code>orderby</code> and/or <code>orderby</code> parameters to the shortcode. These will overide the order supplied by this plugin with the sorting supplied by the <code>[mla_gallery]</code> shortcode itself.
321
+ <a name="posts_per_page"></a>
322
+ </p>
323
+ <p>
324
+ <a href="#backtotop">Go to Top</a>
325
+ </p>
326
+ <h3><strong>Limiting Total Gallery Items</strong></h3>
327
+ <p>
328
+ You can set an upper bound for the total number of items displayed in the random gallery. For example, to select six items in the gallery, code <code>posts_per_page=6</code> or <code>numberposts=6</code>. Either parameter is passed along with the list of items generated by this plugin and applied when the gallery display is generated by <code>[mla_gallery]</code>.
329
+ </p>
330
+ <p>
331
+ Within each random gallery the final order of displayed items is randomized (unless <code>shuffle_gallery</code> is false). If you display only some of the items the display will change each time the post/page is loaded.
332
+ <a name="examples"></a>
333
+ </p>
334
+ <p>
335
+ <a href="#backtotop">Go to Top</a>
336
+ </p>
337
+ <h3>Examples</h3>
338
+ <p>
339
+ Once the plugin is installed and activated you can visit the General tab on this Settings page to specify the taxonomy and term(s) you want to use as defaults for the random gallery generation. For the examples in this section the following default values are assumed:
340
+ </p>
341
+ <ul class="mla-doc-toc-list">
342
+ <li>
343
+ <strong>Random Taxonomy</strong> - attachment_category
344
+ </li>
345
+ <li>
346
+ <strong>Random Term List</strong> - &ldquo;Category One,second-category,Final Category&rdquo;
347
+ </li>
348
+ <li>
349
+ <strong>Verify Post Attributes</strong> - unchecked (false)
350
+ </li>
351
+ </ul>
352
+ <p>
353
+ It's a little unusual to mix term names (Category One, Final Category) with term slugs (second-category) but the plugin will accept either format. Our first example uses the default settings to display three random galleries on one page:
354
+ </p>
355
+ <blockquote><code>
356
+ &lt;h3&gt;Category One Sample&lt;/h3&gt;<br />
357
+ [mla_gallery random_term=category-one posts_per_page=3]<br />
358
+ &lt;h3&gt;Second Category Sample&lt;/h3&gt;<br />
359
+ [mla_gallery random_term="Second Category" posts_per_page=3]<br />
360
+ &lt;h3&gt;Final Category Sample&lt;/h3&gt;<br />
361
+ [mla_gallery random_term=final-category posts_per_page=3]
362
+ </code></blockquote>
363
+ <p>
364
+ When the first shortcode is encountered the default random taxonomy and random term list are used to find all items assigned to the specified terms. Then, the first shortcode displays three random items assigned to Category One. The next shortcode displays three items from the Second Category and the final shortcode displays three items from the Final Category. Again, the choice to use term names or slugs is up to you, and a mix is shown here.
365
+ </p>
366
+ <p>
367
+ Our second example shows how to overide the default random term list and how to limit the number of items selected from each term:</p>
368
+ <blockquote><code>
369
+ &lt;h3&gt;Category One Sample&lt;/h3&gt;<br />
370
+ [mla_gallery random_term_list=category-one,second-category,third-category random_term=category-one posts_per_page=3]<br />
371
+ &lt;h3&gt;Second and Third Category Samples&lt;/h3&gt;<br />
372
+ [mla_gallery random_term=second-category,third-category posts_per_term=1]<br />
373
+ </code></blockquote>
374
+ <p>
375
+ When the first shortcode is encountered the default random taxonomy and <code>random_term_list</code> parameter are used to find all items assigned to the specified terms. Then, the first shortcode displays three random items assigned to Category One. The second shortcode displays one item from the Second Category and one item from the Third Category.
376
+ </p>
377
+ <p>
378
+ Our third example shows how to easily display a sample item from each of the terms in a taxonomy. Here, the <code>random_term_list</code> parameter is present but empty. This causes the plugin to use <strong>all</strong> of the terms in the random taxonomy to populate the list. The <code>random_term</code> parameter is also present but empty. This causes the plugin to use <strong>all</strong> of the terms in the random term list to populate the gallery:</p>
379
+ <blockquote><code>
380
+ &lt;h3&gt;Portfolio Samples&lt;/h3&gt;<br />
381
+ [mla_gallery posts_per_term=1]<br />
382
+ random_term_list=''<br />
383
+ random_term=''<br />
384
+ [/mla_gallery]
385
+ </code></blockquote>
386
+ <p>
387
+ This example uses the &ldquo;alternate enclosing shortcode&rdquo; format to separate each parameter on its own line for readability. You can mix the enclosing syntax with the standard syntax (the <code>posts_per_term</code> parameter) in the same shortcode. Note that if you have multiple shortcodes on the post/page and use the enclosing syntax you must use it for <strong>all</strong> of the shortcodes adding the closing <code>[/mla_gallery]</code> to each shortcode.
388
+ </p>
389
+ <p>
390
+ Our final example shows a less common use case:</p>
391
+ <blockquote><code>
392
+ &lt;h3&gt;Default taxonomy and list parameters&lt;/h3&gt;<br />
393
+ [mla_gallery random_term=category-one posts_per_page=3]<br />
394
+ &lt;h3&gt;New taxonomy and list parameters&lt;/h3&gt;<br />
395
+ [mla_gallery random_taxonomy=attachment_tag random_term_list='' random_term=third-tag posts_per_term=2]<br />
396
+ &lt;h3&gt;New term, existing taxonomy and list parameters&lt;/h3&gt;<br />
397
+ [mla_gallery random_term=fourth-tag posts_per_term=2]
398
+ </code></blockquote>
399
+ <p>
400
+ When the first shortcode is encountered the default random taxonomy and <code>random_term_list</code> parameter are used to find all items assigned to the specified terms in the <code>attachment_category</code> taxonomy. Then, the first shortcode displays three random items assigned to Category One. The second shortcode uses a different taxonomy and it changes the random term list to use all terms in the new taxonomy. The final shortcode displays another term from the attachment_tag term list.
401
+ </p>
402
+ <p>
403
+ Again, the current version of the plugin generates the random term list and galleries when the first shortcode is processed. Subsequent shortcodes must draw items from the random term list generated by the first shortcode unless they specify a new taxonomy and (probably) a new random term list. When either of these parameters changes, the plugin regenerates the random term list and galleries.
404
+ </p>
405
+ </div>
examples/plugins/mla-random-galleries-example/mla-random-galleries-example.php ADDED
@@ -0,0 +1,727 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Provides [mla_gallery] parameters to select random items from a collection of taxonomy terms
4
+ *
5
+ * Detailed information is in the Settings/MLA Random Galleries Documentation tab.
6
+ *
7
+ * Created for support topic "multiple calls to a smaller amount"
8
+ * opened on 1/16/2016 by "luigsm".
9
+ * https://wordpress.org/support/topic/multiple-calls-to-a-smaller-amount/
10
+ *
11
+ * Enhanced for support topic "Gallery incl control break"
12
+ * opened on 9/17/2020 by "ernstwg".
13
+ * https://wordpress.org/support/topic/gallery-incl-control-break/
14
+ *
15
+ * @package MLA Random Galleries Example
16
+ * @version 1.05
17
+ */
18
+
19
+ /*
20
+ Plugin Name: MLA Random Galleries Example
21
+ Plugin URI: http://davidlingren.com/
22
+ Description: High performance queries for random items from a list of taxonomy terms
23
+ Author: David Lingren
24
+ Version: 1.05
25
+ Author URI: http://davidlingren.com/
26
+
27
+ Copyright 2016-2020 David Lingren
28
+
29
+ This program is free software; you can redistribute it and/or modify
30
+ it under the terms of the GNU General Public License as published by
31
+ the Free Software Foundation; either version 2 of the License, or
32
+ (at your option) any later version.
33
+
34
+ This program is distributed in the hope that it will be useful,
35
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
36
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37
+ GNU General Public License for more details.
38
+
39
+ You can get a copy of the GNU General Public License by writing to the
40
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
41
+ */
42
+
43
+ /**
44
+ * Class MLA Random Galleries Example supplies random items from a collection of taxonomy terms
45
+ *
46
+ * @package MLA Random Galleries Example
47
+ * @since 1.00
48
+ */
49
+ class MLARandomGalleriesExample {
50
+ /**
51
+ * Current version number
52
+ *
53
+ * @since 1.02
54
+ *
55
+ * @var string
56
+ */
57
+ const PLUGIN_VERSION = '1.05';
58
+
59
+ /**
60
+ * Constant to log this plugin's debug activity
61
+ *
62
+ * @since 1.02
63
+ *
64
+ * @var integer
65
+ */
66
+ const MLA_DEBUG_CATEGORY = 0x00008000;
67
+
68
+ /**
69
+ * Slug prefix for registering and enqueueing submenu pages, style sheets, scripts and settings
70
+ *
71
+ * @since 1.02
72
+ *
73
+ * @var string
74
+ */
75
+ const SLUG_PREFIX = 'mlarandomgalleries';
76
+
77
+ /**
78
+ * Initialization function, similar to __construct()
79
+ *
80
+ * @since 1.00
81
+ */
82
+ public static function initialize() {
83
+ // This plugin requires MLA
84
+ if ( ! class_exists( 'MLACore', false ) ) {
85
+ return;
86
+ }
87
+
88
+ if ( is_admin() ) {
89
+ // Add submenu page in the "Settings" section
90
+ add_action( 'admin_menu', 'MLARandomGalleriesExample::admin_menu' );
91
+ return;
92
+ }
93
+
94
+ // These filters are only useful for front-end posts/pages
95
+ add_filter( 'mla_gallery_attributes', 'MLARandomGalleriesExample::mla_gallery_attributes_filter', 10, 1 );
96
+ }
97
+
98
+ /**
99
+ * Add submenu page in the "Settings" section
100
+ *
101
+ * @since 1.02
102
+ */
103
+ public static function admin_menu( ) {
104
+ /*
105
+ * We need a tab-specific page ID to manage the screen options on the General tab.
106
+ * Use the URL suffix, if present. If the URL doesn't have a tab suffix, use '-general'.
107
+ * This hack is required to pass the WordPress "referer" validation.
108
+ */
109
+ if ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) && ( self::SLUG_PREFIX . '-settings-' == substr( $_REQUEST['page'], 0, strlen( self::SLUG_PREFIX . '-settings-' ) ) ) ) {
110
+ $tab = substr( $_REQUEST['page'], strlen( self::SLUG_PREFIX . '-settings-' ) );
111
+ } else {
112
+ $tab = 'general';
113
+ }
114
+
115
+ $tab = self::_get_options_tablist( $tab ) ? '-' . $tab : '-general';
116
+ add_submenu_page( 'options-general.php', 'MLA Random Galleries Example', 'MLA Random Galleries', 'manage_options', self::SLUG_PREFIX . '-settings' . $tab, 'MLARandomGalleriesExample::add_submenu_page' );
117
+ add_filter( 'plugin_action_links', 'MLARandomGalleriesExample::plugin_action_links', 10, 2 );
118
+ }
119
+
120
+ /**
121
+ * Add the "Settings" and "Guide" links to the Plugins section entry
122
+ *
123
+ * @since 1.02
124
+ *
125
+ * @param array array of links for the Plugin, e.g., "Activate"
126
+ * @param string Directory and name of the plugin Index file
127
+ *
128
+ * @return array Updated array of links for the Plugin
129
+ */
130
+ public static function plugin_action_links( $links, $file ) {
131
+ if ( $file == 'mla-random-galleries-example/mla-random-galleries-example.php' ) {
132
+ $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=' . self::SLUG_PREFIX . '-settings-documentation&mla_tab=documentation' ), 'Guide' );
133
+ array_unshift( $links, $settings_link );
134
+ $settings_link = sprintf( '<a href="%s">%s</a>', admin_url( 'options-general.php?page=' . self::SLUG_PREFIX . '-settings-general' ), 'Settings' );
135
+ array_unshift( $links, $settings_link );
136
+ }
137
+
138
+ return $links;
139
+ }
140
+
141
+ /**
142
+ * Render (echo) the "MLA Random Galleries" submenu in the Settings section
143
+ *
144
+ * @since 1.02
145
+ *
146
+ * @return void Echoes HTML markup for the submenu page
147
+ */
148
+ public static function add_submenu_page() {
149
+ if ( !current_user_can( 'manage_options' ) ) {
150
+ echo "<h2>MLA Random Galleries Example - Error</h2>\n";
151
+ wp_die( 'You do not have permission to manage plugin settings.' );
152
+ }
153
+
154
+ // Load template array and initialize page-level values.
155
+ self::$page_template_array = MLACore::mla_load_template( dirname( __FILE__ ) . '/admin-settings-page.tpl', 'path' );
156
+ $current_tab_slug = isset( $_REQUEST['mla_tab'] ) ? $_REQUEST['mla_tab']: 'general';
157
+ $current_tab = self::_get_options_tablist( $current_tab_slug );
158
+ $page_values = array(
159
+ 'version' => 'v' . self::PLUGIN_VERSION,
160
+ 'messages' => '',
161
+ 'tablist' => self::_compose_settings_tabs( $current_tab_slug ),
162
+ 'tab_content' => '',
163
+ );
164
+
165
+ // Compose tab content
166
+ if ( $current_tab ) {
167
+ if ( isset( $current_tab['render'] ) ) {
168
+ $handler = $current_tab['render'];
169
+ $page_content = call_user_func( $handler );
170
+ } else {
171
+ $page_content = array( 'message' => 'ERROR: Cannot render content tab', 'body' => '' );
172
+ }
173
+ } else {
174
+ $page_content = array( 'message' => 'ERROR: Unknown content tab', 'body' => '' );
175
+ }
176
+
177
+ if ( ! empty( $page_content['message'] ) ) {
178
+ if ( false !== strpos( $page_content['message'], 'ERROR' ) ) {
179
+ $messages_class = 'updated error';
180
+ $dismiss_button = '';
181
+ } else {
182
+ $messages_class = 'updated notice is-dismissible';
183
+ $dismiss_button = " <button class=\"notice-dismiss\" type=\"button\"><span class=\"screen-reader-text\">[+dismiss_text+].</span></button>\n";
184
+ }
185
+
186
+ $page_values['messages'] = MLAData::mla_parse_template( self::$page_template_array['messages'], array(
187
+ 'mla_messages_class' => $messages_class ,
188
+ 'messages' => $page_content['message'],
189
+ 'dismiss_button' => $dismiss_button,
190
+ 'dismiss_text' => 'Dismiss this notice',
191
+ ) );
192
+ }
193
+
194
+ $page_values['tab_content'] = $page_content['body'];
195
+ echo MLAData::mla_parse_template( self::$page_template_array['page'], $page_values );
196
+ }
197
+
198
+ /**
199
+ * Template file for the Settings page(s) and parts
200
+ *
201
+ * This array contains all of the template parts for the Settings page(s). The array is built once
202
+ * each page load and cached for subsequent use.
203
+ *
204
+ * @since 1.02
205
+ *
206
+ * @var array
207
+ */
208
+ public static $page_template_array = NULL;
209
+
210
+ /**
211
+ * Definitions for Settings page tab ids, titles and handlers
212
+ * Each tab is defined by an array with the following elements:
213
+ *
214
+ * array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
215
+ *
216
+ * title => tab label / heading text
217
+ * render => rendering function for tab messages and content. Usage:
218
+ * $tab_content = ['render']( );
219
+ *
220
+ * @since 1.02
221
+ *
222
+ * @var array
223
+ */
224
+ private static $mla_tablist = array(
225
+ 'general' => array( 'title' => 'General', 'render' => array( 'MLARandomGalleriesExample', '_compose_general_tab' ) ),
226
+ 'documentation' => array( 'title' => 'Documentation', 'render' => array( 'MLARandomGalleriesExample', '_compose_documentation_tab' ) ),
227
+ );
228
+
229
+ /**
230
+ * Retrieve the list of options tabs or a specific tab value
231
+ *
232
+ * @since 1.02
233
+ *
234
+ * @param string Tab slug, to retrieve a single entry
235
+ *
236
+ * @return array|false The entire tablist ( $tab = NULL ), a single tab entry or false if not found/not allowed
237
+ */
238
+ private static function _get_options_tablist( $tab = NULL ) {
239
+ if ( is_string( $tab ) ) {
240
+ if ( isset( self::$mla_tablist[ $tab ] ) ) {
241
+ $results = self::$mla_tablist[ $tab ];
242
+ } else {
243
+ $results = false;
244
+ }
245
+ } else {
246
+ $results = self::$mla_tablist;
247
+ }
248
+
249
+ return $results;
250
+ }
251
+
252
+ /**
253
+ * Compose the navigation tabs for the Settings subpage
254
+ *
255
+ * @since 1.02
256
+ * @uses $page_template_array contains tablist and tablist-item templates
257
+ *
258
+ * @param string Optional data-tab-id value for the active tab, default 'general'
259
+ *
260
+ * @return string HTML markup for the Settings subpage navigation tabs
261
+ */
262
+ private static function _compose_settings_tabs( $active_tab = 'general' ) {
263
+ $tablist_item = self::$page_template_array['tablist-item'];
264
+ $tabs = '';
265
+ foreach ( self::_get_options_tablist() as $key => $item ) {
266
+ $item_values = array(
267
+ 'data-tab-id' => $key,
268
+ 'nav-tab-active' => ( $active_tab == $key ) ? 'nav-tab-active' : '',
269
+ 'settings-page' => self::SLUG_PREFIX . '-settings-' . $key,
270
+ 'title' => $item['title']
271
+ );
272
+
273
+ $tabs .= MLAData::mla_parse_template( $tablist_item, $item_values );
274
+ } // foreach $item
275
+
276
+ $tablist_values = array( 'tablist' => $tabs );
277
+ return MLAData::mla_parse_template( self::$page_template_array['tablist'], $tablist_values );
278
+ }
279
+
280
+ /**
281
+ * Compose the General tab content for the Settings subpage
282
+ *
283
+ * @since 1.02
284
+ * @uses $page_template_array contains tab content template(s)
285
+ *
286
+ * @return array 'message' => status/error messages, 'body' => tab content
287
+ */
288
+ private static function _compose_general_tab( ) {
289
+ $page_content = array( 'message' => '', 'body' => '' );
290
+
291
+ // Initialize page messages and content, check for page-level Save Changes
292
+ if ( !empty( $_REQUEST['mla-random-galleries-options-save'] ) ) {
293
+ check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
294
+ $page_content = self::_save_setting_changes( );
295
+ }
296
+
297
+ if ( !empty( $page_content['body'] ) ) {
298
+ return $page_content;
299
+ }
300
+
301
+ // Display the General tab
302
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array(
303
+ 'mla_random_galleries_options',
304
+ '_wpnonce',
305
+ '_wp_http_referer',
306
+ 'mla-random-galleries-options-save',
307
+ ), $_SERVER['REQUEST_URI'] );
308
+
309
+ // Compose page-level options
310
+ $page_values = array(
311
+ 'random_taxonomy' => self::_get_plugin_option('random_taxonomy'),
312
+ 'random_term_list' => self::_get_plugin_option('random_term_list'),
313
+ 'verify_post_attributes_checked' => self::_get_plugin_option('verify_post_attributes') ? 'checked="checked" ' : '',
314
+ );
315
+ $options_list = MLAData::mla_parse_template( self::$page_template_array['page-level-options'], $page_values );
316
+
317
+ $form_arguments = '?page=' . self::SLUG_PREFIX . '-settings-general&mla_tab=general';
318
+
319
+ $page_values = array(
320
+ 'form_url' => admin_url( 'options-general.php' ) . $form_arguments,
321
+ '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
322
+ 'options_list' => $options_list,
323
+ );
324
+
325
+ $page_content['body'] .= MLAData::mla_parse_template( self::$page_template_array['general-tab'], $page_values );
326
+
327
+ return $page_content;
328
+ }
329
+
330
+ /**
331
+ * Compose the General tab content for the Settings subpage
332
+ *
333
+ * @since 1.02
334
+ * @uses $page_template_array contains tab content template(s)
335
+ *
336
+ * @return array 'message' => status/error messages, 'body' => tab content
337
+ */
338
+ private static function _compose_documentation_tab( ) {
339
+ $page_content = array( 'message' => '', 'body' => '' );
340
+ $page_values = array(
341
+ );
342
+
343
+ $page_content['body'] = MLAData::mla_parse_template( self::$page_template_array['documentation-tab'], $page_values );
344
+ return $page_content;
345
+ }
346
+
347
+ /**
348
+ * Save settings as a WordPress wp_options entry
349
+ *
350
+ * @since 1.02
351
+ *
352
+ * @return array 'message' => status/error messages, 'body' => tab content
353
+ */
354
+ private static function _save_setting_changes() {
355
+ $page_content = array( 'message' => 'Settings unchanged.', 'body' => '' );
356
+
357
+ // random_taxonomy cannot be empty
358
+ if ( empty( $_REQUEST[ 'mla_random_galleries_options' ]['random_taxonomy'] ) ) {
359
+ $_REQUEST[ 'mla_random_galleries_options' ]['random_taxonomy'] = self::$_default_settings['random_taxonomy'];
360
+ }
361
+
362
+ $changed = self::_update_plugin_option( 'random_taxonomy', $_REQUEST[ 'mla_random_galleries_options' ]['random_taxonomy'] );
363
+ $changed |= self::_update_plugin_option( 'random_term_list', $_REQUEST[ 'mla_random_galleries_options' ]['random_term_list'] );
364
+ $changed |= self::_update_plugin_option( 'verify_post_attributes', isset( $_REQUEST[ 'mla_random_galleries_options' ]['verify_post_attributes'] ) );
365
+
366
+ if ( $changed ) {
367
+ // No reason to save defaults in the database
368
+ if ( self::$_settings === self::$_default_settings ) {
369
+ delete_option( self::SLUG_PREFIX . '-settings' );
370
+ } else {
371
+ $changed = update_option( self::SLUG_PREFIX . '-settings', self::$_settings, false );
372
+ }
373
+
374
+ if ( $changed ) {
375
+ $page_content['message'] = "Settings have been updated.";
376
+ } else {
377
+ $page_content['message'] = "Settings updated failed.";
378
+ }
379
+ }
380
+
381
+ return $page_content;
382
+ } // _save_setting_changes
383
+
384
+ /**
385
+ * Assemble the in-memory representation of the plugin settings
386
+ *
387
+ * @since 1.02
388
+ *
389
+ * @param boolean $force_refresh Optional. Force a reload of rules. Default false.
390
+ *
391
+ * @return boolean Success (true) or failure (false) of the operation
392
+ */
393
+ private static function _get_plugin_settings( $force_refresh = false ) {
394
+ if ( false == $force_refresh && NULL != self::$_settings ) {
395
+ return true;
396
+ }
397
+
398
+ // Update the plugin options from the wp_options table or set defaults
399
+ self::$_settings = get_option( self::SLUG_PREFIX . '-settings' );
400
+ if ( !is_array( self::$_settings ) ) {
401
+ self::$_settings = self::$_default_settings;
402
+ }
403
+
404
+ return true;
405
+ }
406
+
407
+ /**
408
+ * In-memory representation of the option settings
409
+ *
410
+ * @since 1.02
411
+ *
412
+ * @var array $_settings {
413
+ * @type string $random_taxonomy The taxonomy to select terms from
414
+ * @type string $random_term_list complete comma-delimited list of terms to select from.
415
+ * If empty, all terms in the taxonomy are processed.
416
+ * @type boolean $verify_post_attributes True to add a post_type=attachment check to the database query
417
+ * }
418
+ */
419
+ private static $_settings = NULL;
420
+
421
+ /**
422
+ * Default processing options
423
+ *
424
+ * @since 1.02
425
+ *
426
+ * @var array
427
+ */
428
+ private static $_default_settings = array (
429
+ 'random_taxonomy' => 'attachment_category',
430
+ 'random_term_list' => 'Colorado River,admin',
431
+ 'verify_post_attributes' => false,
432
+ );
433
+
434
+ /**
435
+ * Get a plugin option setting
436
+ *
437
+ * @since 1.02
438
+ *
439
+ * @param string $name Option name
440
+ *
441
+ * @return mixed Option value, if it exists else NULL
442
+ */
443
+ private static function _get_plugin_option( $name ) {
444
+ if ( !self::_get_plugin_settings() ) {
445
+ return NULL;
446
+ }
447
+
448
+ if ( !isset( self::$_settings[ $name ] ) ) {
449
+ return NULL;
450
+ }
451
+
452
+ return self::$_settings[ $name ];
453
+ }
454
+
455
+ /**
456
+ * Update a plugin option setting
457
+ *
458
+ * @since 1.02
459
+ *
460
+ * @param string $name Option name
461
+ * @param mixed $new_value Option value
462
+ *
463
+ * @return mixed True if option value changed, false if value unchanged, NULL if failure
464
+ */
465
+ private static function _update_plugin_option( $name, $new_value ) {
466
+ if ( !self::_get_plugin_settings() ) {
467
+ return NULL;
468
+ }
469
+
470
+ $old_value = isset( self::$_settings[ $name ] ) ? self::$_settings[ $name ] : NULL;
471
+
472
+ if ( $new_value === $old_value ) {
473
+ return false;
474
+ }
475
+
476
+ self::$_settings[ $name ] = $new_value;
477
+ return true;
478
+ }
479
+
480
+ /**
481
+ * Save the random galleries
482
+ *
483
+ * @since 1.00
484
+ *
485
+ * @var array
486
+ */
487
+ private static $random_galleries = NULL;
488
+
489
+ /**
490
+ * List of term names/slugs for the galleries
491
+ *
492
+ * Populated from the plugin option settings or a shortcode parameter.
493
+ *
494
+ * @since 1.00
495
+ *
496
+ * @var array
497
+ */
498
+ private static $gallery_terms = array();
499
+
500
+ /**
501
+ * MLA Gallery (Display) Attributes
502
+ *
503
+ * The $shortcode_attributes array is where you will find any of your own parameters that are coded in the
504
+ * shortcode, e.g., [mla_gallery random_term="abc"].
505
+ *
506
+ * @since 1.00
507
+ *
508
+ * @param array the shortcode parameters passed in to the shortcode
509
+ */
510
+ public static function mla_gallery_attributes_filter( $shortcode_attributes ) {
511
+ global $wpdb;
512
+ static $current_taxonomy = NULL, $current_term_list = NULL;
513
+
514
+ MLACore::mla_debug_add( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter shortcode_attributes = ' . var_export( $shortcode_attributes, true ), self::MLA_DEBUG_CATEGORY );
515
+
516
+ $primary_arguments = array(
517
+ 'random_taxonomy' => NULL, // If not supplied, a plugin option gives a default value
518
+ 'random_term_list' => NULL, // If the parameter is present but empty, all terms in the taxonomy are processed.
519
+ 'verify_post_attributes' => NULL, // Add database validation of wp_posts attributes
520
+ 'random_term' => NULL, // If the parameter is present but empty, all terms in the taxonomy are displayed.
521
+ 'posts_per_term' => '0', // how many images per term to display.
522
+ 'shuffle_gallery' => NULL, // apply random order to final item list
523
+ );
524
+
525
+ $secondary_arguments = array(
526
+ 'post_type' => 'attachment',
527
+ 'post_status' => 'inherit',
528
+ 'post_mime_type' => 'image',
529
+ );
530
+
531
+ // Find the plugin's unique arguments and supply defaults
532
+ $arguments = shortcode_atts( $primary_arguments, $shortcode_attributes );
533
+
534
+ if ( NULL !== $arguments['verify_post_attributes'] ) {
535
+ // Convert checkbox option to boolean
536
+ if ( $arguments['verify_post_attributes'] ) {
537
+ $arguments['verify_post_attributes'] = 'true' === strtolower( trim( $arguments['verify_post_attributes'] ) );;
538
+ } else {
539
+ $arguments['verify_post_attributes'] = false;
540
+ }
541
+ }
542
+
543
+ if ( NULL !== $arguments['shuffle_gallery'] ) {
544
+ // Convert checkbox option to boolean
545
+ if ( $arguments['shuffle_gallery'] ) {
546
+ $arguments['shuffle_gallery'] = 'true' === strtolower( trim( $arguments['shuffle_gallery'] ) );;
547
+ } else {
548
+ $arguments['shuffle_gallery'] = false;
549
+ }
550
+ } else {
551
+ $arguments['shuffle_gallery'] = true;
552
+ }
553
+
554
+ // ignore shortcodes without any of the "random galleries" parameters
555
+ if ( $arguments === $primary_arguments ) {
556
+ return $shortcode_attributes;
557
+ }
558
+
559
+ // Add the additional, optional, arguments used by the plugin
560
+ $arguments = array_merge( $arguments, shortcode_atts( $secondary_arguments, $shortcode_attributes ) );
561
+ //error_log( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter complete arguments = ' . var_export( $arguments, true ), 0 );
562
+
563
+ if ( is_null( $arguments['verify_post_attributes'] ) ) {
564
+ $arguments['verify_post_attributes'] = self::_get_plugin_option( 'verify_post_attributes' );
565
+ }
566
+
567
+ MLACore::mla_debug_add( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter arguments = ' . var_export( $arguments, true ), self::MLA_DEBUG_CATEGORY );
568
+
569
+ // Get the taxonomy
570
+ if ( empty( $arguments['random_taxonomy'] ) ) {
571
+ if ( NULL === $current_taxonomy ) {
572
+ $random_taxonomy = self::_get_plugin_option( 'random_taxonomy' );
573
+ } else {
574
+ $random_taxonomy = $current_taxonomy;
575
+ }
576
+ } else {
577
+ $random_taxonomy = $arguments['random_taxonomy'];
578
+ }
579
+
580
+ // Get term list slug values
581
+ if ( NULL === $arguments['random_term_list'] ) {
582
+ if ( NULL === $current_term_list ) {
583
+ $new_term_list = self::_get_plugin_option( 'random_term_list' );
584
+ } else {
585
+ $new_term_list = $current_term_list;
586
+ }
587
+ } else {
588
+ $new_term_list = $arguments['random_term_list'];
589
+ }
590
+
591
+ // For each new combination of taxonomy and term list, compute the random galleries just once
592
+ if ( ( $current_taxonomy !== $random_taxonomy ) || ( $current_term_list !== $new_term_list ) ) {
593
+ $current_taxonomy = $random_taxonomy;
594
+ $current_term_list = $new_term_list;
595
+ self::$random_galleries = array();
596
+
597
+ if ( empty( trim( $new_term_list ) ) ) {
598
+ self::$gallery_terms = MLAQuery::mla_wp_get_terms( $random_taxonomy, array( 'fields' => 'slugs', 'hide_empty' => false ) );
599
+ } else {
600
+ self::$gallery_terms = explode( ',', $new_term_list );
601
+ }
602
+
603
+ foreach ( self::$gallery_terms as $index => $term ) {
604
+ self::$gallery_terms[ $index ] = esc_sql( sanitize_term_field( 'slug', $term, 0, $random_taxonomy, 'db' ) );
605
+ }
606
+ $slugs = "'" . implode( "','", self::$gallery_terms ) . "'";
607
+ self::$gallery_terms = array_flip( self::$gallery_terms );
608
+
609
+ // Prepare the array for term validation after the database query
610
+ foreach ( self::$gallery_terms as $term => $index ) {
611
+ self::$gallery_terms[ $term ] = 0;
612
+ }
613
+
614
+ //error_log( __LINE__ . " MLARandomGalleriesExample::mla_gallery_attributes_filter gallery_terms ({$random_taxonomy}) = " . var_export( self::$gallery_terms, true ), 0 );
615
+
616
+ // Build an array of ( slug => term_taxonomy_id )
617
+ $terms_query = sprintf( 'SELECT term_id, slug FROM %1$s WHERE ( slug IN ( %2$s ) ) ORDER BY term_id', $wpdb->terms, $slugs );
618
+ $_terms_taxonomy_query = sprintf( 'SELECT term_taxonomy_id, term_id FROM %1$s WHERE ( taxonomy=\'%2$s\' ) ORDER BY term_id', $wpdb->term_taxonomy, $random_taxonomy );
619
+
620
+ $query = sprintf( 'SELECT tt.term_taxonomy_id, t.term_id, t.slug FROM ( %1$s ) as tt JOIN ( %2$s ) as t ON ( tt.term_id = t.term_id ) ORDER BY term_taxonomy_id', $_terms_taxonomy_query, $terms_query, $slugs );
621
+ $results = $wpdb->get_results( $query );
622
+ //error_log( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter results = ' . var_export( $results, true ), 0 );
623
+
624
+ // self::$gallery_terms = array();
625
+ foreach ( $results as $result ) {
626
+ self::$gallery_terms[ $result->slug ] = absint( $result->term_taxonomy_id );
627
+ }
628
+ unset( $results );
629
+
630
+ // Discard terms that do not appear in the taxonomy
631
+ foreach ( self::$gallery_terms as $term => $index ) {
632
+ if ( 0 === self::$gallery_terms[ $term ] ) {
633
+ unset ( self::$gallery_terms[ $term ] );
634
+ }
635
+ }
636
+
637
+ MLACore::mla_debug_add( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter gallery_terms = ' . var_export( self::$gallery_terms, true ), self::MLA_DEBUG_CATEGORY );
638
+
639
+ if ( !empty( self::$gallery_terms ) ) {
640
+ // Build an array of ( term_taxonomy_id => array( IDs of items assigned to the term )
641
+ $term_taxonomy_ids = implode( ',', array_values( self::$gallery_terms ) );
642
+
643
+ // Verifying the post attributes requires a slower database query involving the wp_posts table
644
+ if ( $arguments['verify_post_attributes'] ) {
645
+ $post_type = "'" . implode( "','", explode( ',', $arguments['post_type'] ) ) . "'";
646
+ $post_status = "'" . implode( "','", explode( ',', $arguments['post_status'] ) ) . "'";
647
+
648
+ if ( 'all' !== strtolower( $arguments['post_mime_type'] ) ) {
649
+ $post_mime_type = str_replace( '%', '%%', wp_post_mime_type_where( $arguments['post_mime_type'], 'p' ) );
650
+ }
651
+
652
+ $query = sprintf( 'SELECT object_id, term_taxonomy_id FROM %1$s AS tr INNER JOIN %2$s AS p ON tr.object_id = p.ID WHERE ( tr.term_taxonomy_id IN ( %3$s ) AND ( p.post_type IN ( %4$s ) ) AND ( p.post_status IN ( %5$s ) ) %6$s ) ORDER BY RAND()', $wpdb->term_relationships, $wpdb->posts, $term_taxonomy_ids, $post_type, $post_status, $post_mime_type );
653
+ } else {
654
+ $query = sprintf( 'SELECT object_id, term_taxonomy_id FROM %1$s WHERE ( term_taxonomy_id IN ( %2$s ) ) ORDER BY RAND()', $wpdb->term_relationships, $term_taxonomy_ids );
655
+ }
656
+
657
+ $results = $wpdb->get_results( $query );
658
+ //error_log( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter results = ' . var_export( $results, true ), 0 );
659
+
660
+ foreach ( $results as $result ) {
661
+ self::$random_galleries[ $result->term_taxonomy_id ][] = absint( $result->object_id );
662
+ }
663
+ unset( $results );
664
+ }
665
+
666
+ $version = self::PLUGIN_VERSION;
667
+ MLACore::mla_debug_add( __LINE__ . " MLARandomGalleriesExample::mla_gallery_attributes_filter v{$version} random_galleries = " . var_export( self::$random_galleries, true ), self::MLA_DEBUG_CATEGORY );
668
+ } // New combination of taxonomy and term list
669
+
670
+ if ( NULL === $arguments['random_term'] ) {
671
+ $ids = '0'; // display an empty gallery
672
+ } else {
673
+ // Present but empty => use all of the random gallery terms
674
+ if ( empty( $arguments['random_term'] ) ) {
675
+ $arguments['random_term'] = implode( ',', array_keys( self::$gallery_terms ) );
676
+ }
677
+
678
+ $ids = array();
679
+ $posts_per_term = absint( $arguments['posts_per_term'] );
680
+
681
+ foreach ( explode( ',', $arguments['random_term'] ) as $random_term ) {
682
+ // Convert the parameter value to a sanitized slug value
683
+ $random_slug = esc_sql( sanitize_term_field( 'slug', $random_term, 0, $random_taxonomy, 'db' ) );
684
+
685
+ // Make sure the parameter matches a value in the random galleries
686
+ if ( isset( self::$gallery_terms[ $random_slug ] ) ) {
687
+ $term_taxonomy_id = self::$gallery_terms[ $random_slug ];
688
+ // Some terms may not have any assigned items
689
+ $random_gallery = isset( self::$random_galleries[ $term_taxonomy_id ] ) ? self::$random_galleries[ $term_taxonomy_id ] : array();
690
+
691
+ // Filter out duplicate items, e.g. assigned to multiple terms
692
+ foreach ( $random_gallery as $index => $item ) {
693
+ if ( in_array( $item, $ids ) ) {
694
+ unset( $random_gallery[ $index ] );
695
+ }
696
+ }
697
+
698
+ if ( $posts_per_term ) {
699
+ $ids = array_merge( $ids, array_slice( $random_gallery, 0, $posts_per_term, true ) );
700
+ } else {
701
+ $ids = array_merge( $ids, $random_gallery );
702
+ }
703
+ }
704
+ //error_log( __LINE__ . " MLARandomGalleriesExample::mla_gallery_attributes_filter ids after {$random_slug} = " . var_export( $ids, true ), 0 );
705
+ } // foreach random_term
706
+
707
+ // Randomize the result set
708
+ if ( $arguments['shuffle_gallery'] ) {
709
+ shuffle( $ids );
710
+ }
711
+ //error_log( __LINE__ . " MLARandomGalleriesExample::mla_gallery_attributes_filter ids after shuffle = " . var_export( $ids, true ), 0 );
712
+ }
713
+
714
+ foreach ( $primary_arguments as $key => $value ) {
715
+ unset( $shortcode_attributes[ $key ] );
716
+ }
717
+
718
+ $shortcode_attributes['ids'] = !empty( $ids ) ? implode( ',', $ids ) : '0';
719
+
720
+ MLACore::mla_debug_add( __LINE__ . ' MLARandomGalleriesExample::mla_gallery_attributes_filter shortcode_attributes = ' . var_export( $shortcode_attributes, true ), self::MLA_DEBUG_CATEGORY );
721
+ return $shortcode_attributes;
722
+ } // mla_gallery_attributes_filter
723
+ } // Class MLARandomGalleriesExample
724
+
725
+ // Install the filters at an early opportunity
726
+ add_action('init', 'MLARandomGalleriesExample::initialize');
727
+ ?>
includes/class-mla-ajax.php CHANGED
@@ -161,11 +161,14 @@ class MLA_Ajax {
161
  * For flat taxonomies that use the checklist meta box, substitute our own handler
162
  * for /wp-admin/includes/ajax-actions.php function _wp_ajax_add_hierarchical_term().
163
  */
164
- if ( ( defined('DOING_AJAX') && DOING_AJAX ) && ( 'add-' == substr( $_REQUEST['action'], 0, 4 ) ) ) {
165
- $key = substr( $_REQUEST['action'], 4 );
166
- if ( MLACore::mla_taxonomy_support( $key, 'flat-checklist' ) ) {
167
- self::_mla_ajax_add_flat_term( $key );
168
- /* note: this function sends an Ajax response and then dies; no return */
 
 
 
169
  }
170
  }
171
 
@@ -186,13 +189,14 @@ class MLA_Ajax {
186
  */
187
  private static function _mla_ajax_add_flat_term( $key ) {
188
  $taxonomy = get_taxonomy( $key );
189
- check_ajax_referer( $_REQUEST['action'], '_ajax_nonce-add-' . $key, true );
190
 
191
  if ( !current_user_can( $taxonomy->cap->edit_terms ) ) {
192
  wp_die( -1 );
193
  }
194
 
195
- $new_names = explode( ',', $_POST[ 'new' . $key ] );
 
196
  $new_terms_markup = '';
197
  foreach( $new_names as $name ) {
198
  if ( '' === sanitize_title( $name ) ) {
@@ -249,7 +253,7 @@ class MLA_Ajax {
249
  if ( empty( $_REQUEST['mla_item'] ) ) {
250
  $download_args['error'] = 'ERROR: mla_item argument not set.';
251
  } else {
252
- $item_name = $_REQUEST['mla_item'];
253
  $args = array(
254
  'name' => $item_name,
255
  'post_type' => 'attachment',
@@ -266,7 +270,7 @@ class MLA_Ajax {
266
  $download_args['mla_download_type'] = $items[0]->post_mime_type;
267
 
268
  if ( !empty( $_REQUEST['mla_disposition'] ) ) {
269
- $download_args['mla_disposition'] = $_REQUEST['mla_disposition'];
270
  }
271
  } else {
272
  $download_args['error'] = 'ERROR: mla_item no attached file.';
@@ -276,7 +280,7 @@ class MLA_Ajax {
276
  }
277
  }
278
 
279
- MLAFileDownloader::$mla_debug = isset( $_REQUEST['mla_debug'] ) && 'log' == $_REQUEST['mla_debug'];
280
  MLAFileDownloader::mla_process_download_file( $download_args );
281
 
282
  MLACore::mla_debug_add( __LINE__ . " MLA_Ajax::mla_named_transfer_ajax_action failed. \$_REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
@@ -302,12 +306,13 @@ class MLA_Ajax {
302
  $post_types = get_post_types( array( 'public' => true ), 'objects' );
303
  unset( $post_types['attachment'] );
304
 
305
- $s = stripslashes( $_REQUEST['mla_set_parent_search_text'] );
306
- $count = isset( $_REQUEST['mla_set_parent_count'] ) ? $_REQUEST['mla_set_parent_count'] : 50;
307
- $paged = isset( $_REQUEST['mla_set_parent_paged'] ) ? $_REQUEST['mla_set_parent_paged'] : 1;
308
 
 
309
  $args = array(
310
- 'post_type' => ( 'all' == $_REQUEST['mla_set_parent_post_type'] ) ? array_keys( $post_types ) : $_REQUEST['mla_set_parent_post_type'],
311
  'post_status' => 'any',
312
  'posts_per_page' => $count,
313
  'paged' => $paged,
@@ -387,14 +392,14 @@ class MLA_Ajax {
387
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
388
 
389
  if ( empty( $_REQUEST['post_ID'] ) ) {
390
- echo __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'No post ID found', 'media-library-assistant' );
391
  die();
392
  } else {
393
- $post_id = $_REQUEST['post_ID'];
394
  }
395
 
396
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
397
- wp_die( __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) );
398
  }
399
 
400
  if ( ! class_exists( 'MLAData' ) ) {
@@ -404,7 +409,7 @@ class MLA_Ajax {
404
 
405
  $results = MLAData::mla_update_single_item( $post_id, $_REQUEST );
406
  if ( false !== strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
407
- wp_die( $results['message'] );
408
  }
409
 
410
  $new_item = (object) MLAData::mla_get_attachment_by_id( $post_id );
161
  * For flat taxonomies that use the checklist meta box, substitute our own handler
162
  * for /wp-admin/includes/ajax-actions.php function _wp_ajax_add_hierarchical_term().
163
  */
164
+ if ( defined('DOING_AJAX') && DOING_AJAX ) {
165
+ $action = sanitize_text_field( isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : '' );
166
+ if ( 'add-' === substr( $action, 0, 4 ) ) {
167
+ $key = substr( $action, 4 );
168
+ if ( MLACore::mla_taxonomy_support( $key, 'flat-checklist' ) ) {
169
+ // note: this function sends an Ajax response and then dies; no return
170
+ self::_mla_ajax_add_flat_term( $key );
171
+ }
172
  }
173
  }
174
 
189
  */
190
  private static function _mla_ajax_add_flat_term( $key ) {
191
  $taxonomy = get_taxonomy( $key );
192
+ check_ajax_referer( sanitize_text_field( isset( $_REQUEST['action'] ) ? wp_unslash( $_REQUEST['action'] ) : '' ), '_ajax_nonce-add-' . $key, true );
193
 
194
  if ( !current_user_can( $taxonomy->cap->edit_terms ) ) {
195
  wp_die( -1 );
196
  }
197
 
198
+ $new_names = sanitize_text_field( isset( $_POST[ 'new' . $key ] ) ? wp_unslash( $_POST[ 'new' . $key ] ) : '' );
199
+ $new_names = explode( ',', $new_names );
200
  $new_terms_markup = '';
201
  foreach( $new_names as $name ) {
202
  if ( '' === sanitize_title( $name ) ) {
253
  if ( empty( $_REQUEST['mla_item'] ) ) {
254
  $download_args['error'] = 'ERROR: mla_item argument not set.';
255
  } else {
256
+ $item_name = sanitize_title( isset( $_REQUEST['mla_item'] ) ? wp_unslash( $_REQUEST['mla_item'] ) : '' );
257
  $args = array(
258
  'name' => $item_name,
259
  'post_type' => 'attachment',
270
  $download_args['mla_download_type'] = $items[0]->post_mime_type;
271
 
272
  if ( !empty( $_REQUEST['mla_disposition'] ) ) {
273
+ $download_args['mla_disposition'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_disposition'] ) );
274
  }
275
  } else {
276
  $download_args['error'] = 'ERROR: mla_item no attached file.';
280
  }
281
  }
282
 
283
+ MLAFileDownloader::$mla_debug = 'log' === sanitize_text_field( isset( $_REQUEST['mla_debug'] ) ? wp_unslash( $_REQUEST['mla_debug'] ) : 'false' );
284
  MLAFileDownloader::mla_process_download_file( $download_args );
285
 
286
  MLACore::mla_debug_add( __LINE__ . " MLA_Ajax::mla_named_transfer_ajax_action failed. \$_REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
306
  $post_types = get_post_types( array( 'public' => true ), 'objects' );
307
  unset( $post_types['attachment'] );
308
 
309
+ $s = sanitize_text_field( isset( $_REQUEST['mla_set_parent_search_text'] ) ? wp_unslash( $_REQUEST['mla_set_parent_search_text'] ) : '' );
310
+ $count = isset( $_REQUEST['mla_set_parent_count'] ) ? absint( $_REQUEST['mla_set_parent_count'] ) : 50;
311
+ $paged = isset( $_REQUEST['mla_set_parent_paged'] ) ? absint( $_REQUEST['mla_set_parent_paged'] ) : 1;
312
 
313
+ $post_type = sanitize_text_field( isset( $_REQUEST['mla_set_parent_post_type'] ) ? wp_unslash( $_REQUEST['mla_set_parent_post_type'] ) : 'all' );
314
  $args = array(
315
+ 'post_type' => ( 'all' == $post_type ) ? array_keys( $post_types ) : $post_type,
316
  'post_status' => 'any',
317
  'posts_per_page' => $count,
318
  'paged' => $paged,
392
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
393
 
394
  if ( empty( $_REQUEST['post_ID'] ) ) {
395
+ echo esc_html( __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'No post ID found', 'media-library-assistant' ) );
396
  die();
397
  } else {
398
+ $post_id = absint( $_REQUEST['post_ID'] );
399
  }
400
 
401
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
402
+ wp_die( esc_html( __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) ) );
403
  }
404
 
405
  if ( ! class_exists( 'MLAData' ) ) {
409
 
410
  $results = MLAData::mla_update_single_item( $post_id, $_REQUEST );
411
  if ( false !== strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
412
+ wp_die( esc_html( $results['message'] ) );
413
  }
414
 
415
  $new_item = (object) MLAData::mla_get_attachment_by_id( $post_id );
includes/class-mla-core.php CHANGED
@@ -21,7 +21,7 @@ class MLACore {
21
  *
22
  * @var string
23
  */
24
- const CURRENT_MLA_VERSION = '2.84';
25
 
26
  /**
27
  * Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)
@@ -389,6 +389,11 @@ class MLACore {
389
  MLACore::$process_mla_gallery_in = false;
390
  }
391
 
 
 
 
 
 
392
  /*
393
  * Look for redirects from the Media/Edit Media screen when it was picked from the
394
  * "Edit" rollover action on the Media/Assistant submenu
@@ -412,7 +417,7 @@ class MLACore {
412
 
413
  if ( $user_id && $not_super_admin ) {
414
  if ( isset( $_COOKIE['wp-settings-' . $user_id] ) ) {
415
- $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user_id] );
416
  } else {
417
  $cookie = (string) get_user_option( 'user-settings', $user_id );
418
  }
@@ -457,6 +462,31 @@ class MLACore {
457
  }
458
  }
459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  /**
461
  * Ensures that MLA media manager enhancements are present when required.
462
  * Declared public because it is a filter.
@@ -610,10 +640,10 @@ class MLACore {
610
  MLACore::mla_debug_add( __LINE__ . sprintf( ' MLACore::mla_plugins_loaded_action() MLA %s (%s) mla_debug_level 0x%X', MLACore::CURRENT_MLA_VERSION, MLA::MLA_DEVELOPMENT_VERSION, MLACore::$mla_debug_level, true ), MLACore::MLA_DEBUG_CATEGORY_ANY );
611
 
612
  if ( ( MLACore::$mla_debug_level & MLACore::MLA_DEBUG_CATEGORY_METADATA ) && isset( $_SERVER['REQUEST_URI'] ) ) {
613
- $is_wplr_sync = false !== strpos( $_SERVER['REQUEST_URI'], '/?wplr-sync-api' );
614
- MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action( {$is_wplr_sync} ) \$_SERVER[REQUEST_URI] = " . var_export( $_SERVER['REQUEST_URI'], true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
615
  if ( $is_wplr_sync && isset( $_POST['action'] ) ) {
616
- MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action wplr action = " . var_export( $_POST['action'], true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
617
  }
618
  }
619
  }
@@ -630,8 +660,8 @@ class MLACore {
630
  }
631
 
632
  // WP REST API calls need everything loaded to process uploads
633
- if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json/' ) ) {
634
- MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json REQUEST_URI = " . var_export( $_SERVER['REQUEST_URI'], true ), MLACore::MLA_DEBUG_CATEGORY_REST );
635
  //MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _GET = " . var_export( $_GET, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
636
  //MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _POST = " . var_export( $_POST, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
637
  MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
@@ -676,11 +706,11 @@ class MLACore {
676
  * @param int $status Status code to use.
677
  */
678
  public static function mla_wp_redirect_filter( $location, $status ) {
679
- /*
680
- * Check for Update, Trash or Delete Permanently on Media/Edit Media screen,
681
- */
682
  if ( ( false !== strpos( $location, 'upload.php?' ) ) || ( false !== strpos( $location, 'post.php?' ) ) ) {
683
- $location = add_query_arg( array( 'mla_source' => $_REQUEST['mla_source'] ), $location );
 
 
684
  }
685
 
686
  return $location;
@@ -1019,7 +1049,7 @@ class MLACore {
1019
  }
1020
 
1021
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1022
- $tax_filter = isset( $_REQUEST['tax_filter'] ) ? $_REQUEST['tax_filter'] : '';
1023
  return ( $tax_name == $tax_filter );
1024
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1025
  return array_key_exists( $tax_name, MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'] );
@@ -1028,7 +1058,7 @@ class MLACore {
1028
  return ( $tax_name == $tax_filter );
1029
  case 'metakey':
1030
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1031
- return isset( $_REQUEST['tax_metakey'] ) ? $_REQUEST['tax_metakey'] : '';
1032
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1033
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1034
  }
@@ -1036,7 +1066,7 @@ class MLACore {
1036
  return isset( $tax_options['tax_metakey'] ) ? $tax_options['tax_metakey'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1037
  case 'metakey_sort':
1038
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1039
- return isset( $_REQUEST['tax_metakey_sort'] ) ? $_REQUEST['tax_metakey_sort'] : '';
1040
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1041
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey_sort'];
1042
  }
@@ -1058,12 +1088,13 @@ class MLACore {
1058
  * array taxonomies assigned to $support_type; can be empty.
1059
  * string if $support_type is 'metakey', returns the custom field to filter by.
1060
  */
1061
- public static function mla_supported_taxonomies($support_type = 'support') {
1062
  $tax_options = MLACore::mla_get_option( MLACoreOptions::MLA_TAXONOMY_SUPPORT );
1063
  switch ( $support_type ) {
1064
  case 'support':
1065
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1066
- return isset( $_REQUEST['tax_support'] ) ? array_keys( $_REQUEST['tax_support'] ) : array();
 
1067
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1068
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_support'] );
1069
  }
@@ -1071,7 +1102,8 @@ class MLACore {
1071
  return array_keys( isset( $tax_options['tax_support'] ) ? $tax_options['tax_support'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_support'] );
1072
  case 'quick-edit':
1073
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1074
- return isset( $_REQUEST['tax_quick_edit'] ) ? array_keys( $_REQUEST['tax_quick_edit'] ) : array();
 
1075
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1076
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_quick_edit'] );
1077
  }
@@ -1079,7 +1111,8 @@ class MLACore {
1079
  return array_keys( isset( $tax_options['tax_quick_edit'] ) ? $tax_options['tax_quick_edit'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_quick_edit'] );
1080
  case 'term-search':
1081
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1082
- return isset( $_REQUEST['tax_term_search'] ) ? array_keys( $_REQUEST['tax_term_search'] ) : array();
 
1083
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1084
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_term_search'] );
1085
  }
@@ -1087,7 +1120,8 @@ class MLACore {
1087
  return array_keys( isset( $tax_options['tax_term_search'] ) ? $tax_options['tax_term_search'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_term_search'] );
1088
  case 'flat-checklist':
1089
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1090
- return isset( $_REQUEST['tax_flat_checklist'] ) ? array_keys( $_REQUEST['tax_flat_checklist'] ) : array();
 
1091
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1092
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_flat_checklist'] );
1093
  }
@@ -1095,7 +1129,8 @@ class MLACore {
1095
  return array_keys( isset( $tax_options['tax_flat_checklist'] ) ? $tax_options['tax_flat_checklist'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_flat_checklist'] );
1096
  case 'checked-on-top':
1097
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1098
- return isset( $_REQUEST['tax_checked_on_top'] ) ? array_keys( $_REQUEST['tax_checked_on_top'] ) : array();
 
1099
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1100
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checked_on_top'] );
1101
  }
@@ -1103,7 +1138,8 @@ class MLACore {
1103
  return array_keys( isset( $tax_options['tax_checked_on_top'] ) ? $tax_options['tax_checked_on_top'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checked_on_top'] );
1104
  case 'checklist-add-term':
1105
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1106
- return isset( $_REQUEST['tax_checklist_add_term'] ) ? array_keys( $_REQUEST['tax_checklist_add_term'] ) : array();
 
1107
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1108
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checklist_add_term'] );
1109
  }
@@ -1111,7 +1147,7 @@ class MLACore {
1111
  return array_keys( isset( $tax_options['tax_checklist_add_term'] ) ? $tax_options['tax_checklist_add_term'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checklist_add_term'] );
1112
  case 'filter':
1113
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1114
- return isset( $_REQUEST['tax_filter'] ) ? (array) $_REQUEST['tax_filter'] : array();
1115
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1116
  return (array) MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'];
1117
  }
@@ -1119,7 +1155,7 @@ class MLACore {
1119
  return (array) isset( $tax_options['tax_filter'] ) ? $tax_options['tax_filter'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'];
1120
  case 'metakey':
1121
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1122
- return isset( $_REQUEST['tax_metakey'] ) ? $_REQUEST['tax_metakey'] : '';
1123
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1124
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1125
  }
@@ -1410,24 +1446,24 @@ class MLACore {
1410
  $span_search_ajax_id = "{$taxonomy}-search-ajax-response";
1411
  }
1412
  ?>
1413
- <div id="<?php echo $div_taxonomy_id; ?>" class="categorydiv">
1414
- <ul id="<?php echo $tabs_ul_id; ?>" class="category-tabs">
1415
- <li class="tabs"><a href="#<?php echo $tab_all_id; ?>"><?php echo $tax->labels->all_items; ?></a></li>
1416
- <li class="hide-if-no-js"><a href="#<?php echo $tab_pop_id; ?>"><?php _e( 'Most Used' ); ?></a></li>
1417
  </ul>
1418
 
1419
- <div id="<?php echo $tab_pop_id; ?>" class="tabs-panel" style="display: none;">
1420
- <ul id="<?php echo $tab_pop_ul_id; ?>" class="categorychecklist form-no-clear" >
1421
  <?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?>
1422
  </ul>
1423
  </div>
1424
 
1425
- <div id="<?php echo $tab_all_id; ?>" class="tabs-panel">
1426
  <?php
1427
  // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
1428
- echo "<input type='hidden' name='{$input_terms_name}' id='{$input_terms_id}' value='0' />";
1429
  ?>
1430
- <ul id="<?php echo $tab_all_ul_id; ?>" data-wp-lists="list:<?php echo $taxonomy?>" class="categorychecklist form-no-clear">
1431
  <?php if ( $tax->hierarchical ): ?>
1432
  <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids, 'checked_ontop'=> MLACore::mla_taxonomy_support( $taxonomy, 'checked-on-top' ) ) ) ?>
1433
  <?php else: ?>
@@ -1437,44 +1473,44 @@ class MLACore {
1437
  </ul>
1438
  </div>
1439
  <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
1440
- <div id="<?php echo $div_adder_id; ?>" class="<?php echo $div_adder_class; ?>">
1441
  <h4>
1442
- <a id="<?php echo $link_adder_id; ?>" href="#<?php echo $link_adder_p_id; ?>" class="hide-if-no-js">
1443
  <?php
1444
  /* translators: %s: add new taxonomy label */
1445
- printf( __( '+ %s', 'media-library-assistant' ), $tax->labels->add_new_item );
1446
  ?>
1447
  </a>
1448
  &nbsp;&nbsp;
1449
- <a id="<?php echo $link_search_id; ?>" href="#<?php echo $link_search_p_id; ?>" class="hide-if-no-js">
1450
  <?php
1451
- echo '?&nbsp;' . __( 'Search', 'media-library-assistant' );
1452
  ?>
1453
  </a>
1454
  </h4>
1455
- <p id="<?php echo $link_adder_p_id; ?>" class="category-add wp-hidden-child">
1456
- <label class="screen-reader-text" for="<?php echo $input_new_name; ?>"><?php echo $tax->labels->add_new_item; ?></label>
1457
- <input type="text" name="<?php echo $input_new_name; ?>" id="<?php echo $input_new_id; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
1458
 
1459
  <?php if ( $tax->hierarchical ): ?>
1460
- <label class="screen-reader-text" for="<?php echo $input_new_parent_name; ?>">
1461
- <?php echo $tax->labels->parent_item_colon; ?>
1462
  </label>
1463
  <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => $input_new_parent_name, 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
1464
  <?php else:
1465
- echo "<input type='hidden' name='{$input_new_parent_name}' id='{$input_new_parent_name}' value='-1' />";
1466
  endif; ?>
1467
- <input type="button" id="<?php echo $input_new_submit_id; ?>" data-wp-lists="add:<?php echo $tab_all_ul_id ?>:<?php echo $link_adder_p_id ?>" class="button category-add-submit mla-taxonomy-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
1468
  <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
1469
- <span id="<?php echo $span_new_ajax_id; ?>"></span>
1470
  </p>
1471
  </div>
1472
- <div id="<?php echo $div_search_id; ?>" class="<?php echo $div_search_class; ?>">
1473
- <p id="<?php echo $link_search_p_id; ?>" class="category-add wp-hidden-child">
1474
- <label class="screen-reader-text" for="<?php echo $input_search_name; ?>"><?php echo $tax->labels->search_items; ?></label>
1475
- <input type="text" name="<?php echo $input_search_name; ?>" id="<?php echo $input_search_id; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->search_items ); ?>" aria-required="true"/>
1476
  <?php wp_nonce_field( 'search-'.$taxonomy, '_ajax_nonce-search-'.$taxonomy, false ); ?>
1477
- <span id="<?php echo $span_search_ajax_id; ?>"></span>
1478
  </p>
1479
  </div>
1480
  <?php endif; ?>
@@ -1661,7 +1697,7 @@ class MLACore {
1661
  break;
1662
  case 'console':
1663
  foreach( self::$mla_debug_messages as $message ) {
1664
- trigger_error( $message, E_USER_WARNING );
1665
  }
1666
  break;
1667
  case 'log':
@@ -1728,7 +1764,7 @@ class MLACore {
1728
  self::$mla_debug_messages[] = $message;
1729
  break;
1730
  case 'console':
1731
- trigger_error( $message, E_USER_WARNING );
1732
  break;
1733
  case 'log':
1734
  self::_debug_log( $message );
21
  *
22
  * @var string
23
  */
24
+ const CURRENT_MLA_VERSION = '2.90';
25
 
26
  /**
27
  * Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)
389
  MLACore::$process_mla_gallery_in = false;
390
  }
391
 
392
+ // Look for Postie chron job
393
+ if ( isset( $_REQUEST['doing_wp_cron'] ) && class_exists( 'Postie', false ) ) {
394
+ add_action( 'postie_session_start', 'MLACore::mla_postie_session_start' );
395
+ }
396
+
397
  /*
398
  * Look for redirects from the Media/Edit Media screen when it was picked from the
399
  * "Edit" rollover action on the Media/Assistant submenu
417
 
418
  if ( $user_id && $not_super_admin ) {
419
  if ( isset( $_COOKIE['wp-settings-' . $user_id] ) ) {
420
+ $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', sanitize_text_field( wp_unslash( $_COOKIE['wp-settings-' . $user_id] ) ) );
421
  } else {
422
  $cookie = (string) get_user_option( 'user-settings', $user_id );
423
  }
462
  }
463
  }
464
 
465
+ /**
466
+ * Ensures that MLA mapping rules can be run from the Postie cron job.
467
+ * Declared public because it is an action.
468
+ *
469
+ * @since 2.90
470
+ */
471
+ public static function mla_postie_session_start() {
472
+ // Template file and database access functions.
473
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-data-query.php' );
474
+ MLAQuery::initialize();
475
+
476
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-data.php' );
477
+ MLAData::initialize();
478
+
479
+ // Shortcode shim functions
480
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-shortcodes.php' );
481
+ MLAShortcodes::initialize();
482
+
483
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-shortcode-support.php' );
484
+
485
+ // Plugin settings management
486
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-options.php' );
487
+ MLAOptions::initialize();
488
+ }
489
+
490
  /**
491
  * Ensures that MLA media manager enhancements are present when required.
492
  * Declared public because it is a filter.
640
  MLACore::mla_debug_add( __LINE__ . sprintf( ' MLACore::mla_plugins_loaded_action() MLA %s (%s) mla_debug_level 0x%X', MLACore::CURRENT_MLA_VERSION, MLA::MLA_DEVELOPMENT_VERSION, MLACore::$mla_debug_level, true ), MLACore::MLA_DEBUG_CATEGORY_ANY );
641
 
642
  if ( ( MLACore::$mla_debug_level & MLACore::MLA_DEBUG_CATEGORY_METADATA ) && isset( $_SERVER['REQUEST_URI'] ) ) {
643
+ $is_wplr_sync = false !== strpos( $_SERVER['REQUEST_URI'], '/?wplr-sync-api' ); // phpcs:ignore
644
+ MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action( {$is_wplr_sync} ) \$_SERVER[REQUEST_URI] = " . var_export( $_SERVER['REQUEST_URI'], true ), MLACore::MLA_DEBUG_CATEGORY_METADATA ); // phpcs:ignore
645
  if ( $is_wplr_sync && isset( $_POST['action'] ) ) {
646
+ MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action wplr action = " . var_export( $_POST['action'], true ), MLACore::MLA_DEBUG_CATEGORY_METADATA ); // phpcs:ignore
647
  }
648
  }
649
  }
660
  }
661
 
662
  // WP REST API calls need everything loaded to process uploads
663
+ if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json/' ) ) { // phpcs:ignore
664
+ MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json REQUEST_URI = " . var_export( $_SERVER['REQUEST_URI'], true ), MLACore::MLA_DEBUG_CATEGORY_REST ); // phpcs:ignore
665
  //MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _GET = " . var_export( $_GET, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
666
  //MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _POST = " . var_export( $_POST, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
667
  MLACore::mla_debug_add( __LINE__ . " MLACore::mla_plugins_loaded_action() wp-json _REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_REST );
706
  * @param int $status Status code to use.
707
  */
708
  public static function mla_wp_redirect_filter( $location, $status ) {
709
+ // Check for Update, Trash or Delete Permanently on Media/Edit Media screen,
 
 
710
  if ( ( false !== strpos( $location, 'upload.php?' ) ) || ( false !== strpos( $location, 'post.php?' ) ) ) {
711
+ if ( isset( $_REQUEST['mla_source'] ) ) {
712
+ $location = add_query_arg( array( 'mla_source' => sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) ) ), $location );
713
+ }
714
  }
715
 
716
  return $location;
1049
  }
1050
 
1051
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1052
+ $tax_filter = isset( $_REQUEST['tax_filter'] ) ? sanitize_text_field( wp_unslash ( $_REQUEST['tax_filter'] ) ) : '';
1053
  return ( $tax_name == $tax_filter );
1054
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1055
  return array_key_exists( $tax_name, MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'] );
1058
  return ( $tax_name == $tax_filter );
1059
  case 'metakey':
1060
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1061
+ return isset( $_REQUEST['tax_metakey'] ) ? sanitize_text_field( wp_unslash ( $_REQUEST['tax_metakey'] ) ) : '';
1062
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1063
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1064
  }
1066
  return isset( $tax_options['tax_metakey'] ) ? $tax_options['tax_metakey'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1067
  case 'metakey_sort':
1068
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1069
+ return isset( $_REQUEST['tax_metakey_sort'] ) ? sanitize_text_field( wp_unslash ( $_REQUEST['tax_metakey_sort'] ) ) : '';
1070
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1071
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey_sort'];
1072
  }
1088
  * array taxonomies assigned to $support_type; can be empty.
1089
  * string if $support_type is 'metakey', returns the custom field to filter by.
1090
  */
1091
+ public static function mla_supported_taxonomies( $support_type = 'support' ) {
1092
  $tax_options = MLACore::mla_get_option( MLACoreOptions::MLA_TAXONOMY_SUPPORT );
1093
  switch ( $support_type ) {
1094
  case 'support':
1095
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1096
+ $tax_support = isset( $_REQUEST['tax_support'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_support'] ) ) : array();
1097
+ return array_keys( $tax_support );
1098
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1099
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_support'] );
1100
  }
1102
  return array_keys( isset( $tax_options['tax_support'] ) ? $tax_options['tax_support'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_support'] );
1103
  case 'quick-edit':
1104
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1105
+ $tax_quick_edit = isset( $_REQUEST['tax_quick_edit'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_quick_edit'] ) ) : array();
1106
+ return array_keys( $tax_quick_edit );
1107
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1108
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_quick_edit'] );
1109
  }
1111
  return array_keys( isset( $tax_options['tax_quick_edit'] ) ? $tax_options['tax_quick_edit'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_quick_edit'] );
1112
  case 'term-search':
1113
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1114
+ $tax_term_search = isset( $_REQUEST['tax_term_search'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_term_search'] ) ) : array();
1115
+ return array_keys( $tax_term_search );
1116
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1117
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_term_search'] );
1118
  }
1120
  return array_keys( isset( $tax_options['tax_term_search'] ) ? $tax_options['tax_term_search'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_term_search'] );
1121
  case 'flat-checklist':
1122
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1123
+ $tax_flat_checklist = isset( $_REQUEST['tax_flat_checklist'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_flat_checklist'] ) ) : array();
1124
+ return array_keys( $tax_flat_checklist );
1125
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1126
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_flat_checklist'] );
1127
  }
1129
  return array_keys( isset( $tax_options['tax_flat_checklist'] ) ? $tax_options['tax_flat_checklist'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_flat_checklist'] );
1130
  case 'checked-on-top':
1131
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1132
+ $tax_checked_on_top = isset( $_REQUEST['tax_checked_on_top'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_checked_on_top'] ) ) : array();
1133
+ return array_keys( $tax_checked_on_top );
1134
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1135
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checked_on_top'] );
1136
  }
1138
  return array_keys( isset( $tax_options['tax_checked_on_top'] ) ? $tax_options['tax_checked_on_top'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checked_on_top'] );
1139
  case 'checklist-add-term':
1140
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1141
+ $tax_checklist_add_term = isset( $_REQUEST['tax_checklist_add_term'] ) ? array_map( 'sanitize_text_field', wp_unslash ( $_REQUEST['tax_checklist_add_term'] ) ) : array();
1142
+ return array_keys( $tax_checklist_add_term );
1143
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1144
  return array_keys( MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checklist_add_term'] );
1145
  }
1147
  return array_keys( isset( $tax_options['tax_checklist_add_term'] ) ? $tax_options['tax_checklist_add_term'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_checklist_add_term'] );
1148
  case 'filter':
1149
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1150
+ return isset( $_REQUEST['tax_filter'] ) ? (array) sanitize_text_field( wp_unslash( $_REQUEST['tax_filter'] ) ) : array();
1151
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1152
  return (array) MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'];
1153
  }
1155
  return (array) isset( $tax_options['tax_filter'] ) ? $tax_options['tax_filter'] : MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_filter'];
1156
  case 'metakey':
1157
  if ( !empty( $_REQUEST['mla-general-options-save'] ) ) {
1158
+ return isset( $_REQUEST['tax_metakey'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['tax_metakey'] ) ) : '';
1159
  } elseif ( !empty( $_REQUEST['mla-general-options-reset'] ) ) {
1160
  return MLACoreOptions::$mla_option_definitions[ MLACoreOptions::MLA_TAXONOMY_SUPPORT ]['std']['tax_metakey'];
1161
  }
1446
  $span_search_ajax_id = "{$taxonomy}-search-ajax-response";
1447
  }
1448
  ?>
1449
+ <div id="<?php echo esc_html( $div_taxonomy_id ); ?>" class="categorydiv">
1450
+ <ul id="<?php echo esc_html( $tabs_ul_id ); ?>" class="category-tabs">
1451
+ <li class="tabs"><a href="#<?php echo esc_html( $tab_all_id ); ?>"><?php echo esc_html( $tax->labels->all_items ); ?></a></li>
1452
+ <li class="hide-if-no-js"><a href="#<?php echo esc_html( $tab_pop_id ); ?>"><?php esc_html_e( 'Most Used' ); ?></a></li>
1453
  </ul>
1454
 
1455
+ <div id="<?php echo esc_html( $tab_pop_id ); ?>" class="tabs-panel" style="display: none;">
1456
+ <ul id="<?php echo esc_html( $tab_pop_ul_id ); ?>" class="categorychecklist form-no-clear" >
1457
  <?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?>
1458
  </ul>
1459
  </div>
1460
 
1461
+ <div id="<?php echo esc_html( $tab_all_id ); ?>" class="tabs-panel">
1462
  <?php
1463
  // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
1464
+ echo "<input type='hidden' name='" . esc_html( $input_terms_name) . "' id='" . esc_html( $input_terms_id ) . "' value='0' />";
1465
  ?>
1466
+ <ul id="<?php echo esc_html( $tab_all_ul_id ); ?>" data-wp-lists="list:<?php echo esc_html( $taxonomy )?>" class="categorychecklist form-no-clear">
1467
  <?php if ( $tax->hierarchical ): ?>
1468
  <?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids, 'checked_ontop'=> MLACore::mla_taxonomy_support( $taxonomy, 'checked-on-top' ) ) ) ?>
1469
  <?php else: ?>
1473
  </ul>
1474
  </div>
1475
  <?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
1476
+ <div id="<?php echo esc_html( $div_adder_id ); ?>" class="<?php echo esc_html( $div_adder_class ); ?>">
1477
  <h4>
1478
+ <a id="<?php echo esc_html( $link_adder_id ); ?>" href="#<?php echo esc_html( $link_adder_p_id ); ?>" class="hide-if-no-js">
1479
  <?php
1480
  /* translators: %s: add new taxonomy label */
1481
+ echo esc_html( sprintf( __( '+ %s', 'media-library-assistant' ), $tax->labels->add_new_item ) );
1482
  ?>
1483
  </a>
1484
  &nbsp;&nbsp;
1485
+ <a id="<?php echo esc_html( $link_search_id ); ?>" href="#<?php echo esc_html( $link_search_p_id ); ?>" class="hide-if-no-js">
1486
  <?php
1487
+ echo '?&nbsp;' . esc_html( __( 'Search', 'media-library-assistant' ) );
1488
  ?>
1489
  </a>
1490
  </h4>
1491
+ <p id="<?php echo esc_html( $link_adder_p_id ); ?>" class="category-add wp-hidden-child">
1492
+ <label class="screen-reader-text" for="<?php echo esc_html( $input_new_name ); ?>"><?php echo esc_html( $tax->labels->add_new_item ); ?></label>
1493
+ <input type="text" name="<?php echo esc_html( $input_new_name ); ?>" id="<?php echo esc_html( $input_new_id ); ?>" class="form-required form-input-tip" value="<?php echo esc_attr( esc_html( $tax->labels->new_item_name ) ); ?>" aria-required="true"/>
1494
 
1495
  <?php if ( $tax->hierarchical ): ?>
1496
+ <label class="screen-reader-text" for="<?php echo esc_html( $input_new_parent_name ); ?>">
1497
+ <?php echo esc_html( $tax->labels->parent_item_colon ); ?>
1498
  </label>
1499
  <?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => $input_new_parent_name, 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '&mdash; ' . $tax->labels->parent_item . ' &mdash;' ) ); ?>
1500
  <?php else:
1501
+ echo "<input type='hidden' name='" . esc_html( $input_new_parent_name ) . "' id='" . esc_html( $input_new_parent_name ) . "' value='-1' />";
1502
  endif; ?>
1503
+ <input type="button" id="<?php echo esc_html( $input_new_submit_id ); ?>" data-wp-lists="add:<?php echo esc_html( $tab_all_ul_id ); ?>:<?php echo esc_html( $link_adder_p_id ); ?>" class="button category-add-submit mla-taxonomy-add-submit" value="<?php echo esc_html( esc_attr( $tax->labels->add_new_item ) ); ?>" />
1504
  <?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
1505
+ <span id="<?php echo esc_html( $span_new_ajax_id ); ?>"></span>
1506
  </p>
1507
  </div>
1508
+ <div id="<?php echo esc_html( $div_search_id ); ?>" class="<?php echo esc_html( $div_search_class ); ?>">
1509
+ <p id="<?php echo esc_html( $link_search_p_id ); ?>" class="category-add wp-hidden-child">
1510
+ <label class="screen-reader-text" for="<?php echo esc_html( $input_search_name ); ?>"><?php echo esc_html( $tax->labels->search_items ); ?></label>
1511
+ <input type="text" name="<?php echo esc_html( $input_search_name ); ?>" id="<?php echo esc_html( $input_search_id ); ?>" class="form-required form-input-tip" value="<?php echo esc_html( esc_attr( $tax->labels->search_items ) ); ?>" aria-required="true"/>
1512
  <?php wp_nonce_field( 'search-'.$taxonomy, '_ajax_nonce-search-'.$taxonomy, false ); ?>
1513
+ <span id="<?php echo esc_html( $span_search_ajax_id ); ?>"></span>
1514
  </p>
1515
  </div>
1516
  <?php endif; ?>
1697
  break;
1698
  case 'console':
1699
  foreach( self::$mla_debug_messages as $message ) {
1700
+ trigger_error( esc_html( $message ), E_USER_WARNING );
1701
  }
1702
  break;
1703
  case 'log':
1764
  self::$mla_debug_messages[] = $message;
1765
  break;
1766
  case 'console':
1767
+ trigger_error( esc_html( $message ), E_USER_WARNING );
1768
  break;
1769
  case 'log':
1770
  self::_debug_log( $message );
includes/class-mla-data-references.php CHANGED
@@ -825,7 +825,7 @@ class MLAReferences {
825
  if ( is_string( $attachments ) ) {
826
  //error_log( __LINE__ . " MLAReferences::_build_mla_galleries( $result_id, $index ) query = " . var_export( $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' cache_results=false update_post_meta_cache=false update_post_term_cache=false where_used_query=this-is-a-where-used-query', true ), 0 );
827
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
828
- trigger_error( htmlentities( sprintf( __( '(%1$s) %2$s (ID %3$d) query "%4$s" failed, returning "%5$s"', 'media-library-assistant' ), $result->post_type, $result->post_title, $result->ID, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'], $attachments) ), E_USER_WARNING );
829
  } elseif ( ! empty( $attachments ) ) {
830
  foreach ( $attachments as $attachment ) {
831
  $galleries_array[ $result_id ]['results'][ $attachment->ID ] = $attachment->ID;
@@ -859,7 +859,7 @@ class MLAReferences {
859
  if ( is_string( $attachments ) ) {
860
  //error_log( __LINE__ . " MLAReferences::_build_mla_galleries( $result_id, $index ) query = " . var_export( $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' cache_results=false update_post_meta_cache=false update_post_term_cache=false where_used_query=this-is-a-where-used-query', true ), 0 );
861
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
862
- trigger_error( htmlentities( sprintf( __( '(%1$s) %2$s (ID %3$d) query "%4$s" failed, returning "%5$s"', 'media-library-assistant' ), $result->post_type, $result->post_title, $result->ID, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'], $attachments) ), E_USER_WARNING );
863
  } elseif ( ! empty( $attachments ) ) {
864
  foreach ( $attachments as $attachment ) {
865
  $galleries_array[ $result_id ]['results'][ $attachment->ID ] = $attachment->ID;
825
  if ( is_string( $attachments ) ) {
826
  //error_log( __LINE__ . " MLAReferences::_build_mla_galleries( $result_id, $index ) query = " . var_export( $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' cache_results=false update_post_meta_cache=false update_post_term_cache=false where_used_query=this-is-a-where-used-query', true ), 0 );
827
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
828
+ trigger_error( esc_html( sprintf( __( '(%1$s) %2$s (ID %3$d) query "%4$s" failed, returning "%5$s"', 'media-library-assistant' ), $result->post_type, $result->post_title, $result->ID, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'], $attachments) ), E_USER_WARNING );
829
  } elseif ( ! empty( $attachments ) ) {
830
  foreach ( $attachments as $attachment ) {
831
  $galleries_array[ $result_id ]['results'][ $attachment->ID ] = $attachment->ID;
859
  if ( is_string( $attachments ) ) {
860
  //error_log( __LINE__ . " MLAReferences::_build_mla_galleries( $result_id, $index ) query = " . var_export( $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' cache_results=false update_post_meta_cache=false update_post_term_cache=false where_used_query=this-is-a-where-used-query', true ), 0 );
861
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
862
+ trigger_error( esc_html( sprintf( __( '(%1$s) %2$s (ID %3$d) query "%4$s" failed, returning "%5$s"', 'media-library-assistant' ), $result->post_type, $result->post_title, $result->ID, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'], $attachments) ), E_USER_WARNING );
863
  } elseif ( ! empty( $attachments ) ) {
864
  foreach ( $attachments as $attachment ) {
865
  $galleries_array[ $result_id ]['results'][ $attachment->ID ] = $attachment->ID;
includes/class-mla-data-source.php CHANGED
@@ -45,6 +45,10 @@ class MLAData_Source {
45
  'comment_count',
46
  'alt_text',
47
 
 
 
 
 
48
  'absolute_path',
49
  'absolute_file_name',
50
  'base_file',
@@ -375,7 +379,7 @@ class MLAData_Source {
375
  */
376
  private static function _evaluate_data_source( $post_id, $category, $data_value, $attachment_metadata = NULL ) {
377
  global $wpdb;
378
- static $upload_dir, $intermediate_sizes = NULL, $wp_attached_files = NULL, $wp_attachment_metadata = NULL;
379
  static $current_id = 0, $file_info = NULL, $parent_info = NULL, $references = NULL, $alt_text = NULL;
380
 
381
  if ( 'none' == $data_value['data_source'] ) {
@@ -386,8 +390,8 @@ class MLAData_Source {
386
 
387
  // Do this once per page load; cache attachment metadata if mapping all attachments
388
  if ( NULL == $intermediate_sizes ) {
389
- $upload_dir = wp_upload_dir();
390
- $upload_dir = $upload_dir['basedir'] . '/';
391
  $intermediate_sizes = get_intermediate_image_sizes();
392
 
393
  if ( 'custom_field_mapping' == $category ) {
@@ -537,6 +541,15 @@ class MLAData_Source {
537
  case 'post_mime_type':
538
  $result = MLAData_Source::_evaluate_post_information( $post_id, $category, $data_source );
539
  break;
 
 
 
 
 
 
 
 
 
540
  case 'absolute_path':
541
  case 'absolute_file_name':
542
  case 'base_file':
45
  'comment_count',
46
  'alt_text',
47
 
48
+ 'site_url',
49
+ 'base_url',
50
+ 'base_dir',
51
+
52
  'absolute_path',
53
  'absolute_file_name',
54
  'base_file',
379
  */
380
  private static function _evaluate_data_source( $post_id, $category, $data_value, $attachment_metadata = NULL ) {
381
  global $wpdb;
382
+ static $upload_dir_array, $upload_dir, $intermediate_sizes = NULL, $wp_attached_files = NULL, $wp_attachment_metadata = NULL;
383
  static $current_id = 0, $file_info = NULL, $parent_info = NULL, $references = NULL, $alt_text = NULL;
384
 
385
  if ( 'none' == $data_value['data_source'] ) {
390
 
391
  // Do this once per page load; cache attachment metadata if mapping all attachments
392
  if ( NULL == $intermediate_sizes ) {
393
+ $upload_dir_array = wp_upload_dir();
394
+ $upload_dir = $upload_dir_array['basedir'] . '/';
395
  $intermediate_sizes = get_intermediate_image_sizes();
396
 
397
  if ( 'custom_field_mapping' == $category ) {
541
  case 'post_mime_type':
542
  $result = MLAData_Source::_evaluate_post_information( $post_id, $category, $data_source );
543
  break;
544
+ case 'site_url':
545
+ $result = site_url();
546
+ break;
547
+ case 'base_url':
548
+ $result = $upload_dir_array['baseurl'];
549
+ break;
550
+ case 'base_dir':
551
+ $result = wptexturize( str_replace( '\\', '/', $upload_dir_array['basedir'] ) );
552
+ break;
553
  case 'absolute_path':
554
  case 'absolute_file_name':
555
  case 'base_file':
includes/class-mla-data.php CHANGED
@@ -1285,12 +1285,12 @@ class MLAData {
1285
  break;
1286
  case 'request':
1287
  if ( isset( $_REQUEST[ $value['value'] ] ) ) {
1288
- $record = $_REQUEST[ $value['value'] ];
1289
  } else {
1290
  // Look for compound names, e.g., tax_input.attachment_category
1291
  $key_array = explode( '.', $value['value'] );
1292
  if ( 1 < count( $key_array ) && isset( $_REQUEST[ $key_array[0] ] ) ) {
1293
- $array_value = array( $key_array[0] => $_REQUEST[ $key_array[0] ] );
1294
  $record = MLAData::mla_find_array_element( $value['value'], $array_value, $value['option'], false, ',' );
1295
  } else {
1296
  $record = '';
@@ -3532,10 +3532,10 @@ class MLAData {
3532
  MLACore::mla_debug_add( __LINE__ . ' mla_fetch_attachment_image_metadata getimagesize returns ' . var_export( $size, true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
3533
  MLACore::mla_debug_add( __LINE__ . ' mla_fetch_attachment_image_metadata getimagesize info keys = ' . var_export( array_keys( $info ), true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
3534
 
3535
- // SVG and some other types don't have metadata
3536
  if ( false === $size ) {
3537
  return $results;
3538
- }
3539
 
3540
  if ( is_callable( 'iptcparse' ) ) {
3541
  if ( ! empty( $info['APP13'] ) ) {
@@ -3582,7 +3582,7 @@ class MLAData {
3582
  } // ! empty
3583
  } // iptcparse
3584
 
3585
- if ( is_callable( 'exif_read_data' ) && in_array( $size[2], array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) {
3586
  set_error_handler( 'MLAData::mla_IPTC_EXIF_error_handler' );
3587
  try {
3588
  $exception = NULL;
@@ -3662,7 +3662,7 @@ class MLAData {
3662
  $results['mla_xmp_metadata'] = array();
3663
  }
3664
 
3665
- // experimental damage repair for Robert O'Conner (Rufus McDufus)
3666
  if ( isset( $exif_data['DateTimeOriginal'] ) && ( 8 > strlen( $exif_data['DateTimeOriginal'] ) ) ) {
3667
  if ( isset( $results['mla_xmp_metadata']['CreateDate'] )&& ( is_numeric( strtotime( $results['mla_xmp_metadata']['CreateDate'] ) ) ) ) {
3668
  $exif_data['BadDateTimeOriginal'] = $exif_data['DateTimeOriginal'];
@@ -3837,9 +3837,7 @@ class MLAData {
3837
  $results['mla_exif_metadata']['CAMERA'] = $new_data;
3838
  }
3839
 
3840
- /*
3841
- * Expand EXIF GPS values
3842
- */
3843
  $new_data = array();
3844
  if ( isset( $exif_data['GPSVersion'] ) ) {
3845
  $new_data['Version'] = sprintf( '%1$d.%2$d.%3$d.%4$d', ord( $exif_data['GPSVersion'][0] ), ord( $exif_data['GPSVersion'][1] ), ord( $exif_data['GPSVersion'][2] ), ord( $exif_data['GPSVersion'][3] ) );
@@ -4040,7 +4038,14 @@ class MLAData {
4040
  */
4041
  public static function mla_update_item_postmeta( $post_id, $new_meta ) {
4042
  $post_data = MLAQuery::mla_fetch_attachment_metadata( $post_id );
4043
- $message = '';
 
 
 
 
 
 
 
4044
 
4045
  $attachment_meta_values = array();
4046
  foreach ( $new_meta as $meta_key => $meta_value ) {
1285
  break;
1286
  case 'request':
1287
  if ( isset( $_REQUEST[ $value['value'] ] ) ) {
1288
+ $record = sanitize_text_field( wp_unslash( $_REQUEST[ $value['value'] ] ) );
1289
  } else {
1290
  // Look for compound names, e.g., tax_input.attachment_category
1291
  $key_array = explode( '.', $value['value'] );
1292
  if ( 1 < count( $key_array ) && isset( $_REQUEST[ $key_array[0] ] ) ) {
1293
+ $array_value = array( $key_array[0] => sanitize_text_field( wp_unslash( $_REQUEST[ $key_array[0] ] ) ) );
1294
  $record = MLAData::mla_find_array_element( $value['value'], $array_value, $value['option'], false, ',' );
1295
  } else {
1296
  $record = '';
3532
  MLACore::mla_debug_add( __LINE__ . ' mla_fetch_attachment_image_metadata getimagesize returns ' . var_export( $size, true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
3533
  MLACore::mla_debug_add( __LINE__ . ' mla_fetch_attachment_image_metadata getimagesize info keys = ' . var_export( array_keys( $info ), true ), MLACore::MLA_DEBUG_CATEGORY_METADATA );
3534
 
3535
+ /*/ SVG and some other types don't have metadata: removed v2.90
3536
  if ( false === $size ) {
3537
  return $results;
3538
+ } // */
3539
 
3540
  if ( is_callable( 'iptcparse' ) ) {
3541
  if ( ! empty( $info['APP13'] ) ) {
3582
  } // ! empty
3583
  } // iptcparse
3584
 
3585
+ if ( is_callable( 'exif_read_data' ) && !empty( $size[2] ) && in_array( $size[2], array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) {
3586
  set_error_handler( 'MLAData::mla_IPTC_EXIF_error_handler' );
3587
  try {
3588
  $exception = NULL;
3662
  $results['mla_xmp_metadata'] = array();
3663
  }
3664
 
3665
+ // damage repair for Robert O'Conner (Rufus McDufus)
3666
  if ( isset( $exif_data['DateTimeOriginal'] ) && ( 8 > strlen( $exif_data['DateTimeOriginal'] ) ) ) {
3667
  if ( isset( $results['mla_xmp_metadata']['CreateDate'] )&& ( is_numeric( strtotime( $results['mla_xmp_metadata']['CreateDate'] ) ) ) ) {
3668
  $exif_data['BadDateTimeOriginal'] = $exif_data['DateTimeOriginal'];
3837
  $results['mla_exif_metadata']['CAMERA'] = $new_data;
3838
  }
3839
 
3840
+ // Expand EXIF GPS values
 
 
3841
  $new_data = array();
3842
  if ( isset( $exif_data['GPSVersion'] ) ) {
3843
  $new_data['Version'] = sprintf( '%1$d.%2$d.%3$d.%4$d', ord( $exif_data['GPSVersion'][0] ), ord( $exif_data['GPSVersion'][1] ), ord( $exif_data['GPSVersion'][2] ), ord( $exif_data['GPSVersion'][3] ) );
4038
  */
4039
  public static function mla_update_item_postmeta( $post_id, $new_meta ) {
4040
  $post_data = MLAQuery::mla_fetch_attachment_metadata( $post_id );
4041
+
4042
+ // Check for updates from "mla_mapping_updates" filters
4043
+ if ( !empty( $new_meta[0x80000000] ) ) {
4044
+ $message = $new_meta[0x80000000];
4045
+ unset( $new_meta[0x80000000] );
4046
+ } else {
4047
+ $message = '';
4048
+ }
4049
 
4050
  $attachment_meta_values = array();
4051
  foreach ( $new_meta as $meta_key => $meta_value ) {
includes/class-mla-edit-media.php CHANGED
@@ -115,17 +115,19 @@ class MLAEdit {
115
  */
116
  if ( 'editpost' == $_REQUEST['action'] ) {
117
  if ( isset( $_POST['tax_input'] ) && is_array( $_POST['tax_input'] ) ) {
118
- foreach( $_POST['tax_input'] as $key => $value ) {
119
- if ( is_array( $value ) ) {
120
- $tax = get_taxonomy( $key );
 
121
  if ( $tax->hierarchical ) {
122
  continue;
123
  }
124
-
 
125
  if ( false !== ( $bad_term = array_search( '0', $value ) ) ) {
126
  unset( $value[ $bad_term ] );
127
  }
128
-
129
  $comma = _x( ',', 'tag_delimiter', 'media-library-assistant' );
130
  $_POST['tax_input'][ $key ] = implode( $comma, $value );
131
  $_REQUEST['tax_input'][ $key ] = implode( $comma, $value );
@@ -211,7 +213,7 @@ class MLAEdit {
211
  return;
212
  }
213
 
214
- $post = get_post( $_REQUEST['post'] );
215
  if ( 'attachment' != $post->post_type ) {
216
  return;
217
  }
@@ -489,7 +491,8 @@ class MLAEdit {
489
  $page_values = apply_filters( 'mla_upload_bulk_edit_form_values', $page_values );
490
  $page_template = apply_filters( 'mla_upload_bulk_edit_form_template', $page_template_array['page'] );
491
  $parse_value = MLAData::mla_parse_template( $page_template, $page_values );
492
- echo apply_filters( 'mla_upload_bulk_edit_form_parse', $parse_value, $page_template, $page_values );
 
493
  }
494
 
495
  /**
@@ -523,10 +526,12 @@ class MLAEdit {
523
  * stripslashes() call in MLA::mla_process_bulk_action().
524
  * wp_parse_args converts plus signs to spaces, which we must avoid.
525
  */
526
- $args = stripslashes( str_replace( '%5C%5C', '%5C%5C%5C%5C', $_REQUEST['mlaAddNewBulkEditFormString'] ) );
 
527
  $args = wp_parse_args( str_replace( '%2B', 'urlencodedmlaplussign', $args ) );
528
  foreach ( $args as $key => $arg ) {
529
- if ( is_string( $arg ) && 0 === strpos( $arg, 'template:' ) ) {
 
530
  $args[ $key ] = str_replace( 'urlencodedmlaplussign', '+', $arg );
531
  }
532
  }
@@ -631,11 +636,11 @@ class MLAEdit {
631
 
632
  echo '<div class="timestamp-wrap">';
633
  /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
634
- printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
635
 
636
  echo "</div>\n";
637
- echo '<input type="hidden" id="ss" name="mla_' . $field . '[ss]" value="' . $ss . '" />' . "\n";
638
- echo '<input type="hidden" id="original" name="mla_' . $field . '[original]" value="' . $date . '" />' . "\n";
639
 
640
  $time_adj = current_time('timestamp');
641
  $map = array(
@@ -648,14 +653,14 @@ class MLAEdit {
648
  foreach ( $map as $timeunit => $value ) {
649
  list( $unit, $curr ) = $value;
650
 
651
- echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden[' . $timeunit . ']" value="' . $unit . '" />' . "\n";
652
  $cur_timeunit = 'cur_' . $timeunit;
653
- echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
654
  }
655
 
656
  echo "<p>\n";
657
- echo '<a href="#edit_' . $field . 'timestamp" class="save-timestamp hide-if-no-js button">' . __('OK') . "</a>\n";
658
- echo '<a href="#edit_' . $field . 'timestamp" class="cancel-timestamp hide-if-no-js button-cancel">' . __('Cancel') . "</a>\n";
659
  echo "<p>\n";
660
  }
661
 
@@ -673,48 +678,49 @@ class MLAEdit {
673
  /* translators: date_i18n format for uploaded on, last modified date and time */
674
  $date_format = __( 'M j, Y @ H:i', 'media-library-assistant' );
675
 
676
- $uploaded_date = date_i18n($date_format, strtotime( $post->post_date ) );
677
  echo '<div class="misc-pub-section uploadtime misc-pub-uploadtime">' . "\n";
678
- echo '<span id="upload-timestamp">' . sprintf(__( 'Uploaded on', 'media-library-assistant' ) . ":\n <b>%1\$s</b></span>\n", $uploaded_date);
679
 
680
- echo '<a href="#edit_uploadtime" class="edit-timestamp edit-uploadtime hide-if-no-js" role="button"><span aria-hidden="true">' . __( 'Edit' ) . "</span>\n";
681
- echo '<span class="screen-reader-text">' . __( 'Edit upload date and time' ) . "</span></a>\n";
682
  echo '<fieldset id="timestampdiv" class="hide-if-js">' . "\n";
683
- echo '<legend class="screen-reader-text">' . __( 'Upload Date and time' ) . "</legend>\n";
684
  self::_generate_time_edit_form( true ) . "\n";
685
  echo "</fieldset>\n";
686
  echo "</div><!-- .misc-pub-section -->\n";
687
 
688
  $modified_date = date_i18n($date_format, strtotime( $post->post_modified ) );
689
  echo '<div class="misc-pub-section modifytime misc-pub-modifytime">' . "\n";
690
- echo '<span id="modify-timestamp">' . sprintf(__( 'Last modified', 'media-library-assistant' ) . ":\n <b>%1\$s</b></span>\n", $modified_date);
691
  echo "</div><!-- .misc-pub-section -->\n";
692
 
693
  echo '<div class="misc-pub-section mla-links">' . "\n";
694
 
695
  $view_args = array( 'page' => MLACore::ADMIN_PAGE_SLUG, 'mla_item_ID' => $post->ID );
696
  if ( isset( $_REQUEST['mla_source'] ) ) {
697
- $view_args['mla_source'] = $_REQUEST['mla_source'];
698
 
699
  // apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete ) in /wp-includes/link-template.php
700
  add_filter( 'get_delete_post_link', 'MLAEdit::get_delete_post_link_filter', 10, 3 );
701
  }
 
702
  if ( isset( $_REQUEST['lang'] ) ) {
703
- $view_args['lang'] = $_REQUEST['lang'];
704
  }
705
 
706
  echo '<span id="mla_metadata_links" style="font-weight: bold; line-height: 2em">';
707
 
708
  if ( isset( $_REQUEST['mla_source'] ) ) {
709
- echo '<input name="mla_source" type="hidden" id="mla_source" value="' . $_REQUEST['mla_source'] . '" />';
710
  }
711
 
712
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_CUSTOM_FIELD_MAPPING ) ) {
713
- echo '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( 'upload.php?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Map Custom Field metadata for this item', 'media-library-assistant' ) . '">' . __( 'Map Custom Field metadata', 'media-library-assistant' ) . '</a><br>';
714
  }
715
 
716
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_IPTC_EXIF_MAPPING ) ) {
717
- echo '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( 'upload.php?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_MAP, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Map IPTC/EXIF metadata for this item', 'media-library-assistant' ) . '">' . __( 'Map IPTC/EXIF metadata', 'media-library-assistant' ) . '</a>';
718
  }
719
 
720
  echo "</span>\n";
@@ -998,11 +1004,11 @@ class MLAEdit {
998
 
999
  $parent_info = apply_filters( 'mla_parent_info_meta_box', $parent_info, self::$mla_references, $post );
1000
 
1001
- echo '<label class="screen-reader-text" for="mla_post_parent">' . __( 'Post Parent', 'media-library-assistant' ) . '</label><input name="mla_post_parent" id="mla_post_parent" type="text" value="' . $post->post_parent . "\" />\n";
1002
- echo '<label class="screen-reader-text" for="mla_parent_info">' . __( 'Select Parent', 'media-library-assistant' ) . '</label><input name="post_parent_set" id="mla_set_parent" class="button-primary parent" type="button" value="' . __( 'Select', 'media-library-assistant' ) . '" />';
1003
- echo '<label class="screen-reader-text" for="mla_parent_info">' . __( 'Parent Info', 'media-library-assistant' ) . '</label><input name="mla_parent_info" id="mla_parent_info" type="text" readonly="readonly" disabled="disabled" value="' . esc_attr( $parent_info ) . "\" /></span>\n";
1004
 
1005
- echo MLA::mla_set_parent_form( false );
1006
  }
1007
 
1008
  /**
@@ -1019,7 +1025,7 @@ class MLAEdit {
1019
 
1020
  $menu_order = apply_filters( 'mla_menu_order_meta_box', $post->menu_order, $post );
1021
 
1022
- echo '<label class="screen-reader-text" for="mla_menu_order">' . __( 'Menu Order', 'media-library-assistant' ) . '</label><input name="mla_menu_order" type="text" size="4" id="mla_menu_order" value="' . esc_attr( $menu_order ) . "\" />\n";
1023
  }
1024
 
1025
  /**
@@ -1044,7 +1050,7 @@ class MLAEdit {
1044
  $value = apply_filters( 'mla_image_metadata_meta_box', array( 'value' => $value, 'rows' => 5, 'cols' => 80 ), $metadata, $post );
1045
 
1046
  $html = '<label class="screen-reader-text" for="mla_image_metadata">' . __( 'Attachment Metadata', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_image_metadata" rows="' . absint( $value['rows'] ) . '" cols="' . absint( $value['cols'] ) . '" readonly="readonly" name="mla_image_metadata" >' . esc_textarea( $value['value'] ) . "</textarea>\n";
1047
- echo apply_filters( 'mla_image_metadata_meta_box_html', $html, $value, $metadata, $post );
1048
  }
1049
 
1050
  /**
@@ -1078,8 +1084,7 @@ class MLAEdit {
1078
  $features = apply_filters( 'mla_featured_in_meta_box', array( 'features' => $features, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1079
 
1080
  $html = '<label class="screen-reader-text" for="mla_featured_in">' . __( 'Featured in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_featured_in" rows="' . absint( $features['rows'] ) . '" cols="' . absint( $features['cols'] ) . '" readonly="readonly" name="mla_featured_in" >' . esc_textarea( $features['features'] ) . "</textarea>\n";
1081
-
1082
- echo apply_filters( 'mla_featured_in_meta_box_html', $html, $features, self::$mla_references, $post );
1083
  }
1084
 
1085
  /**
@@ -1117,8 +1122,7 @@ class MLAEdit {
1117
  $inserts = apply_filters( 'mla_inserted_in_meta_box', array( 'inserts' => $inserts, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1118
 
1119
  $html = '<label class="screen-reader-text" for="mla_inserted_in">' . __( 'Inserted in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_inserted_in" rows="' . absint( $inserts['rows'] ) . '" cols="' . absint( $inserts['cols'] ) . '" readonly="readonly" name="mla_inserted_in" >' . esc_textarea( $inserts['inserts'] ) . "</textarea>\n";
1120
-
1121
- echo apply_filters( 'mla_inserted_in_meta_box_html', $html, $inserts, self::$mla_references, $post );
1122
  }
1123
 
1124
  /**
@@ -1152,8 +1156,7 @@ class MLAEdit {
1152
  $galleries = apply_filters( 'mla_gallery_in_meta_box', array( 'galleries' => $galleries, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1153
 
1154
  $html = '<label class="screen-reader-text" for="mla_gallery_in">' . __( 'Gallery in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_gallery_in" rows="' . absint( $galleries['rows'] ) . '" cols="' . absint( $galleries['cols'] ) . '" readonly="readonly" name="mla_gallery_in" >' . esc_textarea( $galleries['galleries'] ) . "</textarea>\n";
1155
-
1156
- echo apply_filters( 'mla_gallery_in_meta_box_html', $html, $galleries, self::$mla_references, $post );
1157
  }
1158
 
1159
  /**
@@ -1187,8 +1190,7 @@ class MLAEdit {
1187
  $galleries = apply_filters( 'mla_mla_gallery_in_meta_box', array( 'galleries' => $galleries, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1188
 
1189
  $html = '<label class="screen-reader-text" for="mla_mla_gallery_in">' . __( 'MLA Gallery in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_mla_gallery_in" rows="' . absint( $galleries['rows'] ) . '" cols="' . absint( $galleries['cols'] ) . '" readonly="readonly" name="mla_mla_gallery_in" >' . esc_textarea( $galleries['galleries'] ) . "</textarea>\n";
1190
-
1191
- echo apply_filters( 'mla_mla_gallery_in_meta_box_html', $html, $galleries, self::$mla_references, $post );
1192
  }
1193
 
1194
  /**
@@ -1204,15 +1206,15 @@ class MLAEdit {
1204
  public static function mla_edit_attachment_action( $post_ID ) {
1205
  $new_data = array();
1206
  if ( isset( $_REQUEST['mla_post_parent'] ) ) {
1207
- $new_data['post_parent'] = $_REQUEST['mla_post_parent'];
1208
  }
1209
 
1210
  if ( isset( $_REQUEST['mla_menu_order'] ) ) {
1211
- $new_data['menu_order'] = $_REQUEST['mla_menu_order'];
1212
  }
1213
 
1214
  if ( isset( $_REQUEST['mla_upload'] ) ) {
1215
- $date = $_REQUEST['mla_upload'];
1216
  $new_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $date['aa'], $date['mm'], $date['jj'], $date['hh'], $date['mn'], $date['ss'] );
1217
  if ( wp_checkdate( $date['mm'], $date['jj'], $date['aa'], $new_date ) ) {
1218
  if ( $date['original'] !== $new_date ) {
115
  */
116
  if ( 'editpost' == $_REQUEST['action'] ) {
117
  if ( isset( $_POST['tax_input'] ) && is_array( $_POST['tax_input'] ) ) {
118
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_POST['tax_input'] ) ) );
119
+ foreach( $taxonomies as $key ) {
120
+ if ( isset( $_POST['tax_input'][ $key ] ) && is_array( $_POST['tax_input'][ $key ] ) ) {
121
+ $tax = get_taxonomy( sanitize_text_field( $key ) );
122
  if ( $tax->hierarchical ) {
123
  continue;
124
  }
125
+
126
+ $value = array_map( 'sanitize_text_field', wp_unslash( $_POST['tax_input'][ $key ] ) );
127
  if ( false !== ( $bad_term = array_search( '0', $value ) ) ) {
128
  unset( $value[ $bad_term ] );
129
  }
130
+
131
  $comma = _x( ',', 'tag_delimiter', 'media-library-assistant' );
132
  $_POST['tax_input'][ $key ] = implode( $comma, $value );
133
  $_REQUEST['tax_input'][ $key ] = implode( $comma, $value );
213
  return;
214
  }
215
 
216
+ $post = get_post( absint( wp_unslash( $_REQUEST['post'] ) ) );
217
  if ( 'attachment' != $post->post_type ) {
218
  return;
219
  }
491
  $page_values = apply_filters( 'mla_upload_bulk_edit_form_values', $page_values );
492
  $page_template = apply_filters( 'mla_upload_bulk_edit_form_template', $page_template_array['page'] );
493
  $parse_value = MLAData::mla_parse_template( $page_template, $page_values );
494
+ // echo wp_kses( apply_filters( 'mla_upload_bulk_edit_form_parse', $parse_value, $page_template, $page_values ), 'post' );
495
+ echo apply_filters( 'mla_upload_bulk_edit_form_parse', $parse_value, $page_template, $page_values ); // phpcs:ignore
496
  }
497
 
498
  /**
526
  * stripslashes() call in MLA::mla_process_bulk_action().
527
  * wp_parse_args converts plus signs to spaces, which we must avoid.
528
  */
529
+ // $args = stripslashes( str_replace( '%5C%5C', '%5C%5C%5C%5C', $_REQUEST['mlaAddNewBulkEditFormString'] ) );
530
+ $args = str_replace( '&amp;', '&', str_replace( '%5C%5C', '%5C%5C%5C%5C', wp_kses( wp_unslash( $_REQUEST['mlaAddNewBulkEditFormString'] ), 'post' ) ) );
531
  $args = wp_parse_args( str_replace( '%2B', 'urlencodedmlaplussign', $args ) );
532
  foreach ( $args as $key => $arg ) {
533
+ // if ( is_string( $arg ) && 0 === strpos( $arg, 'template:' ) ) {
534
+ if ( is_string( $arg ) ) {
535
  $args[ $key ] = str_replace( 'urlencodedmlaplussign', '+', $arg );
536
  }
537
  }
636
 
637
  echo '<div class="timestamp-wrap">';
638
  /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
639
+ printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute ); // phpcs:ignore
640
 
641
  echo "</div>\n";
642
+ echo '<input type="hidden" id="ss" name="mla_' . esc_html( $field ) . '[ss]" value="' . esc_html( $ss ) . '" />' . "\n";
643
+ echo '<input type="hidden" id="original" name="mla_' . esc_html( $field ) . '[original]" value="' . esc_html( $date ) . '" />' . "\n";
644
 
645
  $time_adj = current_time('timestamp');
646
  $map = array(
653
  foreach ( $map as $timeunit => $value ) {
654
  list( $unit, $curr ) = $value;
655
 
656
+ echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden[' . $timeunit . ']" value="' . $unit . '" />' . "\n"; // phpcs:ignore
657
  $cur_timeunit = 'cur_' . $timeunit;
658
+ echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n"; // phpcs:ignore
659
  }
660
 
661
  echo "<p>\n";
662
+ echo '<a href="#edit_' . esc_html( $field ) . 'timestamp" class="save-timestamp hide-if-no-js button">' . esc_html__('OK') . "</a>\n";
663
+ echo '<a href="#edit_' . esc_html( $field ) . 'timestamp" class="cancel-timestamp hide-if-no-js button-cancel">' . esc_html__('Cancel') . "</a>\n";
664
  echo "<p>\n";
665
  }
666
 
678
  /* translators: date_i18n format for uploaded on, last modified date and time */
679
  $date_format = __( 'M j, Y @ H:i', 'media-library-assistant' );
680
 
681
+ $uploaded_date = date_i18n( $date_format, strtotime( $post->post_date ) );
682
  echo '<div class="misc-pub-section uploadtime misc-pub-uploadtime">' . "\n";
683
+ echo '<span id="upload-timestamp">' . sprintf( esc_html__( 'Uploaded on', 'media-library-assistant' ) . ":\n <b>%1\$s</b></span>\n", esc_html( $uploaded_date ) );
684
 
685
+ echo '<a href="#edit_uploadtime" class="edit-timestamp edit-uploadtime hide-if-no-js" role="button"><span aria-hidden="true">' . esc_html__( 'Edit' ) . "</span>\n";
686
+ echo '<span class="screen-reader-text">' . esc_html__( 'Edit upload date and time' ) . "</span></a>\n";
687
  echo '<fieldset id="timestampdiv" class="hide-if-js">' . "\n";
688
+ echo '<legend class="screen-reader-text">' . esc_html__( 'Upload Date and time' ) . "</legend>\n";
689
  self::_generate_time_edit_form( true ) . "\n";
690
  echo "</fieldset>\n";
691
  echo "</div><!-- .misc-pub-section -->\n";
692
 
693
  $modified_date = date_i18n($date_format, strtotime( $post->post_modified ) );
694
  echo '<div class="misc-pub-section modifytime misc-pub-modifytime">' . "\n";
695
+ echo '<span id="modify-timestamp">' . sprintf( esc_html__( 'Last modified', 'media-library-assistant' ) . ":\n <b>%1\$s</b></span>\n", esc_html( $modified_date ) );
696
  echo "</div><!-- .misc-pub-section -->\n";
697
 
698
  echo '<div class="misc-pub-section mla-links">' . "\n";
699
 
700
  $view_args = array( 'page' => MLACore::ADMIN_PAGE_SLUG, 'mla_item_ID' => $post->ID );
701
  if ( isset( $_REQUEST['mla_source'] ) ) {
702
+ $view_args['mla_source'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) );
703
 
704
  // apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete ) in /wp-includes/link-template.php
705
  add_filter( 'get_delete_post_link', 'MLAEdit::get_delete_post_link_filter', 10, 3 );
706
  }
707
+
708
  if ( isset( $_REQUEST['lang'] ) ) {
709
+ $view_args['lang'] = sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) );
710
  }
711
 
712
  echo '<span id="mla_metadata_links" style="font-weight: bold; line-height: 2em">';
713
 
714
  if ( isset( $_REQUEST['mla_source'] ) ) {
715
+ echo '<input name="mla_source" type="hidden" id="mla_source" value="' . esc_html( sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) ) ) . '" />';
716
  }
717
 
718
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_CUSTOM_FIELD_MAPPING ) ) {
719
+ echo '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( 'upload.php?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Map Custom Field metadata for this item', 'media-library-assistant' ) . '">' . __( 'Map Custom Field metadata', 'media-library-assistant' ) . '</a><br>'; // phpcs:ignore
720
  }
721
 
722
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_IPTC_EXIF_MAPPING ) ) {
723
+ echo '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( 'upload.php?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_MAP, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Map IPTC/EXIF metadata for this item', 'media-library-assistant' ) . '">' . __( 'Map IPTC/EXIF metadata', 'media-library-assistant' ) . '</a>'; // phpcs:ignore
724
  }
725
 
726
  echo "</span>\n";
1004
 
1005
  $parent_info = apply_filters( 'mla_parent_info_meta_box', $parent_info, self::$mla_references, $post );
1006
 
1007
+ echo '<label class="screen-reader-text" for="mla_post_parent">' . esc_html__( 'Post Parent', 'media-library-assistant' ) . '</label><input name="mla_post_parent" id="mla_post_parent" type="text" value="' . esc_html( $post->post_parent ) . "\" />\n";
1008
+ echo '<label class="screen-reader-text" for="mla_parent_info">' . esc_html__( 'Select Parent', 'media-library-assistant' ) . '</label><input name="post_parent_set" id="mla_set_parent" class="button-primary parent" type="button" value="' . esc_html__( 'Select', 'media-library-assistant' ) . '" />';
1009
+ echo '<label class="screen-reader-text" for="mla_parent_info">' . esc_html__( 'Parent Info', 'media-library-assistant' ) . '</label><input name="mla_parent_info" id="mla_parent_info" type="text" readonly="readonly" disabled="disabled" value="' . esc_attr( $parent_info ) . "\" /></span>\n";
1010
 
1011
+ echo MLA::mla_set_parent_form( false ); // phpcs:ignore
1012
  }
1013
 
1014
  /**
1025
 
1026
  $menu_order = apply_filters( 'mla_menu_order_meta_box', $post->menu_order, $post );
1027
 
1028
+ echo '<label class="screen-reader-text" for="mla_menu_order">' . esc_html__( 'Menu Order', 'media-library-assistant' ) . '</label><input name="mla_menu_order" type="text" size="4" id="mla_menu_order" value="' . esc_attr( $menu_order ) . "\" />\n";
1029
  }
1030
 
1031
  /**
1050
  $value = apply_filters( 'mla_image_metadata_meta_box', array( 'value' => $value, 'rows' => 5, 'cols' => 80 ), $metadata, $post );
1051
 
1052
  $html = '<label class="screen-reader-text" for="mla_image_metadata">' . __( 'Attachment Metadata', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_image_metadata" rows="' . absint( $value['rows'] ) . '" cols="' . absint( $value['cols'] ) . '" readonly="readonly" name="mla_image_metadata" >' . esc_textarea( $value['value'] ) . "</textarea>\n";
1053
+ echo apply_filters( 'mla_image_metadata_meta_box_html', $html, $value, $metadata, $post ); // phpcs:ignore
1054
  }
1055
 
1056
  /**
1084
  $features = apply_filters( 'mla_featured_in_meta_box', array( 'features' => $features, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1085
 
1086
  $html = '<label class="screen-reader-text" for="mla_featured_in">' . __( 'Featured in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_featured_in" rows="' . absint( $features['rows'] ) . '" cols="' . absint( $features['cols'] ) . '" readonly="readonly" name="mla_featured_in" >' . esc_textarea( $features['features'] ) . "</textarea>\n";
1087
+ echo apply_filters( 'mla_featured_in_meta_box_html', $html, $features, self::$mla_references, $post ); // phpcs:ignore
 
1088
  }
1089
 
1090
  /**
1122
  $inserts = apply_filters( 'mla_inserted_in_meta_box', array( 'inserts' => $inserts, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1123
 
1124
  $html = '<label class="screen-reader-text" for="mla_inserted_in">' . __( 'Inserted in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_inserted_in" rows="' . absint( $inserts['rows'] ) . '" cols="' . absint( $inserts['cols'] ) . '" readonly="readonly" name="mla_inserted_in" >' . esc_textarea( $inserts['inserts'] ) . "</textarea>\n";
1125
+ echo apply_filters( 'mla_inserted_in_meta_box_html', $html, $inserts, self::$mla_references, $post ); // phpcs:ignore
 
1126
  }
1127
 
1128
  /**
1156
  $galleries = apply_filters( 'mla_gallery_in_meta_box', array( 'galleries' => $galleries, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1157
 
1158
  $html = '<label class="screen-reader-text" for="mla_gallery_in">' . __( 'Gallery in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_gallery_in" rows="' . absint( $galleries['rows'] ) . '" cols="' . absint( $galleries['cols'] ) . '" readonly="readonly" name="mla_gallery_in" >' . esc_textarea( $galleries['galleries'] ) . "</textarea>\n";
1159
+ echo apply_filters( 'mla_gallery_in_meta_box_html', $html, $galleries, self::$mla_references, $post ); // phpcs:ignore
 
1160
  }
1161
 
1162
  /**
1190
  $galleries = apply_filters( 'mla_mla_gallery_in_meta_box', array( 'galleries' => $galleries, 'rows' => 5, 'cols' => 80 ), self::$mla_references, $post );
1191
 
1192
  $html = '<label class="screen-reader-text" for="mla_mla_gallery_in">' . __( 'MLA Gallery in', 'media-library-assistant' ) . '</label><textarea class="readonly" id="mla_mla_gallery_in" rows="' . absint( $galleries['rows'] ) . '" cols="' . absint( $galleries['cols'] ) . '" readonly="readonly" name="mla_mla_gallery_in" >' . esc_textarea( $galleries['galleries'] ) . "</textarea>\n";
1193
+ echo apply_filters( 'mla_mla_gallery_in_meta_box_html', $html, $galleries, self::$mla_references, $post ); // phpcs:ignore
 
1194
  }
1195
 
1196
  /**
1206
  public static function mla_edit_attachment_action( $post_ID ) {
1207
  $new_data = array();
1208
  if ( isset( $_REQUEST['mla_post_parent'] ) ) {
1209
+ $new_data['post_parent'] = absint( wp_unslash( $_REQUEST['mla_post_parent'] ) );
1210
  }
1211
 
1212
  if ( isset( $_REQUEST['mla_menu_order'] ) ) {
1213
+ $new_data['menu_order'] = absint( wp_unslash( $_REQUEST['mla_menu_order'] ) );
1214
  }
1215
 
1216
  if ( isset( $_REQUEST['mla_upload'] ) ) {
1217
+ $date = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_upload'] ) );
1218
  $new_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $date['aa'], $date['mm'], $date['jj'], $date['hh'], $date['mn'], $date['ss'] );
1219
  if ( wp_checkdate( $date['mm'], $date['jj'], $date['aa'], $new_date ) ) {
1220
  if ( $date['original'] !== $new_date ) {
includes/class-mla-file-downloader.php CHANGED
@@ -114,7 +114,7 @@ class MLAFileDownloader {
114
  echo '</head>';
115
  echo '';
116
  echo '<body>';
117
- echo $message;
118
  echo '</body>';
119
  echo '</html> ';
120
  }
114
  echo '</head>';
115
  echo '';
116
  echo '<body>';
117
+ echo esc_html( $message );
118
  echo '</body>';
119
  echo '</html> ';
120
  }
includes/class-mla-image-processor.php CHANGED
@@ -475,7 +475,7 @@ class MLAImageProcessor {
475
  ini_set( 'zlib.output_compression', 'Off' );
476
  }
477
 
478
- $file = $_REQUEST['mla_stream_file'];
479
  if ( ! is_file( $file ) ) {
480
  self::_mla_die( 'File not found', __LINE__, 404 );
481
  }
@@ -483,7 +483,7 @@ class MLAImageProcessor {
483
  $use_mutex = isset( $_REQUEST['mla_single_thread'] );
484
  $width = isset( $_REQUEST['mla_stream_width'] ) ? abs( intval( $_REQUEST['mla_stream_width'] ) ) : 0;
485
  $height = isset( $_REQUEST['mla_stream_height'] ) ? abs( intval( $_REQUEST['mla_stream_height'] ) ) : 0;
486
- $type = isset( $_REQUEST['mla_stream_type'] ) ? $_REQUEST['mla_stream_type'] : 'image/jpeg';
487
  $quality = isset( $_REQUEST['mla_stream_quality'] ) ? abs( intval( $_REQUEST['mla_stream_quality'] ) ) : 0;
488
  $frame = isset( $_REQUEST['mla_stream_frame'] ) ? abs( intval( $_REQUEST['mla_stream_frame'] ) ) : 0;
489
  $resolution = isset( $_REQUEST['mla_stream_resolution'] ) ? abs( intval( $_REQUEST['mla_stream_resolution'] ) ) : 72;
@@ -491,7 +491,7 @@ class MLAImageProcessor {
491
  * If mla_ghostscript_path is present, a non-standard GS location can be found in a file written by
492
  * the [mla_gallery] shortcode processor.
493
  */
494
- $ghostscript_path = isset( $_REQUEST['mla_ghostscript_path'] ) ? $_REQUEST['mla_ghostscript_path'] : '';
495
  if ( ! empty( $ghostscript_path ) ) {
496
  $ghostscript_path = @file_get_contents( dirname( __FILE__ ) . '/' . 'mla-ghostscript-path.txt' );
497
  }
@@ -570,7 +570,7 @@ class MLAImageProcessor {
570
  */
571
  try {
572
  header( "Content-Type: $type" );
573
- echo self::$image->getImageBlob();
574
  }
575
  catch ( Exception $e ) {
576
  self::_mla_die( 'Image stream exception: ' . $e->getMessage(), __LINE__, 500 );
475
  ini_set( 'zlib.output_compression', 'Off' );
476
  }
477
 
478
+ $file = wp_kses( isset( $_REQUEST['mla_stream_file'] ) ? wp_unslash( $_REQUEST['mla_stream_file'] ) : '', 'post' );
479
  if ( ! is_file( $file ) ) {
480
  self::_mla_die( 'File not found', __LINE__, 404 );
481
  }
483
  $use_mutex = isset( $_REQUEST['mla_single_thread'] );
484
  $width = isset( $_REQUEST['mla_stream_width'] ) ? abs( intval( $_REQUEST['mla_stream_width'] ) ) : 0;
485
  $height = isset( $_REQUEST['mla_stream_height'] ) ? abs( intval( $_REQUEST['mla_stream_height'] ) ) : 0;
486
+ $type = isset( $_REQUEST['mla_stream_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_stream_type'] ) ) : 'image/jpeg';
487
  $quality = isset( $_REQUEST['mla_stream_quality'] ) ? abs( intval( $_REQUEST['mla_stream_quality'] ) ) : 0;
488
  $frame = isset( $_REQUEST['mla_stream_frame'] ) ? abs( intval( $_REQUEST['mla_stream_frame'] ) ) : 0;
489
  $resolution = isset( $_REQUEST['mla_stream_resolution'] ) ? abs( intval( $_REQUEST['mla_stream_resolution'] ) ) : 72;
491
  * If mla_ghostscript_path is present, a non-standard GS location can be found in a file written by
492
  * the [mla_gallery] shortcode processor.
493
  */
494
+ $ghostscript_path = wp_kses( isset( $_REQUEST['mla_ghostscript_path'] ) ? wp_unslash( $_REQUEST['mla_ghostscript_path'] ) : '', 'post' );
495
  if ( ! empty( $ghostscript_path ) ) {
496
  $ghostscript_path = @file_get_contents( dirname( __FILE__ ) . '/' . 'mla-ghostscript-path.txt' );
497
  }
570
  */
571
  try {
572
  header( "Content-Type: $type" );
573
+ echo self::$image->getImageBlob(); // phpcs:ignore
574
  }
575
  catch ( Exception $e ) {
576
  self::_mla_die( 'Image stream exception: ' . $e->getMessage(), __LINE__, 500 );
includes/class-mla-list-table.php CHANGED
@@ -239,7 +239,7 @@ class MLA_List_Table extends WP_List_Table {
239
  $tax_filter = MLACore::mla_taxonomy_support('', 'filter');
240
 
241
  if ( MLACoreOptions::MLA_FILTER_METAKEY == $tax_filter ) {
242
- if ( 0 == intval( $selected ) ) {
243
  $selected = MLACoreOptions::ALL_MLA_FILTER_METAKEY;
244
  }
245
 
@@ -301,37 +301,38 @@ class MLA_List_Table extends WP_List_Table {
301
 
302
  // View arguments
303
  if ( isset( $_REQUEST['post_mime_type'] ) ) {
304
- $submenu_arguments['post_mime_type'] = urlencode( $_REQUEST['post_mime_type'] );
305
  }
306
 
307
  if ( isset( $_REQUEST['detached'] ) ) {
308
  if ( ( '0' === $_REQUEST['detached'] ) || ( '1' === $_REQUEST['detached'] ) ) {
309
- $submenu_arguments['detached'] = $_REQUEST['detached'];
310
  }
311
  }
312
 
313
  if ( isset( $_REQUEST['status'] ) ) {
314
  if ( 'trash' === $_REQUEST['status'] ) {
315
- $submenu_arguments['status'] = $_REQUEST['status'];
316
  }
317
  }
318
 
319
  if ( isset( $_REQUEST['meta_query'] ) ) {
320
- $submenu_arguments['meta_query'] = urlencode( stripslashes( $_REQUEST['meta_query'] ) );
321
  }
322
 
323
  // Search box arguments
324
  if ( !empty( $_REQUEST['s'] ) ) {
325
- $submenu_arguments['s'] = urlencode( stripslashes( $_REQUEST['s'] ) );
326
 
327
  if ( isset( $_REQUEST['mla_search_connector'] ) ) {
328
- $submenu_arguments['mla_search_connector'] = ( 'OR' === strtoupper( $_REQUEST['mla_search_connector'] ) ) ? 'OR' : 'AND';
329
  }
330
 
331
  if ( isset( $_REQUEST['mla_search_fields'] ) ) {
 
332
  $submenu_arguments['mla_search_fields'] = array();
333
- foreach ( $_REQUEST['mla_search_fields'] as $key => $value ) {
334
- $submenu_arguments['mla_search_fields'][ $key ] = urlencode( stripslashes( $value ) );
335
  }
336
  }
337
  }
@@ -342,20 +343,30 @@ class MLA_List_Table extends WP_List_Table {
342
  $submenu_arguments['m'] = absint( $_REQUEST['m'] );
343
  }
344
 
345
- if ( isset( $_REQUEST['mla_filter_term'] ) && ( '0' != $_REQUEST['mla_filter_term'] ) ) {
346
- // Format numeric, can be negative
347
- $submenu_arguments['mla_filter_term'] = intval( $_REQUEST['mla_filter_term'] );
 
 
 
 
 
 
 
 
 
348
  }
349
 
350
  // Sort arguments (from column header)
351
  if ( isset( $_REQUEST['order'] ) ) {
352
- $submenu_arguments['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
353
  }
354
 
355
  if ( isset( $_REQUEST['orderby'] ) ) {
356
  foreach ( MLAQuery::$default_sortable_columns as $sortable_column ) {
357
- if ( $sortable_column[0] == $_REQUEST['orderby'] ) {
358
- $submenu_arguments['orderby'] = urlencode( $_REQUEST['orderby'] );
359
  }
360
  }
361
  }
@@ -363,7 +374,7 @@ class MLA_List_Table extends WP_List_Table {
363
  // Filter arguments (from interior table cells)
364
  if ( $include_filters ) {
365
  if ( isset( $_REQUEST['heading_suffix'] ) ) {
366
- $submenu_arguments['heading_suffix'] = urlencode( stripslashes( $_REQUEST['heading_suffix'] ) );
367
  }
368
 
369
  if ( isset( $_REQUEST['parent'] ) ) {
@@ -375,19 +386,19 @@ class MLA_List_Table extends WP_List_Table {
375
  }
376
 
377
  if ( isset( $_REQUEST['mla-tax'] ) ) {
378
- $submenu_arguments['mla-tax'] = urlencode( $_REQUEST['mla-tax'] );
379
  }
380
 
381
  if ( isset( $_REQUEST['mla-term'] ) ) {
382
- $submenu_arguments['mla-term'] = urlencode( $_REQUEST['mla-term'] );
383
  }
384
 
385
  if ( isset( $_REQUEST['mla-metakey'] ) ) {
386
- $submenu_arguments['mla-metakey'] = urlencode( $_REQUEST['mla-metakey'] );
387
  }
388
 
389
  if ( isset( $_REQUEST['mla-metavalue'] ) ) {
390
- $submenu_arguments['mla-metavalue'] = urlencode( $_REQUEST['mla-metavalue'] );
391
  }
392
  }
393
 
@@ -755,14 +766,12 @@ class MLA_List_Table extends WP_List_Table {
755
  $att_title = _draft_or_post_title( $item );
756
 
757
  if ( ( $this->rollover_id != $item->ID ) && !in_array( $column, $this->currently_hidden ) ) {
758
- /*
759
- * Build rollover actions
760
- */
761
  $view_args = array_merge( array( 'page' => MLACore::ADMIN_PAGE_SLUG, 'mla_item_ID' => $item->ID ),
762
  self::mla_submenu_arguments() );
763
 
764
  if ( isset( $_REQUEST['paged'] ) ) {
765
- $view_args['paged'] = $_REQUEST['paged'];
766
  }
767
 
768
  if ( $this->is_trash ) {
@@ -1624,7 +1633,7 @@ class MLA_List_Table extends WP_List_Table {
1624
  * @param string 'top' | 'bottom'
1625
  */
1626
  function pagination( $which ) {
1627
- $save_uri = $_SERVER['REQUEST_URI'];
1628
  $_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );
1629
  parent::pagination( $which );
1630
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1686,7 +1695,7 @@ class MLA_List_Table extends WP_List_Table {
1686
  * @param bool $with_id Whether to set the id attribute or not
1687
  */
1688
  function print_column_headers( $with_id = true ) {
1689
- $save_uri = $_SERVER['REQUEST_URI'];
1690
  $_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );
1691
  parent::print_column_headers( $with_id );
1692
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1847,9 +1856,7 @@ class MLA_List_Table extends WP_List_Table {
1847
  * @return array View information,e.g., array ( id => link )
1848
  */
1849
  function get_views( ) {
1850
- /*
1851
- * Find current view
1852
- */
1853
  if ( $this->detached ) {
1854
  $current_view = 'detached';
1855
  } elseif ( $this->attached ) {
@@ -1858,13 +1865,13 @@ class MLA_List_Table extends WP_List_Table {
1858
  $current_view = 'trash';
1859
  } elseif ( empty( $_REQUEST['post_mime_type'] ) ) {
1860
  if ( isset( $_REQUEST['meta_query'] ) ) {
1861
- $query = json_decode( stripslashes( $_REQUEST['meta_query'] ), true );
1862
  $current_view = $query['slug'];
1863
  } else {
1864
  $current_view = 'all';
1865
  }
1866
  } else {
1867
- $current_view = $_REQUEST['post_mime_type'];
1868
  }
1869
 
1870
  $mla_types = MLAMime::mla_query_view_items( array( 'orderby' => 'menu_order' ), 0, 0 );
@@ -1872,9 +1879,7 @@ class MLA_List_Table extends WP_List_Table {
1872
  $mla_types = array ();
1873
  }
1874
 
1875
- /*
1876
- * Filter the list, generate the views
1877
- */
1878
  $view_links = array();
1879
  foreach ( $mla_types as $value ) {
1880
  if ( $value->table_view ) {
@@ -1939,7 +1944,7 @@ class MLA_List_Table extends WP_List_Table {
1939
 
1940
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
1941
  <?php if ( 'top' === $which && MLAQuery::$wp_4dot0_plus && ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_SCREEN_DISPLAY_SWITCHER ) )): ?>
1942
- <div class="view-switch media-grid-view-switch" style="float: left"> <a class="view-list current" href="<?php echo admin_url( 'upload.php?page=' . MLACore::ADMIN_PAGE_SLUG ); ?>"> <span class="screen-reader-text">List View</span> </a> <a class="view-grid" href="<?php echo admin_url( 'upload.php?mode=grid' ); ?>"> <span class="screen-reader-text">Grid View</span> </a> </div>
1943
  <?php endif; ?>
1944
 
1945
  <?php if ( $this->has_items() ): ?>
@@ -1968,9 +1973,7 @@ class MLA_List_Table extends WP_List_Table {
1968
  * @return void
1969
  */
1970
  function extra_tablenav( $which ) {
1971
- /*
1972
- * Decide which actions to show
1973
- */
1974
  if ( 'top' == $which ) {
1975
  $actions = array( 'month', 'mla_filter_term', 'mla_filter' );
1976
 
@@ -2004,7 +2007,7 @@ class MLA_List_Table extends WP_List_Table {
2004
  $this->months_dropdown( 'attachment' );
2005
  break;
2006
  case 'mla_filter_term':
2007
- echo self::mla_get_taxonomy_filter_dropdown( isset( $_REQUEST['mla_filter_term'] ) ? $_REQUEST['mla_filter_term'] : 0 );
2008
  break;
2009
  case 'mla_filter':
2010
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'post-query-submit' ) );
@@ -2101,8 +2104,8 @@ class MLA_List_Table extends WP_List_Table {
2101
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
2102
  }
2103
 
2104
- echo '<tr id="attachment-' . $item->ID . '"' . $row_class . '>';
2105
- echo parent::single_row_columns( $item );
2106
  echo '</tr>';
2107
  }
2108
  } // class MLA_List_Table
239
  $tax_filter = MLACore::mla_taxonomy_support('', 'filter');
240
 
241
  if ( MLACoreOptions::MLA_FILTER_METAKEY == $tax_filter ) {
242
+ if ( 0 === $selected ) {
243
  $selected = MLACoreOptions::ALL_MLA_FILTER_METAKEY;
244
  }
245
 
301
 
302
  // View arguments
303
  if ( isset( $_REQUEST['post_mime_type'] ) ) {
304
+ $submenu_arguments['post_mime_type'] = urlencode( sanitize_text_field( wp_unslash( $_REQUEST['post_mime_type'] ) ) );
305
  }
306
 
307
  if ( isset( $_REQUEST['detached'] ) ) {
308
  if ( ( '0' === $_REQUEST['detached'] ) || ( '1' === $_REQUEST['detached'] ) ) {
309
+ $submenu_arguments['detached'] = ( '1' === $_REQUEST['detached'] ) ? '1' : 0;
310
  }
311
  }
312
 
313
  if ( isset( $_REQUEST['status'] ) ) {
314
  if ( 'trash' === $_REQUEST['status'] ) {
315
+ $submenu_arguments['status'] = 'trash';
316
  }
317
  }
318
 
319
  if ( isset( $_REQUEST['meta_query'] ) ) {
320
+ $submenu_arguments['meta_query'] = urlencode( wp_kses( wp_unslash( $_REQUEST['meta_query'] ), 'post' ) );
321
  }
322
 
323
  // Search box arguments
324
  if ( !empty( $_REQUEST['s'] ) ) {
325
+ $submenu_arguments['s'] = urlencode( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
326
 
327
  if ( isset( $_REQUEST['mla_search_connector'] ) ) {
328
+ $submenu_arguments['mla_search_connector'] = ( 'OR' === strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['mla_search_connector'] ) ) ) ) ? 'OR' : 'AND';
329
  }
330
 
331
  if ( isset( $_REQUEST['mla_search_fields'] ) ) {
332
+ $mla_search_fields = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_search_fields'] ) );
333
  $submenu_arguments['mla_search_fields'] = array();
334
+ foreach ( $mla_search_fields as $key => $value ) {
335
+ $submenu_arguments['mla_search_fields'][ $key ] = urlencode( $value );
336
  }
337
  }
338
  }
343
  $submenu_arguments['m'] = absint( $_REQUEST['m'] );
344
  }
345
 
346
+ // ['mla_filter_term'] - filter by taxonomy term ID (-1 allowed), or by custom field
347
+ if ( isset( $_REQUEST['mla_filter_term'] ) ) {
348
+ if ( MLACoreOptions::MLA_FILTER_METAKEY == MLACore::mla_taxonomy_support('', 'filter') ) {
349
+ if ( MLACoreOptions::ALL_MLA_FILTER_METAKEY != $_REQUEST['mla_filter_term'] ) {
350
+ $submenu_arguments['mla_filter_term'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_filter_term'] ) );
351
+ }
352
+ } else {
353
+ if ( '0' !== $_REQUEST['mla_filter_term'] ) {
354
+ // Format numeric, can be negative
355
+ $submenu_arguments['mla_filter_term'] = intval( $_REQUEST['mla_filter_term'] );
356
+ }
357
+ }
358
  }
359
 
360
  // Sort arguments (from column header)
361
  if ( isset( $_REQUEST['order'] ) ) {
362
+ $field = strtolower( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
363
+ $submenu_arguments['order'] = ( 'desc' === $field ) ? 'desc' : 'asc';
364
  }
365
 
366
  if ( isset( $_REQUEST['orderby'] ) ) {
367
  foreach ( MLAQuery::$default_sortable_columns as $sortable_column ) {
368
+ if ( $sortable_column[0] === $_REQUEST['orderby'] ) {
369
+ $submenu_arguments['orderby'] = urlencode( $sortable_column[0] );
370
  }
371
  }
372
  }
374
  // Filter arguments (from interior table cells)
375
  if ( $include_filters ) {
376
  if ( isset( $_REQUEST['heading_suffix'] ) ) {
377
+ $submenu_arguments['heading_suffix'] = urlencode( sanitize_text_field( wp_unslash( $_REQUEST['heading_suffix'] ) ) );
378
  }
379
 
380
  if ( isset( $_REQUEST['parent'] ) ) {
386
  }
387
 
388
  if ( isset( $_REQUEST['mla-tax'] ) ) {
389
+ $submenu_arguments['mla-tax'] = urlencode( sanitize_text_field( wp_unslash( $_REQUEST['mla-tax'] ) ) );
390
  }
391
 
392
  if ( isset( $_REQUEST['mla-term'] ) ) {
393
+ $submenu_arguments['mla-term'] = urlencode( sanitize_text_field( wp_unslash( $_REQUEST['mla-term'] ) ) );
394
  }
395
 
396
  if ( isset( $_REQUEST['mla-metakey'] ) ) {
397
+ $submenu_arguments['mla-metakey'] = urlencode( sanitize_text_field( wp_unslash( $_REQUEST['mla-metakey'] ) ) );
398
  }
399
 
400
  if ( isset( $_REQUEST['mla-metavalue'] ) ) {
401
+ $submenu_arguments['mla-metavalue'] = urlencode( wp_kses( wp_unslash( $_REQUEST['mla-metavalue'] ), 'post' ) );
402
  }
403
  }
404
 
766
  $att_title = _draft_or_post_title( $item );
767
 
768
  if ( ( $this->rollover_id != $item->ID ) && !in_array( $column, $this->currently_hidden ) ) {
769
+ // Build rollover actions
 
 
770
  $view_args = array_merge( array( 'page' => MLACore::ADMIN_PAGE_SLUG, 'mla_item_ID' => $item->ID ),
771
  self::mla_submenu_arguments() );
772
 
773
  if ( isset( $_REQUEST['paged'] ) ) {
774
+ $view_args['paged'] = absint( $_REQUEST['paged'] );
775
  }
776
 
777
  if ( $this->is_trash ) {
1633
  * @param string 'top' | 'bottom'
1634
  */
1635
  function pagination( $which ) {
1636
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1637
  $_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );
1638
  parent::pagination( $which );
1639
  $_SERVER['REQUEST_URI'] = $save_uri;
1695
  * @param bool $with_id Whether to set the id attribute or not
1696
  */
1697
  function print_column_headers( $with_id = true ) {
1698
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1699
  $_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );
1700
  parent::print_column_headers( $with_id );
1701
  $_SERVER['REQUEST_URI'] = $save_uri;
1856
  * @return array View information,e.g., array ( id => link )
1857
  */
1858
  function get_views( ) {
1859
+ // Find current view
 
 
1860
  if ( $this->detached ) {
1861
  $current_view = 'detached';
1862
  } elseif ( $this->attached ) {
1865
  $current_view = 'trash';
1866
  } elseif ( empty( $_REQUEST['post_mime_type'] ) ) {
1867
  if ( isset( $_REQUEST['meta_query'] ) ) {
1868
+ $query = json_decode( wp_kses( wp_unslash( $_REQUEST['meta_query'] ), 'post' ), true );
1869
  $current_view = $query['slug'];
1870
  } else {
1871
  $current_view = 'all';
1872
  }
1873
  } else {
1874
+ $current_view = sanitize_text_field( wp_unslash( $_REQUEST['post_mime_type'] ) );
1875
  }
1876
 
1877
  $mla_types = MLAMime::mla_query_view_items( array( 'orderby' => 'menu_order' ), 0, 0 );
1879
  $mla_types = array ();
1880
  }
1881
 
1882
+ // Filter the list, generate the views
 
 
1883
  $view_links = array();
1884
  foreach ( $mla_types as $value ) {
1885
  if ( $value->table_view ) {
1944
 
1945
  <div class="tablenav <?php echo esc_attr( $which ); ?>">
1946
  <?php if ( 'top' === $which && MLAQuery::$wp_4dot0_plus && ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_SCREEN_DISPLAY_SWITCHER ) )): ?>
1947
+ <div class="view-switch media-grid-view-switch" style="float: left"> <a class="view-list current" href="<?php echo esc_url( admin_url( 'upload.php?page=' . MLACore::ADMIN_PAGE_SLUG ) ); ?>"> <span class="screen-reader-text">List View</span> </a> <a class="view-grid" href="<?php echo esc_url( admin_url( 'upload.php?mode=grid' ) ); ?>"> <span class="screen-reader-text">Grid View</span> </a> </div>
1948
  <?php endif; ?>
1949
 
1950
  <?php if ( $this->has_items() ): ?>
1973
  * @return void
1974
  */
1975
  function extra_tablenav( $which ) {
1976
+ // Decide which actions to show
 
 
1977
  if ( 'top' == $which ) {
1978
  $actions = array( 'month', 'mla_filter_term', 'mla_filter' );
1979
 
2007
  $this->months_dropdown( 'attachment' );
2008
  break;
2009
  case 'mla_filter_term':
2010
+ echo self::mla_get_taxonomy_filter_dropdown( isset( $_REQUEST['mla_filter_term'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_filter_term'] ) ) : 0 ); // phpcs:ignore
2011
  break;
2012
  case 'mla_filter':
2013
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'post-query-submit' ) );
2104
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
2105
  }
2106
 
2107
+ echo '<tr id="attachment-' . absint( $item->ID ) . '"' . esc_html( $row_class ) . '>';
2108
+ echo parent::single_row_columns( $item ); // phpcs:ignore
2109
  echo '</tr>';
2110
  }
2111
  } // class MLA_List_Table
includes/class-mla-main.php CHANGED
@@ -62,7 +62,7 @@ class MLA {
62
  $messages = self::$mla_language_support_error_messages;
63
 
64
  echo '<div class="error"><p><strong>The Media Library Assistant cannot activate multi-language support.</strong> Another plugin or theme has declared conflicting class, function or constant names:</p>'."\r\n";
65
- echo "<ul>{$messages}</ul>\r\n";
66
  echo '<p>You must resolve these conflicts before multi-language support can be activated.</p></div>'."\r\n";
67
  }
68
 
@@ -160,7 +160,7 @@ class MLA {
160
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
161
 
162
  $request = array (
163
- 'mla_download_file' => str_replace( '\\', '/', MLA_PLUGIN_PATH . 'examples/plugins/' . stripslashes( $_REQUEST['mla_download_example_plugin'] ) ),
164
  'mla_download_type' => 'text/plain',
165
  );
166
 
@@ -207,7 +207,7 @@ class MLA {
207
  if ( 'download-zip' == $bulk_action ) {
208
  // Exits after redirect unless it returns an error
209
  $_REQUEST['mla_zip_archive_error_message'] = self::_process_zip_archive_download( $_REQUEST );
210
- MLACore::mla_debug_add( __LINE__ . " MLA::_process_zip_archive_download message = " . var_export( $_REQUEST['mla_zip_archive_error_message'], true ), MLACore::MLA_DEBUG_CATEGORY_ANY );
211
  return;
212
  }
213
 
@@ -219,16 +219,17 @@ class MLA {
219
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
220
  }
221
 
222
- if ( apply_filters( 'mla_list_table_admin_action', true, $_REQUEST['mla_admin_action'], ( isset( $_REQUEST['mla_item_ID'] ) ? $_REQUEST['mla_item_ID'] : 0 ) ) ) {
 
223
  switch ( $_REQUEST['mla_admin_action'] ) {
224
  case MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP:
225
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_CUSTOM_FIELD_MAPPING ) ) {
226
- do_action( 'mla_begin_mapping', 'single_custom', $_REQUEST['mla_item_ID'] );
227
- $updates = MLAOptions::mla_evaluate_custom_field_mapping( $_REQUEST['mla_item_ID'], 'single_attachment_mapping' );
228
  do_action( 'mla_end_mapping' );
229
 
230
  if ( !empty( $updates ) ) {
231
- $item_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
232
  }
233
 
234
  $message = '101';
@@ -236,26 +237,26 @@ class MLA {
236
  $message = '103';
237
  }
238
 
239
- $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
240
- wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=' . $message ), 302 );
241
  exit;
242
  case MLACore::MLA_ADMIN_SINGLE_MAP:
243
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_IPTC_EXIF_MAPPING ) ) {
244
- $item = get_post( $_REQUEST['mla_item_ID'] );
245
- do_action( 'mla_begin_mapping', 'single_iptc_exif', $_REQUEST['mla_item_ID'] );
246
  $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
247
  do_action( 'mla_end_mapping' );
248
- $page_content = MLAData::mla_update_single_item( $_REQUEST['mla_item_ID'], $updates );
249
  $message = '102';
250
  } else {
251
  $message = '104';
252
  }
253
 
254
- $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
255
- wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $_REQUEST['mla_item_ID'] . '&action=edit&message=' . $message ), 302 );
256
  exit;
257
  default:
258
- do_action( 'mla_list_table_custom_admin_action', $_REQUEST['mla_admin_action'], ( isset( $_REQUEST['mla_item_ID'] ) ? $_REQUEST['mla_item_ID'] : 0 ) );
259
  // ignore the rest
260
  } // switch ($_REQUEST['mla_admin_action'])
261
  } // apply_filters mla_list_table_admin_action
@@ -284,8 +285,8 @@ class MLA {
284
  }
285
 
286
  echo " ul.subsubsub {\n";
287
- echo " width: {$width_value};\n";
288
- echo " max-width: {$width_value};\n";
289
  echo " }\n";
290
  }
291
 
@@ -307,8 +308,8 @@ class MLA {
307
  $icon_width = $icon_height = $icon_value . 'px';
308
 
309
  echo " height: auto;\n";
310
- echo " max-width: {$icon_width};\n";
311
- echo " max-height: {$icon_height};\n";
312
  } else {
313
  if ( empty( $icon_value ) ) {
314
  if ( MLATest::$wp_4dot3_plus ) {
@@ -319,13 +320,13 @@ class MLA {
319
  }
320
 
321
  $icon_width = absint( $icon_value ) . 'px';
322
- echo " max-width: {$icon_width};\n";
323
 
324
  if ( MLATest::$wp_4dot3_plus ) {
325
  echo " max-height: auto;\n";
326
  } else {
327
  $icon_height = ( absint( .75 * (float) $icon_value ) ) . 'px';
328
- echo " max-height: {$icon_height};\n";
329
  }
330
  }
331
 
@@ -354,7 +355,7 @@ class MLA {
354
  $column_width = ( $icon_value + 30 ) . 'px';
355
 
356
  echo " table.attachments th.column-primary {\n";
357
- echo " width: {$column_width};\n";
358
  echo " }\n";
359
  }
360
 
@@ -362,7 +363,7 @@ class MLA {
362
  echo " position: relative;\n";
363
 
364
  if ( $set_column_width ) {
365
- echo " width: {$column_width};\n";
366
  }
367
 
368
  echo " }\n";
@@ -371,7 +372,7 @@ class MLA {
371
  * Override defaults in /wp-admin/load-styles.php
372
  */
373
  echo " .fixed td.column-icon, .fixed th.column-icon {\n";
374
- echo " width: {$icon_width};\n";
375
  echo " }\n";
376
 
377
  /*
@@ -507,7 +508,7 @@ class MLA {
507
  add_action( 'load-upload.php', 'MLA::mla_load_media_action' );
508
 
509
  // Disable the MLA Download ZIP Example plugin, if necessary
510
- if ( isset( $_REQUEST['page'] ) && 'mla-menu' === $_REQUEST['page'] ) {
511
  $bulk_action = '';
512
  if ( isset( $_REQUEST['action'] ) && 'download-zip' === $_REQUEST['action']) {
513
  $bulk_action = 'download-zip';
@@ -602,12 +603,12 @@ class MLA {
602
 
603
  // Compose a message if returning from the Edit Media screen
604
  if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
605
- $query_args .= '&mla_admin_message=' . urlencode( sprintf( _n( 'Item permanently deleted.', '%d items permanently deleted.', $deleted, 'media-library-assistant' ), number_format_i18n( $_GET['deleted'] ) ) );
606
  }
607
 
608
- if ( ! empty( $_GET['trashed'] ) && $trashed = absint( $_GET['trashed'] ) ) {
609
  /* translators: 1: post ID */
610
- $query_args .= '&mla_admin_message=' . urlencode( sprintf( __( 'Item %1$d moved to Trash.', 'media-library-assistant' ), $_GET['ids'] ) );
611
  }
612
 
613
  wp_redirect( admin_url( 'upload.php' ) . $query_args, 302 );
@@ -878,7 +879,7 @@ class MLA {
878
  echo '</head>';
879
  echo '';
880
  echo '<body>';
881
- echo $message;
882
  echo '</body>';
883
  echo '</html> ';
884
  }
@@ -1274,7 +1275,7 @@ class MLA {
1274
 
1275
  // Check for failed ZIP Archive download request
1276
  if ( !empty( $_REQUEST['mla_zip_archive_error_message'] ) ) {
1277
- $page_content['message'] = $_REQUEST['mla_zip_archive_error_message'];
1278
  return $page_content;
1279
  }
1280
 
@@ -1483,7 +1484,7 @@ class MLA {
1483
  * @return void
1484
  */
1485
  public static function mla_clear_filter_by( $preserves = array() ) {
1486
- $filters = array( 'author', 'heading_suffix', 'ids', 'mla-metakey', 'mla-metavalue', 'mla-tax', 'mla-term', 'parent' );
1487
 
1488
  $filters = apply_filters( 'mla_list_table_clear_filter_by_filters', $filters, $preserves );
1489
  $preserves = apply_filters( 'mla_list_table_clear_filter_by_preserves', $preserves, $filters );
@@ -1508,8 +1509,9 @@ class MLA {
1508
  // Prevent _wp_http_referer recursion with method="get", preserve WPML/Polylang language selection
1509
  $_SERVER['REQUEST_URI'] = parse_url( admin_url( 'upload.php' ), PHP_URL_PATH ) . '?page=mla-menu';
1510
 
 
1511
  $query = array();
1512
- parse_str( strval( $_SERVER[ 'QUERY_STRING' ] ), $query );
1513
  if ( !empty( $query['lang'] ) ) {
1514
  $_SERVER['REQUEST_URI'] .= '&lang=' . $query['lang'];
1515
  }
@@ -1519,15 +1521,15 @@ class MLA {
1519
  * the month filter dropdown or sorting parameters
1520
  */
1521
  if ( isset( $_REQUEST['m'] ) ) {
1522
- $_GET['m'] = $_REQUEST['m'];
1523
  }
1524
 
1525
  if ( isset( $_REQUEST['order'] ) ) {
1526
- $_GET['order'] = $_REQUEST['order'];
1527
  }
1528
 
1529
  if ( isset( $_REQUEST['orderby'] ) ) {
1530
- $_GET['orderby'] = $_REQUEST['orderby'];
1531
  }
1532
 
1533
  // bulk_refresh simply refreshes the page, ignoring other bulk actions
@@ -1548,11 +1550,11 @@ class MLA {
1548
  }
1549
 
1550
  echo "<div class=\"wrap\">\n";
1551
- echo "<h1 class=\"wp-heading-inline\">{$page_title}"; // trailing </h1> is action-specific
1552
 
1553
  if ( !current_user_can( 'upload_files' ) ) {
1554
- echo ' - ' . __( 'ERROR', 'media-library-assistant' ) . "</h1>\n";
1555
- wp_die( __( 'You do not have permission to manage attachments.', 'media-library-assistant' ) );
1556
  }
1557
 
1558
  $heading_tail = "</h1>\n<a href=\"media-new.php\" class=\"page-title-action\">" . esc_html_x('Add New', 'file') . "</a>\n<hr class=\"wp-header-end\">\n";
@@ -1563,7 +1565,7 @@ class MLA {
1563
  );
1564
 
1565
  if ( !empty( $_REQUEST['mla_admin_message'] ) ) {
1566
- $page_content['message'] = $_REQUEST['mla_admin_message'];
1567
  }
1568
 
1569
  /*
@@ -1575,7 +1577,7 @@ class MLA {
1575
  }
1576
 
1577
  if ( isset( $_REQUEST['post_category'] ) ) {
1578
- $_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
1579
  unset ( $_REQUEST['post_category'] );
1580
  }
1581
 
@@ -1620,7 +1622,8 @@ class MLA {
1620
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
1621
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1622
 
1623
- $page_content = apply_filters( 'mla_list_table_single_action', NULL, $_REQUEST['mla_admin_action'], ( isset( $_REQUEST['mla_item_ID'] ) ? $_REQUEST['mla_item_ID'] : 0 ) );
 
1624
  if ( is_null( $page_content ) ) {
1625
  $prevent_default = false;
1626
  $custom_message = '';
@@ -1632,18 +1635,19 @@ class MLA {
1632
  if ( ! $prevent_default ) {
1633
  switch ( $_REQUEST['mla_admin_action'] ) {
1634
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
1635
- $page_content = self::_delete_single_item( $_REQUEST['mla_item_ID'] );
1636
  break;
1637
  case MLACore::MLA_ADMIN_SINGLE_RESTORE:
1638
- $page_content = self::_restore_single_item( $_REQUEST['mla_item_ID'] );
1639
  break;
1640
  case MLACore::MLA_ADMIN_SINGLE_TRASH:
1641
- $page_content = self::_trash_single_item( $_REQUEST['mla_item_ID'] );
1642
  break;
1643
  case MLACore::MLA_ADMIN_SET_PARENT:
1644
- $new_data = array( 'post_parent' => $_REQUEST['found_post_id'] );
1645
 
1646
- foreach( $_REQUEST['children'] as $child ) {
 
1647
  $item_content = MLAData::mla_update_single_item( $child, $new_data );
1648
  $page_content['message'] .= $item_content['message'] . '<br>';
1649
  }
@@ -1660,7 +1664,12 @@ class MLA {
1660
  * This will be handled as a database query argument,
1661
  * but validate the arguments here
1662
  */
1663
- $mla_terms_search = isset( $_REQUEST['mla_terms_search'] ) ? $_REQUEST['mla_terms_search'] : array( 'phrases' => '', 'taxonomies' => array() );
 
 
 
 
 
1664
  if ( ! is_array( $mla_terms_search ) || empty( $mla_terms_search['phrases'] ) || empty( $mla_terms_search['taxonomies'] ) ) {
1665
  unset( $_REQUEST['mla_terms_search'] );
1666
  $page_content = array(
@@ -1672,11 +1681,11 @@ class MLA {
1672
  }
1673
  break;
1674
  default:
1675
- $page_content = apply_filters( 'mla_list_table_custom_single_action', NULL, $_REQUEST['mla_admin_action'], ( isset( $_REQUEST['mla_item_ID'] ) ? $_REQUEST['mla_item_ID'] : 0 ) );
1676
  if ( is_null( $page_content ) ) {
1677
  $page_content = array(
1678
  /* translators: 1: row-level action, e.g., single_item_delete, single_item_edit */
1679
- 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] ),
1680
  'body' => ''
1681
  );
1682
  } // Unknown mla_admin_action
@@ -1710,26 +1719,26 @@ class MLA {
1710
  $messages_class = 'mla_messages';
1711
  }
1712
 
1713
- echo " <div class=\"{$messages_class}\"><p>\n";
1714
- echo ' ' . $page_content['message'] . "\n";
1715
  echo " </p></div>\n"; // id="message"
1716
  }
1717
 
1718
- echo $page_content['body'];
1719
  } else {
1720
  // Display Attachments list
1721
  if ( !empty( $_REQUEST['heading_suffix'] ) ) {
1722
- echo ' - ' . esc_html( $_REQUEST['heading_suffix'] ) . $heading_tail;
1723
  } elseif ( !empty( $_REQUEST['mla_terms_search'] ) ) {
1724
- echo ' - ' . __( 'term search results for', 'media-library-assistant' ) . ' "' . esc_html( stripslashes( trim( $_REQUEST['mla_terms_search']['phrases'] ) ) ) . "\"" . $heading_tail;
1725
  } elseif ( !empty( $_REQUEST['s'] ) ) {
1726
  if ( empty( $_REQUEST['mla_search_fields'] ) ) {
1727
- echo ' - ' . __( 'post/parent results for', 'media-library-assistant' ) . ' "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . "\"" . $heading_tail;
1728
  } else {
1729
- echo ' - ' . __( 'search results for', 'media-library-assistant' ) . ' "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . "\"" . $heading_tail;
1730
  }
1731
  } else {
1732
- echo $heading_tail;
1733
  }
1734
 
1735
  if ( !empty( $page_content['message'] ) ) {
@@ -1739,8 +1748,8 @@ class MLA {
1739
  $messages_class = 'mla_messages';
1740
  }
1741
 
1742
- echo " <div class=\"{$messages_class}\"><p>\n";
1743
- echo ' ' . $page_content['message'] . "\n";
1744
  echo " </p></div>\n"; // id="message"
1745
  }
1746
 
@@ -1762,22 +1771,22 @@ class MLA {
1762
  }
1763
 
1764
  // Forms are NOT created automatically, wrap the table in one to use features like bulk actions
1765
- echo "\n" . '<form action="' . admin_url( $form_url ) . '" method="get" id="mla-filter">' . "\n";
1766
 
1767
  // Include the Search Media box
1768
  require_once MLA_PLUGIN_PATH . 'includes/mla-main-search-box-template.php';
1769
 
1770
  // We also need to ensure that the form posts back to our current page and remember all the view arguments
1771
- echo sprintf( '<input type="hidden" name="page" value="%1$s" />', $_REQUEST['page'] ) . "\n";
1772
 
1773
  // Pass the WPML/Polylang language in the form
1774
  if ( isset( $view_arguments['lang'] ) ) {
1775
- echo sprintf( '<input type="hidden" name="lang" value="%1$s" />', $view_arguments['lang'] ) . "\n";
1776
  }
1777
 
1778
  foreach ( $view_arguments as $key => $value ) {
1779
- if ( 'meta_query' == $key ) {
1780
- $value = stripslashes( $_REQUEST['meta_query'] );
1781
  }
1782
 
1783
  /*
@@ -1789,10 +1798,11 @@ class MLA {
1789
  }
1790
 
1791
  if ( is_array( $value ) ) {
1792
- foreach ( $value as $element_key => $element_value )
1793
- echo sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( $element_value ) ) . "\n";
 
1794
  } else {
1795
- echo sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( $value ) ) . "\n";
1796
  }
1797
  }
1798
 
@@ -1800,10 +1810,8 @@ class MLA {
1800
  $MLAListTable->display();
1801
  echo "</form><!-- id=mla-filter -->\n";
1802
 
1803
- /*
1804
- * Insert the hidden form and table for inline edits (quick & bulk)
1805
- */
1806
- echo self::_build_inline_edit_form( $MLAListTable );
1807
 
1808
  echo "<div id=\"ajax-response\"></div>\n";
1809
  echo "<br class=\"clear\" />\n";
@@ -1828,24 +1836,24 @@ class MLA {
1828
  }
1829
 
1830
  if ( isset( $_REQUEST['post_category'] ) ) {
1831
- $_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
1832
  unset ( $_REQUEST['post_category'] );
1833
  }
1834
 
1835
- /*
1836
- * Convert bulk_action to the old button name/value variables
1837
- */
1838
- switch ( $_REQUEST['bulk_action'] ) {
1839
- case 'bulk_custom_field_map':
1840
- $_REQUEST['bulk_custom_field_map'] = __( 'Map Custom Field metadata', 'media-library-assistant' );
1841
- break;
1842
- case 'bulk_map':
1843
- $_REQUEST['bulk_map'] = __( 'Map IPTC/EXIF metadata', 'media-library-assistant' );
1844
- break;
1845
- case 'bulk_edit':
1846
- $_REQUEST['bulk_edit'] = __( 'Update', 'media-library-assistant' );
1847
  }
1848
-
1849
  $item_content = (object) self::mla_process_bulk_action( 'edit' );
1850
  wp_send_json_success( $item_content );
1851
  }
@@ -1860,7 +1868,9 @@ class MLA {
1860
  * @return void echo HTML <tr> markup for updated row or error message, then die()
1861
  */
1862
  public static function mla_inline_edit_ajax_action() {
1863
- set_current_screen( $_REQUEST['screen'] );
 
 
1864
 
1865
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1866
 
@@ -1869,21 +1879,21 @@ class MLA {
1869
  }
1870
 
1871
  if ( empty( $_REQUEST['post_ID'] ) ) {
1872
- echo __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'No post ID found', 'media-library-assistant' );
1873
  die();
1874
  } else {
1875
- $post_id = $_REQUEST['post_ID'];
1876
  }
1877
 
1878
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
1879
- wp_die( __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) );
1880
  }
1881
 
1882
  // Custom field support
1883
  $custom_fields = array();
1884
  foreach ( MLACore::mla_custom_field_support( 'quick_edit' ) as $slug => $details ) {
1885
  if ( isset( $_REQUEST[ $slug ] ) ) {
1886
- $value = trim( $_REQUEST[ $slug ] );
1887
  unset ( $_REQUEST[ $slug ] );
1888
 
1889
  // '(Array)' indicates an existing array value in the field, which we preserve
@@ -1911,40 +1921,44 @@ class MLA {
1911
  }
1912
 
1913
  if ( isset( $_REQUEST['post_category'] ) ) {
1914
- $_REQUEST['tax_input']['category'] = $_REQUEST['post_category'];
1915
  unset ( $_REQUEST['post_category'] );
1916
  }
1917
 
 
1918
  if ( ! empty( $_REQUEST['tax_input'] ) ) {
1919
  // Flat taxonomy strings must be cleaned up and duplicates removed
1920
- $tax_output = array();
1921
- foreach ( $_REQUEST['tax_input'] as $tax_name => $tax_value ) {
1922
- if ( is_array( $tax_value ) ) {
1923
- // Make sure term_id values are integers, not strings, for flat-checklist
1924
- $tax_value = array_map( 'absint', $tax_value );
1925
- } else {
1926
- $comma = _x( ',', 'tag_delimiter', 'media-library-assistant' );
1927
- if ( ',' != $comma ) {
1928
- $tax_value = str_replace( $comma, ',', $tax_value );
1929
- }
1930
-
1931
- $tax_value = preg_replace( '#\s*,\s*#', ',', $tax_value );
1932
- $tax_value = preg_replace( '#,+#', ',', $tax_value );
1933
- $tax_value = preg_replace( '#[,\s]+$#', '', $tax_value );
1934
- $tax_value = preg_replace( '#^[,\s]+#', '', $tax_value );
1935
-
1936
- if ( ',' != $comma ) {
1937
- $tax_value = str_replace( ',', $comma, $tax_value );
1938
- }
1939
-
1940
- $tax_array = array();
1941
- $dedup_array = explode( $comma, $tax_value );
1942
- foreach ( $dedup_array as $tax_value )
1943
- $tax_array [$tax_value] = $tax_value;
1944
-
1945
- $tax_value = implode( $comma, $tax_array );
1946
- } // ! array( $tax_value )
1947
-
 
 
 
1948
  $tax_output[$tax_name] = $tax_value;
1949
  } // foreach tax_input
1950
 
@@ -1963,13 +1977,18 @@ class MLA {
1963
  if ( ! $prevent_default ) {
1964
  MLACore::mla_debug_add( __LINE__ . " MLA::mla_inline_edit_ajax_action( {$post_id} ) \$_REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1965
 
1966
- $new_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $_REQUEST['aa'], $_REQUEST['mm'], $_REQUEST['jj'], $_REQUEST['hh'], $_REQUEST['mn'], $_REQUEST['ss'] );
1967
- if ( wp_checkdate( $_REQUEST['mm'], $_REQUEST['jj'], $_REQUEST['aa'], $new_date ) ) {
 
 
 
 
 
1968
  $_REQUEST['post_date'] = $new_date;
1969
  $_REQUEST['post_date_gmt'] = get_gmt_from_date( $new_date );
1970
  }
1971
 
1972
- $results = MLAData::mla_update_single_item( $post_id, $_REQUEST, $_REQUEST['tax_input'] );
1973
  MLACore::mla_debug_add( __LINE__ . " MLA::mla_inline_edit_ajax_action( {$post_id} ) results = " . var_export( $results, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1974
  }
1975
 
@@ -2461,7 +2480,7 @@ class MLA {
2461
 
2462
  if ( isset( $_REQUEST['action'] ) ) {
2463
  if ( -1 != $_REQUEST['action'] ) {
2464
- return $_REQUEST['action'];
2465
  } else {
2466
  $action = 'none';
2467
  }
@@ -2469,7 +2488,7 @@ class MLA {
2469
 
2470
  if ( isset( $_REQUEST['action2'] ) ) {
2471
  if ( -1 != $_REQUEST['action2'] ) {
2472
- return $_REQUEST['action2'];
2473
  } else {
2474
  $action = 'none';
2475
  }
62
  $messages = self::$mla_language_support_error_messages;
63
 
64
  echo '<div class="error"><p><strong>The Media Library Assistant cannot activate multi-language support.</strong> Another plugin or theme has declared conflicting class, function or constant names:</p>'."\r\n";
65
+ echo "<ul>" . esc_html( $messages ) . "</ul>\r\n";
66
  echo '<p>You must resolve these conflicts before multi-language support can be activated.</p></div>'."\r\n";
67
  }
68
 
160
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
161
 
162
  $request = array (
163
+ 'mla_download_file' => str_replace( '\\', '/', MLA_PLUGIN_PATH . 'examples/plugins/' . sanitize_text_field( wp_unslash( $_REQUEST['mla_download_example_plugin'] ) ) ),
164
  'mla_download_type' => 'text/plain',
165
  );
166
 
207
  if ( 'download-zip' == $bulk_action ) {
208
  // Exits after redirect unless it returns an error
209
  $_REQUEST['mla_zip_archive_error_message'] = self::_process_zip_archive_download( $_REQUEST );
210
+ MLACore::mla_debug_add( __LINE__ . " MLA::_process_zip_archive_download message = " . var_export( $_REQUEST['mla_zip_archive_error_message'], true ), MLACore::MLA_DEBUG_CATEGORY_ANY ); // phpcs:ignore
211
  return;
212
  }
213
 
219
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
220
  }
221
 
222
+ $mla_item_id = isset( $_REQUEST['mla_item_ID'] ) ? absint( $_REQUEST['mla_item_ID'] ) : 0;
223
+ if ( apply_filters( 'mla_list_table_admin_action', true, sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ), $mla_item_id ) ) {
224
  switch ( $_REQUEST['mla_admin_action'] ) {
225
  case MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP:
226
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_CUSTOM_FIELD_MAPPING ) ) {
227
+ do_action( 'mla_begin_mapping', 'single_custom', $mla_item_id );
228
+ $updates = MLAOptions::mla_evaluate_custom_field_mapping( $mla_item_id, 'single_attachment_mapping' );
229
  do_action( 'mla_end_mapping' );
230
 
231
  if ( !empty( $updates ) ) {
232
+ $item_content = MLAData::mla_update_single_item( $mla_item_id, $updates );
233
  }
234
 
235
  $message = '101';
237
  $message = '103';
238
  }
239
 
240
+ $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) ) ) : array();
241
+ wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $mla_item_id . '&action=edit&message=' . $message ), 302 );
242
  exit;
243
  case MLACore::MLA_ADMIN_SINGLE_MAP:
244
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ALLOW_IPTC_EXIF_MAPPING ) ) {
245
+ $item = get_post( $mla_item_id );
246
+ do_action( 'mla_begin_mapping', 'single_iptc_exif', $mla_item_id );
247
  $updates = MLAOptions::mla_evaluate_iptc_exif_mapping( $item, 'iptc_exif_mapping' );
248
  do_action( 'mla_end_mapping' );
249
+ $page_content = MLAData::mla_update_single_item( $mla_item_id, $updates );
250
  $message = '102';
251
  } else {
252
  $message = '104';
253
  }
254
 
255
+ $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) ) ) : array();
256
+ wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?post=' . $mla_item_id . '&action=edit&message=' . $message ), 302 );
257
  exit;
258
  default:
259
+ do_action( 'mla_list_table_custom_admin_action', sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ), $mla_item_id );
260
  // ignore the rest
261
  } // switch ($_REQUEST['mla_admin_action'])
262
  } // apply_filters mla_list_table_admin_action
285
  }
286
 
287
  echo " ul.subsubsub {\n";
288
+ echo " width: " . esc_html( $width_value ) . ";\n";
289
+ echo " max-width: " . esc_html( $width_value ) . ";\n";
290
  echo " }\n";
291
  }
292
 
308
  $icon_width = $icon_height = $icon_value . 'px';
309
 
310
  echo " height: auto;\n";
311
+ echo " max-width: " . esc_html( $icon_width ) . ";\n";
312
+ echo " max-height: " . esc_html( $icon_height ) . ";\n";
313
  } else {
314
  if ( empty( $icon_value ) ) {
315
  if ( MLATest::$wp_4dot3_plus ) {
320
  }
321
 
322
  $icon_width = absint( $icon_value ) . 'px';
323
+ echo " max-width: " . esc_html( $icon_width ) . ";\n";
324
 
325
  if ( MLATest::$wp_4dot3_plus ) {
326
  echo " max-height: auto;\n";
327
  } else {
328
  $icon_height = ( absint( .75 * (float) $icon_value ) ) . 'px';
329
+ echo " max-height: " . esc_html( $icon_height ) . ";\n";
330
  }
331
  }
332
 
355
  $column_width = ( $icon_value + 30 ) . 'px';
356
 
357
  echo " table.attachments th.column-primary {\n";
358
+ echo " width: " . esc_html( $column_width ) . ";\n";
359
  echo " }\n";
360
  }
361
 
363
  echo " position: relative;\n";
364
 
365
  if ( $set_column_width ) {
366
+ echo " width: " . esc_html( $column_width ) . ";\n";
367
  }
368
 
369
  echo " }\n";
372
  * Override defaults in /wp-admin/load-styles.php
373
  */
374
  echo " .fixed td.column-icon, .fixed th.column-icon {\n";
375
+ echo " width: " . esc_html( $icon_width ) . ";\n";
376
  echo " }\n";
377
 
378
  /*
508
  add_action( 'load-upload.php', 'MLA::mla_load_media_action' );
509
 
510
  // Disable the MLA Download ZIP Example plugin, if necessary
511
+ if ( isset( $_REQUEST['page'] ) && MLACore::ADMIN_PAGE_SLUG === $_REQUEST['page'] ) {
512
  $bulk_action = '';
513
  if ( isset( $_REQUEST['action'] ) && 'download-zip' === $_REQUEST['action']) {
514
  $bulk_action = 'download-zip';
603
 
604
  // Compose a message if returning from the Edit Media screen
605
  if ( ! empty( $_GET['deleted'] ) && $deleted = absint( $_GET['deleted'] ) ) {
606
+ $query_args .= '&mla_admin_message=' . urlencode( sprintf( _n( 'Item permanently deleted.', '%d items permanently deleted.', $deleted, 'media-library-assistant' ), number_format_i18n( $deleted ) ) );
607
  }
608
 
609
+ if ( ! empty( $_GET['trashed'] ) && absint( $_GET['trashed'] ) ) {
610
  /* translators: 1: post ID */
611
+ $query_args .= '&mla_admin_message=' . urlencode( sprintf( __( 'Item %1$d moved to Trash.', 'media-library-assistant' ), isset( $_GET['ids'] ) ? absint( $_GET['ids'] ) : 0 ) );
612
  }
613
 
614
  wp_redirect( admin_url( 'upload.php' ) . $query_args, 302 );
879
  echo '</head>';
880
  echo '';
881
  echo '<body>';
882
+ echo esc_html( $message );
883
  echo '</body>';
884
  echo '</html> ';
885
  }
1275
 
1276
  // Check for failed ZIP Archive download request
1277
  if ( !empty( $_REQUEST['mla_zip_archive_error_message'] ) ) {
1278
+ $page_content['message'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_zip_archive_error_message'] ) );
1279
  return $page_content;
1280
  }
1281
 
1484
  * @return void
1485
  */
1486
  public static function mla_clear_filter_by( $preserves = array() ) {
1487
+ $filters = array( 'author', 'heading_suffix', 'ids', 'mla-metakey', 'mla-metavalue', 'mla-tax', 'mla-term', 'parent', 'clear_filter_by' );
1488
 
1489
  $filters = apply_filters( 'mla_list_table_clear_filter_by_filters', $filters, $preserves );
1490
  $preserves = apply_filters( 'mla_list_table_clear_filter_by_preserves', $preserves, $filters );
1509
  // Prevent _wp_http_referer recursion with method="get", preserve WPML/Polylang language selection
1510
  $_SERVER['REQUEST_URI'] = parse_url( admin_url( 'upload.php' ), PHP_URL_PATH ) . '?page=mla-menu';
1511
 
1512
+ $query_string = strval( isset( $_SERVER[ 'QUERY_STRING' ] ) ? esc_url_raw( wp_unslash( $_SERVER[ 'QUERY_STRING' ] ) ) : '' );
1513
  $query = array();
1514
+ parse_str( $query_string, $query );
1515
  if ( !empty( $query['lang'] ) ) {
1516
  $_SERVER['REQUEST_URI'] .= '&lang=' . $query['lang'];
1517
  }
1521
  * the month filter dropdown or sorting parameters
1522
  */
1523
  if ( isset( $_REQUEST['m'] ) ) {
1524
+ $_GET['m'] = absint( $_REQUEST['m'] );
1525
  }
1526
 
1527
  if ( isset( $_REQUEST['order'] ) ) {
1528
+ $_GET['order'] = sanitize_text_field( wp_unslash( $_REQUEST['order'] ) );
1529
  }
1530
 
1531
  if ( isset( $_REQUEST['orderby'] ) ) {
1532
+ $_GET['orderby'] = sanitize_text_field( wp_unslash( $_REQUEST['orderby'] ) );
1533
  }
1534
 
1535
  // bulk_refresh simply refreshes the page, ignoring other bulk actions
1550
  }
1551
 
1552
  echo "<div class=\"wrap\">\n";
1553
+ echo "<h1 class=\"wp-heading-inline\">" . esc_html( $page_title ); // trailing </h1> is action-specific
1554
 
1555
  if ( !current_user_can( 'upload_files' ) ) {
1556
+ echo ' - ' . esc_html__( 'ERROR', 'media-library-assistant' ) . "</h1>\n";
1557
+ wp_die( esc_html__( 'You do not have permission to manage attachments.', 'media-library-assistant' ) );
1558
  }
1559
 
1560
  $heading_tail = "</h1>\n<a href=\"media-new.php\" class=\"page-title-action\">" . esc_html_x('Add New', 'file') . "</a>\n<hr class=\"wp-header-end\">\n";
1565
  );
1566
 
1567
  if ( !empty( $_REQUEST['mla_admin_message'] ) ) {
1568
+ $page_content['message'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_message'] ) );
1569
  }
1570
 
1571
  /*
1577
  }
1578
 
1579
  if ( isset( $_REQUEST['post_category'] ) ) {
1580
+ $_REQUEST['tax_input']['category'] = array_map ( 'absint', $_REQUEST['post_category'] );
1581
  unset ( $_REQUEST['post_category'] );
1582
  }
1583
 
1622
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
1623
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1624
 
1625
+ $mla_item_id = isset( $_REQUEST['mla_item_ID'] ) ? absint( $_REQUEST['mla_item_ID'] ) : 0;
1626
+ $page_content = apply_filters( 'mla_list_table_single_action', NULL, sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ), $mla_item_id );
1627
  if ( is_null( $page_content ) ) {
1628
  $prevent_default = false;
1629
  $custom_message = '';
1635
  if ( ! $prevent_default ) {
1636
  switch ( $_REQUEST['mla_admin_action'] ) {
1637
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
1638
+ $page_content = self::_delete_single_item( $mla_item_id );
1639
  break;
1640
  case MLACore::MLA_ADMIN_SINGLE_RESTORE:
1641
+ $page_content = self::_restore_single_item( $mla_item_id );
1642
  break;
1643
  case MLACore::MLA_ADMIN_SINGLE_TRASH:
1644
+ $page_content = self::_trash_single_item( $mla_item_id );
1645
  break;
1646
  case MLACore::MLA_ADMIN_SET_PARENT:
1647
+ $new_data = array( 'post_parent' => isset( $_REQUEST['found_post_id'] ) ? absint( $_REQUEST['found_post_id'] ) : 0 );
1648
 
1649
+ $children = isset( $_REQUEST['children'] ) ? array_map ( 'absint', $_REQUEST['children'] ) : array();
1650
+ foreach( $children as $child ) {
1651
  $item_content = MLAData::mla_update_single_item( $child, $new_data );
1652
  $page_content['message'] .= $item_content['message'] . '<br>';
1653
  }
1664
  * This will be handled as a database query argument,
1665
  * but validate the arguments here
1666
  */
1667
+ $mla_terms_search = array( 'phrases' => '', 'taxonomies' => array() );
1668
+ if ( isset( $_REQUEST['mla_terms_search'] ) ) {
1669
+ $mla_terms_search['phrases'] = isset( $_REQUEST['mla_terms_search']['phrases'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_terms_search']['phrases'] ) ) : '';
1670
+ $mla_terms_search['taxonomies'] = isset( $_REQUEST['mla_terms_search']['taxonomies'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_terms_search']['taxonomies'] ) ) : array();
1671
+ }
1672
+
1673
  if ( ! is_array( $mla_terms_search ) || empty( $mla_terms_search['phrases'] ) || empty( $mla_terms_search['taxonomies'] ) ) {
1674
  unset( $_REQUEST['mla_terms_search'] );
1675
  $page_content = array(
1681
  }
1682
  break;
1683
  default:
1684
+ $page_content = apply_filters( 'mla_list_table_custom_single_action', NULL, sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ), $mla_item_id );
1685
  if ( is_null( $page_content ) ) {
1686
  $page_content = array(
1687
  /* translators: 1: row-level action, e.g., single_item_delete, single_item_edit */
1688
+ 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ) ),
1689
  'body' => ''
1690
  );
1691
  } // Unknown mla_admin_action
1719
  $messages_class = 'mla_messages';
1720
  }
1721
 
1722
+ echo " <div class=\"" . esc_html( $messages_class ) . "\"><p>\n";
1723
+ echo ' ' . wp_kses( $page_content['message'], 'post' ) . "\n";
1724
  echo " </p></div>\n"; // id="message"
1725
  }
1726
 
1727
+ echo $page_content['body']; // phpcs:ignore
1728
  } else {
1729
  // Display Attachments list
1730
  if ( !empty( $_REQUEST['heading_suffix'] ) ) {
1731
+ echo ' - ' . esc_html( urldecode( wp_kses( wp_unslash( $_REQUEST['heading_suffix'] ), 'post' ) ) ) . wp_kses( $heading_tail, 'post' );
1732
  } elseif ( !empty( $_REQUEST['mla_terms_search'] ) ) {
1733
+ echo ' - ' . esc_html__( 'term search results for', 'media-library-assistant' ) . ' "' . esc_html( trim( sanitize_text_field( wp_unslash( $_REQUEST['mla_terms_search']['phrases'] ), 'post' ) ) ). "\"" . wp_kses( $heading_tail, 'post' );
1734
  } elseif ( !empty( $_REQUEST['s'] ) ) {
1735
  if ( empty( $_REQUEST['mla_search_fields'] ) ) {
1736
+ echo ' - ' . esc_html__( 'post/parent results for', 'media-library-assistant' ) . ' "' . esc_html( trim( wp_kses( wp_unslash( $_REQUEST['s'] , 'post' ) ) ) ) . "\"" . wp_kses( $heading_tail, 'post' );
1737
  } else {
1738
+ echo ' - ' . esc_html__( 'search results for', 'media-library-assistant' ) . ' "' . esc_html( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) . "\"" . wp_kses( $heading_tail, 'post' );
1739
  }
1740
  } else {
1741
+ echo wp_kses( $heading_tail, 'post' );
1742
  }
1743
 
1744
  if ( !empty( $page_content['message'] ) ) {
1748
  $messages_class = 'mla_messages';
1749
  }
1750
 
1751
+ echo " <div class=\"" . esc_html( $messages_class ) . "\"><p>\n";
1752
+ echo ' ' . wp_kses( $page_content['message'], 'post' ) . "\n";
1753
  echo " </p></div>\n"; // id="message"
1754
  }
1755
 
1771
  }
1772
 
1773
  // Forms are NOT created automatically, wrap the table in one to use features like bulk actions
1774
+ echo "\n" . '<form action="' . esc_url_raw( admin_url( $form_url ) ) . '" method="get" id="mla-filter">' . "\n";
1775
 
1776
  // Include the Search Media box
1777
  require_once MLA_PLUGIN_PATH . 'includes/mla-main-search-box-template.php';
1778
 
1779
  // We also need to ensure that the form posts back to our current page and remember all the view arguments
1780
+ echo sprintf( '<input type="hidden" name="page" value="%1$s" />', esc_html( isset( $_REQUEST['page'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : MLACore::ADMIN_PAGE_SLUG ) ) . "\n";
1781
 
1782
  // Pass the WPML/Polylang language in the form
1783
  if ( isset( $view_arguments['lang'] ) ) {
1784
+ echo sprintf( '<input type="hidden" name="lang" value="%1$s" />', esc_html( $view_arguments['lang'] ) ) . "\n";
1785
  }
1786
 
1787
  foreach ( $view_arguments as $key => $value ) {
1788
+ if ( 'meta_query' == $key && isset( $_REQUEST['meta_query'] ) ) {
1789
+ $value = wp_kses( wp_unslash( $_REQUEST['meta_query'] ), 'post' );
1790
  }
1791
 
1792
  /*
1798
  }
1799
 
1800
  if ( is_array( $value ) ) {
1801
+ foreach ( $value as $element_key => $element_value ) {
1802
+ echo sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', esc_attr( $key ), esc_attr( $element_key ), esc_attr( $element_value ) ) . "\n";
1803
+ }
1804
  } else {
1805
+ echo sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', esc_attr( $key ), esc_attr( urldecode( $value ) ) ) . "\n";
1806
  }
1807
  }
1808
 
1810
  $MLAListTable->display();
1811
  echo "</form><!-- id=mla-filter -->\n";
1812
 
1813
+ // Insert the hidden form and table for inline edits (quick & bulk)
1814
+ echo self::_build_inline_edit_form( $MLAListTable ); // phpcs:ignore
 
 
1815
 
1816
  echo "<div id=\"ajax-response\"></div>\n";
1817
  echo "<br class=\"clear\" />\n";
1836
  }
1837
 
1838
  if ( isset( $_REQUEST['post_category'] ) ) {
1839
+ $_REQUEST['tax_input']['category'] = array_map( 'absint', $_REQUEST['post_category'] );
1840
  unset ( $_REQUEST['post_category'] );
1841
  }
1842
 
1843
+ // Convert bulk_action to the old button name/value variables
1844
+ if ( isset( $_REQUEST['bulk_action'] ) ) {
1845
+ switch ( $_REQUEST['bulk_action'] ) {
1846
+ case 'bulk_custom_field_map':
1847
+ $_REQUEST['bulk_custom_field_map'] = __( 'Map Custom Field metadata', 'media-library-assistant' );
1848
+ break;
1849
+ case 'bulk_map':
1850
+ $_REQUEST['bulk_map'] = __( 'Map IPTC/EXIF metadata', 'media-library-assistant' );
1851
+ break;
1852
+ case 'bulk_edit':
1853
+ $_REQUEST['bulk_edit'] = __( 'Update', 'media-library-assistant' );
1854
+ }
1855
  }
1856
+
1857
  $item_content = (object) self::mla_process_bulk_action( 'edit' );
1858
  wp_send_json_success( $item_content );
1859
  }
1868
  * @return void echo HTML <tr> markup for updated row or error message, then die()
1869
  */
1870
  public static function mla_inline_edit_ajax_action() {
1871
+ if ( isset( $_REQUEST['screen'] ) ) {
1872
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
1873
+ }
1874
 
1875
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1876
 
1879
  }
1880
 
1881
  if ( empty( $_REQUEST['post_ID'] ) ) {
1882
+ echo esc_html__( 'ERROR', 'media-library-assistant' ) . ': ' . esc_html__( 'No post ID found', 'media-library-assistant' );
1883
  die();
1884
  } else {
1885
+ $post_id = absint( $_REQUEST['post_ID'] );
1886
  }
1887
 
1888
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
1889
+ wp_die( esc_html__( 'ERROR', 'media-library-assistant' ) . ': ' . esc_html__( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) );
1890
  }
1891
 
1892
  // Custom field support
1893
  $custom_fields = array();
1894
  foreach ( MLACore::mla_custom_field_support( 'quick_edit' ) as $slug => $details ) {
1895
  if ( isset( $_REQUEST[ $slug ] ) ) {
1896
+ $value = trim( wp_kses( wp_unslash( $_REQUEST[ $slug ] ), 'post' ) );
1897
  unset ( $_REQUEST[ $slug ] );
1898
 
1899
  // '(Array)' indicates an existing array value in the field, which we preserve
1921
  }
1922
 
1923
  if ( isset( $_REQUEST['post_category'] ) ) {
1924
+ $_REQUEST['tax_input']['category'] = array_map( 'absint', $_REQUEST['post_category'], 'post' );
1925
  unset ( $_REQUEST['post_category'] );
1926
  }
1927
 
1928
+ $tax_output = array();
1929
  if ( ! empty( $_REQUEST['tax_input'] ) ) {
1930
  // Flat taxonomy strings must be cleaned up and duplicates removed
1931
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_REQUEST['tax_input'] ) ) );
1932
+ foreach ( $taxonomies as $tax_name ) {
1933
+ if ( isset( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1934
+ if ( is_array( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1935
+ // Make sure term_id values are integers, not strings, for flat-checklist
1936
+ $tax_value = array_map( 'absint', $_REQUEST['tax_input'][ $tax_name ] );
1937
+ } else {
1938
+ $tax_value = sanitize_text_field( wp_unslash( $_REQUEST['tax_input'][ $tax_name ] ) );
1939
+ $comma = _x( ',', 'tag_delimiter', 'media-library-assistant' );
1940
+ if ( ',' != $comma ) {
1941
+ $tax_value = str_replace( $comma, ',', $tax_value );
1942
+ }
1943
+
1944
+ $tax_value = preg_replace( '#\s*,\s*#', ',', $tax_value );
1945
+ $tax_value = preg_replace( '#,+#', ',', $tax_value );
1946
+ $tax_value = preg_replace( '#[,\s]+$#', '', $tax_value );
1947
+ $tax_value = preg_replace( '#^[,\s]+#', '', $tax_value );
1948
+
1949
+ if ( ',' != $comma ) {
1950
+ $tax_value = str_replace( ',', $comma, $tax_value );
1951
+ }
1952
+
1953
+ $tax_array = array();
1954
+ $dedup_array = explode( $comma, $tax_value );
1955
+ foreach ( $dedup_array as $tax_value )
1956
+ $tax_array [$tax_value] = $tax_value;
1957
+
1958
+ $tax_value = implode( $comma, $tax_array );
1959
+ } // ! array( $tax_value )
1960
+ } // isset
1961
+
1962
  $tax_output[$tax_name] = $tax_value;
1963
  } // foreach tax_input
1964
 
1977
  if ( ! $prevent_default ) {
1978
  MLACore::mla_debug_add( __LINE__ . " MLA::mla_inline_edit_ajax_action( {$post_id} ) \$_REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1979
 
1980
+ $date = array();
1981
+ foreach( array( 'aa', 'mm', 'jj', 'hh', 'mn', 'ss' ) as $index ) {
1982
+ $date[ $index ] = isset( $_REQUEST[ $index ] ) ? absint( $_REQUEST[ $index ] ) : 0;
1983
+ }
1984
+
1985
+ $new_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $date['aa'], $date['mm'], $date['jj'], $date['hh'], $date['mn'], $date['ss'] );
1986
+ if ( wp_checkdate( $date['mm'], $date['jj'], $date['aa'], $new_date ) ) {
1987
  $_REQUEST['post_date'] = $new_date;
1988
  $_REQUEST['post_date_gmt'] = get_gmt_from_date( $new_date );
1989
  }
1990
 
1991
+ $results = MLAData::mla_update_single_item( $post_id, $_REQUEST, $tax_output );
1992
  MLACore::mla_debug_add( __LINE__ . " MLA::mla_inline_edit_ajax_action( {$post_id} ) results = " . var_export( $results, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1993
  }
1994
 
2480
 
2481
  if ( isset( $_REQUEST['action'] ) ) {
2482
  if ( -1 != $_REQUEST['action'] ) {
2483
+ return sanitize_text_field( wp_unslash( $_REQUEST['action'] ) );
2484
  } else {
2485
  $action = 'none';
2486
  }
2488
 
2489
  if ( isset( $_REQUEST['action2'] ) ) {
2490
  if ( -1 != $_REQUEST['action2'] ) {
2491
+ return sanitize_text_field( wp_unslash( $_REQUEST['action2'] ) );
2492
  } else {
2493
  $action = 'none';
2494
  }
includes/class-mla-media-modal-ajax.php CHANGED
@@ -98,7 +98,27 @@ class MLAModal_Ajax {
98
  * and substitute our handler for the WordPress default handler.
99
  */
100
  if ( ( $_REQUEST['action'] == 'query-attachments' ) && isset( $_POST['query']['s'] ) && is_array( $_POST['query']['s'] ) ){
101
- foreach ( $_POST['query']['s'] as $key => $value ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  $_POST['query'][ $key ] = $value;
103
  $_REQUEST['query'][ $key ] = $value;
104
  }
@@ -321,7 +341,12 @@ class MLAModal_Ajax {
321
  * @return void passes array of results to wp_send_json_success() for JSON encoding and transmission
322
  */
323
  public static function mla_fill_compat_fields_action() {
324
- if ( empty( $_REQUEST['query'] ) || ! $requested = $_REQUEST['query'] ) {
 
 
 
 
 
325
  wp_send_json_error();
326
  }
327
 
@@ -495,9 +520,7 @@ class MLAModal_Ajax {
495
  } // is supported
496
  } // foreach
497
 
498
- /*
499
- * Any left-over requests are for unsupported taxonomies
500
- */
501
  foreach( $requested as $key ) {
502
  $row = "\t\t<tr class='compat-field-{$key} mla-taxonomy-row'>\n";
503
  $row .= "\t\t<th class='label' valign='top' scope='row'>\n";
@@ -516,7 +539,7 @@ class MLAModal_Ajax {
516
  $results[ $key ] = $row;
517
  }
518
 
519
- wp_send_json_success( apply_filters( 'mla_media_modal_end_fill_compat_fields', $results, $_REQUEST['query'], $requested, $post ) );
520
  } // mla_fill_compat_fields_action
521
 
522
  /**
@@ -553,9 +576,9 @@ class MLAModal_Ajax {
553
  }
554
 
555
  if ( $value->hierarchical ) {
556
- $terms = array_map( 'absint', preg_split( '/,+/', $_REQUEST[ $key ] ) );
557
  } else {
558
- $terms = array_map( 'trim', preg_split( '/,+/', $_REQUEST[ $key ] ) );
559
  }
560
 
561
  $terms = apply_filters( 'mla_media_modal_update_compat_fields_terms', $terms, $key, $value, $post_id );
@@ -622,21 +645,19 @@ class MLAModal_Ajax {
622
  * @return void passes array of post arrays to wp_send_json_success() for JSON encoding and transmission
623
  */
624
  public static function mla_query_attachments_action() {
 
625
  if ( ! current_user_can( 'upload_files' ) ) {
626
  wp_send_json_error();
627
  }
628
 
629
- /*
630
- * Pick out and clean up the query terms we can process
631
- */
632
- $raw_query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
633
  $query = array_intersect_key( $raw_query, array_flip( array(
634
  'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
635
  'post_parent', 'post__in', 'post__not_in',
636
  'mla_filter_month', 'mla_filter_term', 'mla_terms_search',
637
  'mla_search_value', 's', 'mla_search_fields', 'mla_search_connector'
638
  ) ) );
639
- //error_log( __LINE__ . ' mla_query_attachments_action query = ' . var_export( $query, true ), 0 );
640
 
641
  $query = apply_filters( 'mla_media_modal_query_initial_terms', $query, $raw_query );
642
 
@@ -651,50 +672,42 @@ class MLAModal_Ajax {
651
  $query['status'] = 'trash';
652
  unset( $query['post_mime_type'] );
653
  } else {
654
- $view = $query['post_mime_type'];
655
  unset( $query['post_mime_type'] );
656
  $query = array_merge( $query, MLACore::mla_prepare_view_query( 'view', $view ) );
657
  }
658
  }
659
 
660
- /*
661
- * Convert mla_filter_month back to the WordPress "m" parameter
662
- */
663
  if ( isset( $query['mla_filter_month'] ) ) {
664
  if ( '0' != $query['mla_filter_month'] ) {
665
- $query['m'] = $query['mla_filter_month'];
666
  }
667
 
668
  unset( $query['mla_filter_month'] );
669
  }
670
 
671
- /*
672
- * Process the enhanced search box OR fix up the default search box
673
- */
674
  if ( isset( $query['mla_search_value'] ) ) {
675
  if ( ! empty( $query['mla_search_value'] ) ) {
676
- $query['s'] = $query['mla_search_value'];
677
  }
678
 
679
  unset( $query['mla_search_value'] );
680
  }
681
 
682
  if ( isset( $query['posts_per_page'] ) ) {
683
- $count = $query['posts_per_page'];
684
- $offset = $count * (isset( $query['paged'] ) ? $query['paged'] - 1 : 0);
685
  } else {
686
  $count = 0;
687
  $offset = 0;
688
  }
689
 
690
- /*
691
- * Check for sorting override
692
- */
693
  $option = MLACore::mla_get_option( MLACoreOptions::MLA_MEDIA_MODAL_ORDERBY );
694
  if ( 'default' != $option ) {
695
- /*
696
- * Make sure the current orderby choice still exists or revert to default.
697
- */
698
  $default_orderby = array_merge( array( 'none' => array('none',false) ), MLAQuery::mla_get_sortable_columns( ) );
699
  $found_current = false;
700
  foreach ($default_orderby as $key => $value ) {
@@ -728,6 +741,15 @@ class MLAModal_Ajax {
728
 
729
  $query = apply_filters( 'mla_media_modal_query_filtered_terms', $query, $raw_query );
730
 
 
 
 
 
 
 
 
 
 
731
  $query = MLAQuery::mla_query_media_modal_items( $query, $offset, $count );
732
  $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
733
  $posts = array_filter( $posts );
98
  * and substitute our handler for the WordPress default handler.
99
  */
100
  if ( ( $_REQUEST['action'] == 'query-attachments' ) && isset( $_POST['query']['s'] ) && is_array( $_POST['query']['s'] ) ){
101
+ $keys = array_keys( array_map( 'absint', wp_unslash( $_POST['query']['s'] ) ) );
102
+ foreach ( $keys as $key ) {
103
+ switch ( $key ) {
104
+ case 'mla_terms_search':
105
+ $value = array();
106
+ $value['phrases'] = isset( $_POST['query']['s'][ $key ]['phrases'] ) ? wp_kses( wp_unslash( $_POST['query']['s'][ $key ]['phrases'] ), 'post' ) : '';
107
+ $value['taxonomies'] = isset( $_POST['query']['s'][ $key ]['taxonomies'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['query']['s'][ $key ]['taxonomies'] ) ) : array();
108
+ $value['radio_phrases'] = isset( $_POST['query']['s'][ $key ]['radio_phrases'] ) ? sanitize_text_field( wp_unslash( $_POST['query']['s'][ $key ]['radio_phrases'] ) ) : 'AND';
109
+ $value['radio_terms'] = isset( $_POST['query']['s'][ $key ]['radio_terms'] ) ? sanitize_text_field( wp_unslash( $_POST['query']['s'][ $key ]['radio_terms'] ) ) : 'OR';
110
+ break;
111
+ case 'mla_search_fields':
112
+ $value = isset( $_POST['query']['s'][ $key ] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['query']['s'][ $key ] ) ) : array();
113
+ break;
114
+ case 'mla_search_value':
115
+ $value = isset( $_POST['query']['s'][ $key ] ) ? wp_kses( wp_unslash( $_POST['query']['s'][ $key ] ), 'post' ) : '';
116
+ break;
117
+ default:
118
+ $value = isset( $_POST['query']['s'][ $key ] ) ? sanitize_text_field( wp_unslash( $_POST['query']['s'][ $key ] ) ) : '';
119
+ break;
120
+ }
121
+
122
  $_POST['query'][ $key ] = $value;
123
  $_REQUEST['query'][ $key ] = $value;
124
  }
341
  * @return void passes array of results to wp_send_json_success() for JSON encoding and transmission
342
  */
343
  public static function mla_fill_compat_fields_action() {
344
+ $requested = array();
345
+ if ( !empty( $_REQUEST['query'] ) ) {
346
+ $requested = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['query'] ) );
347
+ }
348
+
349
+ if ( empty( $requested ) ) {
350
  wp_send_json_error();
351
  }
352
 
520
  } // is supported
521
  } // foreach
522
 
523
+ // Any left-over requests are for unsupported taxonomies
 
 
524
  foreach( $requested as $key ) {
525
  $row = "\t\t<tr class='compat-field-{$key} mla-taxonomy-row'>\n";
526
  $row .= "\t\t<th class='label' valign='top' scope='row'>\n";
539
  $results[ $key ] = $row;
540
  }
541
 
542
+ wp_send_json_success( apply_filters( 'mla_media_modal_end_fill_compat_fields', $results, $_REQUEST['query'], $requested, $post ) ); // phpcs:ignore
543
  } // mla_fill_compat_fields_action
544
 
545
  /**
576
  }
577
 
578
  if ( $value->hierarchical ) {
579
+ $terms = array_map( 'absint', preg_split( '/,+/', sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ) ) );
580
  } else {
581
+ $terms = array_map( 'trim', preg_split( '/,+/', sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ) ) );
582
  }
583
 
584
  $terms = apply_filters( 'mla_media_modal_update_compat_fields_terms', $terms, $key, $value, $post_id );
645
  * @return void passes array of post arrays to wp_send_json_success() for JSON encoding and transmission
646
  */
647
  public static function mla_query_attachments_action() {
648
+ error_log( __LINE__ . ' mla_query_attachments_action query = ' . var_export( $_REQUEST['query'], true ), 0 );
649
  if ( ! current_user_can( 'upload_files' ) ) {
650
  wp_send_json_error();
651
  }
652
 
653
+ // Pick out and clean up the query terms we can process
654
+ $raw_query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array(); // phpcs:ignore
 
 
655
  $query = array_intersect_key( $raw_query, array_flip( array(
656
  'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
657
  'post_parent', 'post__in', 'post__not_in',
658
  'mla_filter_month', 'mla_filter_term', 'mla_terms_search',
659
  'mla_search_value', 's', 'mla_search_fields', 'mla_search_connector'
660
  ) ) );
 
661
 
662
  $query = apply_filters( 'mla_media_modal_query_initial_terms', $query, $raw_query );
663
 
672
  $query['status'] = 'trash';
673
  unset( $query['post_mime_type'] );
674
  } else {
675
+ $view = sanitize_text_field( wp_unslash( $query['post_mime_type'] ) );
676
  unset( $query['post_mime_type'] );
677
  $query = array_merge( $query, MLACore::mla_prepare_view_query( 'view', $view ) );
678
  }
679
  }
680
 
681
+ // Convert mla_filter_month back to the WordPress "m" parameter
 
 
682
  if ( isset( $query['mla_filter_month'] ) ) {
683
  if ( '0' != $query['mla_filter_month'] ) {
684
+ $query['m'] = absint( $query['mla_filter_month'] );
685
  }
686
 
687
  unset( $query['mla_filter_month'] );
688
  }
689
 
690
+ // Process the enhanced search box OR fix up the default search box
 
 
691
  if ( isset( $query['mla_search_value'] ) ) {
692
  if ( ! empty( $query['mla_search_value'] ) ) {
693
+ $query['s'] = wp_kses( wp_unslash( $query['mla_search_value'] ) );
694
  }
695
 
696
  unset( $query['mla_search_value'] );
697
  }
698
 
699
  if ( isset( $query['posts_per_page'] ) ) {
700
+ $count = absint( $query['posts_per_page'] );
701
+ $offset = $count * (isset( $query['paged'] ) ? absint( $query['paged'] ) - 1 : 0);
702
  } else {
703
  $count = 0;
704
  $offset = 0;
705
  }
706
 
707
+ // Check for sorting override - NOT IMPLEMENTED: MMMW Doesn't allow it
 
 
708
  $option = MLACore::mla_get_option( MLACoreOptions::MLA_MEDIA_MODAL_ORDERBY );
709
  if ( 'default' != $option ) {
710
+ // Make sure the current orderby choice still exists or revert to default.
 
 
711
  $default_orderby = array_merge( array( 'none' => array('none',false) ), MLAQuery::mla_get_sortable_columns( ) );
712
  $found_current = false;
713
  foreach ($default_orderby as $key => $value ) {
741
 
742
  $query = apply_filters( 'mla_media_modal_query_filtered_terms', $query, $raw_query );
743
 
744
+ if ( isset( $raw_query['_acfuploader'] ) ) {
745
+ global $acf_instances;
746
+
747
+ if( isset($acf_instances[ 'ACF_Media' ]) ) {
748
+ $acf_instances[ 'ACF_Media' ]->wp_ajax_query_attachments();
749
+ }
750
+ }
751
+
752
+ error_log( __LINE__ . ' mla_query_attachments_action query = ' . var_export( $_REQUEST['query'], true ), 0 );
753
  $query = MLAQuery::mla_query_media_modal_items( $query, $offset, $count );
754
  $posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
755
  $posts = array_filter( $posts );
includes/class-mla-media-modal.php CHANGED
@@ -600,7 +600,7 @@ class MLAModal {
600
  * @return void Echos the HTML <form> markup for hidden form
601
  */
602
  public static function mla_echo_terms_search_form() {
603
- echo MLAModal::mla_terms_search_form();
604
  }
605
 
606
  /**
600
  * @return void Echos the HTML <form> markup for hidden form
601
  */
602
  public static function mla_echo_terms_search_form() {
603
+ echo MLAModal::mla_terms_search_form(); // phpcs:ignore
604
  }
605
 
606
  /**
includes/class-mla-mime-types.php CHANGED
@@ -105,7 +105,7 @@ class MLAMime {
105
  return $mime_to_ext;
106
  }
107
 
108
- $file_name = strtolower( $_REQUEST['name'] );
109
  if ( false === strpos( $file_name, '.svg' ) ) {
110
  return $mime_to_ext;
111
  }
@@ -853,9 +853,7 @@ class MLAMime {
853
  $clean_request[ $key ] = 'ASC';
854
  }
855
  break;
856
- /*
857
- * ['s'] - Search Media by one or more keywords
858
- */
859
  case 's':
860
  $clean_request[ $key ] = stripslashes( trim( $value ) );
861
  break;
@@ -864,9 +862,7 @@ class MLAMime {
864
  } // switch $key
865
  } // foreach $raw_request
866
 
867
- /*
868
- * Ignore incoming paged value; use offset and count instead
869
- */
870
  if ( ( (int) $count ) > 0 ) {
871
  $clean_request['offset'] = $offset;
872
  $clean_request['posts_per_page'] = $count;
@@ -948,12 +944,10 @@ class MLAMime {
948
  $sorted_types = array_reverse( $sorted_types, true );
949
  }
950
 
951
- /*
952
- * Paginate the sorted list
953
- */
954
  $results = array();
955
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
956
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
957
  foreach ( $sorted_types as $value ) {
958
  if ( $offset ) {
959
  $offset--;
@@ -1632,12 +1626,10 @@ class MLAMime {
1632
  $sorted_types = array_reverse( $sorted_types, true );
1633
  }
1634
 
1635
- /*
1636
- * Paginate the sorted list
1637
- */
1638
  $results = array();
1639
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
1640
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
1641
  foreach ( $sorted_types as $value ) {
1642
  if ( $offset ) {
1643
  $offset--;
@@ -2376,9 +2368,7 @@ class MLAMime {
2376
  );
2377
  }
2378
 
2379
- /*
2380
- * $request = NULL is a call from MLASettings::_version_upgrade
2381
- */
2382
  if ( NULL == $request ) {
2383
  self::_put_upload_mime_templates();
2384
  return;
@@ -2408,29 +2398,28 @@ class MLAMime {
2408
  );
2409
  }
2410
 
2411
- /*
2412
- * Validate changed slug value
2413
- */
2414
  if ( $slug != $original_slug ) {
2415
  if ( $slug != $request['slug'] ) {
2416
  /* translators: 1: element name 2: bad_value 3: good_value */
2417
  $messages .= sprintf( __( '<br>' . 'Changing new %1$s "%2$s" to valid value "%3$s"', 'media-library-assistant' ), __( 'Extension', 'media-library-assistant' ), $request['slug'], $slug );
2418
  }
2419
 
2420
- /*
2421
- * Make sure new slug is unique
2422
- */
2423
  if ( isset( self::$mla_upload_mime_templates[ $slug ] ) ) {
2424
  /* translators: 1: ERROR tag 2: slug */
2425
  $errors .= '<br>' . sprintf( __( '%1$s: Could not add new extension "%2$s"; value already exists', 'media-library-assistant' ), __( 'ERROR', 'media-library-assistant' ), $slug );
2426
  } else {
2427
  /* translators: 1: element name 2: old_value 3: new_value */
2428
  $messages .= sprintf( '<br>' . __( 'Changing %1$s from "%2$s" to "%3$s"', 'media-library-assistant' ), __( 'Extension', 'media-library-assistant' ), $original_slug, $slug );
 
 
 
 
 
2429
  }
2430
 
2431
- /*
2432
- * A new extension cannot have an $original_type
2433
- */
2434
  $original_type = array(
2435
  'post_ID' => 0,
2436
  'mime_type' => '',
@@ -2447,9 +2436,7 @@ class MLAMime {
2447
  );
2448
  }
2449
 
2450
- /*
2451
- * Validate mime_type
2452
- */
2453
  if ( empty( $request['mime_type'] ) ) {
2454
  $clean_mime_type = $original_type['mime_type'];
2455
  } else {
@@ -2478,9 +2465,7 @@ class MLAMime {
2478
  $new_type['core_type'] = $original_type['core_type'];
2479
  $new_type['mla_type'] = $original_type['mla_type'];
2480
 
2481
- /*
2482
- * Determine the source
2483
- */
2484
  if ( 'core' == $original_type['standard_source'] && $clean_mime_type == $original_type['core_type'] ) {
2485
  $new_type['source'] = 'core';
2486
  } elseif ( 'mla' == $original_type['standard_source'] && $clean_mime_type == $original_type['mla_type'] ) {
@@ -2489,9 +2474,7 @@ class MLAMime {
2489
  $new_type['source'] = 'custom';
2490
  }
2491
 
2492
- /*
2493
- * Determine new icon types
2494
- */
2495
  $new_type['core_icon_type'] = self::mla_get_core_icon_type( $slug );
2496
 
2497
  if ( isset( $request['icon_type'] ) ) {
@@ -2777,12 +2760,10 @@ class MLAMime {
2777
  $sorted_types = array_reverse( $sorted_types, true );
2778
  }
2779
 
2780
- /*
2781
- * Paginate the sorted list
2782
- */
2783
  $results = array();
2784
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
2785
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
2786
  foreach ( $sorted_types as $value ) {
2787
  if ( $offset ) {
2788
  $offset--;
105
  return $mime_to_ext;
106
  }
107
 
108
+ $file_name = strtolower( sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) );
109
  if ( false === strpos( $file_name, '.svg' ) ) {
110
  return $mime_to_ext;
111
  }
853
  $clean_request[ $key ] = 'ASC';
854
  }
855
  break;
856
+ // ['s'] - Search Media by one or more keywords
 
 
857
  case 's':
858
  $clean_request[ $key ] = stripslashes( trim( $value ) );
859
  break;
862
  } // switch $key
863
  } // foreach $raw_request
864
 
865
+ // Ignore incoming paged value; use offset and count instead
 
 
866
  if ( ( (int) $count ) > 0 ) {
867
  $clean_request['offset'] = $offset;
868
  $clean_request['posts_per_page'] = $count;
944
  $sorted_types = array_reverse( $sorted_types, true );
945
  }
946
 
947
+ // Paginate the sorted list
 
 
948
  $results = array();
949
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
950
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
951
  foreach ( $sorted_types as $value ) {
952
  if ( $offset ) {
953
  $offset--;
1626
  $sorted_types = array_reverse( $sorted_types, true );
1627
  }
1628
 
1629
+ // Paginate the sorted list
 
 
1630
  $results = array();
1631
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
1632
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
1633
  foreach ( $sorted_types as $value ) {
1634
  if ( $offset ) {
1635
  $offset--;
2368
  );
2369
  }
2370
 
2371
+ // $request = NULL is a call from MLASettings::_version_upgrade
 
 
2372
  if ( NULL == $request ) {
2373
  self::_put_upload_mime_templates();
2374
  return;
2398
  );
2399
  }
2400
 
2401
+ // Validate changed slug value
 
 
2402
  if ( $slug != $original_slug ) {
2403
  if ( $slug != $request['slug'] ) {
2404
  /* translators: 1: element name 2: bad_value 3: good_value */
2405
  $messages .= sprintf( __( '<br>' . 'Changing new %1$s "%2$s" to valid value "%3$s"', 'media-library-assistant' ), __( 'Extension', 'media-library-assistant' ), $request['slug'], $slug );
2406
  }
2407
 
2408
+ // Make sure new slug is unique
 
 
2409
  if ( isset( self::$mla_upload_mime_templates[ $slug ] ) ) {
2410
  /* translators: 1: ERROR tag 2: slug */
2411
  $errors .= '<br>' . sprintf( __( '%1$s: Could not add new extension "%2$s"; value already exists', 'media-library-assistant' ), __( 'ERROR', 'media-library-assistant' ), $slug );
2412
  } else {
2413
  /* translators: 1: element name 2: old_value 3: new_value */
2414
  $messages .= sprintf( '<br>' . __( 'Changing %1$s from "%2$s" to "%3$s"', 'media-library-assistant' ), __( 'Extension', 'media-library-assistant' ), $original_slug, $slug );
2415
+
2416
+ // Changing the slug with "Quick Edit" must retain the original Description
2417
+ if ( !isset( $request['description'] ) ) {
2418
+ $request['description'] = $original_type['description'];
2419
+ }
2420
  }
2421
 
2422
+ // A new extension cannot have an $original_type
 
 
2423
  $original_type = array(
2424
  'post_ID' => 0,
2425
  'mime_type' => '',
2436
  );
2437
  }
2438
 
2439
+ // Validate mime_type
 
 
2440
  if ( empty( $request['mime_type'] ) ) {
2441
  $clean_mime_type = $original_type['mime_type'];
2442
  } else {
2465
  $new_type['core_type'] = $original_type['core_type'];
2466
  $new_type['mla_type'] = $original_type['mla_type'];
2467
 
2468
+ // Determine the source
 
 
2469
  if ( 'core' == $original_type['standard_source'] && $clean_mime_type == $original_type['core_type'] ) {
2470
  $new_type['source'] = 'core';
2471
  } elseif ( 'mla' == $original_type['standard_source'] && $clean_mime_type == $original_type['mla_type'] ) {
2474
  $new_type['source'] = 'custom';
2475
  }
2476
 
2477
+ // Determine new icon types
 
 
2478
  $new_type['core_icon_type'] = self::mla_get_core_icon_type( $slug );
2479
 
2480
  if ( isset( $request['icon_type'] ) ) {
2760
  $sorted_types = array_reverse( $sorted_types, true );
2761
  }
2762
 
2763
+ // Paginate the sorted list
 
 
2764
  $results = array();
2765
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
2766
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
2767
  foreach ( $sorted_types as $value ) {
2768
  if ( $offset ) {
2769
  $offset--;
includes/class-mla-objects.php CHANGED
@@ -131,8 +131,8 @@ class MLAObjects {
131
  public static function mla_taxonomy_get_columns_filter( $columns ) {
132
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
133
  if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'add-tag', 'inline-save-tax' ) ) ) {
134
- $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
135
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
136
  } else {
137
  $screen = get_current_screen();
138
  $post_type = !empty( $screen->post_type ) ? $screen->post_type : 'post';
@@ -178,7 +178,7 @@ class MLAObjects {
178
  if ( NULL == $taxonomy ) {
179
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
180
  if ( defined('DOING_AJAX') && DOING_AJAX ) {
181
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
182
  } else {
183
  $screen = get_current_screen();
184
  $taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
@@ -198,7 +198,7 @@ class MLAObjects {
198
  if ( NULL == $tax_object ) {
199
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
200
  if ( defined('DOING_AJAX') && DOING_AJAX ) {
201
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
202
  } else {
203
  $screen = get_current_screen();
204
  $taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
@@ -322,13 +322,13 @@ class MLATextWidget extends WP_Widget {
322
  function widget( $args, $instance ) {
323
  $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
324
  $text = do_shortcode( apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ) );
325
- echo $args['before_widget'];
326
- if ( !empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } ?>
327
  <?php if ( !empty( $instance['textwidget_div'] ) ) echo '<div class="textwidget">';
328
- echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text;
329
  if ( !empty( $instance['textwidget_div'] ) ) echo '</div>'; ?>
330
  <?php
331
- echo $args['after_widget'];
332
  }
333
 
334
  /**
@@ -345,13 +345,13 @@ class MLATextWidget extends WP_Widget {
345
  $title = strip_tags( $instance['title'] );
346
  $text = esc_textarea( $instance['text'] );
347
  ?>
348
- <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php echo __( 'Title', 'media-library-assistant' ) . ':'; ?></label>
349
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
350
 
351
- <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo $text; ?></textarea>
352
 
353
- <p><input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox" <?php checked( isset( $instance['filter'] ) ? $instance['filter'] : 0 ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs', 'media-library-assistant' ); ?></label></p>
354
- <p><input id="<?php echo $this->get_field_id( 'textwidget_div' ); ?>" name="<?php echo $this->get_field_name( 'textwidget_div' ); ?>" type="checkbox" <?php checked( isset( $instance['textwidget_div'] ) ? $instance['textwidget_div'] : 1 ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'textwidget_div' ); ?>"><?php _e( 'Add .textwidget div tags', 'media-library-assistant' ); ?></label></p>
355
  <?php
356
  }
357
 
131
  public static function mla_taxonomy_get_columns_filter( $columns ) {
132
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
133
  if ( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'add-tag', 'inline-save-tax' ) ) ) {
134
+ $post_type = !empty($_POST['post_type']) ? sanitize_text_field( wp_unslash( $_POST['post_type'] ) ) : 'post';
135
+ $taxonomy = !empty($_POST['taxonomy']) ? sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) ) : 'post_tag';
136
  } else {
137
  $screen = get_current_screen();
138
  $post_type = !empty( $screen->post_type ) ? $screen->post_type : 'post';
178
  if ( NULL == $taxonomy ) {
179
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
180
  if ( defined('DOING_AJAX') && DOING_AJAX ) {
181
+ $taxonomy = !empty($_POST['taxonomy']) ? sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) ) : 'post_tag';
182
  } else {
183
  $screen = get_current_screen();
184
  $taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
198
  if ( NULL == $tax_object ) {
199
  // Adding or inline-editing a tag is done with AJAX, and there's no current screen object
200
  if ( defined('DOING_AJAX') && DOING_AJAX ) {
201
+ $taxonomy = !empty($_POST['taxonomy']) ? sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) ) : 'post_tag';
202
  } else {
203
  $screen = get_current_screen();
204
  $taxonomy = !empty( $screen->taxonomy ) ? $screen->taxonomy : 'post_tag';
322
  function widget( $args, $instance ) {
323
  $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
324
  $text = do_shortcode( apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ) );
325
+ echo $args['before_widget']; // phpcs:ignore
326
+ if ( !empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } // phpcs:ignore?>
327
  <?php if ( !empty( $instance['textwidget_div'] ) ) echo '<div class="textwidget">';
328
+ echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; // phpcs:ignore
329
  if ( !empty( $instance['textwidget_div'] ) ) echo '</div>'; ?>
330
  <?php
331
+ echo $args['after_widget']; // phpcs:ignore
332
  }
333
 
334
  /**
345
  $title = strip_tags( $instance['title'] );
346
  $text = esc_textarea( $instance['text'] );
347
  ?>
348
+ <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo esc_html__( 'Title', 'media-library-assistant' ) . ':'; ?></label>
349
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
350
 
351
+ <textarea class="widefat" rows="16" cols="20" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"><?php echo esc_textarea( $text ); ?></textarea>
352
 
353
+ <p><input id="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'filter' ) ); ?>" type="checkbox" <?php checked( isset( $instance['filter'] ) ? $instance['filter'] : 0 ); ?> />&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>"><?php esc_html_e( 'Automatically add paragraphs', 'media-library-assistant' ); ?></label></p>
354
+ <p><input id="<?php echo esc_attr( $this->get_field_id( 'textwidget_div' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'textwidget_div' ) ); ?>" type="checkbox" <?php checked( isset( $instance['textwidget_div'] ) ? $instance['textwidget_div'] : 1 ); ?> />&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'textwidget_div' ) ); ?>"><?php esc_html_e( 'Add .textwidget div tags', 'media-library-assistant' ); ?></label></p>
355
  <?php
356
  }
357
 
includes/class-mla-options.php CHANGED
@@ -35,7 +35,7 @@ class MLAOptions {
35
  add_filter( 'wp_generate_attachment_metadata', 'MLAOptions::mla_generate_attachment_metadata_filter', 0x7FFFFFFF, 2 );
36
  add_filter( 'wp_update_attachment_metadata', 'MLAOptions::mla_update_attachment_metadata_filter', 0x7FFFFFFF, 2 );
37
 
38
- MLACore::mla_debug_add( __LINE__ . " MLAOptions::initialize( " . $_SERVER['REQUEST_URI'] . " ) hooks set", MLACore::MLA_DEBUG_CATEGORY_REST );
39
  }
40
  }
41
 
@@ -955,6 +955,8 @@ class MLAOptions {
955
  }
956
  }
957
 
 
 
958
  if ( ( ' ' != $new_text ) && empty( $old_text ) ) {
959
  $custom_updates[ $setting_value['name'] ] = $new_text;
960
  }
@@ -1834,6 +1836,8 @@ class MLAOptions {
1834
  }
1835
  }
1836
 
 
 
1837
  if ( ( ! empty( $new_text ) ) && empty( $old_value ) ) {
1838
  $custom_updates[ $setting_name ] = $new_text;
1839
  }
35
  add_filter( 'wp_generate_attachment_metadata', 'MLAOptions::mla_generate_attachment_metadata_filter', 0x7FFFFFFF, 2 );
36
  add_filter( 'wp_update_attachment_metadata', 'MLAOptions::mla_update_attachment_metadata_filter', 0x7FFFFFFF, 2 );
37
 
38
+ MLACore::mla_debug_add( __LINE__ . " MLAOptions::initialize( " . $_SERVER['REQUEST_URI'] . " ) hooks set", MLACore::MLA_DEBUG_CATEGORY_REST ); // phpcs:ignore
39
  }
40
  }
41
 
955
  }
956
  }
957
 
958
+ $old_text = apply_filters( 'mla_mapping_old_custom_value', $old_text, $setting_key, $post_id, $category, $attachment_metadata );
959
+
960
  if ( ( ' ' != $new_text ) && empty( $old_text ) ) {
961
  $custom_updates[ $setting_value['name'] ] = $new_text;
962
  }
1836
  }
1837
  }
1838
 
1839
+ $old_value = apply_filters( 'mla_mapping_old_custom_value', $old_value, $setting_key, $post->ID, 'iptc_exif_custom_mapping', $attachment_metadata );
1840
+
1841
  if ( ( ! empty( $new_text ) ) && empty( $old_value ) ) {
1842
  $custom_updates[ $setting_name ] = $new_text;
1843
  }
includes/class-mla-polylang-support.php CHANGED
@@ -43,7 +43,7 @@ class MLA_Polylang {
43
  */
44
  public static function initialize() {
45
  global $polylang;
46
-
47
  self::$polylang_1dot8_plus = version_compare( POLYLANG_VERSION, '1.7.99', '>' );
48
 
49
  // These filters are only useful for the admin section; exit in the front-end posts/pages
@@ -233,7 +233,7 @@ class MLA_Polylang {
233
  $lang = $polylang->model->get_post_language( $post_id );
234
  $translations = $polylang->model->get_translations( 'post', $post_id );
235
  }
236
-
237
  if ( ! $translations && $lang )
238
  $translations[ $lang->slug ] = $post_id;
239
 
@@ -261,14 +261,14 @@ class MLA_Polylang {
261
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
262
 
263
  if ( empty( $_REQUEST['post_ID'] ) ) {
264
- echo __( 'ERROR: No post ID found', 'media-library-assistant' );
265
  die();
266
  } else {
267
  $post_id = (integer) $_REQUEST['post_ID'];
268
  }
269
 
270
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
271
- wp_die( __( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) );
272
  }
273
 
274
  self::_build_existing_terms( $post_id );
@@ -278,19 +278,20 @@ class MLA_Polylang {
278
  * inline_lang_choice is the value of the Language dropdown control; change the value of the current item
279
  */
280
  if ( ! empty( $_REQUEST['pll_quick_language'] ) ) {
281
- $new_id = MLA_Polylang::_get_translation( $post_id, $_REQUEST['pll_quick_language'] );
282
  } else {
283
  $new_id = $post_id;
284
 
285
  // Language dropdown in Quick Edit area
286
  if ( isset( $_REQUEST['inline_lang_choice'] ) ) {
 
287
  if ( self::$polylang_1dot8_plus ) {
288
  $translations = PLL()->model->post->get_translations( $post_id );
289
  } else {
290
  $translations = $polylang->model->get_translations( 'post', $post_id );
291
  }
292
 
293
- if ( ! array_key_exists( $_REQUEST['inline_lang_choice'], $translations ) ) {
294
  $post = get_post( $post_id );
295
  // save_post() does a check_admin_referer() security test
296
  $_REQUEST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' );
@@ -301,12 +302,12 @@ class MLA_Polylang {
301
  if ( ! empty( $_REQUEST['tax_input'] ) ) {
302
  // Discard the old translation, which is gone
303
  unset( self::$existing_terms[ self::$existing_terms['slug'] ] );
304
- self::$existing_terms['slug'] = $_REQUEST['inline_lang_choice'];
305
  }
306
 
307
  self::_build_existing_terms( $post_id );
308
  self::_build_tax_input( $post_id );
309
- $tax_inputs = self::_apply_tax_input( 0, $_REQUEST['inline_lang_choice'] );
310
  } else {
311
  $tax_inputs = NULL;
312
  }
@@ -562,7 +563,7 @@ class MLA_Polylang {
562
  if ( 'iptc_exif_taxonomy_mapping' !== $category ) {
563
  return $new_text;
564
  }
565
-
566
  if ( is_null( $replicate ) ) {
567
  $replicate = ( 'checked' == MLACore::mla_get_option( 'term_mapping_replication', false, false, MLA_Polylang::$mla_language_option_definitions ) );
568
 
@@ -586,7 +587,7 @@ class MLA_Polylang {
586
  }
587
  }
588
  }
589
-
590
  if ( ( ! empty( $new_text ) ) && in_array( $setting_key, $taxonomies ) ) {
591
  if ( self::$polylang_1dot8_plus ) {
592
  $language_details = PLL()->model->post->get_language( $post_id );
@@ -606,7 +607,7 @@ class MLA_Polylang {
606
  } else {
607
  $parent_term = 0;
608
  }
609
-
610
  $new_terms = array();
611
  foreach( $new_text as $new_name ) {
612
  $relevant_term = self::_get_relevant_term( 'name', $new_name, $setting_key );
@@ -627,7 +628,7 @@ class MLA_Polylang {
627
  } else {
628
  $parent = 0;
629
  }
630
-
631
  $res = wp_insert_term( $new_name, $setting_key, array( 'parent' => $parent ) );
632
  if ( ( ! is_wp_error( $res ) ) && isset( $res['term_id'] ) ) {
633
  if ( self::$polylang_1dot8_plus ) {
@@ -649,7 +650,7 @@ class MLA_Polylang {
649
  } else {
650
  $parent = 0;
651
  }
652
-
653
  // save_language() does a check_admin_referer() security test
654
  $_REQUEST['_pll_nonce'] = wp_create_nonce( 'pll_language' );
655
  $_POST['term_lang_choice'] = $language;
@@ -668,7 +669,7 @@ class MLA_Polylang {
668
 
669
  unset( $_POST['term_lang_choice'] );
670
  unset( $_POST['action'] );
671
-
672
  if ( ! empty( $translations ) ) {
673
  if ( self::$polylang_1dot8_plus ) {
674
  PLL()->model->term->save_translations( $source_term, $translations );
@@ -764,7 +765,7 @@ class MLA_Polylang {
764
  */
765
  private static function _create_relevant_translation( $relevant_term, $language ) {
766
  global $polylang;
767
-
768
  $source_term = $relevant_term['term']->term_id;
769
  $name = $relevant_term['term']->name;
770
  $taxonomy = $relevant_term['term']->taxonomy;
@@ -788,7 +789,7 @@ class MLA_Polylang {
788
  $translations[ $slug ] = $translation->element_id;
789
  }
790
  }
791
-
792
  if ( self::$polylang_1dot8_plus ) {
793
  PLL()->model->term->save_translations( $source_term, $translations );
794
  } else {
@@ -815,7 +816,7 @@ class MLA_Polylang {
815
  private static function _add_relevant_term( $term, $translations = NULL ) {
816
  global $polylang;
817
  static $languages = NULL;
818
-
819
  if ( ! is_object( $term ) ) {
820
  return false;
821
  }
@@ -842,7 +843,7 @@ class MLA_Polylang {
842
  if ( empty( $languages ) ) {
843
  $languages = $polylang->model->get_languages_list( array( 'fields' => 'slug' ) );
844
  }
845
-
846
  foreach( $languages as $language_code ) {
847
  $translations[ $language_code ] = (object) array( 'element_id' => $term->term_id );
848
  }
@@ -856,7 +857,7 @@ class MLA_Polylang {
856
  // Translations may have been added in Quick or Bulk Edit
857
  self::$relevant_terms[ $term->term_taxonomy_id ]['translations'] = $translations;
858
  }
859
-
860
  return self::$relevant_terms[ $term->term_taxonomy_id ];
861
  } // _add_relevant_term
862
 
@@ -1212,7 +1213,7 @@ class MLA_Polylang {
1212
  }
1213
  }
1214
  }
1215
-
1216
  if ( isset( $relevant_term['translations'] ) ) {
1217
  foreach ( $relevant_term['translations'] as $language => $translation ) {
1218
  if ( $translated_term = self::_get_relevant_term( 'id', $translation->element_id, $taxonomy ) ) {
@@ -1280,7 +1281,7 @@ class MLA_Polylang {
1280
  } else {
1281
  $post_language = $polylang->model->get_post_language( $post_id );
1282
  }
1283
-
1284
  $post_language = $post_language->slug;
1285
  }
1286
  }
@@ -1500,18 +1501,14 @@ class MLA_Polylang {
1500
 
1501
  MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::edit_attachment( {$post_id} ) _REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_LANGUAGE );
1502
 
1503
- /*
1504
- * mla_update_single_item may call this action again
1505
- */
1506
  if ( $already_updating == $post_id ) {
1507
  return;
1508
  } else {
1509
  $already_updating = $post_id;
1510
  }
1511
 
1512
- /*
1513
- * Check for Bulk Edit during Add New Media
1514
- */
1515
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) {
1516
  if ( ! empty( self::$bulk_edit_request['tax_input'] ) ) {
1517
  $tax_inputs = self::$bulk_edit_request['tax_input'];
@@ -1532,27 +1529,35 @@ class MLA_Polylang {
1532
  return;
1533
  } // Upload New Media Bulk Edit
1534
 
1535
- /*
1536
- * For the Bulk Edit action on the Media/Assistant screen, only synchronization is needed
1537
- */
1538
  if ( ! ( isset( $_REQUEST['bulk_action'] ) && 'bulk_edit' == $_REQUEST['bulk_action'] ) ) {
1539
  /*
1540
  * This is the Media/Edit Media screen.
1541
  * The category taxonomy (edit screens) is a special case because
1542
  * post_categories_meta_box() changes the input name
1543
  */
 
1544
  if ( isset( $_REQUEST['tax_input'] ) ) {
1545
- $tax_inputs = $_REQUEST['tax_input'];
1546
- } else {
1547
- $tax_inputs = array();
 
 
 
 
 
 
 
 
 
1548
  }
1549
 
1550
  if ( isset( $_REQUEST['post_category'] ) ) {
1551
- $tax_inputs['category'] = $_REQUEST['post_category'];
1552
  }
1553
 
1554
  if ( isset( $_REQUEST['tax_action'] ) ) {
1555
- $tax_actions = $_REQUEST['tax_action'];
1556
  } else {
1557
  $tax_actions = NULL;
1558
  }
@@ -1585,9 +1590,7 @@ class MLA_Polylang {
1585
  return $term_values;
1586
  }
1587
 
1588
- /*
1589
- * Check Polylang Languages/Settings "Activate languages and translations for media" option
1590
- */
1591
  if ( isset( $polylang->options['media_support'] ) && ! $polylang->options['media_support'] ) {
1592
  $in_process = true;
1593
  $dropdown_options = array( 'pll_get_terms_not_translated' => true );
@@ -1690,15 +1693,29 @@ class MLA_Polylang {
1690
 
1691
  self::_build_existing_terms( $post_id );
1692
  if ( isset( $_REQUEST['action'] ) && 'mla-inline-edit-scripts' === $_REQUEST['action'] && isset( $_REQUEST['tax_input'] ) ) {
1693
- MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::mla_list_table_inline_action( {$post_id} ) Quick Edit initial \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1694
-
1695
  if ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_Polylang::$mla_language_option_definitions ) ) {
1696
  // Quick Edit calls update_single_item right after this filter
1697
- self::_build_tax_input( $post_id, $_REQUEST['tax_input'], NULL, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1698
  $_REQUEST['tax_input'] = self::_apply_tax_input( $post_id );
1699
  }
1700
-
1701
- MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::mla_list_table_inline_action( {$post_id} ) Quick Edit final \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
1702
  }
1703
 
1704
  // Language dropdown in Quick Edit area
@@ -1709,7 +1726,8 @@ class MLA_Polylang {
1709
  $translations = $polylang->model->get_translations( 'post', $post_id );
1710
  }
1711
 
1712
- if ( ! array_key_exists( $_REQUEST['inline_lang_choice'], $translations ) ) {
 
1713
  $post = get_post( $post_id );
1714
  // save_post() does a check_admin_referer() security test
1715
  $_REQUEST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' );
@@ -1719,7 +1737,7 @@ class MLA_Polylang {
1719
  if ( ( ! empty( $_REQUEST['tax_input'] ) ) && ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_Polylang::$mla_language_option_definitions ) ) ) {
1720
  // Discard the old translation, which is gone
1721
  unset( self::$existing_terms[ self::$existing_terms['slug'] ] );
1722
- self::$existing_terms['slug'] = $_REQUEST['inline_lang_choice'];
1723
  }
1724
  } // change language
1725
  }
@@ -1837,7 +1855,7 @@ class MLA_Polylang {
1837
  $_REQUEST['bulk_edit'] = $_GET['bulk_edit'] ='Update';
1838
  $polylang->filters_post->save_post( $post_id, $post, true );
1839
 
1840
- if ( $_REQUEST['inline_lang_choice'] != -1 ) {
1841
  $item_content = array( 'message' => "Item {$post_id}, language updated." );
1842
  }
1843
  }
@@ -1874,7 +1892,7 @@ class MLA_Polylang {
1874
  if ( 'pll-translate' == $bulk_action ) {
1875
  $translations = array();
1876
  if ( isset( $_REQUEST['bulk_tr_languages'] ) ) {
1877
- $bulk_tr_languages = $_REQUEST['bulk_tr_languages'];
1878
 
1879
  // Expand All Languages selection
1880
  if ( isset( $bulk_tr_languages['all'] ) ) {
@@ -1944,7 +1962,7 @@ class MLA_Polylang {
1944
  */
1945
  public static function mla_list_table_inline_values( $item_values ) {
1946
  global $polylang;
1947
-
1948
  // Find the first "language" column slug
1949
  $all_languages = false === $polylang->curlang;
1950
  $language_column = '';
@@ -1969,7 +1987,7 @@ class MLA_Polylang {
1969
  preg_match('/\<\/label[^\>]*\>/', $value, $match_end, PREG_OFFSET_CAPTURE );
1970
  $item_values['custom_fields'] .= substr( $value, $match_start[0][1], ( $match_end[0][1] + strlen( $match_end[0][0] ) ) - $match_start[0][1] );
1971
  }
1972
-
1973
  // Add the Translate links to the Quick Edit values
1974
  if ( array_key_exists( 'Quick Edit', $item_values ) ) {
1975
  $actions = "<input name=\"inline_translations\" type=\"hidden\" value=\"\">\n";
@@ -2002,7 +2020,7 @@ class MLA_Polylang {
2002
  preg_match('/\<\/label[^\>]*\>/', $value, $match_end, PREG_OFFSET_CAPTURE );
2003
  $item_values['bulk_custom_fields'] .= substr( $value, $match_start[0][1], ( $match_end[0][1] + strlen( $match_end[0][0] ) ) - $match_start[0][1] );
2004
  }
2005
-
2006
  return $item_values;
2007
  } // mla_list_table_inline_values
2008
 
@@ -2101,13 +2119,11 @@ class MLA_Polylang {
2101
  if ( is_null( MLA_Polylang::$language_columns ) ) {
2102
  global $polylang;
2103
 
2104
- /*
2105
- * Build language management columns
2106
- */
2107
  $show_language = 'checked' == MLACore::mla_get_option( 'language_column', false, false, MLA_Polylang::$mla_language_option_definitions );
2108
 
2109
  $languages = count( $polylang->model->get_languages_list() );
2110
- $view_status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : '';
2111
  if ( 1 < $languages && $view_status != 'trash' ) {
2112
  $show_translations = 'checked' == MLACore::mla_get_option( 'translations_column', false, false, MLA_Polylang::$mla_language_option_definitions );
2113
  } else {
@@ -2117,11 +2133,11 @@ class MLA_Polylang {
2117
  MLA_Polylang::$language_columns = array();
2118
 
2119
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2120
- $current_language = $_REQUEST['quick_current_language'];
2121
  } else {
2122
  $current_language = $polylang->curlang;
2123
  }
2124
-
2125
  if ( $show_language && empty( $current_language ) ) {
2126
  MLA_Polylang::$language_columns[ 'language' ] = __( 'Language', 'media-library-assistant' );
2127
  }
@@ -2156,11 +2172,11 @@ class MLA_Polylang {
2156
 
2157
  $current_language = $polylang->curlang;
2158
  $languages = count( $polylang->model->get_languages_list() );
2159
- $view_status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : '';
2160
 
2161
  if ( 1 < $languages && $view_status != 'trash' ) {
2162
  $w = 22 * ( empty( $current_language ) ? $languages : $languages - 1 );
2163
- echo '<style type="text/css">.column-pll_translations{width:' . $w . 'px;}.column-pll_translations img{margin:2px;}</style>';
2164
  }
2165
  }
2166
 
@@ -2186,12 +2202,12 @@ class MLA_Polylang {
2186
  } else {
2187
  $item_language = $polylang->model->get_post_language( $item->ID );
2188
  }
2189
-
2190
  $content = is_object( $item_language ) ? $item_language->name : 'none';
2191
  } elseif ('pll_translations' == $column_name ) {
2192
  if ( is_null( $languages ) ) {
2193
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2194
- $current_language = $_REQUEST['quick_current_language'];
2195
  } else {
2196
  $current_language = $polylang->curlang;
2197
  }
@@ -2204,10 +2220,10 @@ class MLA_Polylang {
2204
  // don't add the column for the filtered language
2205
  if ( empty($current_language) || $language->slug != $current_language->slug ) {
2206
  // Polylang post_column() function applies this test for 'inline-save' before updating "language"
2207
- $inline = defined('DOING_AJAX') && isset($_POST['inline_lang_choice']) && in_array( $_REQUEST['action'], array( MLA_Polylang::MLA_PLL_QUICK_TRANSLATE, MLACore::JAVASCRIPT_INLINE_EDIT_SLUG ) );
 
2208
 
2209
  if ( $inline ) {
2210
- $save_action = $_REQUEST['action'];
2211
  $_REQUEST['action'] = 'inline-save';
2212
  }
2213
 
@@ -2258,7 +2274,7 @@ class MLA_Polylang {
2258
  global $polylang;
2259
 
2260
  if ( isset( $_REQUEST['lang'] ) ) {
2261
- $submenu_arguments['lang'] = $_REQUEST['lang'];
2262
  } elseif ( $polylang->curlang ) {
2263
  $submenu_arguments['lang'] = $polylang->curlang->slug;
2264
  } else {
@@ -2392,13 +2408,13 @@ class MLA_Polylang {
2392
 
2393
  $translations = json_encode( $translations );
2394
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2395
- $current_language = $_REQUEST['quick_current_language'];
2396
  } elseif ( $polylang->curlang ) {
2397
  $current_language = $polylang->curlang->slug;
2398
  } else {
2399
  $current_language = '';
2400
  }
2401
-
2402
  $inline_data .= "\n\t<div class=\"lang\">{$old_lang}</div>";
2403
  $inline_data .= "\n\t<div class=\"old_lang\">{$old_lang}</div>";
2404
  $inline_data .= "\n\t<div class=\"inline_lang_choice\">{$old_lang}</div>";
@@ -2530,7 +2546,7 @@ class MLA_Polylang {
2530
  'std' => 'checked',
2531
  'help' => __( 'When mapping IPTC/EXIF metadata to taxonomy terms, make them available in all languages.'), 'media-library-assistant' ),
2532
  );
2533
-
2534
  /*
2535
  * Respect the Polylang Languages/Settings "Activate languages and translations for media" option.
2536
  */
43
  */
44
  public static function initialize() {
45
  global $polylang;
46
+
47
  self::$polylang_1dot8_plus = version_compare( POLYLANG_VERSION, '1.7.99', '>' );
48
 
49
  // These filters are only useful for the admin section; exit in the front-end posts/pages
233
  $lang = $polylang->model->get_post_language( $post_id );
234
  $translations = $polylang->model->get_translations( 'post', $post_id );
235
  }
236
+
237
  if ( ! $translations && $lang )
238
  $translations[ $lang->slug ] = $post_id;
239
 
261
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
262
 
263
  if ( empty( $_REQUEST['post_ID'] ) ) {
264
+ echo esc_html__( 'ERROR: No post ID found', 'media-library-assistant' );
265
  die();
266
  } else {
267
  $post_id = (integer) $_REQUEST['post_ID'];
268
  }
269
 
270
  if ( ! current_user_can( 'edit_post', $post_id ) ) {
271
+ wp_die( esc_html__( 'You are not allowed to edit this Attachment.', 'media-library-assistant' ) );
272
  }
273
 
274
  self::_build_existing_terms( $post_id );
278
  * inline_lang_choice is the value of the Language dropdown control; change the value of the current item
279
  */
280
  if ( ! empty( $_REQUEST['pll_quick_language'] ) ) {
281
+ $new_id = MLA_Polylang::_get_translation( $post_id, sanitize_text_field( wp_unslash( $_REQUEST['pll_quick_language'] ) ) );
282
  } else {
283
  $new_id = $post_id;
284
 
285
  // Language dropdown in Quick Edit area
286
  if ( isset( $_REQUEST['inline_lang_choice'] ) ) {
287
+ $inline_lang_choice = sanitize_text_field( wp_unslash( $_REQUEST['inline_lang_choice'] ) );
288
  if ( self::$polylang_1dot8_plus ) {
289
  $translations = PLL()->model->post->get_translations( $post_id );
290
  } else {
291
  $translations = $polylang->model->get_translations( 'post', $post_id );
292
  }
293
 
294
+ if ( ! array_key_exists( $inline_lang_choice, $translations ) ) {
295
  $post = get_post( $post_id );
296
  // save_post() does a check_admin_referer() security test
297
  $_REQUEST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' );
302
  if ( ! empty( $_REQUEST['tax_input'] ) ) {
303
  // Discard the old translation, which is gone
304
  unset( self::$existing_terms[ self::$existing_terms['slug'] ] );
305
+ self::$existing_terms['slug'] = $inline_lang_choice;
306
  }
307
 
308
  self::_build_existing_terms( $post_id );
309
  self::_build_tax_input( $post_id );
310
+ $tax_inputs = self::_apply_tax_input( 0, $inline_lang_choice );
311
  } else {
312
  $tax_inputs = NULL;
313
  }
563
  if ( 'iptc_exif_taxonomy_mapping' !== $category ) {
564
  return $new_text;
565
  }
566
+
567
  if ( is_null( $replicate ) ) {
568
  $replicate = ( 'checked' == MLACore::mla_get_option( 'term_mapping_replication', false, false, MLA_Polylang::$mla_language_option_definitions ) );
569
 
587
  }
588
  }
589
  }
590
+
591
  if ( ( ! empty( $new_text ) ) && in_array( $setting_key, $taxonomies ) ) {
592
  if ( self::$polylang_1dot8_plus ) {
593
  $language_details = PLL()->model->post->get_language( $post_id );
607
  } else {
608
  $parent_term = 0;
609
  }
610
+
611
  $new_terms = array();
612
  foreach( $new_text as $new_name ) {
613
  $relevant_term = self::_get_relevant_term( 'name', $new_name, $setting_key );
628
  } else {
629
  $parent = 0;
630
  }
631
+
632
  $res = wp_insert_term( $new_name, $setting_key, array( 'parent' => $parent ) );
633
  if ( ( ! is_wp_error( $res ) ) && isset( $res['term_id'] ) ) {
634
  if ( self::$polylang_1dot8_plus ) {
650
  } else {
651
  $parent = 0;
652
  }
653
+
654
  // save_language() does a check_admin_referer() security test
655
  $_REQUEST['_pll_nonce'] = wp_create_nonce( 'pll_language' );
656
  $_POST['term_lang_choice'] = $language;
669
 
670
  unset( $_POST['term_lang_choice'] );
671
  unset( $_POST['action'] );
672
+
673
  if ( ! empty( $translations ) ) {
674
  if ( self::$polylang_1dot8_plus ) {
675
  PLL()->model->term->save_translations( $source_term, $translations );
765
  */
766
  private static function _create_relevant_translation( $relevant_term, $language ) {
767
  global $polylang;
768
+
769
  $source_term = $relevant_term['term']->term_id;
770
  $name = $relevant_term['term']->name;
771
  $taxonomy = $relevant_term['term']->taxonomy;
789
  $translations[ $slug ] = $translation->element_id;
790
  }
791
  }
792
+
793
  if ( self::$polylang_1dot8_plus ) {
794
  PLL()->model->term->save_translations( $source_term, $translations );
795
  } else {
816
  private static function _add_relevant_term( $term, $translations = NULL ) {
817
  global $polylang;
818
  static $languages = NULL;
819
+
820
  if ( ! is_object( $term ) ) {
821
  return false;
822
  }
843
  if ( empty( $languages ) ) {
844
  $languages = $polylang->model->get_languages_list( array( 'fields' => 'slug' ) );
845
  }
846
+
847
  foreach( $languages as $language_code ) {
848
  $translations[ $language_code ] = (object) array( 'element_id' => $term->term_id );
849
  }
857
  // Translations may have been added in Quick or Bulk Edit
858
  self::$relevant_terms[ $term->term_taxonomy_id ]['translations'] = $translations;
859
  }
860
+
861
  return self::$relevant_terms[ $term->term_taxonomy_id ];
862
  } // _add_relevant_term
863
 
1213
  }
1214
  }
1215
  }
1216
+
1217
  if ( isset( $relevant_term['translations'] ) ) {
1218
  foreach ( $relevant_term['translations'] as $language => $translation ) {
1219
  if ( $translated_term = self::_get_relevant_term( 'id', $translation->element_id, $taxonomy ) ) {
1281
  } else {
1282
  $post_language = $polylang->model->get_post_language( $post_id );
1283
  }
1284
+
1285
  $post_language = $post_language->slug;
1286
  }
1287
  }
1501
 
1502
  MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::edit_attachment( {$post_id} ) _REQUEST = " . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_LANGUAGE );
1503
 
1504
+ // mla_update_single_item may call this action again
 
 
1505
  if ( $already_updating == $post_id ) {
1506
  return;
1507
  } else {
1508
  $already_updating = $post_id;
1509
  }
1510
 
1511
+ // Check for Bulk Edit during Add New Media
 
 
1512
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) {
1513
  if ( ! empty( self::$bulk_edit_request['tax_input'] ) ) {
1514
  $tax_inputs = self::$bulk_edit_request['tax_input'];
1529
  return;
1530
  } // Upload New Media Bulk Edit
1531
 
1532
+ // For the Bulk Edit action on the Media/Assistant screen, only synchronization is needed
 
 
1533
  if ( ! ( isset( $_REQUEST['bulk_action'] ) && 'bulk_edit' == $_REQUEST['bulk_action'] ) ) {
1534
  /*
1535
  * This is the Media/Edit Media screen.
1536
  * The category taxonomy (edit screens) is a special case because
1537
  * post_categories_meta_box() changes the input name
1538
  */
1539
+ $tax_inputs = array();
1540
  if ( isset( $_REQUEST['tax_input'] ) ) {
1541
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_REQUEST['tax_input'] ) ) );
1542
+ foreach ( $taxonomies as $tax_name ) {
1543
+ if ( isset( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1544
+ if ( is_array( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1545
+ $tax_value = array_map( 'absint', $_REQUEST['tax_input'][ $tax_name ] );
1546
+ } else {
1547
+ $tax_value = sanitize_text_field( wp_unslash( $_REQUEST['tax_input'][ $tax_name ] ) );
1548
+ }
1549
+ }
1550
+
1551
+ $tax_inputs[$tax_name] = $tax_value;
1552
+ } // foreach tax_input
1553
  }
1554
 
1555
  if ( isset( $_REQUEST['post_category'] ) ) {
1556
+ $tax_inputs['category'] = array_map( 'absint', wp_unslash( $_REQUEST['post_category'] ) );
1557
  }
1558
 
1559
  if ( isset( $_REQUEST['tax_action'] ) ) {
1560
+ $tax_actions = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['tax_action'] ) );
1561
  } else {
1562
  $tax_actions = NULL;
1563
  }
1590
  return $term_values;
1591
  }
1592
 
1593
+ // Check Polylang Languages/Settings "Activate languages and translations for media" option
 
 
1594
  if ( isset( $polylang->options['media_support'] ) && ! $polylang->options['media_support'] ) {
1595
  $in_process = true;
1596
  $dropdown_options = array( 'pll_get_terms_not_translated' => true );
1693
 
1694
  self::_build_existing_terms( $post_id );
1695
  if ( isset( $_REQUEST['action'] ) && 'mla-inline-edit-scripts' === $_REQUEST['action'] && isset( $_REQUEST['tax_input'] ) ) {
1696
+ MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::mla_list_table_inline_action( {$post_id} ) Quick Edit initial \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX ); // phpcs:ignore
1697
+
1698
  if ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_Polylang::$mla_language_option_definitions ) ) {
1699
  // Quick Edit calls update_single_item right after this filter
1700
+ $tax_inputs = array();
1701
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_REQUEST['tax_input'] ) ) );
1702
+ foreach ( $taxonomies as $tax_name ) {
1703
+ if ( isset( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1704
+ if ( is_array( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1705
+ $tax_value = array_map( 'absint', $_REQUEST['tax_input'][ $tax_name ] );
1706
+ } else {
1707
+ $tax_value = sanitize_text_field( wp_unslash( $_REQUEST['tax_input'][ $tax_name ] ) );
1708
+ }
1709
+ }
1710
+
1711
+ $tax_inputs[$tax_name] = $tax_value;
1712
+ } // foreach tax_input
1713
+
1714
+ self::_build_tax_input( $post_id, $tax_inputs, NULL, true );
1715
  $_REQUEST['tax_input'] = self::_apply_tax_input( $post_id );
1716
  }
1717
+
1718
+ MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::mla_list_table_inline_action( {$post_id} ) Quick Edit final \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX ); // phpcs:ignore
1719
  }
1720
 
1721
  // Language dropdown in Quick Edit area
1726
  $translations = $polylang->model->get_translations( 'post', $post_id );
1727
  }
1728
 
1729
+ $inline_lang_choice = sanitize_text_field( wp_unslash( $_REQUEST['inline_lang_choice'] ) );
1730
+ if ( ! array_key_exists( $inline_lang_choice, $translations ) ) {
1731
  $post = get_post( $post_id );
1732
  // save_post() does a check_admin_referer() security test
1733
  $_REQUEST['_inline_edit'] = wp_create_nonce( 'inlineeditnonce' );
1737
  if ( ( ! empty( $_REQUEST['tax_input'] ) ) && ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_Polylang::$mla_language_option_definitions ) ) ) {
1738
  // Discard the old translation, which is gone
1739
  unset( self::$existing_terms[ self::$existing_terms['slug'] ] );
1740
+ self::$existing_terms['slug'] = $inline_lang_choice;
1741
  }
1742
  } // change language
1743
  }
1855
  $_REQUEST['bulk_edit'] = $_GET['bulk_edit'] ='Update';
1856
  $polylang->filters_post->save_post( $post_id, $post, true );
1857
 
1858
+ if ( isset( $_REQUEST['inline_lang_choice'] ) &&( $_REQUEST['inline_lang_choice'] != -1 ) ) {
1859
  $item_content = array( 'message' => "Item {$post_id}, language updated." );
1860
  }
1861
  }
1892
  if ( 'pll-translate' == $bulk_action ) {
1893
  $translations = array();
1894
  if ( isset( $_REQUEST['bulk_tr_languages'] ) ) {
1895
+ $bulk_tr_languages = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['bulk_tr_languages'] ) );
1896
 
1897
  // Expand All Languages selection
1898
  if ( isset( $bulk_tr_languages['all'] ) ) {
1962
  */
1963
  public static function mla_list_table_inline_values( $item_values ) {
1964
  global $polylang;
1965
+
1966
  // Find the first "language" column slug
1967
  $all_languages = false === $polylang->curlang;
1968
  $language_column = '';
1987
  preg_match('/\<\/label[^\>]*\>/', $value, $match_end, PREG_OFFSET_CAPTURE );
1988
  $item_values['custom_fields'] .= substr( $value, $match_start[0][1], ( $match_end[0][1] + strlen( $match_end[0][0] ) ) - $match_start[0][1] );
1989
  }
1990
+
1991
  // Add the Translate links to the Quick Edit values
1992
  if ( array_key_exists( 'Quick Edit', $item_values ) ) {
1993
  $actions = "<input name=\"inline_translations\" type=\"hidden\" value=\"\">\n";
2020
  preg_match('/\<\/label[^\>]*\>/', $value, $match_end, PREG_OFFSET_CAPTURE );
2021
  $item_values['bulk_custom_fields'] .= substr( $value, $match_start[0][1], ( $match_end[0][1] + strlen( $match_end[0][0] ) ) - $match_start[0][1] );
2022
  }
2023
+
2024
  return $item_values;
2025
  } // mla_list_table_inline_values
2026
 
2119
  if ( is_null( MLA_Polylang::$language_columns ) ) {
2120
  global $polylang;
2121
 
2122
+ // Build language management columns
 
 
2123
  $show_language = 'checked' == MLACore::mla_get_option( 'language_column', false, false, MLA_Polylang::$mla_language_option_definitions );
2124
 
2125
  $languages = count( $polylang->model->get_languages_list() );
2126
+ $view_status = isset( $_REQUEST['status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ) : '';
2127
  if ( 1 < $languages && $view_status != 'trash' ) {
2128
  $show_translations = 'checked' == MLACore::mla_get_option( 'translations_column', false, false, MLA_Polylang::$mla_language_option_definitions );
2129
  } else {
2133
  MLA_Polylang::$language_columns = array();
2134
 
2135
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2136
+ $current_language = sanitize_text_field( wp_unslash( $_REQUEST['quick_current_language'] ) );
2137
  } else {
2138
  $current_language = $polylang->curlang;
2139
  }
2140
+
2141
  if ( $show_language && empty( $current_language ) ) {
2142
  MLA_Polylang::$language_columns[ 'language' ] = __( 'Language', 'media-library-assistant' );
2143
  }
2172
 
2173
  $current_language = $polylang->curlang;
2174
  $languages = count( $polylang->model->get_languages_list() );
2175
+ $view_status = isset( $_REQUEST['status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ) : '';
2176
 
2177
  if ( 1 < $languages && $view_status != 'trash' ) {
2178
  $w = 22 * ( empty( $current_language ) ? $languages : $languages - 1 );
2179
+ echo '<style type="text/css">.column-pll_translations{width:' . absint( $w ) . 'px;}.column-pll_translations img{margin:2px;}</style>';
2180
  }
2181
  }
2182
 
2202
  } else {
2203
  $item_language = $polylang->model->get_post_language( $item->ID );
2204
  }
2205
+
2206
  $content = is_object( $item_language ) ? $item_language->name : 'none';
2207
  } elseif ('pll_translations' == $column_name ) {
2208
  if ( is_null( $languages ) ) {
2209
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2210
+ $current_language = sanitize_text_field( wp_unslash( $_REQUEST['quick_current_language'] ) );
2211
  } else {
2212
  $current_language = $polylang->curlang;
2213
  }
2220
  // don't add the column for the filtered language
2221
  if ( empty($current_language) || $language->slug != $current_language->slug ) {
2222
  // Polylang post_column() function applies this test for 'inline-save' before updating "language"
2223
+ $save_action = isset( $_REQUEST['action'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) : '';
2224
+ $inline = defined('DOING_AJAX') && isset($_POST['inline_lang_choice']) && in_array( $save_action, array( MLA_Polylang::MLA_PLL_QUICK_TRANSLATE, MLACore::JAVASCRIPT_INLINE_EDIT_SLUG ) );
2225
 
2226
  if ( $inline ) {
 
2227
  $_REQUEST['action'] = 'inline-save';
2228
  }
2229
 
2274
  global $polylang;
2275
 
2276
  if ( isset( $_REQUEST['lang'] ) ) {
2277
+ $submenu_arguments['lang'] = sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) );
2278
  } elseif ( $polylang->curlang ) {
2279
  $submenu_arguments['lang'] = $polylang->curlang->slug;
2280
  } else {
2408
 
2409
  $translations = json_encode( $translations );
2410
  if ( isset( $_REQUEST['quick_current_language'] ) ) {
2411
+ $current_language = sanitize_text_field( wp_unslash( $_REQUEST['quick_current_language'] ) );
2412
  } elseif ( $polylang->curlang ) {
2413
  $current_language = $polylang->curlang->slug;
2414
  } else {
2415
  $current_language = '';
2416
  }
2417
+
2418
  $inline_data .= "\n\t<div class=\"lang\">{$old_lang}</div>";
2419
  $inline_data .= "\n\t<div class=\"old_lang\">{$old_lang}</div>";
2420
  $inline_data .= "\n\t<div class=\"inline_lang_choice\">{$old_lang}</div>";
2546
  'std' => 'checked',
2547
  'help' => __( 'When mapping IPTC/EXIF metadata to taxonomy terms, make them available in all languages.'), 'media-library-assistant' ),
2548
  );
2549
+
2550
  /*
2551
  * Respect the Polylang Languages/Settings "Activate languages and translations for media" option.
2552
  */
includes/class-mla-settings-custom-fields-tab.php CHANGED
@@ -49,9 +49,7 @@ class MLASettings_CustomFields {
49
  $use_spinner_class = version_compare( get_bloginfo( 'version' ), '4.2', '>=' );
50
  $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
51
 
52
- /*
53
- * Initialize variables for mapping scripts
54
- */
55
  $script_variables = array(
56
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
57
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
@@ -83,10 +81,8 @@ class MLASettings_CustomFields {
83
 
84
  wp_localize_script( MLASettings::JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG,
85
  MLASettings::JAVASCRIPT_INLINE_MAPPING_OBJECT, $script_variables );
86
-
87
- /*
88
- * Initialize variables for inline edit scripts
89
- */
90
  $script_variables = array(
91
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
92
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
@@ -137,7 +133,7 @@ class MLASettings_CustomFields {
137
 
138
  // Uncomment this for debugging.
139
  //$message_list = $option_messages . '<br>';
140
-
141
  if ( $changed ) {
142
  $message_list .= __( 'Custom field mapping settings updated.', 'media-library-assistant' ) . "\r\n";
143
  } else {
@@ -227,13 +223,30 @@ class MLASettings_CustomFields {
227
  * @return string Message(s) reflecting the results of the operation
228
  */
229
  private static function _add_custom_field_rule() {
230
- $mla_custom_field = isset( $_REQUEST['mla_custom_field'] ) ? stripslashes_deep( $_REQUEST['mla_custom_field'] ) : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
 
232
  // Validate new rule name
233
- if ( !empty( $mla_custom_field['new_field'] ) ) {
234
- $new_name = $mla_custom_field['new_field'];
235
- } elseif ( !empty( $mla_custom_field['new_name'] ) && ( 'none' !== $mla_custom_field['new_name'] ) ) {
236
- $new_name = $mla_custom_field['new_name'];
237
  } else {
238
  return __( 'ERROR', 'media-library-assistant' ) . __( ': No custom field name selected/entered', 'media-library-assistant' );
239
  }
@@ -242,32 +255,18 @@ class MLASettings_CustomFields {
242
  return __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
243
  }
244
 
245
- // Convert checkbox/dropdown controls to booleans
246
- $mla_custom_field['mla_column'] = isset( $mla_custom_field['mla_column'] );
247
- $mla_custom_field['quick_edit'] = isset( $mla_custom_field['quick_edit'] );
248
- $mla_custom_field['bulk_edit'] = isset( $mla_custom_field['bulk_edit'] );
249
- $mla_custom_field['keep_existing'] = '1' === $mla_custom_field['keep_existing'];
250
- $mla_custom_field['no_null'] = isset( $mla_custom_field['no_null'] );
251
- $mla_custom_field['active'] = '1' === $mla_custom_field['status'];
252
-
253
- $new_rule = array(
254
- 'post_ID' => 0,
255
- 'rule_name' => $new_name,
256
- 'name' => $new_name,
257
- 'data_source' => $mla_custom_field['data_source'],
258
- 'meta_name' => $mla_custom_field['meta_name'],
259
- 'format' => $mla_custom_field['format'],
260
- 'option' => $mla_custom_field['option'],
261
- 'keep_existing' => $mla_custom_field['keep_existing'],
262
- 'no_null' => $mla_custom_field['no_null'],
263
- 'mla_column' => $mla_custom_field['mla_column'],
264
- 'quick_edit' => $mla_custom_field['quick_edit'],
265
- 'bulk_edit' => $mla_custom_field['bulk_edit'],
266
- 'active' => $mla_custom_field['active'],
267
- 'read_only' => false,
268
- 'changed' => true,
269
- 'deleted' => false,
270
- );
271
 
272
  if ( MLA_Custom_Field_Query::mla_add_custom_field_rule( $new_rule ) ) {
273
  return __( 'Rule added', 'media-library-assistant' );
@@ -288,13 +287,30 @@ class MLASettings_CustomFields {
288
  */
289
  private static function _update_custom_field_rule( $post_id, &$template ) {
290
  $error_message = '';
291
- $mla_custom_field = isset( $_REQUEST['mla_custom_field'] ) ? stripslashes_deep( $_REQUEST['mla_custom_field'] ) : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
  // Validate rule name change
294
- if ( !empty( $mla_custom_field['new_field'] ) ) {
295
- $new_name = $mla_custom_field['new_field'];
296
- } elseif ( !empty( $mla_custom_field['new_name'] ) && ( 'none' !== $mla_custom_field['new_name'] ) ) {
297
- $new_name = $mla_custom_field['new_name'];
298
  } else {
299
  $new_name = '';
300
  }
@@ -304,37 +320,26 @@ class MLASettings_CustomFields {
304
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
305
  $new_name = '';
306
  }
307
- } elseif ( $mla_custom_field['name'] !== $mla_custom_field['rule_name'] ) {
308
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Invalid rule name must be changed', 'media-library-assistant' );
309
  }
310
 
311
- // Convert checkbox/dropdown controls to booleans
312
- $mla_custom_field['mla_column'] = isset( $mla_custom_field['mla_column'] );
313
- $mla_custom_field['quick_edit'] = isset( $mla_custom_field['quick_edit'] );
314
- $mla_custom_field['bulk_edit'] = isset( $mla_custom_field['bulk_edit'] );
315
- $mla_custom_field['keep_existing'] = '1' === $mla_custom_field['keep_existing'];
316
- $mla_custom_field['no_null'] = isset( $mla_custom_field['no_null'] );
317
- $mla_custom_field['active'] = '1' === $mla_custom_field['status'];
318
- $mla_custom_field['read_only'] = $mla_custom_field['name'] !== $mla_custom_field['rule_name'];
319
-
320
- $new_rule = array(
321
- 'post_ID' => $mla_custom_field['post_ID'],
322
- 'rule_name' => $new_name ? $new_name : $mla_custom_field['rule_name'],
323
- 'name' => $new_name ? $new_name : $mla_custom_field['name'],
324
- 'data_source' => $mla_custom_field['data_source'],
325
- 'meta_name' => $mla_custom_field['meta_name'],
326
- 'format' => $mla_custom_field['format'],
327
- 'option' => $mla_custom_field['option'],
328
- 'keep_existing' => $mla_custom_field['keep_existing'],
329
- 'no_null' => $mla_custom_field['no_null'],
330
- 'mla_column' => $mla_custom_field['mla_column'],
331
- 'quick_edit' => $mla_custom_field['quick_edit'],
332
- 'bulk_edit' => $mla_custom_field['bulk_edit'],
333
- 'active' => $mla_custom_field['active'],
334
- 'read_only' => $mla_custom_field['read_only'],
335
- 'changed' => true,
336
- 'deleted' => false,
337
- );
338
 
339
  if ( empty( $error_message ) ) {
340
  if ( false === MLA_Custom_Field_Query::mla_replace_custom_field_rule( $new_rule ) ) {
@@ -385,39 +390,47 @@ class MLASettings_CustomFields {
385
  return "ERROR: _bulk_update_custom_field_rule( {$post_id} ) rule not found.";
386
  }
387
 
388
- // Convert dropdown controls to field values
389
- if ( '-1' !== $_REQUEST['format'] ) {
390
- $rule['format'] = $_REQUEST['format'];
 
391
  }
392
-
393
- if ( '-1' !== $_REQUEST['option'] ) {
394
- $rule['option'] = $_REQUEST['option'];
 
395
  }
396
-
397
- if ( '-1' !== $_REQUEST['keep_existing'] ) {
398
- $rule['keep_existing'] = '1' === $_REQUEST['keep_existing'];
 
399
  }
400
-
401
- if ( '-1' !== $_REQUEST['no_null'] ) {
402
- $rule['no_null'] = '1' === $_REQUEST['no_null'];
 
403
  }
404
-
405
- if ( '-1' !== $_REQUEST['mla_column'] ) {
406
- $rule['mla_column'] = '1' === $_REQUEST['mla_column'];
 
407
  }
408
-
409
- if ( '-1' !== $_REQUEST['quick_edit'] ) {
410
- $rule['quick_edit'] = '1' === $_REQUEST['quick_edit'];
 
411
  }
412
-
413
- if ( '-1' !== $_REQUEST['bulk_edit'] ) {
414
- $rule['bulk_edit'] = '1' === $_REQUEST['bulk_edit'];
 
415
  }
416
-
417
- if ( '-1' !== $_REQUEST['active'] ) {
418
- $rule['active'] = '1' === $_REQUEST['active'];
 
419
  }
420
-
421
  $rule['changed'] = true;
422
  $rule['deleted'] = false;
423
 
@@ -530,7 +543,12 @@ class MLASettings_CustomFields {
530
  $message = '';
531
  $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $rule_ids );
532
  foreach ( $source_rules as $rule_name => $rule ) {
533
- $result = MLASettings::mla_delete_custom_field( $rule );
 
 
 
 
 
534
  $message .= sprintf( __( 'Custom Field Rule "%1$s": %2$s', 'media-library-assistant' ), $rule['name'], $result );
535
  }
536
 
@@ -563,7 +581,8 @@ class MLASettings_CustomFields {
563
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
564
  } elseif ( !empty( $_REQUEST['mla-edit-custom-field-submit'] ) ) {
565
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
566
- $page_content = MLASettings_CustomFields::_update_custom_field_rule( $_REQUEST['mla_custom_field']['post_ID'], $page_template_array );
 
567
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
568
  } elseif ( !empty( $_REQUEST['mla-edit-custom-field-cancel'] ) ) {
569
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
@@ -579,12 +598,13 @@ class MLASettings_CustomFields {
579
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
580
  if ( array_key_exists( $bulk_action, MLA_Custom_Fields_List_Table::mla_get_bulk_actions() ) ) {
581
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
 
582
  if ( 'execute' === $bulk_action ) {
583
  $page_content['message'] = sprintf( __( 'Unknown bulk action %1$s', 'media-library-assistant' ), $bulk_action );
584
  } elseif ( 'purge' === $bulk_action ) {
585
- $page_content['message'] = MLASettings_CustomFields::_purge_custom_field_values( $_REQUEST['cb_mla_item_ID'] );
586
  } else {
587
- foreach ( $_REQUEST['cb_mla_item_ID'] as $post_ID ) {
588
  switch ( $bulk_action ) {
589
  case 'edit':
590
  $item_content = MLASettings_CustomFields::_bulk_update_custom_field_rule( $post_ID );
@@ -595,10 +615,10 @@ class MLASettings_CustomFields {
595
  default:
596
  $item_content = 'Bad action'; // UNREACHABLE
597
  } // switch $bulk_action
598
-
599
  $page_content['message'] .= $item_content . '<br>';
600
  } // foreach cb_attachment
601
-
602
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
603
  } // edit, delete
604
  } // isset cb_attachment
@@ -618,20 +638,21 @@ class MLASettings_CustomFields {
618
 
619
  $page_content = array( 'message' => '', 'body' => '' );
620
 
 
621
  switch ( $_REQUEST['mla_admin_action'] ) {
622
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
623
- $item = MLA_Custom_Field_Query::mla_find_custom_field_rule( $_REQUEST['mla_item_ID'] );
624
  $page_content = self::_compose_edit_custom_field_rule_tab( $item, $page_template_array );
625
  break;
626
  case MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_PURGE:
627
- $page_content['message'] = MLASettings_CustomFields::_purge_custom_field_values( $_REQUEST['mla_item_ID'] );
628
  break;
629
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
630
- $page_content['message'] = MLASettings_CustomFields::_delete_custom_field_rule( $_REQUEST['mla_item_ID'] );
631
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
632
  break;
633
  default:
634
- $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] );
635
  break;
636
  } // switch ($_REQUEST['mla_admin_action'])
637
  } // (!empty($_REQUEST['mla_admin_action'])
@@ -663,19 +684,21 @@ class MLASettings_CustomFields {
663
  }
664
 
665
  // Display the Custom Fields tab and the custom fields rule table
666
- $_SERVER['REQUEST_URI'] = remove_query_arg( array(
667
- 'mla_admin_action',
668
- 'mla_custom_field_item',
669
- 'mla_item_ID',
670
- '_wpnonce',
671
- '_wp_http_referer',
672
- 'action',
673
- 'action2',
674
- 'cb_mla_item_ID',
675
- 'mla-edit-custom-field-cancel',
676
- 'mla-edit-custom-field-submit',
677
- 'mla-custom-field-options-save',
678
- ), $_SERVER['REQUEST_URI'] );
 
 
679
 
680
  // Create an instance of our package class
681
  $MLACustomFieldsListTable = new MLA_Custom_Fields_List_Table();
@@ -706,9 +729,9 @@ class MLASettings_CustomFields {
706
 
707
  if ( is_array( $value ) ) {
708
  foreach ( $value as $element_key => $element_value )
709
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( $element_value ) ) . "\n";
710
  } else {
711
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( $value ) ) . "\n";
712
  }
713
  }
714
 
@@ -750,7 +773,7 @@ class MLASettings_CustomFields {
750
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
751
  // '_wp_http_referer' => wp_referer_field( false ),
752
  'Search Rules Text' => __( 'Search Rules Text', 'media-library-assistant' ),
753
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
754
  'Search Rules' => __( 'Search Rules', 'media-library-assistant' ),
755
  'options_list' => $options_list,
756
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
@@ -836,12 +859,15 @@ class MLASettings_CustomFields {
836
  */
837
  public static function mla_inline_mapping_custom_action() {
838
  MLACore::mla_debug_add( 'MLASettings_CustomFields::mla_inline_mapping_custom_action $_REQUEST = ' . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
839
- set_current_screen( $_REQUEST['screen'] );
 
 
 
840
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
841
 
842
  // Find the current chunk
843
- $offset = isset( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0;
844
- $length = isset( $_REQUEST['length'] ) ? $_REQUEST['length'] : 0;
845
 
846
  $page_content = array(
847
  'message' => 'ERROR: No action taken',
@@ -851,52 +877,57 @@ class MLASettings_CustomFields {
851
  'success' => 0
852
  );
853
 
854
- // Look for "Execute All Rules", Bulk Action Execute, then the "Execute" rollover action
855
- if ( ! empty( $_REQUEST['bulk_action'] ) && ( 'custom-field-options-map' == $_REQUEST['bulk_action'] ) ) {
856
- $page_content = self::_process_custom_field_mapping( NULL, $offset, $length );
857
- }
858
- elseif ( ! empty( $_REQUEST['bulk_action'] ) && ( 'mapping-options-bulk-execute' == $_REQUEST['bulk_action'] ) ) {
859
- $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $_REQUEST['ids'] );
860
-
861
- $rules = array();
862
- foreach ( $source_rules as $rule_name => $rule ) {
863
- if ( 'none' === $rule['data_source'] ) {
864
- continue;
865
- }
866
-
867
- $rule['active'] = true; // Always execute for bulk actions
868
- $rules[ $rule_name ] = $rule;
869
- }
870
-
871
- if ( empty( $rules ) ) {
872
- $page_content['message'] = __( 'Nothing to execute', 'media-library-assistant' );
873
- } else {
874
- $page_content = self::_process_custom_field_mapping( $rules, $offset, $length );
875
  }
876
- }
877
- elseif ( ! empty( $_REQUEST['bulk_action'] ) && ( 0 === strpos( $_REQUEST['bulk_action'], MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP ) ) ) {
878
- $match_count = preg_match( '/\[(.*)\]/', $_REQUEST['bulk_action'], $matches );
879
- if ( $match_count ) {
880
- $post_id = absint( $matches[1] );
881
- $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $post_id );
882
-
883
  $rules = array();
884
  foreach ( $source_rules as $rule_name => $rule ) {
885
  if ( 'none' === $rule['data_source'] ) {
886
  continue;
887
  }
888
-
889
- $rule['active'] = true; // Always execute for rollover action
890
  $rules[ $rule_name ] = $rule;
891
  }
892
-
893
  if ( empty( $rules ) ) {
894
  $page_content['message'] = __( 'Nothing to execute', 'media-library-assistant' );
895
  } else {
896
  $page_content = self::_process_custom_field_mapping( $rules, $offset, $length );
897
  }
898
  }
899
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
900
 
901
  $chunk_results = array(
902
  'message' => $page_content['message'],
@@ -920,40 +951,43 @@ class MLASettings_CustomFields {
920
  * @return void echo HTML <tr> markup for updated row or error message, then die()
921
  */
922
  public static function mla_inline_edit_custom_action() {
923
- set_current_screen( $_REQUEST['screen'] );
 
 
 
924
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
925
 
926
  $error_message = '';
927
- if ( empty( $_REQUEST['post_ID'] ) ) {
928
- $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule ID not found', 'media-library-assistant' );
929
- } else {
930
- $rule = MLA_Custom_Field_Query::mla_find_custom_field_rule( $_REQUEST['post_ID'] );
931
  if ( false === $rule ) {
932
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule not found', 'media-library-assistant' );
933
  }
 
 
934
  }
935
-
936
  if ( !empty( $error_message ) ) {
937
- echo $error_message;
938
  die();
939
  }
940
 
941
- $rule['data_source'] = $_REQUEST['data_source'];
942
- $rule['meta_name'] = $_REQUEST['meta_name'];
943
- $rule['format'] = $_REQUEST['format'];
944
- $rule['option'] = $_REQUEST['option'];
945
- $rule['keep_existing'] = '1' === $_REQUEST['keep_existing'];
946
  $rule['no_null'] = isset( $_REQUEST['no_null'] ) && '1' === $_REQUEST['no_null'];
947
  $rule['mla_column'] = isset( $_REQUEST['mla_column'] ) && '1' === $_REQUEST['mla_column'];
948
  $rule['quick_edit'] = isset( $_REQUEST['quick_edit'] ) && '1' === $_REQUEST['quick_edit'];
949
  $rule['bulk_edit'] = isset( $_REQUEST['bulk_edit'] ) && '1' === $_REQUEST['bulk_edit'];
950
- $rule['active'] = '1' === $_REQUEST['active'];
951
  $rule['changed'] = true;
952
  $rule['deleted'] = false;
953
  $rule = stripslashes_deep( $rule );
954
 
955
  if ( false === MLA_Custom_Field_Query::mla_replace_custom_field_rule( $rule ) ) {
956
- echo __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' );
957
  die();
958
  }
959
 
@@ -966,9 +1000,7 @@ class MLASettings_CustomFields {
966
  } // mla_inline_edit_custom_action
967
  } // class MLASettings_CustomFields
968
 
969
- /*
970
- * The WP_List_Table class isn't automatically available to plugins
971
- */
972
  if ( !class_exists( 'WP_List_Table' ) ) {
973
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
974
  }
@@ -1122,33 +1154,33 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1122
  $has_filters = $include_filters;
1123
 
1124
  // View arguments - see also mla_tabulate_custom_field_items
1125
- if ( isset( $_REQUEST['mla_custom_field_view'] ) ) {
1126
- if ( in_array( $_REQUEST['mla_custom_field_view'], array( 'all', 'mla_column', 'quick_edit', 'bulk_edit', 'read_only' ) ) ) {
1127
- $submenu_arguments['mla_custom_field_view'] = $_REQUEST['mla_custom_field_view'];
1128
- }
1129
  }
1130
 
1131
  // Search box arguments
1132
  if ( !empty( $_REQUEST['s'] ) ) {
1133
- $submenu_arguments['s'] = urlencode( stripslashes( $_REQUEST['s'] ) );
1134
  }
1135
 
1136
  // Filter arguments (from table header)
1137
- if ( isset( $_REQUEST['mla_custom_field_status'] ) && ( 'any' != $_REQUEST['mla_custom_field_status'] ) ) {
1138
- if ( in_array( $_REQUEST['mla_custom_field_status'], array( 'active', 'inactive' ) ) ) {
1139
- $submenu_arguments['mla_custom_field_status'] = $_REQUEST['mla_custom_field_status'];
 
1140
  }
1141
  }
1142
 
1143
  // Sort arguments (from column header)
1144
  if ( isset( $_REQUEST['order'] ) ) {
1145
- $submenu_arguments['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
1146
  }
1147
 
1148
- if ( isset( $_REQUEST['orderby'] ) ) {
1149
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
1150
- $submenu_arguments['orderby'] = $_REQUEST['orderby'];
1151
- }
1152
  }
1153
 
1154
  return $submenu_arguments;
@@ -1337,13 +1369,13 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1337
  }
1338
 
1339
  if ( isset( $_REQUEST['order'] ) ) {
1340
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
1341
  }
1342
 
1343
- if ( isset( $_REQUEST['orderby'] ) ) {
1344
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
1345
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
1346
- }
1347
  }
1348
 
1349
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
@@ -1555,7 +1587,7 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1555
  * @param string 'top' | 'bottom'
1556
  */
1557
  function pagination( $which ) {
1558
- $save_uri = $_SERVER['REQUEST_URI'];
1559
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Custom_Fields_List_Table::mla_submenu_arguments(), $save_uri );
1560
  parent::pagination( $which );
1561
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1619,17 +1651,13 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1619
 
1620
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1621
 
1622
- /*
1623
- * Calculate the common values once per page load
1624
- */
1625
  if ( is_null( $base_url ) ) {
1626
- /*
1627
- * Remember the view filters
1628
- */
1629
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-custom_field&mla_tab=custom_field';
1630
 
1631
  if ( isset( $_REQUEST['s'] ) ) {
1632
- //$base_url = add_query_arg( array( 's' => $_REQUEST['s'] ), $base_url );
1633
  }
1634
  }
1635
 
@@ -1650,10 +1678,10 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1650
  */
1651
  function get_views( ) {
1652
  // Find current view
1653
- $current_view = isset( $_REQUEST['mla_custom_field_view'] ) ? $_REQUEST['mla_custom_field_view'] : 'all';
1654
 
1655
  // Generate the list of views, retaining keyword search criterion
1656
- $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
1657
  $custom_field_items = MLA_Custom_Field_Query::mla_tabulate_custom_field_items( $s );
1658
  $view_links = array();
1659
  foreach ( $custom_field_items as $slug => $item )
@@ -1730,9 +1758,7 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1730
  * @return void
1731
  */
1732
  function extra_tablenav( $which ) {
1733
- /*
1734
- * Decide which actions to show
1735
- */
1736
  if ( 'top' == $which ) {
1737
  $actions = array( 'mla_custom_field_status', 'mla_filter' );
1738
  } else {
@@ -1748,7 +1774,7 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1748
  foreach ( $actions as $action ) {
1749
  switch ( $action ) {
1750
  case 'mla_custom_field_status':
1751
- echo self::mla_get_custom_field_status_dropdown( isset( $_REQUEST['mla_custom_field_status'] ) ? $_REQUEST['mla_custom_field_status'] : 'any' );
1752
  break;
1753
  case 'mla_filter':
1754
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
@@ -1780,9 +1806,7 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1780
  $this->get_sortable_columns()
1781
  );
1782
 
1783
- /*
1784
- * REQUIRED for pagination.
1785
- */
1786
  $total_items = MLA_Custom_Field_Query::mla_count_custom_field_rules( $_REQUEST );
1787
  $user = get_current_user_id();
1788
  $screen = get_current_screen();
@@ -1797,9 +1821,7 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1797
  $per_page = $screen->get_option( 'per_page', 'default' );
1798
  }
1799
 
1800
- /*
1801
- * REQUIRED. We also have to register our pagination options & calculations.
1802
- */
1803
  $this->set_pagination_args( array(
1804
  'total_items' => $total_items,
1805
  'per_page' => $per_page,
@@ -1828,8 +1850,8 @@ class MLA_Custom_Fields_List_Table extends WP_List_Table {
1828
  static $row_class = '';
1829
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1830
 
1831
- echo '<tr id="custom_field-' . $item->post_ID . '"' . $row_class . '>';
1832
- echo parent::single_row_columns( $item );
1833
  echo '</tr>';
1834
  }
1835
  } // class MLA_Custom_Fields_List_Table
@@ -1919,9 +1941,7 @@ class MLA_Custom_Field_Query {
1919
  return true;
1920
  }
1921
 
1922
- /*
1923
- * One row for each existing rule, case insensitive "natural order"
1924
- */
1925
  $sorted_keys = array();
1926
  foreach ( $current_values as $rule_name => $current_value ) {
1927
  $sorted_keys[ $current_value['name'] ] = $current_value['name'];
@@ -1933,9 +1953,7 @@ class MLA_Custom_Field_Query {
1933
  $sorted_names[ $rule_name ] = array();
1934
  }
1935
 
1936
- /*
1937
- * Allow for multiple rules mapping the same name (an old bug)
1938
- */
1939
  foreach ( $current_values as $rule_name => $current_value ) {
1940
  $sorted_names[ $current_value['name'] ][] = $rule_name;
1941
  }
@@ -2068,9 +2086,7 @@ class MLA_Custom_Field_Query {
2068
  $clean_request[ $key ] = 'ASC';
2069
  }
2070
  break;
2071
- /*
2072
- * ['s'] - Search items by one or more keywords
2073
- */
2074
  case 's':
2075
  $clean_request[ $key ] = stripslashes( trim( $value ) );
2076
  break;
@@ -2079,9 +2095,7 @@ class MLA_Custom_Field_Query {
2079
  } // switch $key
2080
  } // foreach $raw_request
2081
 
2082
- /*
2083
- * Ignore incoming paged value; use offset and count instead
2084
- */
2085
  if ( ( (int) $count ) > 0 ) {
2086
  $clean_request['offset'] = $offset;
2087
  $clean_request['posts_per_page'] = $count;
@@ -2104,9 +2118,7 @@ class MLA_Custom_Field_Query {
2104
  return array ();
2105
  }
2106
 
2107
- /*
2108
- * Sort and filter the list
2109
- */
2110
  $keywords = isset( $request['s'] ) ? $request['s'] : '';
2111
  preg_match_all('/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keywords, $matches);
2112
  $keywords = array_map( 'MLAQuery::mla_search_terms_tidy', $matches[0]);
@@ -2208,12 +2220,10 @@ class MLA_Custom_Field_Query {
2208
  $sorted_items = array_reverse( $sorted_items, true );
2209
  }
2210
 
2211
- /*
2212
- * Paginate the sorted list
2213
- */
2214
  $results = array();
2215
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
2216
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
2217
  foreach ( $sorted_items as $value ) {
2218
  if ( $offset ) {
2219
  $offset--;
49
  $use_spinner_class = version_compare( get_bloginfo( 'version' ), '4.2', '>=' );
50
  $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
51
 
52
+ // Initialize variables for mapping scripts
 
 
53
  $script_variables = array(
54
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
55
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
81
 
82
  wp_localize_script( MLASettings::JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG,
83
  MLASettings::JAVASCRIPT_INLINE_MAPPING_OBJECT, $script_variables );
84
+
85
+ // Initialize variables for inline edit scripts
 
 
86
  $script_variables = array(
87
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
88
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
133
 
134
  // Uncomment this for debugging.
135
  //$message_list = $option_messages . '<br>';
136
+
137
  if ( $changed ) {
138
  $message_list .= __( 'Custom field mapping settings updated.', 'media-library-assistant' ) . "\r\n";
139
  } else {
223
  * @return string Message(s) reflecting the results of the operation
224
  */
225
  private static function _add_custom_field_rule() {
226
+ $new_rule = array(
227
+ 'post_ID' => 0,
228
+ 'rule_name' => '',
229
+ 'name' => '',
230
+ 'data_source' => '',
231
+ 'meta_name' => '',
232
+ 'format' => '',
233
+ 'option' => '',
234
+ 'keep_existing' => false,
235
+ 'no_null' => false,
236
+ 'mla_column' => false,
237
+ 'quick_edit' => false,
238
+ 'bulk_edit' => false,
239
+ 'active' => false,
240
+ 'read_only' => false,
241
+ 'changed' => true,
242
+ 'deleted' => false,
243
+ );
244
 
245
  // Validate new rule name
246
+ if ( !empty( $_REQUEST['mla_custom_field']['new_field'] ) ) {
247
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field']['new_field'] ) );
248
+ } elseif ( !empty( $_REQUEST['mla_custom_field']['new_name'] ) && ( 'none' !== $_REQUEST['mla_custom_field']['new_name'] ) ) {
249
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field']['new_name'] ) );
250
  } else {
251
  return __( 'ERROR', 'media-library-assistant' ) . __( ': No custom field name selected/entered', 'media-library-assistant' );
252
  }
255
  return __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
256
  }
257
 
258
+ $new_rule['rule_name'] = $new_name;
259
+ $new_rule['name'] = $new_name;
260
+ $new_rule['data_source'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['data_source'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['data_source'] ) : 'none' );
261
+ $new_rule['meta_name'] = wp_kses( isset( $_REQUEST['mla_custom_field']['meta_name'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['meta_name'] ) : '', 'post' );
262
+ $new_rule['format'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['format'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['format'] ) : 'native' );
263
+ $new_rule['option'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['option'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['option'] ) : 'text' );
264
+ $new_rule['keep_existing'] = isset( $_REQUEST['mla_custom_field']['keep_existing'] ) && '1' === $_REQUEST['mla_custom_field']['keep_existing'];
265
+ $new_rule['no_null'] = isset( $_REQUEST['mla_custom_field']['no_null'] );
266
+ $new_rule['mla_column'] = isset( $_REQUEST['mla_custom_field']['mla_column'] );
267
+ $new_rule['quick_edit'] = isset( $_REQUEST['mla_custom_field']['quick_edit'] );
268
+ $new_rule['bulk_edit'] = isset( $_REQUEST['mla_custom_field']['bulk_edit'] );
269
+ $new_rule['active'] = isset( $_REQUEST['mla_custom_field']['status'] ) && '1' === $_REQUEST['mla_custom_field']['status'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
 
271
  if ( MLA_Custom_Field_Query::mla_add_custom_field_rule( $new_rule ) ) {
272
  return __( 'Rule added', 'media-library-assistant' );
287
  */
288
  private static function _update_custom_field_rule( $post_id, &$template ) {
289
  $error_message = '';
290
+ $new_rule = array(
291
+ 'post_ID' => 0,
292
+ 'rule_name' => '',
293
+ 'name' => '',
294
+ 'data_source' => '',
295
+ 'meta_name' => '',
296
+ 'format' => '',
297
+ 'option' => '',
298
+ 'keep_existing' => false,
299
+ 'no_null' => false,
300
+ 'mla_column' => false,
301
+ 'quick_edit' => false,
302
+ 'bulk_edit' => false,
303
+ 'active' => false,
304
+ 'read_only' => false,
305
+ 'changed' => true,
306
+ 'deleted' => false,
307
+ );
308
 
309
  // Validate rule name change
310
+ if ( !empty( $_REQUEST['mla_custom_field']['new_field'] ) ) {
311
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field']['new_field'] ) );
312
+ } elseif ( !empty( $_REQUEST['mla_custom_field']['new_name'] ) && ( 'none' !== $_REQUEST['mla_custom_field']['new_name'] ) ) {
313
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field']['new_name'] ) );
314
  } else {
315
  $new_name = '';
316
  }
320
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
321
  $new_name = '';
322
  }
323
+ } elseif ( isset( $_REQUEST['mla_custom_field']['name'] ) && isset( $_REQUEST['mla_custom_field']['rule_name'] ) && ( $_REQUEST['mla_custom_field']['name'] !== $_REQUEST['mla_custom_field']['rule_name'] ) ) {
324
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Invalid rule name must be changed', 'media-library-assistant' );
325
  }
326
 
327
+ if ( empty( $error_message ) ) {
328
+ $new_rule['post_ID'] = isset( $_REQUEST['mla_custom_field']['post_ID'] ) ? absint( $_REQUEST['mla_custom_field']['post_ID'] ) : 0;
329
+ $new_rule['rule_name'] = $new_name ? $new_name : sanitize_text_field( isset( $_REQUEST['mla_custom_field']['rule_name'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['rule_name'] ) : '' );
330
+ $new_rule['name'] = $new_name ? $new_name : sanitize_text_field( isset( $_REQUEST['mla_custom_field']['name'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['name'] ) : '' );
331
+ $new_rule['data_source'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['data_source'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['data_source'] ) : 'none' );
332
+ $new_rule['meta_name'] = wp_kses( isset( $_REQUEST['mla_custom_field']['meta_name'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['meta_name'] ) : '', 'post' );
333
+ $new_rule['format'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['format'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['format'] ) : 'native' );
334
+ $new_rule['option'] = sanitize_text_field( isset( $_REQUEST['mla_custom_field']['option'] ) ? wp_unslash( $_REQUEST['mla_custom_field']['option'] ) : 'text' );
335
+ $new_rule['keep_existing'] = isset( $_REQUEST['mla_custom_field']['keep_existing'] ) && '1' === $_REQUEST['mla_custom_field']['keep_existing'];
336
+ $new_rule['no_null'] = isset( $_REQUEST['mla_custom_field']['no_null'] );
337
+ $new_rule['mla_column'] = isset( $_REQUEST['mla_custom_field']['mla_column'] );
338
+ $new_rule['quick_edit'] = isset( $_REQUEST['mla_custom_field']['quick_edit'] );
339
+ $new_rule['bulk_edit'] = isset( $_REQUEST['mla_custom_field']['bulk_edit'] );
340
+ $new_rule['active'] = isset( $_REQUEST['mla_custom_field']['status'] ) && '1' === $_REQUEST['mla_custom_field']['status'];
341
+ $new_rule['read_only'] = $new_rule['name'] !== $new_rule['rule_name'];
342
+ } // no error
 
 
 
 
 
 
 
 
 
 
 
343
 
344
  if ( empty( $error_message ) ) {
345
  if ( false === MLA_Custom_Field_Query::mla_replace_custom_field_rule( $new_rule ) ) {
390
  return "ERROR: _bulk_update_custom_field_rule( {$post_id} ) rule not found.";
391
  }
392
 
393
+ // Sanitize and convert dropdown controls to field values
394
+ $field = sanitize_text_field( isset( $_REQUEST['format'] ) ? wp_unslash( $_REQUEST['format'] ) : '-1' );
395
+ if ( '-1' !== $field ) {
396
+ $rule['format'] = $field;
397
  }
398
+
399
+ $field = sanitize_text_field( isset( $_REQUEST['option'] ) ? wp_unslash( $_REQUEST['option'] ) : '-1' );
400
+ if ( '-1' !== $field ) {
401
+ $rule['option'] = $field;
402
  }
403
+
404
+ $field = sanitize_text_field( isset( $_REQUEST['keep_existing'] ) ? wp_unslash( $_REQUEST['keep_existing'] ) : '-1' );
405
+ if ( '-1' !== $field ) {
406
+ $rule['keep_existing'] = '1' === $field;
407
  }
408
+
409
+ $field = sanitize_text_field( isset( $_REQUEST['no_null'] ) ? wp_unslash( $_REQUEST['no_null'] ) : '-1' );
410
+ if ( '-1' !== $field ) {
411
+ $rule['no_null'] = '1' === $field;
412
  }
413
+
414
+ $field = sanitize_text_field( isset( $_REQUEST['mla_column'] ) ? wp_unslash( $_REQUEST['mla_column'] ) : '-1' );
415
+ if ( '-1' !== $field ) {
416
+ $rule['mla_column'] = '1' === $field;
417
  }
418
+
419
+ $field = sanitize_text_field( isset( $_REQUEST['quick_edit'] ) ? wp_unslash( $_REQUEST['quick_edit'] ) : '-1' );
420
+ if ( '-1' !== $field ) {
421
+ $rule['quick_edit'] = '1' === $field;
422
  }
423
+
424
+ $field = sanitize_text_field( isset( $_REQUEST['bulk_edit'] ) ? wp_unslash( $_REQUEST['bulk_edit'] ) : '-1' );
425
+ if ( '-1' !== $field ) {
426
+ $rule['bulk_edit'] = '1' === $field;
427
  }
428
+
429
+ $field = sanitize_text_field( isset( $_REQUEST['active'] ) ? wp_unslash( $_REQUEST['active'] ) : '-1' );
430
+ if ( '-1' !== $field ) {
431
+ $rule['active'] = '1' === $field;
432
  }
433
+
434
  $rule['changed'] = true;
435
  $rule['deleted'] = false;
436
 
543
  $message = '';
544
  $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $rule_ids );
545
  foreach ( $source_rules as $rule_name => $rule ) {
546
+ $result = apply_filters( 'mla_purge_custom_field_values', NULL, 'custom_field_mapping', $rule_name, $rule );
547
+
548
+ if ( NULL === $result ) {
549
+ $result = MLASettings::mla_delete_custom_field( $rule );
550
+ }
551
+
552
  $message .= sprintf( __( 'Custom Field Rule "%1$s": %2$s', 'media-library-assistant' ), $rule['name'], $result );
553
  }
554
 
581
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
582
  } elseif ( !empty( $_REQUEST['mla-edit-custom-field-submit'] ) ) {
583
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
584
+ $post_id = !empty( $_REQUEST['mla_custom_field']['post_ID'] ) ? absint( $_REQUEST['mla_custom_field']['post_ID'] ) : 0;
585
+ $page_content = MLASettings_CustomFields::_update_custom_field_rule( $post_id, $page_template_array );
586
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
587
  } elseif ( !empty( $_REQUEST['mla-edit-custom-field-cancel'] ) ) {
588
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
598
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
599
  if ( array_key_exists( $bulk_action, MLA_Custom_Fields_List_Table::mla_get_bulk_actions() ) ) {
600
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
601
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
602
  if ( 'execute' === $bulk_action ) {
603
  $page_content['message'] = sprintf( __( 'Unknown bulk action %1$s', 'media-library-assistant' ), $bulk_action );
604
  } elseif ( 'purge' === $bulk_action ) {
605
+ $page_content['message'] = MLASettings_CustomFields::_purge_custom_field_values( $post_ids );
606
  } else {
607
+ foreach ( $post_ids as $post_ID ) {
608
  switch ( $bulk_action ) {
609
  case 'edit':
610
  $item_content = MLASettings_CustomFields::_bulk_update_custom_field_rule( $post_ID );
615
  default:
616
  $item_content = 'Bad action'; // UNREACHABLE
617
  } // switch $bulk_action
618
+
619
  $page_content['message'] .= $item_content . '<br>';
620
  } // foreach cb_attachment
621
+
622
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
623
  } // edit, delete
624
  } // isset cb_attachment
638
 
639
  $page_content = array( 'message' => '', 'body' => '' );
640
 
641
+ $post_id = !empty( $_REQUEST['mla_item_ID'] ) ? absint( $_REQUEST['mla_item_ID'] ) : 0;
642
  switch ( $_REQUEST['mla_admin_action'] ) {
643
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
644
+ $item = MLA_Custom_Field_Query::mla_find_custom_field_rule( $post_id );
645
  $page_content = self::_compose_edit_custom_field_rule_tab( $item, $page_template_array );
646
  break;
647
  case MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_PURGE:
648
+ $page_content['message'] = MLASettings_CustomFields::_purge_custom_field_values( $post_id );
649
  break;
650
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
651
+ $page_content['message'] = MLASettings_CustomFields::_delete_custom_field_rule( $post_id );
652
  MLA_Custom_Field_Query::mla_put_custom_field_rules();
653
  break;
654
  default:
655
+ $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ) );
656
  break;
657
  } // switch ($_REQUEST['mla_admin_action'])
658
  } // (!empty($_REQUEST['mla_admin_action'])
684
  }
685
 
686
  // Display the Custom Fields tab and the custom fields rule table
687
+ if ( isset( $_SERVER['REQUEST_URI'] ) ) {
688
+ $_SERVER['REQUEST_URI'] = remove_query_arg( array(
689
+ 'mla_admin_action',
690
+ 'mla_custom_field_item',
691
+ 'mla_item_ID',
692
+ '_wpnonce',
693
+ '_wp_http_referer',
694
+ 'action',
695
+ 'action2',
696
+ 'cb_mla_item_ID',
697
+ 'mla-edit-custom-field-cancel',
698
+ 'mla-edit-custom-field-submit',
699
+ 'mla-custom-field-options-save',
700
+ ), $_SERVER['REQUEST_URI'] ); // phpcs:ignore
701
+ }
702
 
703
  // Create an instance of our package class
704
  $MLACustomFieldsListTable = new MLA_Custom_Fields_List_Table();
729
 
730
  if ( is_array( $value ) ) {
731
  foreach ( $value as $element_key => $element_value )
732
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( urldecode( $element_value ) ) ) . "\n";
733
  } else {
734
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( urldecode( $value ) ) ) . "\n";
735
  }
736
  }
737
 
773
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
774
  // '_wp_http_referer' => wp_referer_field( false ),
775
  'Search Rules Text' => __( 'Search Rules Text', 'media-library-assistant' ),
776
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
777
  'Search Rules' => __( 'Search Rules', 'media-library-assistant' ),
778
  'options_list' => $options_list,
779
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
859
  */
860
  public static function mla_inline_mapping_custom_action() {
861
  MLACore::mla_debug_add( 'MLASettings_CustomFields::mla_inline_mapping_custom_action $_REQUEST = ' . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
862
+ if ( isset( $_REQUEST['screen'] ) ) {
863
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
864
+ }
865
+
866
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
867
 
868
  // Find the current chunk
869
+ $offset = isset( $_REQUEST['offset'] ) ? absint( $_REQUEST['offset'] ) : 0;
870
+ $length = isset( $_REQUEST['length'] ) ? absint( $_REQUEST['length'] ) : 0;
871
 
872
  $page_content = array(
873
  'message' => 'ERROR: No action taken',
877
  'success' => 0
878
  );
879
 
880
+ if ( ! empty( $_REQUEST['bulk_action'] ) ) {
881
+ $bulk_action = sanitize_text_field( wp_unslash( $_REQUEST['bulk_action'] ) );
882
+
883
+ // Look for "Execute All Rules", Bulk Action Execute, then the "Execute" rollover action
884
+ if ( 'custom-field-options-map' === $bulk_action ) {
885
+ $page_content = self::_process_custom_field_mapping( NULL, $offset, $length );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
886
  }
887
+ elseif ( 'mapping-options-bulk-execute' == $bulk_action ) {
888
+ $post_ids = !empty( $_REQUEST['ids'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['ids'] ) ) : array();
889
+ $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $post_ids );
890
+
 
 
 
891
  $rules = array();
892
  foreach ( $source_rules as $rule_name => $rule ) {
893
  if ( 'none' === $rule['data_source'] ) {
894
  continue;
895
  }
896
+
897
+ $rule['active'] = true; // Always execute for bulk actions
898
  $rules[ $rule_name ] = $rule;
899
  }
900
+
901
  if ( empty( $rules ) ) {
902
  $page_content['message'] = __( 'Nothing to execute', 'media-library-assistant' );
903
  } else {
904
  $page_content = self::_process_custom_field_mapping( $rules, $offset, $length );
905
  }
906
  }
907
+ elseif ( 0 === strpos( $bulk_action, MLACore::MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP ) ) {
908
+ $match_count = preg_match( '/\[(.*)\]/', $bulk_action, $matches );
909
+ if ( $match_count ) {
910
+ $post_id = absint( $matches[1] );
911
+ $source_rules = MLA_Custom_Field_Query::mla_convert_custom_field_rules( $post_id );
912
+
913
+ $rules = array();
914
+ foreach ( $source_rules as $rule_name => $rule ) {
915
+ if ( 'none' === $rule['data_source'] ) {
916
+ continue;
917
+ }
918
+
919
+ $rule['active'] = true; // Always execute for rollover action
920
+ $rules[ $rule_name ] = $rule;
921
+ }
922
+
923
+ if ( empty( $rules ) ) {
924
+ $page_content['message'] = __( 'Nothing to execute', 'media-library-assistant' );
925
+ } else {
926
+ $page_content = self::_process_custom_field_mapping( $rules, $offset, $length );
927
+ }
928
+ }
929
+ }
930
+ } // ! empty( $_REQUEST['bulk_action'] )
931
 
932
  $chunk_results = array(
933
  'message' => $page_content['message'],
951
  * @return void echo HTML <tr> markup for updated row or error message, then die()
952
  */
953
  public static function mla_inline_edit_custom_action() {
954
+ if ( isset( $_REQUEST['screen'] ) ) {
955
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
956
+ }
957
+
958
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
959
 
960
  $error_message = '';
961
+ if ( !empty( $_REQUEST['post_ID'] ) ) {
962
+ $rule = MLA_Custom_Field_Query::mla_find_custom_field_rule( absint( $_REQUEST['post_ID'] ) );
 
 
963
  if ( false === $rule ) {
964
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule not found', 'media-library-assistant' );
965
  }
966
+ } else {
967
+ $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule ID not found', 'media-library-assistant' );
968
  }
969
+
970
  if ( !empty( $error_message ) ) {
971
+ echo esc_html( $error_message );
972
  die();
973
  }
974
 
975
+ $rule['data_source'] = sanitize_text_field( isset( $_REQUEST['data_source'] ) ? wp_unslash( $_REQUEST['data_source'] ) : 'none' );
976
+ $rule['meta_name'] = wp_kses( isset( $_REQUEST['meta_name'] ) ? wp_unslash( $_REQUEST['meta_name'] ) : '', 'post' );
977
+ $rule['format'] = sanitize_text_field( isset( $_REQUEST['format'] ) ? wp_unslash( $_REQUEST['format'] ) : 'native' );
978
+ $rule['option'] = sanitize_text_field( isset( $_REQUEST['option'] ) ? wp_unslash( $_REQUEST['option'] ) : 'text' );
979
+ $rule['keep_existing'] = isset( $_REQUEST['keep_existing'] ) && '1' === $_REQUEST['keep_existing'];
980
  $rule['no_null'] = isset( $_REQUEST['no_null'] ) && '1' === $_REQUEST['no_null'];
981
  $rule['mla_column'] = isset( $_REQUEST['mla_column'] ) && '1' === $_REQUEST['mla_column'];
982
  $rule['quick_edit'] = isset( $_REQUEST['quick_edit'] ) && '1' === $_REQUEST['quick_edit'];
983
  $rule['bulk_edit'] = isset( $_REQUEST['bulk_edit'] ) && '1' === $_REQUEST['bulk_edit'];
984
+ $rule['active'] = isset( $_REQUEST['active'] ) && '1' === $_REQUEST['active'];
985
  $rule['changed'] = true;
986
  $rule['deleted'] = false;
987
  $rule = stripslashes_deep( $rule );
988
 
989
  if ( false === MLA_Custom_Field_Query::mla_replace_custom_field_rule( $rule ) ) {
990
+ echo esc_html( __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' ) );
991
  die();
992
  }
993
 
1000
  } // mla_inline_edit_custom_action
1001
  } // class MLASettings_CustomFields
1002
 
1003
+ // The WP_List_Table class isn't automatically available to plugins
 
 
1004
  if ( !class_exists( 'WP_List_Table' ) ) {
1005
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
1006
  }
1154
  $has_filters = $include_filters;
1155
 
1156
  // View arguments - see also mla_tabulate_custom_field_items
1157
+ $field = sanitize_text_field( isset( $_REQUEST['mla_custom_field_view'] ) ? wp_unslash( $_REQUEST['mla_custom_field_view'] ) : 'all' );
1158
+ if ( in_array( $field, array( 'all', 'mla_column', 'quick_edit', 'bulk_edit', 'read_only' ) ) ) {
1159
+ $submenu_arguments['mla_custom_field_view'] = $field;
 
1160
  }
1161
 
1162
  // Search box arguments
1163
  if ( !empty( $_REQUEST['s'] ) ) {
1164
+ $submenu_arguments['s'] = urlencode( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
1165
  }
1166
 
1167
  // Filter arguments (from table header)
1168
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['mla_custom_field_status'] ) ? wp_unslash( $_REQUEST['mla_custom_field_status'] ) : 'any' ) );
1169
+ if ( 'any' !== $field ) {
1170
+ if ( in_array( $field, array( 'active', 'inactive' ) ) ) {
1171
+ $submenu_arguments['mla_custom_field_status'] = $field;
1172
  }
1173
  }
1174
 
1175
  // Sort arguments (from column header)
1176
  if ( isset( $_REQUEST['order'] ) ) {
1177
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
1178
+ $submenu_arguments['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
1179
  }
1180
 
1181
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
1182
+ if ( array_key_exists( $field, self::$default_sortable_columns ) ) {
1183
+ $submenu_arguments['orderby'] = $field;
 
1184
  }
1185
 
1186
  return $submenu_arguments;
1369
  }
1370
 
1371
  if ( isset( $_REQUEST['order'] ) ) {
1372
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
1373
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
1374
  }
1375
 
1376
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
1377
+ if ( array_key_exists( $field, self::$default_sortable_columns ) ) {
1378
+ $view_args['orderby'] = urlencode( $field );
 
1379
  }
1380
 
1381
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
1587
  * @param string 'top' | 'bottom'
1588
  */
1589
  function pagination( $which ) {
1590
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1591
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Custom_Fields_List_Table::mla_submenu_arguments(), $save_uri );
1592
  parent::pagination( $which );
1593
  $_SERVER['REQUEST_URI'] = $save_uri;
1651
 
1652
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1653
 
1654
+ // Calculate the common values once per page load
 
 
1655
  if ( is_null( $base_url ) ) {
1656
+ // Remember the view filters
 
 
1657
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-custom_field&mla_tab=custom_field';
1658
 
1659
  if ( isset( $_REQUEST['s'] ) ) {
1660
+ $base_url = add_query_arg( array( 's' => wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ), $base_url );
1661
  }
1662
  }
1663
 
1678
  */
1679
  function get_views( ) {
1680
  // Find current view
1681
+ $current_view = isset( $_REQUEST['mla_custom_field_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field_view'] ) ) : 'all';
1682
 
1683
  // Generate the list of views, retaining keyword search criterion
1684
+ $s = wp_kses( isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '', 'post' );
1685
  $custom_field_items = MLA_Custom_Field_Query::mla_tabulate_custom_field_items( $s );
1686
  $view_links = array();
1687
  foreach ( $custom_field_items as $slug => $item )
1758
  * @return void
1759
  */
1760
  function extra_tablenav( $which ) {
1761
+ // Decide which actions to show
 
 
1762
  if ( 'top' == $which ) {
1763
  $actions = array( 'mla_custom_field_status', 'mla_filter' );
1764
  } else {
1774
  foreach ( $actions as $action ) {
1775
  switch ( $action ) {
1776
  case 'mla_custom_field_status':
1777
+ echo self::mla_get_custom_field_status_dropdown( isset( $_REQUEST['mla_custom_field_status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_custom_field_status'] ) ) : 'any' ); // phpcs:ignore
1778
  break;
1779
  case 'mla_filter':
1780
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
1806
  $this->get_sortable_columns()
1807
  );
1808
 
1809
+ // REQUIRED for pagination.
 
 
1810
  $total_items = MLA_Custom_Field_Query::mla_count_custom_field_rules( $_REQUEST );
1811
  $user = get_current_user_id();
1812
  $screen = get_current_screen();
1821
  $per_page = $screen->get_option( 'per_page', 'default' );
1822
  }
1823
 
1824
+ // REQUIRED. We also have to register our pagination options & calculations.
 
 
1825
  $this->set_pagination_args( array(
1826
  'total_items' => $total_items,
1827
  'per_page' => $per_page,
1850
  static $row_class = '';
1851
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1852
 
1853
+ echo '<tr id="custom_field-' . $item->post_ID . '"' . $row_class . '>'; // phpcs:ignore
1854
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1855
  echo '</tr>';
1856
  }
1857
  } // class MLA_Custom_Fields_List_Table
1941
  return true;
1942
  }
1943
 
1944
+ // One row for each existing rule, case insensitive "natural order"
 
 
1945
  $sorted_keys = array();
1946
  foreach ( $current_values as $rule_name => $current_value ) {
1947
  $sorted_keys[ $current_value['name'] ] = $current_value['name'];
1953
  $sorted_names[ $rule_name ] = array();
1954
  }
1955
 
1956
+ // Allow for multiple rules mapping the same name (an old bug)
 
 
1957
  foreach ( $current_values as $rule_name => $current_value ) {
1958
  $sorted_names[ $current_value['name'] ][] = $rule_name;
1959
  }
2086
  $clean_request[ $key ] = 'ASC';
2087
  }
2088
  break;
2089
+ // ['s'] - Search items by one or more keywords
 
 
2090
  case 's':
2091
  $clean_request[ $key ] = stripslashes( trim( $value ) );
2092
  break;
2095
  } // switch $key
2096
  } // foreach $raw_request
2097
 
2098
+ // Ignore incoming paged value; use offset and count instead
 
 
2099
  if ( ( (int) $count ) > 0 ) {
2100
  $clean_request['offset'] = $offset;
2101
  $clean_request['posts_per_page'] = $count;
2118
  return array ();
2119
  }
2120
 
2121
+ // Sort and filter the list
 
 
2122
  $keywords = isset( $request['s'] ) ? $request['s'] : '';
2123
  preg_match_all('/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keywords, $matches);
2124
  $keywords = array_map( 'MLAQuery::mla_search_terms_tidy', $matches[0]);
2220
  $sorted_items = array_reverse( $sorted_items, true );
2221
  }
2222
 
2223
+ // Paginate the sorted list
 
 
2224
  $results = array();
2225
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
2226
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
2227
  foreach ( $sorted_items as $value ) {
2228
  if ( $offset ) {
2229
  $offset--;
includes/class-mla-settings-documentation-tab.php CHANGED
@@ -59,6 +59,43 @@ class MLASettings_Documentation {
59
  self::JAVASCRIPT_DOCUMENTATION_TAB_OBJECT, $script_variables );
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  /**
63
  * Display (read-only) an Example Plugin
64
  *
@@ -83,37 +120,11 @@ class MLASettings_Documentation {
83
  return $page_content;
84
  }
85
 
86
- // Compose view arguments
87
- $view_args = array(
88
  'page' => MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation',
89
  'mla_tab' => 'documentation',
90
  'mla-example-search' => 'Search'
91
- );
92
-
93
- if ( isset( $_REQUEST['s'] ) ) {
94
- $view_args['s'] = urlencode( stripslashes( $_REQUEST['s'] ) );
95
- }
96
-
97
- // See also _build_rollover_actions, _tabulate_example_items
98
- if ( isset( $_REQUEST['mla_example_view'] ) ) {
99
- if ( in_array( $_REQUEST['mla_example_view'], array( 'all', 'installed', 'active', 'inactive', 'network', 'uninstalled' ) ) ) {
100
- $view_args['mla_example_view'] = urlencode( $_REQUEST['mla_example_view'] );
101
- }
102
- }
103
-
104
- if ( isset( $_REQUEST['orderby'] ) ) {
105
- if ( array_key_exists( $_REQUEST['orderby'], MLA_Example_List_Table::$default_sortable_columns ) ) {
106
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
107
- }
108
- }
109
-
110
- if ( isset( $_REQUEST['order'] ) ) {
111
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
112
- }
113
-
114
- if ( isset( $_REQUEST['paged'] ) && absint( $_REQUEST['paged'] ) ) {
115
- $view_args['paged'] = absint( $_REQUEST['paged'] );
116
- }
117
 
118
  $form_url = add_query_arg( $view_args, admin_url( 'options-general.php' ) );
119
 
@@ -130,7 +141,7 @@ class MLASettings_Documentation {
130
  /* translators: 1: ERROR tag 2: file type 3: file name 4: error message*/
131
  $page_content['message'] = sprintf( __( '%1$s: Reading the %2$s file ( %3$s ) "%4$s".', 'media-library-assistant' ), __( 'ERROR', 'media-library-assistant' ), __( 'plugin', 'media-library-assistant' ), $plugin->file, $php_errormsg );
132
  $file_contents = '';
133
- }
134
 
135
  // Compose tab content
136
  $page_template_array = MLACore::mla_load_template( 'admin-display-settings-example-tab.tpl' );
@@ -169,7 +180,7 @@ class MLASettings_Documentation {
169
  'action2',
170
  'cb_attachment',
171
  'mla-example-search'
172
- ), $_SERVER['REQUEST_URI'] ) );
173
 
174
  // Create an instance of our package class
175
  $MLAListExampleTable = new MLA_Example_List_Table();
@@ -183,7 +194,7 @@ class MLASettings_Documentation {
183
  );
184
 
185
  $page_values = array(
186
- 'results' => ! empty( $_REQUEST['s'] ) ? ' - ' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . '"' : '',
187
  'In this tab' => __( 'In this tab you can browse the list of MLA example plugins, install or update them in the Plugins/Installed Plugins area and see which examples you have already installed. <strong>To activate, deactivate or delete</strong> the plugins you must go to the Plugins/Installed Plugins admin submenu.' ),
188
  /* translators: 1: Documentation hyperlink */
189
  'You can find' => sprintf( __( 'You can find more information about using the example plugins in the %1$s section of the Documentation or by clicking the <strong>"Help"</strong> tab in the upper-right corner of this screen.', 'media-library-assistant' ), '<a href="[+settingsURL+]?page=mla-settings-menu-documentation&amp;mla_tab=documentation#mla_example_plugins" title="' . __( 'Example plugin documentation', 'media-library-assistant' ) . '">' . __( 'The Example Plugins', 'media-library-assistant' ) . '</a>' ),
@@ -193,7 +204,7 @@ class MLASettings_Documentation {
193
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
194
  'Example Plugins' => __( 'Example Plugins', 'media-library-assistant' ),
195
  'Search Example Plugins' => __( 'Search Example Plugins', 'media-library-assistant' ),
196
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
197
  'Search Plugins' => __( 'Search Plugins', 'media-library-assistant' ),
198
  'Search help' => __( 'Searches Name, Description, File Name and Tags', 'media-library-assistant' ),
199
  'Cancel' => __( 'Cancel', 'media-library-assistant' ),
@@ -252,7 +263,8 @@ class MLASettings_Documentation {
252
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
253
  $bulk_message = '';
254
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
255
- foreach ( $_REQUEST['cb_mla_item_ID'] as $ID ) {
 
256
  switch ( $bulk_action ) {
257
  case 'install':
258
  $item_content = MLA_Example_List_Table::mla_install_example_plugin( $ID );
@@ -281,21 +293,23 @@ class MLASettings_Documentation {
281
 
282
  // Process row-level actions that affect a single item
283
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
 
284
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
285
  $action_content = array( 'message' => '' );
286
  if ( empty( $_REQUEST['mla_item_ID'] ) ) {
287
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
288
- $action_content['message'] = sprintf( __( 'Empty mla_item_ID - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] );
289
  } else {
290
- switch ( $_REQUEST['mla_admin_action'] ) {
 
291
  case MLACore::MLA_ADMIN_SINGLE_EDIT_INSTALL:
292
- $action_content = MLA_Example_List_Table::mla_install_example_plugin( $_REQUEST['mla_item_ID'] );
293
  break;
294
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
295
- $action_content = MLA_Example_List_Table::mla_update_example_plugin( $_REQUEST['mla_item_ID'] );
296
  break;
297
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
298
- $action_content = MLASettings_Documentation::_display_example_plugin( $_REQUEST['mla_item_ID'] );
299
  if ( !empty( $action_content['body'] ) ) {
300
  return $action_content;
301
  }
@@ -304,7 +318,7 @@ class MLASettings_Documentation {
304
  break;
305
  default:
306
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
307
- $action_content = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] );
308
  break;
309
  } // switch ($_REQUEST['mla_admin_action'])
310
  }
@@ -564,7 +578,6 @@ class MLA_Example_List_Table extends WP_List_Table {
564
  * @return void
565
  */
566
  public static function mla_admin_init( ) {
567
- //error_log( __LINE__ . ' MLA_Example_List_Table::mla_admin_init request = ' . var_export( $_REQUEST, true ), 0 );
568
  if ( isset( $_REQUEST['mla-example-cancel'] ) ) {
569
  unset( $_REQUEST['mla-example-display'] );
570
  }
@@ -634,41 +647,13 @@ class MLA_Example_List_Table extends WP_List_Table {
634
  */
635
  private function _build_rollover_actions( $item, $column ) {
636
  $actions = array();
637
- //error_log( __LINE__ . " MLASettings_Documentation::_build_rollover_actions( {$column} ) _REQUEST = " . var_export( $_REQUEST, true ), 0 );
638
 
639
- // Compose view arguments
640
- $view_args = array(
641
  'page' => MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation',
642
  'mla_tab' => 'documentation',
643
  'mla-example-display' => 'true',
644
  'mla_item_ID' => urlencode( $item->post_ID )
645
- );
646
-
647
- if ( isset( $_REQUEST['s'] ) ) {
648
- $view_args['s'] = urlencode( $_REQUEST['s'] );
649
- }
650
-
651
- // See also _display_example_plugin, _tabulate_example_items
652
- if ( isset( $_REQUEST['mla_example_view'] ) ) {
653
- if ( in_array( $_REQUEST['mla_example_view'], array( 'all', 'installed', 'active', 'inactive', 'network', 'uninstalled' ) ) ) {
654
- $view_args['mla_example_view'] = urlencode( $_REQUEST['mla_example_view'] );
655
- }
656
- }
657
-
658
- if ( isset( $_REQUEST['orderby'] ) ) {
659
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
660
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
661
- }
662
- }
663
-
664
- if ( isset( $_REQUEST['order'] ) ) {
665
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
666
- }
667
-
668
- if ( isset( $_REQUEST['paged'] ) && absint( $_REQUEST['paged'] ) ) {
669
- $view_args['paged'] = absint( $_REQUEST['paged'] );
670
- }
671
- //error_log( __LINE__ . " MLASettings_Documentation::_build_rollover_actions( {$column} ) view_args = " . var_export( $view_args, true ), 0 );
672
 
673
  if ( empty( $item->installed_version ) ) {
674
  if ( current_user_can( 'install_plugins' ) ) {
@@ -825,17 +810,13 @@ class MLA_Example_List_Table extends WP_List_Table {
825
 
826
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
827
 
828
- /*
829
- * Calculate the common values once per page load
830
- */
831
  if ( is_null( $base_url ) ) {
832
- /*
833
- * Remember the view filters
834
- */
835
  $base_url = MLACore::mla_nonce_url( 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation&mla_tab=documentation&mla-example-search=Search', MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
836
 
837
  if ( isset( $_REQUEST['s'] ) ) {
838
- $base_url = add_query_arg( array( 's' => $_REQUEST['s'] ), $base_url );
839
  }
840
  }
841
 
@@ -855,15 +836,11 @@ class MLA_Example_List_Table extends WP_List_Table {
855
  * @return array View information,e.g., array ( id => link )
856
  */
857
  function get_views( ) {
858
- /*
859
- * Find current view
860
- */
861
- $current_view = isset( $_REQUEST['mla_example_view'] ) ? $_REQUEST['mla_example_view'] : 'all';
862
 
863
- /*
864
- * Generate the list of views, retaining keyword search criterion
865
- */
866
- $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
867
  $example_items = self::_tabulate_example_items( $s );
868
  $view_links = array();
869
  foreach ( $example_items as $slug => $item )
@@ -950,8 +927,8 @@ class MLA_Example_List_Table extends WP_List_Table {
950
  static $row_class = '';
951
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
952
 
953
- echo '<tr id="example-' . $item->post_ID . '"' . $row_class . '>';
954
- echo parent::single_row_columns( $item );
955
  echo '</tr>';
956
  }
957
 
@@ -1445,12 +1422,10 @@ class MLA_Example_List_Table extends WP_List_Table {
1445
  $sorted_types = array_reverse( $sorted_types, true );
1446
  }
1447
 
1448
- /*
1449
- * Paginate the sorted list
1450
- */
1451
  $results = array();
1452
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
1453
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
1454
  foreach ( $sorted_types as $value ) {
1455
  if ( $offset ) {
1456
  $offset--;
@@ -1565,7 +1540,6 @@ class MLA_Example_List_Table extends WP_List_Table {
1565
 
1566
  $items = self::_query_example_items( $request, 0, 0 );
1567
 
1568
- // See also _display_example_plugin, _build_rollover_actions
1569
  $example_items = array(
1570
  'all' => array(
1571
  'singular' => _x( 'All', 'table_view_singular', 'media_library-assistant' ),
59
  self::JAVASCRIPT_DOCUMENTATION_TAB_OBJECT, $script_variables );
60
  }
61
 
62
+ /**
63
+ * Compose view arguments from $_REQUEST elements
64
+ *
65
+ * @since 2.90
66
+ *
67
+ * @param array $view_args Initial array values
68
+ *
69
+ * @return array Initial values plus view arguments
70
+ */
71
+ public static function mla_compose_view_arguments( $view_args ) {
72
+ $field = isset( $_REQUEST['mla_example_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_example_view'] ) ) : 'all';
73
+ if ( in_array( $field, array( 'all', 'installed', 'active', 'inactive', 'network', 'uninstalled' ) ) ) {
74
+ $view_args['mla_example_view'] = $field;
75
+ }
76
+
77
+ // Search box arguments
78
+ if ( !empty( $_REQUEST['s'] ) ) {
79
+ $view_args['s'] = urlencode( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
80
+ }
81
+
82
+ if ( isset( $_REQUEST['order'] ) ) {
83
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
84
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
85
+ }
86
+
87
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
88
+ if ( array_key_exists( $field, MLA_Example_List_Table::$default_sortable_columns ) ) {
89
+ $view_args['orderby'] = $field;
90
+ }
91
+
92
+ if ( isset( $_REQUEST['paged'] ) && absint( $_REQUEST['paged'] ) ) {
93
+ $view_args['paged'] = absint( $_REQUEST['paged'] );
94
+ }
95
+
96
+ return $view_args;
97
+ }
98
+
99
  /**
100
  * Display (read-only) an Example Plugin
101
  *
120
  return $page_content;
121
  }
122
 
123
+ $view_args = MLASettings_Documentation::mla_compose_view_arguments( array(
 
124
  'page' => MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation',
125
  'mla_tab' => 'documentation',
126
  'mla-example-search' => 'Search'
127
+ ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  $form_url = add_query_arg( $view_args, admin_url( 'options-general.php' ) );
130
 
141
  /* translators: 1: ERROR tag 2: file type 3: file name 4: error message*/
142
  $page_content['message'] = sprintf( __( '%1$s: Reading the %2$s file ( %3$s ) "%4$s".', 'media-library-assistant' ), __( 'ERROR', 'media-library-assistant' ), __( 'plugin', 'media-library-assistant' ), $plugin->file, $php_errormsg );
143
  $file_contents = '';
144
+ } // file error
145
 
146
  // Compose tab content
147
  $page_template_array = MLACore::mla_load_template( 'admin-display-settings-example-tab.tpl' );
180
  'action2',
181
  'cb_attachment',
182
  'mla-example-search'
183
+ ), $_SERVER['REQUEST_URI'] ) ); // phpcs:ignore
184
 
185
  // Create an instance of our package class
186
  $MLAListExampleTable = new MLA_Example_List_Table();
194
  );
195
 
196
  $page_values = array(
197
+ 'results' => ! empty( $_REQUEST['s'] ) ? ' - ' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) . '"' : '',
198
  'In this tab' => __( 'In this tab you can browse the list of MLA example plugins, install or update them in the Plugins/Installed Plugins area and see which examples you have already installed. <strong>To activate, deactivate or delete</strong> the plugins you must go to the Plugins/Installed Plugins admin submenu.' ),
199
  /* translators: 1: Documentation hyperlink */
200
  'You can find' => sprintf( __( 'You can find more information about using the example plugins in the %1$s section of the Documentation or by clicking the <strong>"Help"</strong> tab in the upper-right corner of this screen.', 'media-library-assistant' ), '<a href="[+settingsURL+]?page=mla-settings-menu-documentation&amp;mla_tab=documentation#mla_example_plugins" title="' . __( 'Example plugin documentation', 'media-library-assistant' ) . '">' . __( 'The Example Plugins', 'media-library-assistant' ) . '</a>' ),
204
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
205
  'Example Plugins' => __( 'Example Plugins', 'media-library-assistant' ),
206
  'Search Example Plugins' => __( 'Search Example Plugins', 'media-library-assistant' ),
207
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
208
  'Search Plugins' => __( 'Search Plugins', 'media-library-assistant' ),
209
  'Search help' => __( 'Searches Name, Description, File Name and Tags', 'media-library-assistant' ),
210
  'Cancel' => __( 'Cancel', 'media-library-assistant' ),
263
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
264
  $bulk_message = '';
265
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
266
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
267
+ foreach ( $post_ids as $post_ID ) {
268
  switch ( $bulk_action ) {
269
  case 'install':
270
  $item_content = MLA_Example_List_Table::mla_install_example_plugin( $ID );
293
 
294
  // Process row-level actions that affect a single item
295
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
296
+ $mla_admin_action = sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) );
297
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
298
  $action_content = array( 'message' => '' );
299
  if ( empty( $_REQUEST['mla_item_ID'] ) ) {
300
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
301
+ $action_content['message'] = sprintf( __( 'Empty mla_item_ID - "%1$s"', 'media-library-assistant' ), $mla_admin_action );
302
  } else {
303
+ $mla_item_ID = absint( $_REQUEST['mla_item_ID'] );
304
+ switch ( $mla_admin_action ) {
305
  case MLACore::MLA_ADMIN_SINGLE_EDIT_INSTALL:
306
+ $action_content = MLA_Example_List_Table::mla_install_example_plugin( $mla_item_ID );
307
  break;
308
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
309
+ $action_content = MLA_Example_List_Table::mla_update_example_plugin( $mla_item_ID );
310
  break;
311
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
312
+ $action_content = MLASettings_Documentation::_display_example_plugin( $mla_item_ID );
313
  if ( !empty( $action_content['body'] ) ) {
314
  return $action_content;
315
  }
318
  break;
319
  default:
320
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
321
+ $action_content = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $mla_admin_action );
322
  break;
323
  } // switch ($_REQUEST['mla_admin_action'])
324
  }
578
  * @return void
579
  */
580
  public static function mla_admin_init( ) {
 
581
  if ( isset( $_REQUEST['mla-example-cancel'] ) ) {
582
  unset( $_REQUEST['mla-example-display'] );
583
  }
647
  */
648
  private function _build_rollover_actions( $item, $column ) {
649
  $actions = array();
 
650
 
651
+ $view_args = MLASettings_Documentation::mla_compose_view_arguments( array(
 
652
  'page' => MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation',
653
  'mla_tab' => 'documentation',
654
  'mla-example-display' => 'true',
655
  'mla_item_ID' => urlencode( $item->post_ID )
656
+ ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
 
658
  if ( empty( $item->installed_version ) ) {
659
  if ( current_user_can( 'install_plugins' ) ) {
810
 
811
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
812
 
813
+ // Calculate the common values once per page load
 
 
814
  if ( is_null( $base_url ) ) {
815
+ // Remember the view filters
 
 
816
  $base_url = MLACore::mla_nonce_url( 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-documentation&mla_tab=documentation&mla-example-search=Search', MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
817
 
818
  if ( isset( $_REQUEST['s'] ) ) {
819
+ $base_url = add_query_arg( array( 's' => wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ), $base_url );
820
  }
821
  }
822
 
836
  * @return array View information,e.g., array ( id => link )
837
  */
838
  function get_views( ) {
839
+ // Find current view
840
+ $current_view = isset( $_REQUEST['mla_example_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_example_view'] ) ) : 'all';
 
 
841
 
842
+ // Generate the list of views, retaining keyword search criterion
843
+ $s = isset( $_REQUEST['s'] ) ? wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) : '';
 
 
844
  $example_items = self::_tabulate_example_items( $s );
845
  $view_links = array();
846
  foreach ( $example_items as $slug => $item )
927
  static $row_class = '';
928
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
929
 
930
+ echo '<tr id="example-' . absint( $item->post_ID ) . '"' . esc_html( $row_class ) . '>';
931
+ echo parent::single_row_columns( $item ); // phpcs:ignore
932
  echo '</tr>';
933
  }
934
 
1422
  $sorted_types = array_reverse( $sorted_types, true );
1423
  }
1424
 
1425
+ // Paginate the sorted list
 
 
1426
  $results = array();
1427
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
1428
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
1429
  foreach ( $sorted_types as $value ) {
1430
  if ( $offset ) {
1431
  $offset--;
1540
 
1541
  $items = self::_query_example_items( $request, 0, 0 );
1542
 
 
1543
  $example_items = array(
1544
  'all' => array(
1545
  'singular' => _x( 'All', 'table_view_singular', 'media_library-assistant' ),
includes/class-mla-settings-iptc-exif-tab.php CHANGED
@@ -226,49 +226,53 @@ class MLASettings_IPTCEXIF {
226
  * @return string Message(s) reflecting the results of the operation
227
  */
228
  private static function _add_iptc_exif_rule() {
229
- $mla_iptc_exif_rule = isset( $_REQUEST['mla_iptc_exif_rule'] ) ? stripslashes_deep( $_REQUEST['mla_iptc_exif_rule'] ) : array();
230
-
231
- // Validate new rule name
232
- if ( !empty( $mla_iptc_exif_rule['new_field'] ) ) {
233
- $new_name = $mla_iptc_exif_rule['new_field'];
234
- } elseif ( !empty( $mla_iptc_exif_rule['new_name'] ) && ( 'none' !== $mla_iptc_exif_rule['new_name'] ) ) {
235
- $new_name = $mla_iptc_exif_rule['new_name'];
236
- } else {
237
- return __( 'ERROR', 'media-library-assistant' ) . __( ': No custom field name selected/entered', 'media-library-assistant' );
238
- }
239
-
240
- if ( MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule_ID( $new_name ) ) {
241
- return __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
242
- }
243
-
244
- // Convert checkbox/dropdown controls to booleans
245
- $mla_iptc_exif_rule['iptc_first'] = '1' === $mla_iptc_exif_rule['iptc_first'];
246
- $mla_iptc_exif_rule['keep_existing'] = '1' === $mla_iptc_exif_rule['keep_existing'];
247
- $mla_iptc_exif_rule['no_null'] = isset( $mla_iptc_exif_rule['no_null'] );
248
- $mla_iptc_exif_rule['active'] = '1' === $mla_iptc_exif_rule['status'];
249
-
250
  $new_rule = array(
251
  'post_ID' => 0,
252
  'type' => 'custom',
253
- 'key' => $new_name,
254
- 'rule_name' => $new_name,
255
- 'name' => $new_name,
256
  'hierarchical' => false,
257
- 'iptc_value' => $mla_iptc_exif_rule['iptc_value'],
258
- 'exif_value' => $mla_iptc_exif_rule['exif_value'],
259
- 'iptc_first' => $mla_iptc_exif_rule['iptc_first'],
260
- 'keep_existing' => $mla_iptc_exif_rule['keep_existing'],
261
- 'format' => $mla_iptc_exif_rule['format'],
262
- 'option' => $mla_iptc_exif_rule['option'],
263
- 'no_null' => $mla_iptc_exif_rule['no_null'],
264
  'delimiters' => '',
265
  'parent' => 0,
266
- 'active' => $mla_iptc_exif_rule['active'],
267
  'read_only' => false,
268
  'changed' => true,
269
  'deleted' => false,
270
  );
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  if ( MLA_IPTC_EXIF_Query::mla_add_iptc_exif_rule( $new_rule ) ) {
273
  return __( 'Rule added', 'media-library-assistant' );
274
  }
@@ -288,13 +292,33 @@ class MLASettings_IPTCEXIF {
288
  */
289
  private static function _update_iptc_exif_rule( $post_id, &$template ) {
290
  $error_message = '';
291
- $mla_iptc_exif_rule = isset( $_REQUEST['mla_iptc_exif_rule'] ) ? stripslashes_deep( $_REQUEST['mla_iptc_exif_rule'] ) : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
  // Validate rule name change
294
- if ( !empty( $mla_iptc_exif_rule['new_field'] ) ) {
295
- $new_name = $mla_iptc_exif_rule['new_field'];
296
- } elseif ( !empty( $mla_iptc_exif_rule['new_name'] ) && ( 'none' !== $mla_iptc_exif_rule['new_name'] ) ) {
297
- $new_name = $mla_iptc_exif_rule['new_name'];
298
  } else {
299
  $new_name = '';
300
  }
@@ -304,39 +328,33 @@ class MLASettings_IPTCEXIF {
304
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
305
  $new_name = '';
306
  }
307
- } elseif ( $mla_iptc_exif_rule['name'] !== $mla_iptc_exif_rule['rule_name'] ) {
308
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Invalid rule name must be changed', 'media-library-assistant' );
309
  }
310
 
311
- // Convert checkbox/dropdown controls to booleans
312
- $mla_iptc_exif_rule['hierarchical'] = '1' === $mla_iptc_exif_rule['hierarchical'];
313
- $mla_iptc_exif_rule['iptc_first'] = '1' === $mla_iptc_exif_rule['iptc_first'];
314
- $mla_iptc_exif_rule['keep_existing'] = '1' === $mla_iptc_exif_rule['keep_existing'];
315
- $mla_iptc_exif_rule['no_null'] = isset( $mla_iptc_exif_rule['no_null'] );
316
- $mla_iptc_exif_rule['active'] = '1' === $mla_iptc_exif_rule['status'];
317
-
318
- $new_rule = array(
319
- 'post_ID' => $mla_iptc_exif_rule['post_ID'],
320
- 'type' => $mla_iptc_exif_rule['type'],
321
- 'key' => $new_name ? $new_name : $mla_iptc_exif_rule['key'],
322
- 'rule_name' => $new_name ? $new_name : $mla_iptc_exif_rule['rule_name'],
323
- 'name' => $new_name ? $new_name : $mla_iptc_exif_rule['name'],
324
- 'hierarchical' => $mla_iptc_exif_rule['hierarchical'],
325
- 'iptc_value' => $mla_iptc_exif_rule['iptc_value'],
326
- 'exif_value' => $mla_iptc_exif_rule['exif_value'],
327
- 'iptc_first' => $mla_iptc_exif_rule['iptc_first'],
328
- 'keep_existing' => $mla_iptc_exif_rule['keep_existing'],
329
- 'format' => $mla_iptc_exif_rule['format'],
330
- 'option' => $mla_iptc_exif_rule['tax_option'],
331
- 'no_null' => $mla_iptc_exif_rule['no_null'],
332
- 'delimiters' => $mla_iptc_exif_rule['delimiters'],
333
- 'parent' => !empty( $mla_iptc_exif_rule['parent'] ) && ( '0' !== $mla_iptc_exif_rule['parent'] ) ? absint( $mla_iptc_exif_rule['parent'] ) : 0,
334
- 'active' => $mla_iptc_exif_rule['active'],
335
- 'read_only' => false,
336
- 'changed' => true,
337
- 'deleted' => false,
338
- );
339
-
340
  if ( empty( $error_message ) ) {
341
  if ( false === MLA_IPTC_EXIF_Query::mla_replace_iptc_exif_rule( $new_rule ) ) {
342
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' );
@@ -387,36 +405,42 @@ class MLASettings_IPTCEXIF {
387
  }
388
 
389
  // Convert dropdown controls to field values
390
- if ( '-1' !== $_REQUEST['iptc_first'] ) {
391
- $rule['iptc_first'] = '1' === $_REQUEST['iptc_first'];
 
392
  }
393
 
394
- if ( '-1' !== $_REQUEST['keep_existing'] ) {
395
- $rule['keep_existing'] = '1' === $_REQUEST['keep_existing'];
 
396
  }
397
 
398
- if ( '-1' !== $_REQUEST['format'] ) {
399
- $rule['format'] = $_REQUEST['format'];
 
400
  }
401
 
402
- if ( '-1' !== $_REQUEST['option'] ) {
 
403
  // Only custom and taxonomy types use this value
404
  if ( 'custom' === $rule['type'] ) {
405
- $rule['option'] = $_REQUEST['option'];
406
  } elseif ( 'taxonomy' === $rule['type'] ) {
407
  // Taxonomy rules have limited options; array or text
408
- if ( ( 'array' === $rule['option'] ) || ( 'text' === $rule['option'] ) ) {
409
- $rule['option'] = $_REQUEST['option'];
410
  }
411
  }
412
  }
413
 
414
- if ( '-1' !== $_REQUEST['no_null'] ) {
415
- $rule['no_null'] = '1' === $_REQUEST['no_null'];
 
416
  }
417
 
418
- if ( '-1' !== $_REQUEST['active'] ) {
419
- $rule['active'] = '1' === $_REQUEST['active'];
 
420
  }
421
 
422
  $rule['changed'] = true;
@@ -508,7 +532,7 @@ class MLASettings_IPTCEXIF {
508
  'Array' => __( 'Array', 'media-library-assistant' ),
509
  'multi_option' => '', // Set below
510
  'Multi' => __( 'Multi', 'media-library-assistant' ),
511
- 'no_null_checked' => '', // Set below
512
  'Delete NULL' => __( 'Delete NULL values', 'media-library-assistant' ),
513
  'Check Delete NULL' => __( 'Do not store empty custom field values', 'media-library-assistant' ),
514
  // Common values
@@ -595,7 +619,7 @@ class MLASettings_IPTCEXIF {
595
  } // option
596
 
597
  if ( $item['no_null'] ) {
598
- $page_values['no_null_checked'] = 'checked="checked"';
599
  }
600
  break;
601
  default:
@@ -621,7 +645,12 @@ class MLASettings_IPTCEXIF {
621
  $message = '';
622
  $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $rule_ids );
623
  foreach ( $source_rules['custom'] as $rule_name => $rule ) {
624
- $result = MLASettings::mla_delete_custom_field( $rule );
 
 
 
 
 
625
  $message .= sprintf( __( 'Custom Field Rule "%1$s": %2$s', 'media-library-assistant' ), $rule['name'], $result );
626
  }
627
 
@@ -654,7 +683,8 @@ class MLASettings_IPTCEXIF {
654
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
655
  } elseif ( !empty( $_REQUEST['mla-edit-iptc-exif-submit'] ) ) {
656
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
657
- $page_content = MLASettings_IPTCEXIF::_update_iptc_exif_rule( $_REQUEST['mla_iptc_exif_rule']['post_ID'], $page_template_array );
 
658
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
659
  } elseif ( !empty( $_REQUEST['mla-edit-iptc-exif-cancel'] ) ) {
660
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
@@ -670,12 +700,13 @@ class MLASettings_IPTCEXIF {
670
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
671
  if ( array_key_exists( $bulk_action, MLA_IPTC_EXIF_List_Table::mla_get_bulk_actions() ) ) {
672
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
 
673
  if ( 'execute' === $bulk_action ) {
674
  $page_content['message'] = sprintf( __( 'Unknown bulk action %1$s', 'media-library-assistant' ), $bulk_action );
675
  } elseif ( 'purge' === $bulk_action ) {
676
- $page_content['message'] = MLASettings_IPTCEXIF::_purge_custom_field_values( $_REQUEST['cb_mla_item_ID'] );
677
  } else {
678
- foreach ( $_REQUEST['cb_mla_item_ID'] as $post_ID ) {
679
  switch ( $bulk_action ) {
680
  case 'edit':
681
  $item_content = MLASettings_IPTCEXIF::_bulk_update_iptc_exif_rule( $post_ID );
@@ -703,28 +734,27 @@ class MLASettings_IPTCEXIF {
703
  }
704
  } // $bulk_action
705
 
706
- /*
707
- * Process row-level actions that affect a single item
708
- */
709
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
710
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
711
 
712
  $page_content = array( 'message' => '', 'body' => '' );
713
 
 
714
  switch ( $_REQUEST['mla_admin_action'] ) {
715
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
716
- $item = MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule( $_REQUEST['mla_item_ID'] );
717
  $page_content = self::_compose_edit_iptc_exif_rule_tab( $item, $page_template_array );
718
  break;
719
  case MLACore::MLA_ADMIN_SINGLE_PURGE:
720
- $page_content['message'] = MLASettings_IPTCEXIF::_purge_custom_field_values( $_REQUEST['mla_item_ID'] );
721
  break;
722
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
723
- $page_content['message'] = MLASettings_IPTCEXIF::_delete_iptc_exif_rule( $_REQUEST['mla_item_ID'] );
724
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
725
  break;
726
  default:
727
- $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] );
728
  break;
729
  } // switch ($_REQUEST['mla_admin_action'])
730
  } // (!empty($_REQUEST['mla_admin_action'])
@@ -768,7 +798,7 @@ class MLASettings_IPTCEXIF {
768
  'mla-edit-iptc-exif-cancel',
769
  'mla-edit-iptc-exif-submit',
770
  'mla-iptc-exif-options-save',
771
- ), $_SERVER['REQUEST_URI'] );
772
 
773
  // Create an instance of our package class
774
  $MLAIPTCEXIFListTable = new MLA_IPTC_EXIF_List_Table();
@@ -799,9 +829,9 @@ class MLASettings_IPTCEXIF {
799
 
800
  if ( is_array( $value ) ) {
801
  foreach ( $value as $element_key => $element_value )
802
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( $element_value ) ) . "\n";
803
  } else {
804
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( $value ) ) . "\n";
805
  }
806
  }
807
 
@@ -842,7 +872,7 @@ class MLASettings_IPTCEXIF {
842
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
843
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
844
  'Search Rules Text' => __( 'Search Rules Text', 'media-library-assistant' ),
845
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
846
  'Search Rules' => __( 'Search Rules', 'media-library-assistant' ),
847
  'options_list' => $options_list,
848
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
@@ -931,12 +961,15 @@ class MLASettings_IPTCEXIF {
931
  */
932
  public static function mla_inline_mapping_iptc_exif_action() {
933
  MLACore::mla_debug_add( 'MLASettings_IPTCEXIF::mla_inline_mapping_custom_action $_REQUEST = ' . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
934
- set_current_screen( $_REQUEST['screen'] );
 
 
 
935
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
936
 
937
  // Find the current chunk
938
- $offset = isset( $_REQUEST['offset'] ) ? $_REQUEST['offset'] : 0;
939
- $length = isset( $_REQUEST['length'] ) ? $_REQUEST['length'] : 0;
940
 
941
  $page_content = array(
942
  'message' => 'ERROR: No action taken',
@@ -951,13 +984,15 @@ class MLASettings_IPTCEXIF {
951
  $page_content = self::_process_iptc_exif_mapping( NULL, $offset, $length );
952
  }
953
  elseif ( ! empty( $_REQUEST['bulk_action'] ) ) {
 
954
  $source_rules = NULL;
955
 
956
- if ( 'mapping-options-bulk-execute' == $_REQUEST['bulk_action'] ) {
957
- $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $_REQUEST['ids'] );
 
958
  }
959
- elseif ( 0 === strpos( $_REQUEST['bulk_action'], MLACore::MLA_ADMIN_SINGLE_MAP ) ) {
960
- $match_count = preg_match( '/\[(.*)\]/', $_REQUEST['bulk_action'], $matches );
961
  if ( $match_count ) {
962
  $post_id = absint( $matches[1] );
963
  $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $post_id );
@@ -1003,7 +1038,9 @@ class MLASettings_IPTCEXIF {
1003
  * @return void echo HTML <tr> markup for updated row or error message, then die()
1004
  */
1005
  public static function mla_inline_edit_iptc_exif_action() {
1006
- set_current_screen( $_REQUEST['screen'] );
 
 
1007
 
1008
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1009
 
@@ -1011,39 +1048,39 @@ class MLASettings_IPTCEXIF {
1011
  if ( empty( $_REQUEST['post_ID'] ) ) {
1012
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule ID not found', 'media-library-assistant' );
1013
  } else {
1014
- $rule = MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule( $_REQUEST['post_ID'] );
1015
  if ( false === $rule ) {
1016
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule not found', 'media-library-assistant' );
1017
  }
1018
  }
1019
 
1020
  if ( !empty( $error_message ) ) {
1021
- echo $error_message;
1022
  die();
1023
  }
1024
 
1025
- $rule['iptc_value'] = $_REQUEST['iptc_value'];
1026
- $rule['exif_value'] = $_REQUEST['exif_value'];
1027
- $rule['iptc_first'] = '1' === $_REQUEST['iptc_first'];
1028
- $rule['keep_existing'] = '1' === $_REQUEST['keep_existing'];
1029
- $rule['delimiters'] = !empty( $_REQUEST['delimiters'] ) ? $_REQUEST['delimiters'] : '';
1030
  $rule['parent'] = !empty( $_REQUEST['parent'] ) ? absint( $_REQUEST['parent'] ) : 0;
1031
- $rule['format'] = $_REQUEST['format'];
1032
 
1033
  if ( 'taxonomy' === $rule['type'] ) {
1034
- $rule['option'] = $_REQUEST['tax_option'];
1035
  } else {
1036
- $rule['option'] = $_REQUEST['option'];
1037
  }
1038
 
1039
  $rule['no_null'] = isset( $_REQUEST['no_null'] ) && '1' === $_REQUEST['no_null'];
1040
- $rule['active'] = '1' === $_REQUEST['active'];
1041
  $rule['changed'] = true;
1042
  $rule['deleted'] = false;
1043
  $rule = stripslashes_deep( $rule );
1044
 
1045
  if ( false === MLA_IPTC_EXIF_Query::mla_replace_iptc_exif_rule( $rule ) ) {
1046
- echo __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' );
1047
  die();
1048
  }
1049
 
@@ -1056,9 +1093,7 @@ class MLASettings_IPTCEXIF {
1056
  } // mla_inline_edit_iptc_exif_action
1057
  } // class MLASettings_IPTCEXIF
1058
 
1059
- /*
1060
- * The WP_List_Table class isn't automatically available to plugins
1061
- */
1062
  if ( !class_exists( 'WP_List_Table' ) ) {
1063
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
1064
  }
@@ -1216,33 +1251,33 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1216
  $has_filters = $include_filters;
1217
 
1218
  // View arguments - see also mla_tabulate_iptc_exif_items
1219
- if ( isset( $_REQUEST['mla_iptc_exif_view'] ) ) {
1220
- if ( in_array( $_REQUEST['mla_iptc_exif_view'], array( 'all', 'standard', 'taxonomy', 'custom', 'read_only' ) ) ) {
1221
- $submenu_arguments['mla_iptc_exif_view'] = $_REQUEST['mla_iptc_exif_view'];
1222
- }
1223
  }
1224
 
1225
  // Search box arguments
1226
  if ( !empty( $_REQUEST['s'] ) ) {
1227
- $submenu_arguments['s'] = urlencode( stripslashes( $_REQUEST['s'] ) );
1228
  }
1229
 
1230
  // Filter arguments (from table header)
1231
- if ( isset( $_REQUEST['mla_iptc_exif_status'] ) && ( 'any' != $_REQUEST['mla_iptc_exif_status'] ) ) {
1232
- if ( in_array( $_REQUEST['mla_iptc_exif_status'], array( 'active', 'inactive' ) ) ) {
1233
- $submenu_arguments['mla_iptc_exif_status'] = $_REQUEST['mla_iptc_exif_status'];
 
1234
  }
1235
  }
1236
 
1237
  // Sort arguments (from column header)
1238
  if ( isset( $_REQUEST['order'] ) ) {
1239
- $submenu_arguments['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
1240
  }
1241
 
1242
- if ( isset( $_REQUEST['orderby'] ) ) {
1243
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
1244
- $submenu_arguments['orderby'] = $_REQUEST['orderby'];
1245
- }
1246
  }
1247
 
1248
  return $submenu_arguments;
@@ -1433,13 +1468,13 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1433
  }
1434
 
1435
  if ( isset( $_REQUEST['order'] ) ) {
1436
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
1437
  }
1438
 
1439
- if ( isset( $_REQUEST['orderby'] ) ) {
1440
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
1441
- $view_args['orderby'] = $_REQUEST['orderby'];
1442
- }
1443
  }
1444
 
1445
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
@@ -1680,7 +1715,7 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1680
  * @param string 'top' | 'bottom'
1681
  */
1682
  function pagination( $which ) {
1683
- $save_uri = $_SERVER['REQUEST_URI'];
1684
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_IPTC_EXIF_List_Table::mla_submenu_arguments(), $save_uri );
1685
  parent::pagination( $which );
1686
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1744,17 +1779,13 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1744
 
1745
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1746
 
1747
- /*
1748
- * Calculate the common values once per page load
1749
- */
1750
  if ( is_null( $base_url ) ) {
1751
- /*
1752
- * Remember the view filters
1753
- */
1754
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-iptc_exif&mla_tab=iptc_exif';
1755
 
1756
  if ( isset( $_REQUEST['s'] ) ) {
1757
- //$base_url = add_query_arg( array( 's' => $_REQUEST['s'] ), $base_url );
1758
  }
1759
  }
1760
 
@@ -1775,10 +1806,10 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1775
  */
1776
  function get_views( ) {
1777
  // Find current view
1778
- $current_view = isset( $_REQUEST['mla_iptc_exif_view'] ) ? $_REQUEST['mla_iptc_exif_view'] : 'all';
1779
 
1780
  // Generate the list of views, retaining keyword search criterion
1781
- $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
1782
  $iptc_exif_items = MLA_IPTC_EXIF_Query::mla_tabulate_iptc_exif_items( $s );
1783
  $view_links = array();
1784
  foreach ( $iptc_exif_items as $slug => $item )
@@ -1855,9 +1886,7 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1855
  * @return void
1856
  */
1857
  function extra_tablenav( $which ) {
1858
- /*
1859
- * Decide which actions to show
1860
- */
1861
  if ( 'top' == $which ) {
1862
  $actions = array( 'mla_iptc_exif_status', 'mla_filter' );
1863
  } else {
@@ -1873,7 +1902,7 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1873
  foreach ( $actions as $action ) {
1874
  switch ( $action ) {
1875
  case 'mla_iptc_exif_status':
1876
- echo self::mla_get_custom_field_status_dropdown( isset( $_REQUEST['mla_iptc_exif_status'] ) ? $_REQUEST['mla_iptc_exif_status'] : 'any' );
1877
  break;
1878
  case 'mla_filter':
1879
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
@@ -1905,9 +1934,7 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1905
  $this->get_sortable_columns()
1906
  );
1907
 
1908
- /*
1909
- * REQUIRED for pagination.
1910
- */
1911
  $total_items = MLA_IPTC_EXIF_Query::mla_count_iptc_exif_rules( $_REQUEST );
1912
  $user = get_current_user_id();
1913
  $screen = get_current_screen();
@@ -1922,9 +1949,7 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1922
  $per_page = $screen->get_option( 'per_page', 'default' );
1923
  }
1924
 
1925
- /*
1926
- * REQUIRED. We also have to register our pagination options & calculations.
1927
- */
1928
  $this->set_pagination_args( array(
1929
  'total_items' => $total_items,
1930
  'per_page' => $per_page,
@@ -1953,8 +1978,8 @@ class MLA_IPTC_EXIF_List_Table extends WP_List_Table {
1953
  static $row_class = '';
1954
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1955
 
1956
- echo '<tr id="iptc_exif-' . $item->post_ID . '"' . $row_class . '>';
1957
- echo parent::single_row_columns( $item );
1958
  echo '</tr>';
1959
  }
1960
  } // class MLA_IPTC_EXIF_List_Table
@@ -2160,17 +2185,17 @@ class MLA_IPTC_EXIF_Query {
2160
  $sorted_keys[ $current_value['name'] ] = $current_value['name'];
2161
  }
2162
  natcasesort( $sorted_keys );
2163
-
2164
  $sorted_names = array();
2165
  foreach ( $sorted_keys as $rule_name ) {
2166
  $sorted_names[ $rule_name ] = array();
2167
  }
2168
-
2169
  // Allow for multiple rules mapping the same name (an old bug)
2170
  foreach ( $current_values['custom'] as $rule_name => $current_value ) {
2171
  $sorted_names[ $current_value['name'] ][] = $rule_name;
2172
  }
2173
-
2174
  foreach ( $sorted_names as $sorted_keys ) {
2175
  foreach ( $sorted_keys as $rule_name ) {
2176
  $current_value = $current_values['custom'][ $rule_name ];
@@ -2195,7 +2220,7 @@ class MLA_IPTC_EXIF_Query {
2195
  'changed' => false,
2196
  'deleted' => false,
2197
  );
2198
-
2199
  if ( self::$_iptc_exif_rules[ self::$_iptc_exif_rule_highest_ID ]['read_only'] ) {
2200
  self::$_iptc_exif_rules[ self::$_iptc_exif_rule_highest_ID ]['active'] = false;
2201
  }
@@ -2207,7 +2232,7 @@ class MLA_IPTC_EXIF_Query {
2207
  if ( $taxonomy_rules_changed ) {
2208
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
2209
  }
2210
-
2211
  return true;
2212
  }
2213
 
@@ -2320,9 +2345,7 @@ class MLA_IPTC_EXIF_Query {
2320
  $clean_request[ $key ] = 'ASC';
2321
  }
2322
  break;
2323
- /*
2324
- * ['s'] - Search items by one or more keywords
2325
- */
2326
  case 's':
2327
  $clean_request[ $key ] = stripslashes( trim( $value ) );
2328
  break;
@@ -2331,9 +2354,7 @@ class MLA_IPTC_EXIF_Query {
2331
  } // switch $key
2332
  } // foreach $raw_request
2333
 
2334
- /*
2335
- * Ignore incoming paged value; use offset and count instead
2336
- */
2337
  if ( ( (int) $count ) > 0 ) {
2338
  $clean_request['offset'] = $offset;
2339
  $clean_request['posts_per_page'] = $count;
@@ -2356,9 +2377,7 @@ class MLA_IPTC_EXIF_Query {
2356
  return array ();
2357
  }
2358
 
2359
- /*
2360
- * Sort and filter the list
2361
- */
2362
  $keywords = isset( $request['s'] ) ? $request['s'] : '';
2363
  preg_match_all('/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keywords, $matches);
2364
  $keywords = array_map( 'MLAQuery::mla_search_terms_tidy', $matches[0]);
@@ -2482,12 +2501,10 @@ class MLA_IPTC_EXIF_Query {
2482
  $sorted_items = array_reverse( $sorted_items, true );
2483
  }
2484
 
2485
- /*
2486
- * Paginate the sorted list
2487
- */
2488
  $results = array();
2489
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
2490
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
2491
  foreach ( $sorted_items as $value ) {
2492
  if ( $offset ) {
2493
  $offset--;
226
  * @return string Message(s) reflecting the results of the operation
227
  */
228
  private static function _add_iptc_exif_rule() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  $new_rule = array(
230
  'post_ID' => 0,
231
  'type' => 'custom',
232
+ 'key' => '',
233
+ 'rule_name' => '',
234
+ 'name' => '',
235
  'hierarchical' => false,
236
+ 'iptc_value' => '',
237
+ 'exif_value' => '',
238
+ 'iptc_first' => false,
239
+ 'keep_existing' => false,
240
+ 'format' => '',
241
+ 'option' => '',
242
+ 'no_null' => false,
243
  'delimiters' => '',
244
  'parent' => 0,
245
+ 'active' => false,
246
  'read_only' => false,
247
  'changed' => true,
248
  'deleted' => false,
249
  );
250
 
251
+ // Validate new rule name
252
+ if ( !empty( $_REQUEST['mla_iptc_exif_rule']['new_field'] ) ) {
253
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_rule']['new_field'] ) );
254
+ } elseif ( !empty( $_REQUEST['mla_iptc_exif_rule']['new_name'] ) && ( 'none' !== $_REQUEST['mla_iptc_exif_rule']['new_name'] ) ) {
255
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_rule']['new_name'] ) );
256
+ } else {
257
+ return __( 'ERROR', 'media-library-assistant' ) . __( ': No custom field name selected/entered', 'media-library-assistant' );
258
+ }
259
+
260
+ if ( MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule_ID( $new_name ) ) {
261
+ return __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
262
+ }
263
+
264
+ $new_rule['key'] = $new_name;
265
+ $new_rule['rule_name'] = $new_name;
266
+ $new_rule['name'] = $new_name;
267
+ $new_rule['iptc_value'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['iptc_value'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['iptc_value'] ) : 'none' );
268
+ $new_rule['exif_value'] = wp_kses( isset( $_REQUEST['mla_iptc_exif_rule']['exif_value'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['exif_value'] ) : '', 'post' );
269
+ $new_rule['iptc_first'] = isset( $_REQUEST['mla_iptc_exif_rule']['iptc_first'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['iptc_first'];
270
+ $new_rule['keep_existing'] = isset( $_REQUEST['mla_iptc_exif_rule']['keep_existing'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['keep_existing'];
271
+ $new_rule['format'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['format'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['format'] ) : 'native' );
272
+ $new_rule['option'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['option'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['option'] ) : 'text' );
273
+ $new_rule['no_null'] = isset( $_REQUEST['mla_iptc_exif_rule']['no_null'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['no_null'];
274
+ $new_rule['active'] = isset( $_REQUEST['mla_iptc_exif_rule']['status'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['status'];
275
+
276
  if ( MLA_IPTC_EXIF_Query::mla_add_iptc_exif_rule( $new_rule ) ) {
277
  return __( 'Rule added', 'media-library-assistant' );
278
  }
292
  */
293
  private static function _update_iptc_exif_rule( $post_id, &$template ) {
294
  $error_message = '';
295
+ $new_rule = array(
296
+ 'post_ID' => 0,
297
+ 'type' => '',
298
+ 'key' => '',
299
+ 'rule_name' => '',
300
+ 'name' => '',
301
+ 'hierarchical' => false,
302
+ 'iptc_value' => '',
303
+ 'exif_value' => '',
304
+ 'iptc_first' => false,
305
+ 'keep_existing' => false,
306
+ 'format' => '',
307
+ 'option' => '',
308
+ 'no_null' => false,
309
+ 'delimiters' => '',
310
+ 'parent' => 0,
311
+ 'active' => false,
312
+ 'read_only' => false,
313
+ 'changed' => true,
314
+ 'deleted' => false,
315
+ );
316
 
317
  // Validate rule name change
318
+ if ( !empty( $_REQUEST['mla_iptc_exif_rule']['new_field'] ) ) {
319
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_rule']['new_field'] ) );
320
+ } elseif ( !empty( $_REQUEST['mla_iptc_exif_rule']['new_name'] ) && ( 'none' !== $_REQUEST['mla_iptc_exif_rule']['new_name'] ) ) {
321
+ $new_name = sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_rule']['new_name'] ) );
322
  } else {
323
  $new_name = '';
324
  }
328
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule already exists for the new name', 'media-library-assistant' );
329
  $new_name = '';
330
  }
331
+ } elseif ( isset( $_REQUEST['mla_iptc_exif_rule']['name'] ) && isset( $_REQUEST['mla_iptc_exif_rule']['rule_name'] ) && ( $_REQUEST['mla_iptc_exif_rule']['name'] !== $_REQUEST['mla_iptc_exif_rule']['rule_name'] ) ) {
332
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Invalid rule name must be changed', 'media-library-assistant' );
333
  }
334
 
335
+ if ( empty( $error_message ) ) {
336
+ $new_rule['post_ID'] = isset( $_REQUEST['mla_iptc_exif_rule']['post_ID'] ) ? absint( $_REQUEST['mla_iptc_exif_rule']['post_ID'] ) : 0;
337
+ $new_rule['type'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['type'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['type'] ) : '' );
338
+ $new_rule['key'] = $new_name ? $new_name : sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['key'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['key'] ) : '' );
339
+ $new_rule['rule_name'] = $new_name ? $new_name : sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['rule_name'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['rule_name'] ) : '' );
340
+ $new_rule['name'] = $new_name ? $new_name : sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['name'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['name'] ) : '' );
341
+ $new_rule['hierarchical'] = isset( $_REQUEST['mla_iptc_exif_rule']['hierarchical'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['hierarchical'];
342
+ $new_rule['iptc_value'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['iptc_value'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['iptc_value'] ) : 'none' );
343
+ $new_rule['exif_value'] = wp_kses( isset( $_REQUEST['mla_iptc_exif_rule']['exif_value'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['exif_value'] ) : '', 'post' );
344
+ $new_rule['iptc_first'] = isset( $_REQUEST['mla_iptc_exif_rule']['iptc_first'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['iptc_first'];
345
+ $new_rule['keep_existing'] = isset( $_REQUEST['mla_iptc_exif_rule']['keep_existing'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['keep_existing'];
346
+ $new_rule['format'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['format'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['format'] ) : 'native' );
347
+ $new_rule['option'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['option'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['option'] ) : 'text' );
348
+ $new_rule['no_null'] = isset( $_REQUEST['mla_iptc_exif_rule']['no_null'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['no_null'];
349
+ $new_rule['delimiters'] = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_rule']['delimiters'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_rule']['delimiters'] ) : '' );
350
+ $new_rule['parent'] = isset( $_REQUEST['mla_iptc_exif_rule']['parent'] ) ? absint( $_REQUEST['mla_iptc_exif_rule']['parent'] ) : 0;
351
+ $new_rule['active'] = isset( $_REQUEST['mla_iptc_exif_rule']['status'] ) && '1' === $_REQUEST['mla_iptc_exif_rule']['status'];
352
+ } // no error
353
+
354
+ if ( empty( $new_rule['key'] ) || empty( $new_rule['rule_name'] ) || empty( $new_rule['name'] ) ) {
355
+ $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' );
356
+ }
357
+
 
 
 
 
 
 
358
  if ( empty( $error_message ) ) {
359
  if ( false === MLA_IPTC_EXIF_Query::mla_replace_iptc_exif_rule( $new_rule ) ) {
360
  $error_message = __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' );
405
  }
406
 
407
  // Convert dropdown controls to field values
408
+ $field = sanitize_text_field( isset( $_REQUEST['iptc_first'] ) ? wp_unslash( $_REQUEST['iptc_first'] ) : '-1' );
409
+ if ( '-1' !== $field ) {
410
+ $rule['iptc_first'] = '1' === $field;
411
  }
412
 
413
+ $field = sanitize_text_field( isset( $_REQUEST['keep_existing'] ) ? wp_unslash( $_REQUEST['keep_existing'] ) : '-1' );
414
+ if ( '-1' !== $field ) {
415
+ $rule['keep_existing'] = '1' === $field;
416
  }
417
 
418
+ $field = sanitize_text_field( isset( $_REQUEST['format'] ) ? wp_unslash( $_REQUEST['format'] ) : '-1' );
419
+ if ( '-1' !== $field ) {
420
+ $rule['format'] = $field;
421
  }
422
 
423
+ $field = sanitize_text_field( isset( $_REQUEST['option'] ) ? wp_unslash( $_REQUEST['option'] ) : '-1' );
424
+ if ( '-1' !== $field ) {
425
  // Only custom and taxonomy types use this value
426
  if ( 'custom' === $rule['type'] ) {
427
+ $rule['option'] = $field;
428
  } elseif ( 'taxonomy' === $rule['type'] ) {
429
  // Taxonomy rules have limited options; array or text
430
+ if ( ( 'array' === $field ) || ( 'text' === $field ) ) {
431
+ $rule['option'] = $field;
432
  }
433
  }
434
  }
435
 
436
+ $field = sanitize_text_field( isset( $_REQUEST['no_null'] ) ? wp_unslash( $_REQUEST['no_null'] ) : '-1' );
437
+ if ( '-1' !== $field ) {
438
+ $rule['no_null'] = '1' === $field;
439
  }
440
 
441
+ $field = sanitize_text_field( isset( $_REQUEST['active'] ) ? wp_unslash( $_REQUEST['active'] ) : '-1' );
442
+ if ( '-1' !== $field ) {
443
+ $rule['active'] = '1' === $field;
444
  }
445
 
446
  $rule['changed'] = true;
532
  'Array' => __( 'Array', 'media-library-assistant' ),
533
  'multi_option' => '', // Set below
534
  'Multi' => __( 'Multi', 'media-library-assistant' ),
535
+ 'no_null' => '', // Set below
536
  'Delete NULL' => __( 'Delete NULL values', 'media-library-assistant' ),
537
  'Check Delete NULL' => __( 'Do not store empty custom field values', 'media-library-assistant' ),
538
  // Common values
619
  } // option
620
 
621
  if ( $item['no_null'] ) {
622
+ $page_values['no_null'] = 'checked="checked"';
623
  }
624
  break;
625
  default:
645
  $message = '';
646
  $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $rule_ids );
647
  foreach ( $source_rules['custom'] as $rule_name => $rule ) {
648
+ $result = apply_filters( 'mla_purge_custom_field_values', NULL, 'iptc_exif_custom_mapping', $rule_name, $rule );
649
+
650
+ if ( NULL === $result ) {
651
+ $result = MLASettings::mla_delete_custom_field( $rule );
652
+ }
653
+
654
  $message .= sprintf( __( 'Custom Field Rule "%1$s": %2$s', 'media-library-assistant' ), $rule['name'], $result );
655
  }
656
 
683
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
684
  } elseif ( !empty( $_REQUEST['mla-edit-iptc-exif-submit'] ) ) {
685
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
686
+ $post_id = !empty( $_REQUEST['mla_iptc_exif_rule']['post_ID'] ) ? absint( $_REQUEST['mla_iptc_exif_rule']['post_ID'] ) : 0;
687
+ $page_content = MLASettings_IPTCEXIF::_update_iptc_exif_rule( $post_id, $page_template_array );
688
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
689
  } elseif ( !empty( $_REQUEST['mla-edit-iptc-exif-cancel'] ) ) {
690
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
700
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
701
  if ( array_key_exists( $bulk_action, MLA_IPTC_EXIF_List_Table::mla_get_bulk_actions() ) ) {
702
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
703
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
704
  if ( 'execute' === $bulk_action ) {
705
  $page_content['message'] = sprintf( __( 'Unknown bulk action %1$s', 'media-library-assistant' ), $bulk_action );
706
  } elseif ( 'purge' === $bulk_action ) {
707
+ $page_content['message'] = MLASettings_IPTCEXIF::_purge_custom_field_values( $post_ids );
708
  } else {
709
+ foreach ( $post_ids as $post_ID ) {
710
  switch ( $bulk_action ) {
711
  case 'edit':
712
  $item_content = MLASettings_IPTCEXIF::_bulk_update_iptc_exif_rule( $post_ID );
734
  }
735
  } // $bulk_action
736
 
737
+ // Process row-level actions that affect a single item
 
 
738
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
739
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
740
 
741
  $page_content = array( 'message' => '', 'body' => '' );
742
 
743
+ $post_id = !empty( $_REQUEST['mla_item_ID'] ) ? absint( $_REQUEST['mla_item_ID'] ) : 0;
744
  switch ( $_REQUEST['mla_admin_action'] ) {
745
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
746
+ $item = MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule( $post_id );
747
  $page_content = self::_compose_edit_iptc_exif_rule_tab( $item, $page_template_array );
748
  break;
749
  case MLACore::MLA_ADMIN_SINGLE_PURGE:
750
+ $page_content['message'] = MLASettings_IPTCEXIF::_purge_custom_field_values( $post_id );
751
  break;
752
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
753
+ $page_content['message'] = MLASettings_IPTCEXIF::_delete_iptc_exif_rule( $post_id );
754
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
755
  break;
756
  default:
757
+ $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ) );
758
  break;
759
  } // switch ($_REQUEST['mla_admin_action'])
760
  } // (!empty($_REQUEST['mla_admin_action'])
798
  'mla-edit-iptc-exif-cancel',
799
  'mla-edit-iptc-exif-submit',
800
  'mla-iptc-exif-options-save',
801
+ ), $_SERVER['REQUEST_URI'] ); // phpcs:ignore
802
 
803
  // Create an instance of our package class
804
  $MLAIPTCEXIFListTable = new MLA_IPTC_EXIF_List_Table();
829
 
830
  if ( is_array( $value ) ) {
831
  foreach ( $value as $element_key => $element_value )
832
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( urldecode( $element_value ) ) ) . "\n";
833
  } else {
834
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( urldecode( $value ) ) ) . "\n";
835
  }
836
  }
837
 
872
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
873
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
874
  'Search Rules Text' => __( 'Search Rules Text', 'media-library-assistant' ),
875
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
876
  'Search Rules' => __( 'Search Rules', 'media-library-assistant' ),
877
  'options_list' => $options_list,
878
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
961
  */
962
  public static function mla_inline_mapping_iptc_exif_action() {
963
  MLACore::mla_debug_add( 'MLASettings_IPTCEXIF::mla_inline_mapping_custom_action $_REQUEST = ' . var_export( $_REQUEST, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
964
+ if ( isset( $_REQUEST['screen'] ) ) {
965
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
966
+ }
967
+
968
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
969
 
970
  // Find the current chunk
971
+ $offset = isset( $_REQUEST['offset'] ) ? absint( $_REQUEST['offset'] ) : 0;
972
+ $length = isset( $_REQUEST['length'] ) ? absint( $_REQUEST['length'] ) : 0;
973
 
974
  $page_content = array(
975
  'message' => 'ERROR: No action taken',
984
  $page_content = self::_process_iptc_exif_mapping( NULL, $offset, $length );
985
  }
986
  elseif ( ! empty( $_REQUEST['bulk_action'] ) ) {
987
+ $bulk_action = sanitize_text_field( wp_unslash( $_REQUEST['bulk_action'] ) );
988
  $source_rules = NULL;
989
 
990
+ if ( 'mapping-options-bulk-execute' == $bulk_action ) {
991
+ $post_ids = !empty( $_REQUEST['ids'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['ids'] ) ) : array();
992
+ $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $post_ids );
993
  }
994
+ elseif ( 0 === strpos( $bulk_action, MLACore::MLA_ADMIN_SINGLE_MAP ) ) {
995
+ $match_count = preg_match( '/\[(.*)\]/', $bulk_action, $matches );
996
  if ( $match_count ) {
997
  $post_id = absint( $matches[1] );
998
  $source_rules = MLA_IPTC_EXIF_Query::mla_convert_iptc_exif_rules( $post_id );
1038
  * @return void echo HTML <tr> markup for updated row or error message, then die()
1039
  */
1040
  public static function mla_inline_edit_iptc_exif_action() {
1041
+ if ( isset( $_REQUEST['screen'] ) ) {
1042
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
1043
+ }
1044
 
1045
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1046
 
1048
  if ( empty( $_REQUEST['post_ID'] ) ) {
1049
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule ID not found', 'media-library-assistant' );
1050
  } else {
1051
+ $rule = MLA_IPTC_EXIF_Query::mla_find_iptc_exif_rule( absint( $_REQUEST['post_ID'] ) );
1052
  if ( false === $rule ) {
1053
  $error_message = __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'Rule not found', 'media-library-assistant' );
1054
  }
1055
  }
1056
 
1057
  if ( !empty( $error_message ) ) {
1058
+ echo esc_html( $error_message );
1059
  die();
1060
  }
1061
 
1062
+ $rule['iptc_value'] = sanitize_text_field( isset( $_REQUEST['iptc_value'] ) ? wp_unslash( $_REQUEST['iptc_value'] ) : 'none' );
1063
+ $rule['exif_value'] = wp_kses( isset( $_REQUEST['exif_value'] ) ? wp_unslash( $_REQUEST['exif_value'] ) : '', 'post' );
1064
+ $rule['iptc_first'] = isset( $_REQUEST['iptc_first'] ) && '1' === $_REQUEST['iptc_first'];
1065
+ $rule['keep_existing'] = isset( $_REQUEST['keep_existing'] ) && '1' === $_REQUEST['keep_existing'];
1066
+ $rule['delimiters'] = sanitize_text_field( !empty( $_REQUEST['delimiters'] ) ? wp_unslash( $_REQUEST['delimiters'] ) : '' );
1067
  $rule['parent'] = !empty( $_REQUEST['parent'] ) ? absint( $_REQUEST['parent'] ) : 0;
1068
+ $rule['format'] = sanitize_text_field( isset( $_REQUEST['format'] ) ? wp_unslash( $_REQUEST['format'] ) : 'native' );
1069
 
1070
  if ( 'taxonomy' === $rule['type'] ) {
1071
+ $rule['option'] = sanitize_text_field( isset( $_REQUEST['tax_option'] ) ? wp_unslash( $_REQUEST['tax_option'] ) : 'text' );
1072
  } else {
1073
+ $rule['option'] = sanitize_text_field( isset( $_REQUEST['option'] ) ? wp_unslash( $_REQUEST['option'] ) : 'text' );
1074
  }
1075
 
1076
  $rule['no_null'] = isset( $_REQUEST['no_null'] ) && '1' === $_REQUEST['no_null'];
1077
+ $rule['active'] = isset( $_REQUEST['active'] ) && '1' === $_REQUEST['active'];
1078
  $rule['changed'] = true;
1079
  $rule['deleted'] = false;
1080
  $rule = stripslashes_deep( $rule );
1081
 
1082
  if ( false === MLA_IPTC_EXIF_Query::mla_replace_iptc_exif_rule( $rule ) ) {
1083
+ echo esc_html( __( 'ERROR', 'media-library-assistant' ) . __( ': Rule update failed', 'media-library-assistant' ) );
1084
  die();
1085
  }
1086
 
1093
  } // mla_inline_edit_iptc_exif_action
1094
  } // class MLASettings_IPTCEXIF
1095
 
1096
+ // The WP_List_Table class isn't automatically available to plugins
 
 
1097
  if ( !class_exists( 'WP_List_Table' ) ) {
1098
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
1099
  }
1251
  $has_filters = $include_filters;
1252
 
1253
  // View arguments - see also mla_tabulate_iptc_exif_items
1254
+ $field = sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_view'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_view'] ) : 'all' );
1255
+ if ( in_array( $field, array( 'all', 'standard', 'taxonomy', 'custom', 'read_only' ) ) ) {
1256
+ $submenu_arguments['mla_iptc_exif_view'] = $field;
 
1257
  }
1258
 
1259
  // Search box arguments
1260
  if ( !empty( $_REQUEST['s'] ) ) {
1261
+ $submenu_arguments['s'] = urlencode( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
1262
  }
1263
 
1264
  // Filter arguments (from table header)
1265
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['mla_iptc_exif_status'] ) ? wp_unslash( $_REQUEST['mla_iptc_exif_status'] ) : 'any' ) );
1266
+ if ( 'any' !== $field ) {
1267
+ if ( in_array( $field, array( 'active', 'inactive' ) ) ) {
1268
+ $submenu_arguments['mla_iptc_exif_status'] = $field;
1269
  }
1270
  }
1271
 
1272
  // Sort arguments (from column header)
1273
  if ( isset( $_REQUEST['order'] ) ) {
1274
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
1275
+ $submenu_arguments['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
1276
  }
1277
 
1278
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
1279
+ if ( array_key_exists( $field, self::$default_sortable_columns ) ) {
1280
+ $submenu_arguments['orderby'] = $field;
 
1281
  }
1282
 
1283
  return $submenu_arguments;
1468
  }
1469
 
1470
  if ( isset( $_REQUEST['order'] ) ) {
1471
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
1472
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
1473
  }
1474
 
1475
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
1476
+ if ( array_key_exists( $field, self::$default_sortable_columns ) ) {
1477
+ $view_args['orderby'] = urlencode( $field );
 
1478
  }
1479
 
1480
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
1715
  * @param string 'top' | 'bottom'
1716
  */
1717
  function pagination( $which ) {
1718
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1719
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_IPTC_EXIF_List_Table::mla_submenu_arguments(), $save_uri );
1720
  parent::pagination( $which );
1721
  $_SERVER['REQUEST_URI'] = $save_uri;
1779
 
1780
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1781
 
1782
+ // Calculate the common values once per page load
 
 
1783
  if ( is_null( $base_url ) ) {
1784
+ // Remember the view filters
 
 
1785
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-iptc_exif&mla_tab=iptc_exif';
1786
 
1787
  if ( isset( $_REQUEST['s'] ) ) {
1788
+ $base_url = add_query_arg( array( 's' => wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ), $base_url );
1789
  }
1790
  }
1791
 
1806
  */
1807
  function get_views( ) {
1808
  // Find current view
1809
+ $current_view = isset( $_REQUEST['mla_iptc_exif_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_view'] ) ) : 'all';
1810
 
1811
  // Generate the list of views, retaining keyword search criterion
1812
+ $s = wp_kses( isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '', 'post' );
1813
  $iptc_exif_items = MLA_IPTC_EXIF_Query::mla_tabulate_iptc_exif_items( $s );
1814
  $view_links = array();
1815
  foreach ( $iptc_exif_items as $slug => $item )
1886
  * @return void
1887
  */
1888
  function extra_tablenav( $which ) {
1889
+ // Decide which actions to show
 
 
1890
  if ( 'top' == $which ) {
1891
  $actions = array( 'mla_iptc_exif_status', 'mla_filter' );
1892
  } else {
1902
  foreach ( $actions as $action ) {
1903
  switch ( $action ) {
1904
  case 'mla_iptc_exif_status':
1905
+ echo self::mla_get_custom_field_status_dropdown( isset( $_REQUEST['mla_iptc_exif_status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_iptc_exif_status'] ) ) : 'any' ); // phpcs:ignore
1906
  break;
1907
  case 'mla_filter':
1908
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
1934
  $this->get_sortable_columns()
1935
  );
1936
 
1937
+ // REQUIRED for pagination.
 
 
1938
  $total_items = MLA_IPTC_EXIF_Query::mla_count_iptc_exif_rules( $_REQUEST );
1939
  $user = get_current_user_id();
1940
  $screen = get_current_screen();
1949
  $per_page = $screen->get_option( 'per_page', 'default' );
1950
  }
1951
 
1952
+ // REQUIRED. We also have to register our pagination options & calculations.
 
 
1953
  $this->set_pagination_args( array(
1954
  'total_items' => $total_items,
1955
  'per_page' => $per_page,
1978
  static $row_class = '';
1979
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1980
 
1981
+ echo '<tr id="iptc_exif-' . $item->post_ID . '"' . $row_class . '>'; // phpcs:ignore
1982
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1983
  echo '</tr>';
1984
  }
1985
  } // class MLA_IPTC_EXIF_List_Table
2185
  $sorted_keys[ $current_value['name'] ] = $current_value['name'];
2186
  }
2187
  natcasesort( $sorted_keys );
2188
+
2189
  $sorted_names = array();
2190
  foreach ( $sorted_keys as $rule_name ) {
2191
  $sorted_names[ $rule_name ] = array();
2192
  }
2193
+
2194
  // Allow for multiple rules mapping the same name (an old bug)
2195
  foreach ( $current_values['custom'] as $rule_name => $current_value ) {
2196
  $sorted_names[ $current_value['name'] ][] = $rule_name;
2197
  }
2198
+
2199
  foreach ( $sorted_names as $sorted_keys ) {
2200
  foreach ( $sorted_keys as $rule_name ) {
2201
  $current_value = $current_values['custom'][ $rule_name ];
2220
  'changed' => false,
2221
  'deleted' => false,
2222
  );
2223
+
2224
  if ( self::$_iptc_exif_rules[ self::$_iptc_exif_rule_highest_ID ]['read_only'] ) {
2225
  self::$_iptc_exif_rules[ self::$_iptc_exif_rule_highest_ID ]['active'] = false;
2226
  }
2232
  if ( $taxonomy_rules_changed ) {
2233
  MLA_IPTC_EXIF_Query::mla_put_iptc_exif_rules();
2234
  }
2235
+
2236
  return true;
2237
  }
2238
 
2345
  $clean_request[ $key ] = 'ASC';
2346
  }
2347
  break;
2348
+ // ['s'] - Search items by one or more keywords
 
 
2349
  case 's':
2350
  $clean_request[ $key ] = stripslashes( trim( $value ) );
2351
  break;
2354
  } // switch $key
2355
  } // foreach $raw_request
2356
 
2357
+ // Ignore incoming paged value; use offset and count instead
 
 
2358
  if ( ( (int) $count ) > 0 ) {
2359
  $clean_request['offset'] = $offset;
2360
  $clean_request['posts_per_page'] = $count;
2377
  return array ();
2378
  }
2379
 
2380
+ // Sort and filter the list
 
 
2381
  $keywords = isset( $request['s'] ) ? $request['s'] : '';
2382
  preg_match_all('/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keywords, $matches);
2383
  $keywords = array_map( 'MLAQuery::mla_search_terms_tidy', $matches[0]);
2501
  $sorted_items = array_reverse( $sorted_items, true );
2502
  }
2503
 
2504
+ // Paginate the sorted list
 
 
2505
  $results = array();
2506
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
2507
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
2508
  foreach ( $sorted_items as $value ) {
2509
  if ( $offset ) {
2510
  $offset--;
includes/class-mla-settings-shortcodes-tab.php CHANGED
@@ -60,16 +60,39 @@ class MLASettings_Shortcodes {
60
  self::JAVASCRIPT_SHORTCODES_TAB_OBJECT, $script_variables );
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Process a shortcode template add action.
65
  *
66
  * @since 2.40
67
  *
68
- * @param array $value New template values.
69
  * @return string Action status/error messages.
70
  */
71
- public static function mla_add_template( $value ) {
72
- $value = stripslashes_deep( $value );
73
  $value['default'] = false;
74
  $value['changed'] = true;
75
  $value['deleted'] = false;
@@ -182,13 +205,14 @@ class MLASettings_Shortcodes {
182
  *
183
  * @since 2.40
184
  *
185
- * @param array $value New template values.
186
  * @return string Action status/error messages.
187
  */
188
- public static function mla_update_template( $value ) {
 
 
189
  $ID = $value['post_ID'];
190
- $value = stripslashes_deep( $value );
191
  $old_value = MLA_Template_Query::mla_find_shortcode_template( $ID );
 
192
  $template_changed = false;
193
  $message_list = '';
194
  $error_list = '';
@@ -282,17 +306,18 @@ class MLASettings_Shortcodes {
282
  if ( 'mla_gallery' == $value['tab'] ) {
283
  $this_setting_changed = false;
284
  $old_value = MLACore::mla_get_option( $key );
 
285
 
286
  if ( 'select' == $value['type'] ) {
287
- if ( $old_value != $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
288
  $this_setting_changed = true;
289
  }
290
  } elseif ( 'text' == $value['type'] ) {
291
- if ( '' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
292
  $_REQUEST[ MLA_OPTION_PREFIX . $key ] = $value['std'];
293
  }
294
 
295
- if ( $old_value != $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
296
  $this_setting_changed = true;
297
  }
298
  } elseif ( 'checkbox' == $value['type'] ) {
@@ -303,9 +328,7 @@ class MLASettings_Shortcodes {
303
  }
304
  }
305
 
306
- /*
307
- * Always update to scrub default settings
308
- */
309
  $message = MLASettings::mla_update_option_row( $key, $value );
310
  if ( $this_setting_changed ) {
311
  $settings_changed = true;
@@ -513,11 +536,11 @@ class MLASettings_Shortcodes {
513
  $page_content = self::_compose_add_template_tab( $page_template_array );
514
  } elseif ( !empty( $_REQUEST['mla-add-template-submit'] ) ) {
515
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
516
- $page_content['message'] = MLASettings_Shortcodes::mla_add_template( $_REQUEST['mla_template_item'] );
517
  MLA_Template_Query::mla_put_shortcode_template_items();
518
  } elseif ( !empty( $_REQUEST['mla-edit-template-submit'] ) ) {
519
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
520
- $page_content['message'] = MLASettings_Shortcodes::mla_update_template( $_REQUEST['mla_template_item'] );
521
  MLA_Template_Query::mla_put_shortcode_template_items();
522
  } elseif ( !empty( $_REQUEST['mla-add-template-cancel'] ) ) {
523
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
@@ -537,7 +560,8 @@ class MLASettings_Shortcodes {
537
  $bulk_action = MLASettings::mla_current_bulk_action();
538
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
539
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
540
- foreach ( $_REQUEST['cb_mla_item_ID'] as $post_ID ) {
 
541
  switch ( $bulk_action ) {
542
  case 'delete':
543
  $item_content = MLASettings_Shortcodes::mla_delete_template( $post_ID );
@@ -565,32 +589,30 @@ class MLASettings_Shortcodes {
565
  }
566
  } // $bulk_action
567
 
568
- /*
569
- * Process row-level actions that affect a single item
570
- */
571
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
 
572
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
573
-
574
  $page_content = array( 'message' => '', 'body' => '' );
575
-
576
- switch ( $_REQUEST['mla_admin_action'] ) {
577
  case MLACore::MLA_ADMIN_SINGLE_COPY:
578
- $content = MLASettings_Shortcodes::mla_copy_template( $_REQUEST['mla_item_ID'] );
579
  MLA_Template_Query::mla_put_shortcode_template_items();
580
  $item = MLA_Template_Query::mla_find_shortcode_template_ID( $content['type'], $content['name'] );
581
  $item = MLA_Template_Query::mla_find_shortcode_template( $item );
582
  $page_content = self::_compose_edit_template_tab( $item, $page_template_array );
583
  break;
584
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
585
- $item = MLA_Template_Query::mla_find_shortcode_template( $_REQUEST['mla_item_ID'] );
586
  $page_content = self::_compose_edit_template_tab( $item, $page_template_array );
587
  break;
588
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
589
- $page_content['message'] = MLASettings_Shortcodes::mla_delete_template( $_REQUEST['mla_item_ID'] );
590
  MLA_Template_Query::mla_put_shortcode_template_items();
591
  break;
592
  default:
593
- $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] );
594
  break;
595
  } // switch ($_REQUEST['mla_admin_action'])
596
  } // (!empty($_REQUEST['mla_admin_action'])
@@ -614,7 +636,7 @@ class MLASettings_Shortcodes {
614
  'mla-edit-template-cancel',
615
  'mla-edit-template-submit',
616
  'mla-shortcodes-options-save',
617
- ), $_SERVER['REQUEST_URI'] );
618
 
619
  // Create an instance of our package class
620
  $MLATemplateListTable = new MLA_Template_List_Table();
@@ -689,9 +711,9 @@ class MLASettings_Shortcodes {
689
 
690
  if ( is_array( $value ) ) {
691
  foreach ( $value as $element_key => $element_value )
692
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( $element_value ) ) . "\n";
693
  } else {
694
- $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( $value ) ) . "\n";
695
  }
696
  }
697
 
@@ -707,7 +729,7 @@ class MLASettings_Shortcodes {
707
  '_wp_http_referer' => wp_referer_field( false ),
708
  'Add New Template' => __( 'Add New Template', 'media-library-assistant' ),
709
  'Search Templates' => __( 'Search Templates', 'media-library-assistant' ),
710
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
711
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
712
  'options_list' => $options_list,
713
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
@@ -873,32 +895,34 @@ class MLA_Template_List_Table extends WP_List_Table {
873
 
874
  // View arguments - see also mla_tabulate_template_items
875
  if ( isset( $_REQUEST['mla_template_view'] ) ) {
876
- if ( in_array( $_REQUEST['mla_template_view'], array( 'all', 'style', 'markup', 'gallery', 'tag-cloud', 'term-list' ) ) ) {
877
- $submenu_arguments['mla_template_view'] = $_REQUEST['mla_template_view'];
 
878
  }
879
  }
880
 
881
  // Search box arguments
882
  if ( !empty( $_REQUEST['s'] ) ) {
883
- $submenu_arguments['s'] = urlencode( stripslashes( $_REQUEST['s'] ) );
884
  }
885
 
886
  // Filter arguments (from table header)
887
  if ( isset( $_REQUEST['mla_template_status'] ) && ( 'any' != $_REQUEST['mla_template_status'] ) ) {
888
- if ( in_array( $_REQUEST['mla_template_status'], array( 'default', 'custom' ) ) ) {
889
- $submenu_arguments['mla_template_status'] = $_REQUEST['mla_template_status'];
 
890
  }
891
  }
892
 
893
  // Sort arguments (from column header)
894
  if ( isset( $_REQUEST['order'] ) ) {
895
- $submenu_arguments['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
896
  }
897
 
898
- if ( isset( $_REQUEST['orderby'] ) ) {
899
- if ( array_key_exists( $_REQUEST['orderby'], self::$default_sortable_columns ) ) {
900
- $submenu_arguments['orderby'] = $_REQUEST['orderby'];
901
- }
902
  }
903
 
904
  return $submenu_arguments;
@@ -1146,7 +1170,7 @@ class MLA_Template_List_Table extends WP_List_Table {
1146
  * @param string 'top' | 'bottom'
1147
  */
1148
  function pagination( $which ) {
1149
- $save_uri = $_SERVER['REQUEST_URI'];
1150
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Template_List_Table::mla_submenu_arguments(), $save_uri );
1151
  parent::pagination( $which );
1152
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1202,7 +1226,7 @@ class MLA_Template_List_Table extends WP_List_Table {
1202
  * @param bool $with_id Whether to set the id attribute or not
1203
  */
1204
  function print_column_headers( $with_id = true ) {
1205
- $save_uri = $_SERVER['REQUEST_URI'];
1206
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Template_List_Table::mla_submenu_arguments(), $save_uri );
1207
  parent::print_column_headers( $with_id );
1208
  $_SERVER['REQUEST_URI'] = $save_uri;
@@ -1224,17 +1248,13 @@ class MLA_Template_List_Table extends WP_List_Table {
1224
 
1225
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1226
 
1227
- /*
1228
- * Calculate the common values once per page load
1229
- */
1230
  if ( is_null( $base_url ) ) {
1231
- /*
1232
- * Remember the view filters
1233
- */
1234
  $base_url = MLACore::mla_nonce_url( 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-shortcodes&mla_tab=shortcodes', MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1235
 
1236
  if ( isset( $_REQUEST['s'] ) ) {
1237
- $base_url = add_query_arg( array( 's' => $_REQUEST['s'] ), $base_url );
1238
  }
1239
  }
1240
 
@@ -1254,16 +1274,13 @@ class MLA_Template_List_Table extends WP_List_Table {
1254
  * @return array View information,e.g., array ( id => link )
1255
  */
1256
  function get_views( ) {
1257
- /*
1258
- * Find current view
1259
- */
1260
- $current_view = isset( $_REQUEST['mla_template_view'] ) ? $_REQUEST['mla_template_view'] : 'all';
1261
 
1262
- /*
1263
- * Generate the list of views, retaining keyword search criterion
1264
- */
1265
  //$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
1266
  $s = '';
 
1267
  $template_items = MLA_Template_Query::mla_tabulate_template_items( $s );
1268
  $view_links = array();
1269
  foreach ( $template_items as $slug => $item )
@@ -1324,9 +1341,7 @@ class MLA_Template_List_Table extends WP_List_Table {
1324
  * @return void
1325
  */
1326
  function extra_tablenav( $which ) {
1327
- /*
1328
- * Decide which actions to show
1329
- */
1330
  if ( 'top' == $which ) {
1331
  $actions = array( 'mla_template_status', 'mla_filter' );
1332
  } else {
@@ -1342,7 +1357,7 @@ class MLA_Template_List_Table extends WP_List_Table {
1342
  foreach ( $actions as $action ) {
1343
  switch ( $action ) {
1344
  case 'mla_template_status':
1345
- echo self::mla_get_template_status_dropdown( isset( $_REQUEST['mla_template_status'] ) ? $_REQUEST['mla_template_status'] : 'any' );
1346
  break;
1347
  case 'mla_filter':
1348
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
@@ -1422,8 +1437,8 @@ class MLA_Template_List_Table extends WP_List_Table {
1422
  static $row_class = '';
1423
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1424
 
1425
- echo '<tr id="template-' . $item->post_ID . '"' . $row_class . '>';
1426
- echo parent::single_row_columns( $item );
1427
  echo '</tr>';
1428
  }
1429
  } // class MLA_Template_List_Table
@@ -1790,12 +1805,10 @@ class MLA_Template_Query {
1790
  $sorted_items = array_reverse( $sorted_items, true );
1791
  }
1792
 
1793
- /*
1794
- * Paginate the sorted list
1795
- */
1796
  $results = array();
1797
- $offset = isset( $request['offset'] ) ? $request['offset'] : 0;
1798
- $count = isset( $request['posts_per_page'] ) ? $request['posts_per_page'] : -1;
1799
  foreach ( $sorted_items as $value ) {
1800
  if ( $offset ) {
1801
  $offset--;
60
  self::JAVASCRIPT_SHORTCODES_TAB_OBJECT, $script_variables );
61
  }
62
 
63
+ /**
64
+ * Validate an incoming $_REQUEST['mla_template_item']
65
+ *
66
+ * @since 2.90
67
+ *
68
+ * @return array Sanitized template item
69
+ */
70
+ private static function _sanitize_template_item() {
71
+ $template = array();
72
+ $template['post_ID'] = isset( $_REQUEST['mla_template_item']['post_ID'] ) ? absint( $_REQUEST['mla_template_item']['post_ID'] ) : 0;
73
+ $template['type'] = isset( $_REQUEST['mla_template_item']['type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_template_item']['type'] ) ) : 'any';
74
+ $template['shortcode'] = isset( $_REQUEST['mla_template_item']['shortcode'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_template_item']['shortcode'] ) ) : 'any';
75
+ $template['name'] = isset( $_REQUEST['mla_template_item']['name'] ) ? sanitize_title( wp_unslash( $_REQUEST['mla_template_item']['name'] ) ) : '';
76
+
77
+ $template['sections'] = array();
78
+ $sections = isset( $_REQUEST['mla_template_item']['sections'] ) ? array_keys( array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_template_item']['sections'] ) ) ) : array();
79
+ foreach ( $sections as $section ) {
80
+ // Must allow arbitrary HTML tags, e.g., <[+itemtag+] class=\'gallery-item [+last_in_row+]\'>
81
+ $template['sections'][ $section ] = isset( $_REQUEST['mla_template_item']['sections'][ $section ] ) ? wp_unslash( $_REQUEST['mla_template_item']['sections'][ $section ] ) : ''; // phpcs:ignore
82
+ }
83
+
84
+ return $template;
85
+ }
86
+
87
  /**
88
  * Process a shortcode template add action.
89
  *
90
  * @since 2.40
91
  *
 
92
  * @return string Action status/error messages.
93
  */
94
+ private static function _add_template() {
95
+ $value = self::_sanitize_template_item();
96
  $value['default'] = false;
97
  $value['changed'] = true;
98
  $value['deleted'] = false;
205
  *
206
  * @since 2.40
207
  *
 
208
  * @return string Action status/error messages.
209
  */
210
+ private static function _update_template() {
211
+ $value = self::_sanitize_template_item();
212
+ error_log( __LINE__ . ' mla_update_template value = ' . var_export( $value, true ), 0 );
213
  $ID = $value['post_ID'];
 
214
  $old_value = MLA_Template_Query::mla_find_shortcode_template( $ID );
215
+ error_log( __LINE__ . ' mla_update_template old_value = ' . var_export( $old_value, true ), 0 );
216
  $template_changed = false;
217
  $message_list = '';
218
  $error_list = '';
306
  if ( 'mla_gallery' == $value['tab'] ) {
307
  $this_setting_changed = false;
308
  $old_value = MLACore::mla_get_option( $key );
309
+ $current = isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ? wp_kses( wp_unslash( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ), 'post' ) : '';
310
 
311
  if ( 'select' == $value['type'] ) {
312
+ if ( $old_value != $current ) {
313
  $this_setting_changed = true;
314
  }
315
  } elseif ( 'text' == $value['type'] ) {
316
+ if ( '' == $current ) {
317
  $_REQUEST[ MLA_OPTION_PREFIX . $key ] = $value['std'];
318
  }
319
 
320
+ if ( $old_value != $current ) {
321
  $this_setting_changed = true;
322
  }
323
  } elseif ( 'checkbox' == $value['type'] ) {
328
  }
329
  }
330
 
331
+ // Always update to scrub default settings
 
 
332
  $message = MLASettings::mla_update_option_row( $key, $value );
333
  if ( $this_setting_changed ) {
334
  $settings_changed = true;
536
  $page_content = self::_compose_add_template_tab( $page_template_array );
537
  } elseif ( !empty( $_REQUEST['mla-add-template-submit'] ) ) {
538
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
539
+ $page_content['message'] = self::_add_template();
540
  MLA_Template_Query::mla_put_shortcode_template_items();
541
  } elseif ( !empty( $_REQUEST['mla-edit-template-submit'] ) ) {
542
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
543
+ $page_content['message'] = self::_update_template();
544
  MLA_Template_Query::mla_put_shortcode_template_items();
545
  } elseif ( !empty( $_REQUEST['mla-add-template-cancel'] ) ) {
546
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
560
  $bulk_action = MLASettings::mla_current_bulk_action();
561
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
562
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
563
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
564
+ foreach ( $post_ids as $post_ID ) {
565
  switch ( $bulk_action ) {
566
  case 'delete':
567
  $item_content = MLASettings_Shortcodes::mla_delete_template( $post_ID );
589
  }
590
  } // $bulk_action
591
 
592
+ // Process row-level actions that affect a single item
 
 
593
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
594
+ $mla_admin_action = sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) );
595
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
 
596
  $page_content = array( 'message' => '', 'body' => '' );
597
+ $mla_item_ID = isset( $_REQUEST['mla_item_ID'] ) ? absint( $_REQUEST['mla_item_ID'] ) : 0;
598
+ switch ( $mla_admin_action ) {
599
  case MLACore::MLA_ADMIN_SINGLE_COPY:
600
+ $content = MLASettings_Shortcodes::mla_copy_template( $mla_item_ID );
601
  MLA_Template_Query::mla_put_shortcode_template_items();
602
  $item = MLA_Template_Query::mla_find_shortcode_template_ID( $content['type'], $content['name'] );
603
  $item = MLA_Template_Query::mla_find_shortcode_template( $item );
604
  $page_content = self::_compose_edit_template_tab( $item, $page_template_array );
605
  break;
606
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
607
+ $item = MLA_Template_Query::mla_find_shortcode_template( $mla_item_ID );
608
  $page_content = self::_compose_edit_template_tab( $item, $page_template_array );
609
  break;
610
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
611
+ $page_content['message'] = MLASettings_Shortcodes::mla_delete_template( $mla_item_ID );
612
  MLA_Template_Query::mla_put_shortcode_template_items();
613
  break;
614
  default:
615
+ $page_content['message'] = sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $mla_admin_action );
616
  break;
617
  } // switch ($_REQUEST['mla_admin_action'])
618
  } // (!empty($_REQUEST['mla_admin_action'])
636
  'mla-edit-template-cancel',
637
  'mla-edit-template-submit',
638
  'mla-shortcodes-options-save',
639
+ ), $_SERVER['REQUEST_URI'] ); // phpcs:ignore
640
 
641
  // Create an instance of our package class
642
  $MLATemplateListTable = new MLA_Template_List_Table();
711
 
712
  if ( is_array( $value ) ) {
713
  foreach ( $value as $element_key => $element_value )
714
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s[%2$s]" value="%3$s" />', $key, $element_key, esc_attr( urldecode( $element_value ) ) ) . "\n";
715
  } else {
716
+ $view_args .= "\t" . sprintf( '<input type="hidden" name="%1$s" value="%2$s" />', $key, esc_attr( urldecode( $value ) ) ) . "\n";
717
  }
718
  }
719
 
729
  '_wp_http_referer' => wp_referer_field( false ),
730
  'Add New Template' => __( 'Add New Template', 'media-library-assistant' ),
731
  'Search Templates' => __( 'Search Templates', 'media-library-assistant' ),
732
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
733
  'results' => ! empty( $_REQUEST['s'] ) ? '<span class="alignright" style="margin-top: .5em; font-weight: bold">' . __( 'Search results for', 'media-library-assistant' ) . ':&nbsp;</span>' : '',
734
  'options_list' => $options_list,
735
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
895
 
896
  // View arguments - see also mla_tabulate_template_items
897
  if ( isset( $_REQUEST['mla_template_view'] ) ) {
898
+ $field = sanitize_text_field( wp_unslash( $_REQUEST['mla_template_view'] ) );
899
+ if ( in_array( $field, array( 'all', 'style', 'markup', 'gallery', 'tag-cloud', 'term-list' ) ) ) {
900
+ $submenu_arguments['mla_template_view'] = $field;
901
  }
902
  }
903
 
904
  // Search box arguments
905
  if ( !empty( $_REQUEST['s'] ) ) {
906
+ $submenu_arguments['s'] = urlencode( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
907
  }
908
 
909
  // Filter arguments (from table header)
910
  if ( isset( $_REQUEST['mla_template_status'] ) && ( 'any' != $_REQUEST['mla_template_status'] ) ) {
911
+ $field = sanitize_text_field( wp_unslash( $_REQUEST['mla_template_status'] ) );
912
+ if ( in_array( $field, array( 'default', 'custom' ) ) ) {
913
+ $submenu_arguments['mla_template_status'] = $field;
914
  }
915
  }
916
 
917
  // Sort arguments (from column header)
918
  if ( isset( $_REQUEST['order'] ) ) {
919
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
920
+ $submenu_arguments['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
921
  }
922
 
923
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
924
+ if ( array_key_exists( $field, self::$default_sortable_columns ) ) {
925
+ $submenu_arguments['orderby'] = $field;
 
926
  }
927
 
928
  return $submenu_arguments;
1170
  * @param string 'top' | 'bottom'
1171
  */
1172
  function pagination( $which ) {
1173
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1174
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Template_List_Table::mla_submenu_arguments(), $save_uri );
1175
  parent::pagination( $which );
1176
  $_SERVER['REQUEST_URI'] = $save_uri;
1226
  * @param bool $with_id Whether to set the id attribute or not
1227
  */
1228
  function print_column_headers( $with_id = true ) {
1229
+ $save_uri = $_SERVER['REQUEST_URI']; // phpcs:ignore
1230
  $_SERVER['REQUEST_URI'] = add_query_arg( MLA_Template_List_Table::mla_submenu_arguments(), $save_uri );
1231
  parent::print_column_headers( $with_id );
1232
  $_SERVER['REQUEST_URI'] = $save_uri;
1248
 
1249
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1250
 
1251
+ // Calculate the common values once per page load
 
 
1252
  if ( is_null( $base_url ) ) {
1253
+ // Remember the view filters
 
 
1254
  $base_url = MLACore::mla_nonce_url( 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-shortcodes&mla_tab=shortcodes', MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
1255
 
1256
  if ( isset( $_REQUEST['s'] ) ) {
1257
+ $base_url = add_query_arg( array( 's' => wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ), $base_url );
1258
  }
1259
  }
1260
 
1274
  * @return array View information,e.g., array ( id => link )
1275
  */
1276
  function get_views( ) {
1277
+ // Find current view
1278
+ $current_view = isset( $_REQUEST['mla_template_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_template_view'] ) ) : 'all';
 
 
1279
 
1280
+ // Generate the list of views, retaining keyword search criterion
 
 
1281
  //$s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
1282
  $s = '';
1283
+ $s = isset( $_REQUEST['s'] ) ? wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) : '';
1284
  $template_items = MLA_Template_Query::mla_tabulate_template_items( $s );
1285
  $view_links = array();
1286
  foreach ( $template_items as $slug => $item )
1341
  * @return void
1342
  */
1343
  function extra_tablenav( $which ) {
1344
+ // Decide which actions to show
 
 
1345
  if ( 'top' == $which ) {
1346
  $actions = array( 'mla_template_status', 'mla_filter' );
1347
  } else {
1357
  foreach ( $actions as $action ) {
1358
  switch ( $action ) {
1359
  case 'mla_template_status':
1360
+ echo self::mla_get_template_status_dropdown( isset( $_REQUEST['mla_template_status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_template_status'] ) ) : 'any' ); // phpcs:ignore
1361
  break;
1362
  case 'mla_filter':
1363
  submit_button( __( 'Filter', 'media-library-assistant' ), 'secondary', 'mla_filter', false, array( 'id' => 'template-query-submit' ) );
1437
  static $row_class = '';
1438
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1439
 
1440
+ echo '<tr id="template-' . absint( $item->post_ID ) . '"' . esc_html( $row_class ) . '>';
1441
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1442
  echo '</tr>';
1443
  }
1444
  } // class MLA_Template_List_Table
1805
  $sorted_items = array_reverse( $sorted_items, true );
1806
  }
1807
 
1808
+ // Paginate the sorted list
 
 
1809
  $results = array();
1810
+ $offset = isset( $request['offset'] ) ? absint( $request['offset'] ) : 0;
1811
+ $count = isset( $request['posts_per_page'] ) ? absint( $request['posts_per_page'] ) : -1;
1812
  foreach ( $sorted_items as $value ) {
1813
  if ( $offset ) {
1814
  $offset--;
includes/class-mla-settings-upload-tab.php CHANGED
@@ -38,9 +38,7 @@ class MLASettings_Upload {
38
  return;
39
  }
40
 
41
- /*
42
- * Initialize common script variables
43
- */
44
  $script_variables = array(
45
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
46
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
@@ -145,6 +143,33 @@ class MLASettings_Upload {
145
  return MLAData::mla_parse_template( $templates['icon-type-select'], array( 'name' => $name, 'options' => $options ) );
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  /**
149
  * Compose the Edit Upload type tab content for the Settings subpage
150
  *
@@ -203,9 +228,7 @@ class MLASettings_Upload {
203
  * @return array 'message' => status/error messages, 'body' => tab content
204
  */
205
  private static function _compose_optional_upload_tab( $page_template_array ) {
206
- /*
207
- * Display the Optional Upload MIME Types Table
208
- */
209
  $_SERVER['REQUEST_URI'] = add_query_arg( array( 'mla-optional-uploads-display' => 'true' ), remove_query_arg( array(
210
  'mla_admin_action',
211
  'mla_item_slug',
@@ -215,12 +238,10 @@ class MLASettings_Upload {
215
  'action',
216
  'action2',
217
  'cb_attachment',
218
- 'mla-optional-uploads-search'
219
- ), $_SERVER['REQUEST_URI'] ) );
220
 
221
- /*
222
- * Suppress display of the hidden columns selection list
223
- */
224
  echo " <style type='text/css'>\r\n";
225
  echo " form#adv-settings div.metabox-prefs,\r\n";
226
  echo " form#adv-settings fieldset.metabox-prefs {\r\n";
@@ -243,9 +264,9 @@ class MLASettings_Upload {
243
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-upload&mla_tab=upload',
244
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
245
  'Known File Extension' => __( 'Known File Extension/MIME Type Associations', 'media-library-assistant' ),
246
- 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . '"</h2>' : '',
247
  'Search Known MIME' => __( 'Search Known MIME Types', 'media-library-assistant' ),
248
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
249
  'Search Types' => __( 'Search Types', 'media-library-assistant' ),
250
  'To search by' => __( 'To search by extension, use ".", e.g., ".doc"', 'media-library-assistant' ),
251
  'Cancel' => __( 'Cancel', 'media-library-assistant' ),
@@ -312,21 +333,12 @@ class MLASettings_Upload {
312
  unset( $_REQUEST['s'] );
313
  }
314
 
315
- /*
316
- * Convert checkbox values, if present
317
- */
318
- if ( isset( $_REQUEST['mla_upload_item'] ) ) {
319
- $_REQUEST['mla_upload_item']['disabled'] = isset( $_REQUEST['mla_upload_item']['disabled'] );
320
- }
321
-
322
- /*
323
- * Set default values, check for Add New Upload MIME Type button
324
- */
325
  $add_form_values = array (
326
  'slug' => '',
327
  'mime_type' => '',
328
  'icon_type' => '.none.',
329
- 'disabled' => '',
330
  'description' => ''
331
  );
332
 
@@ -349,9 +361,9 @@ class MLASettings_Upload {
349
  $page_content = self::_compose_optional_upload_tab( $page_template_array );
350
  } elseif ( !empty( $_REQUEST['mla-add-upload-submit'] ) ) {
351
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
352
- $page_content = MLAMime::mla_add_upload_mime( $_REQUEST['mla_upload_item'] );
353
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
354
- $add_form_values = $_REQUEST['mla_upload_item'];
355
  $add_form_values['disabled'] = $add_form_values['disabled'] ? 'checked="checked"' : '';
356
  }
357
  } else {
@@ -364,16 +376,18 @@ class MLASettings_Upload {
364
  // Process bulk actions that affect an array of items
365
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
366
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
 
367
  if ( 'select' == $bulk_action ) {
368
- foreach ( $_REQUEST['cb_mla_item_ID'] as $ID ) {
369
  $item_content = self::_process_optional_upload_mime( $ID );
370
  $page_content['message'] .= $item_content['message'] . '<br>';
371
  }
372
  } else {
373
  // Convert post-ID to slug; separate loop required because delete changes post_IDs
374
  $slugs = array();
375
- foreach ( $_REQUEST['cb_mla_item_ID'] as $post_ID )
376
  $slugs[] = MLAMime::mla_get_upload_mime_slug( $post_ID );
 
377
 
378
  foreach ( $slugs as $slug ) {
379
  switch ( $bulk_action ) {
@@ -382,11 +396,11 @@ class MLASettings_Upload {
382
  break;
383
  case 'edit':
384
  $request = array( 'slug' => $slug );
385
- if ( '-1' != $_REQUEST['disabled'] ) {
386
  $request['disabled'] = '1' == $_REQUEST['disabled'];
387
  }
388
- if ( '.none.' != $_REQUEST['icon_type'] ) {
389
- $request['icon_type'] = $_REQUEST['icon_type'];
390
  }
391
  $item_content = MLAMime::mla_update_upload_mime( $request );
392
  break;
@@ -408,34 +422,33 @@ class MLASettings_Upload {
408
  }
409
  } // $bulk_action
410
 
411
- /*
412
- * Process row-level actions that affect a single item
413
- */
414
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
415
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
416
-
417
  switch ( $_REQUEST['mla_admin_action'] ) {
418
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
419
- $page_content = MLAMime::mla_delete_upload_mime( $_REQUEST['mla_item_slug'] );
420
  break;
421
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
422
- $view = MLAMime::mla_get_upload_mime( $_REQUEST['mla_item_slug'] );
423
  $page_content = self::_compose_edit_upload_tab( $view, $page_template_array );
424
  break;
425
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
 
426
  if ( !empty( $_REQUEST['update'] ) ) {
427
- $page_content = MLAMime::mla_update_upload_mime( $_REQUEST['mla_upload_item'] );
428
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
429
  $message = $page_content['message'];
430
- $page_content = self::_compose_edit_upload_tab( $_REQUEST['mla_upload_item'], $page_template_array );
431
  $page_content['message'] = $message;
432
  }
433
  } elseif ( !empty( $_REQUEST['mla_item_ID'] ) ) {
434
- $page_content = self::_process_optional_upload_mime( $_REQUEST['mla_item_ID'] );
435
  } else {
436
  $page_content = array(
437
  /* translators: 1: view name/slug */
438
- 'message' => sprintf( __( 'Edit view "%1$s" cancelled.', 'media-library-assistant' ), $_REQUEST['mla_upload_item']['original_slug'] ),
439
  'body' => ''
440
  );
441
  }
@@ -443,7 +456,7 @@ class MLASettings_Upload {
443
  default:
444
  $page_content = array(
445
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
446
- 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] ),
447
  'body' => ''
448
  );
449
  break;
@@ -454,13 +467,9 @@ class MLASettings_Upload {
454
  return $page_content;
455
  }
456
 
457
- /*
458
- * Check for disabled status
459
- */
460
  if ( 'checked' != MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_UPLOAD_MIMES ) ) {
461
- /*
462
- * Fill in with any page-level options
463
- */
464
  $options_list = '';
465
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
466
  if ( MLACoreOptions::MLA_ENABLE_UPLOAD_MIMES == $key ) {
@@ -481,9 +490,7 @@ class MLASettings_Upload {
481
  return $page_content;
482
  }
483
 
484
- /*
485
- * Display the Upload MIME Types Table
486
- */
487
  $_SERVER['REQUEST_URI'] = remove_query_arg( array(
488
  'mla_admin_action',
489
  'mla_item_slug',
@@ -494,7 +501,7 @@ class MLASettings_Upload {
494
  'action2',
495
  'cb_mla_item_ID',
496
  'mla-optional-uploads-search',
497
- ), $_SERVER['REQUEST_URI'] );
498
 
499
  // Create an instance of our package class
500
  $MLAListUploadTable = new MLA_Upload_List_Table();
@@ -502,9 +509,7 @@ class MLASettings_Upload {
502
  // Fetch, prepare, sort, and filter our data
503
  $MLAListUploadTable->prepare_items();
504
 
505
- /*
506
- * Start with any page-level options
507
- */
508
  $options_list = '';
509
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
510
  if ( 'upload' == $value['tab'] ) {
@@ -548,8 +553,8 @@ class MLASettings_Upload {
548
  'Status' => __( 'Status', 'media-library-assistant' ),
549
  'No Change' => __( 'No Change', 'media-library-assistant' ),
550
  'Active' => __( 'Active', 'media-library-assistant' ),
551
- 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . '"</h2>' : '',
552
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
553
  'icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'mla_upload_item[icon_type]' ),
554
  'inline_icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'icon_type' ),
555
  'bulk_icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'icon_type', '.nochange.' ),
@@ -582,28 +587,33 @@ class MLASettings_Upload {
582
  * @return void echo HTML <tr> markup for updated row or error message, then die()
583
  */
584
  public static function mla_inline_edit_upload_action() {
585
- set_current_screen( $_REQUEST['screen'] );
 
 
586
 
587
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
588
 
589
  if ( empty( $_REQUEST['original_slug'] ) ) {
590
- echo __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'No upload slug found', 'media-library-assistant' );
591
  die();
592
  }
593
 
594
- $request = array( 'original_slug' => $_REQUEST['original_slug'] );
595
- $request['slug'] = $_REQUEST['slug'];
596
- $request['mime_type'] = $_REQUEST['mime_type'];
597
- $request['icon_type'] = $_REQUEST['icon_type'];
598
- $request['disabled'] = isset( $_REQUEST['disabled'] ) && ( '1' == $_REQUEST['disabled'] );
599
- $results = MLAMime::mla_update_upload_mime( $request );
600
 
 
 
601
  if ( false === strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
602
- $new_item = (object) MLAMime::mla_get_upload_mime( $_REQUEST['slug'] );
603
  } else {
604
- $new_item = (object) MLAMime::mla_get_upload_mime( $_REQUEST['original_slug'] );
605
  }
606
- $new_item->post_ID = $_REQUEST['post_ID'];
 
607
 
608
  // Create an instance of our package class and echo the new HTML
609
  $MLAListUploadTable = new MLA_Upload_List_Table();
@@ -763,8 +773,8 @@ class MLA_Upload_List_Table extends WP_List_Table {
763
  echo " left: 10px;\n";
764
  echo " }\n";
765
  echo " table.upload_types div.upload_types-info {\n";
766
- echo " margin-left: {$icon_width};\n";
767
- echo " min-height: {$icon_height};\n";
768
  echo " }\n";
769
 
770
  echo "</style>\n";
@@ -906,13 +916,13 @@ class MLA_Upload_List_Table extends WP_List_Table {
906
  }
907
 
908
  if ( isset( $_REQUEST['order'] ) ) {
909
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
910
  }
911
 
912
- if ( isset( $_REQUEST['orderby'] ) ) {
913
- if ( array_key_exists( $_REQUEST['orderby'], MLAMime::$default_sortable_upload_columns ) ) {
914
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
915
- }
916
  }
917
 
918
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
@@ -1150,17 +1160,13 @@ class MLA_Upload_List_Table extends WP_List_Table {
1150
 
1151
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1152
 
1153
- /*
1154
- * Calculate the common values once per page load
1155
- */
1156
  if ( is_null( $base_url ) ) {
1157
- /*
1158
- * Remember the view filters
1159
- */
1160
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-upload&mla_tab=upload';
1161
 
1162
  if ( isset( $_REQUEST['s'] ) ) {
1163
- $base_url = add_query_arg( array( 's' => $_REQUEST['s'] ), $base_url );
1164
  }
1165
  }
1166
 
@@ -1181,10 +1187,10 @@ class MLA_Upload_List_Table extends WP_List_Table {
1181
  */
1182
  function get_views( ) {
1183
  // Find current view
1184
- $current_view = isset( $_REQUEST['mla_upload_view'] ) ? $_REQUEST['mla_upload_view'] : 'all';
1185
 
1186
  // Generate the list of views, retaining keyword search criterion
1187
- $s = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
1188
  $upload_items = MLAMime::mla_tabulate_upload_items( $s );
1189
  $view_links = array();
1190
  foreach ( $upload_items as $slug => $item )
@@ -1269,8 +1275,8 @@ class MLA_Upload_List_Table extends WP_List_Table {
1269
  static $row_class = '';
1270
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1271
 
1272
- echo '<tr id="upload-' . $item->post_ID . '"' . $row_class . '>';
1273
- echo parent::single_row_columns( $item );
1274
  echo '</tr>';
1275
  }
1276
  } // class MLA_Upload_List_Table
@@ -1451,13 +1457,13 @@ class MLA_Upload_Optional_List_Table extends WP_List_Table {
1451
  }
1452
 
1453
  if ( isset( $_REQUEST['order'] ) ) {
1454
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
1455
  }
1456
 
1457
- if ( isset( $_REQUEST['orderby'] ) ) {
1458
- if ( array_key_exists( $_REQUEST['orderby'], MLAMime::$default_upload_optional_sortable_columns ) ) {
1459
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
1460
- }
1461
  }
1462
 
1463
  $actions['select'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Select this entry', 'media-library-assistant' ) . '">' . __( 'Select', 'media-library-assistant' ) . '</a>';
@@ -1652,8 +1658,8 @@ class MLA_Upload_Optional_List_Table extends WP_List_Table {
1652
  static $row_class = '';
1653
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1654
 
1655
- echo '<tr id="optional-upload-' . $item->ID . '"' . $row_class . '>';
1656
- echo parent::single_row_columns( $item );
1657
  echo '</tr>';
1658
  }
1659
  } // class MLA_Upload_Optional_List_Table
38
  return;
39
  }
40
 
41
+ // Initialize common script variables
 
 
42
  $script_variables = array(
43
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
44
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
143
  return MLAData::mla_parse_template( $templates['icon-type-select'], array( 'name' => $name, 'options' => $options ) );
144
  }
145
 
146
+ /**
147
+ * Validate an incoming $_REQUEST['mla_upload_item']
148
+ *
149
+ * @since 2.90
150
+ *
151
+ * @return array Sanitized upload item
152
+ */
153
+ private static function _sanitize_upload_item() {
154
+ $item = array();
155
+
156
+ if ( isset( $_REQUEST['mla_upload_item']['original_slug'] ) ) {
157
+ $item['original_slug'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_item']['original_slug'] ) );
158
+ }
159
+
160
+ $item['slug'] = isset( $_REQUEST['mla_upload_item']['slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_item']['slug'] ) ) : '';
161
+ $item['mime_type'] = isset( $_REQUEST['mla_upload_item']['mime_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_item']['mime_type'] ) ) : '';
162
+ $item['icon_type'] = isset( $_REQUEST['mla_upload_item']['icon_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_item']['icon_type'] ) ) : '.none.';
163
+ $item['disabled'] = isset( $_REQUEST['mla_upload_item']['disabled'] );
164
+
165
+ if ( isset( $_REQUEST['mla_upload_item']['description'] ) ) {
166
+ $item['description'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_item']['description'] ) );
167
+ }
168
+
169
+ //error_log( __LINE__ . ' _sanitize_upload_item item = ' . var_export( $item, true ), 0 );
170
+ return $item;
171
+ }
172
+
173
  /**
174
  * Compose the Edit Upload type tab content for the Settings subpage
175
  *
228
  * @return array 'message' => status/error messages, 'body' => tab content
229
  */
230
  private static function _compose_optional_upload_tab( $page_template_array ) {
231
+ // Display the Optional Upload MIME Types Table
 
 
232
  $_SERVER['REQUEST_URI'] = add_query_arg( array( 'mla-optional-uploads-display' => 'true' ), remove_query_arg( array(
233
  'mla_admin_action',
234
  'mla_item_slug',
238
  'action',
239
  'action2',
240
  'cb_attachment',
241
+ 'mla-optional-uploads-search',
242
+ ), $_SERVER['REQUEST_URI'] ) ); // phpcs:ignore
243
 
244
+ // Suppress display of the hidden columns selection list
 
 
245
  echo " <style type='text/css'>\r\n";
246
  echo " form#adv-settings div.metabox-prefs,\r\n";
247
  echo " form#adv-settings fieldset.metabox-prefs {\r\n";
264
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-upload&mla_tab=upload',
265
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
266
  'Known File Extension' => __( 'Known File Extension/MIME Type Associations', 'media-library-assistant' ),
267
+ 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) . '"</h2>' : '',
268
  'Search Known MIME' => __( 'Search Known MIME Types', 'media-library-assistant' ),
269
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
270
  'Search Types' => __( 'Search Types', 'media-library-assistant' ),
271
  'To search by' => __( 'To search by extension, use ".", e.g., ".doc"', 'media-library-assistant' ),
272
  'Cancel' => __( 'Cancel', 'media-library-assistant' ),
333
  unset( $_REQUEST['s'] );
334
  }
335
 
336
+ // Set default values, check for Add New Upload MIME Type button
 
 
 
 
 
 
 
 
 
337
  $add_form_values = array (
338
  'slug' => '',
339
  'mime_type' => '',
340
  'icon_type' => '.none.',
341
+ 'disabled' => true,
342
  'description' => ''
343
  );
344
 
361
  $page_content = self::_compose_optional_upload_tab( $page_template_array );
362
  } elseif ( !empty( $_REQUEST['mla-add-upload-submit'] ) ) {
363
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
364
+ $page_content = MLAMime::mla_add_upload_mime( self::_sanitize_upload_item() );
365
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
366
+ $add_form_values = self::_sanitize_upload_item();
367
  $add_form_values['disabled'] = $add_form_values['disabled'] ? 'checked="checked"' : '';
368
  }
369
  } else {
376
  // Process bulk actions that affect an array of items
377
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
378
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
379
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
380
  if ( 'select' == $bulk_action ) {
381
+ foreach ( $post_ids as $ID ) {
382
  $item_content = self::_process_optional_upload_mime( $ID );
383
  $page_content['message'] .= $item_content['message'] . '<br>';
384
  }
385
  } else {
386
  // Convert post-ID to slug; separate loop required because delete changes post_IDs
387
  $slugs = array();
388
+ foreach ( $post_ids as $post_ID ) {
389
  $slugs[] = MLAMime::mla_get_upload_mime_slug( $post_ID );
390
+ }
391
 
392
  foreach ( $slugs as $slug ) {
393
  switch ( $bulk_action ) {
396
  break;
397
  case 'edit':
398
  $request = array( 'slug' => $slug );
399
+ if ( isset( $_REQUEST['disabled'] ) && '-1' != $_REQUEST['disabled'] ) {
400
  $request['disabled'] = '1' == $_REQUEST['disabled'];
401
  }
402
+ if ( isset( $_REQUEST['icon_type'] ) && '.none.' != $_REQUEST['icon_type'] ) {
403
+ $request['icon_type'] = sanitize_text_field( wp_unslash( $_REQUEST['icon_type'] ) );
404
  }
405
  $item_content = MLAMime::mla_update_upload_mime( $request );
406
  break;
422
  }
423
  } // $bulk_action
424
 
425
+ // Process row-level actions that affect a single item
 
 
426
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
427
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
428
+ $mla_item_slug = isset( $_REQUEST['mla_item_slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_item_slug'] ) ) : '';
429
  switch ( $_REQUEST['mla_admin_action'] ) {
430
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
431
+ $page_content = MLAMime::mla_delete_upload_mime( $mla_item_slug );
432
  break;
433
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
434
+ $view = MLAMime::mla_get_upload_mime( $mla_item_slug );
435
  $page_content = self::_compose_edit_upload_tab( $view, $page_template_array );
436
  break;
437
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
438
+ $mla_upload_item = self::_sanitize_upload_item();
439
  if ( !empty( $_REQUEST['update'] ) ) {
440
+ $page_content = MLAMime::mla_update_upload_mime( $mla_upload_item );
441
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
442
  $message = $page_content['message'];
443
+ $page_content = self::_compose_edit_upload_tab( $mla_upload_item, $page_template_array );
444
  $page_content['message'] = $message;
445
  }
446
  } elseif ( !empty( $_REQUEST['mla_item_ID'] ) ) {
447
+ $page_content = self::_process_optional_upload_mime( absint( $_REQUEST['mla_item_ID'] ) );
448
  } else {
449
  $page_content = array(
450
  /* translators: 1: view name/slug */
451
+ 'message' => sprintf( __( 'Edit view "%1$s" cancelled.', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $mla_upload_item['original_slug'] ) ) ),
452
  'body' => ''
453
  );
454
  }
456
  default:
457
  $page_content = array(
458
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
459
+ 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ) ),
460
  'body' => ''
461
  );
462
  break;
467
  return $page_content;
468
  }
469
 
470
+ // Check for disabled status
 
 
471
  if ( 'checked' != MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_UPLOAD_MIMES ) ) {
472
+ // Fill in with any page-level options
 
 
473
  $options_list = '';
474
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
475
  if ( MLACoreOptions::MLA_ENABLE_UPLOAD_MIMES == $key ) {
490
  return $page_content;
491
  }
492
 
493
+ // Display the Upload MIME Types Table
 
 
494
  $_SERVER['REQUEST_URI'] = remove_query_arg( array(
495
  'mla_admin_action',
496
  'mla_item_slug',
501
  'action2',
502
  'cb_mla_item_ID',
503
  'mla-optional-uploads-search',
504
+ ), $_SERVER['REQUEST_URI'] ); // phpcs:ignore
505
 
506
  // Create an instance of our package class
507
  $MLAListUploadTable = new MLA_Upload_List_Table();
509
  // Fetch, prepare, sort, and filter our data
510
  $MLAListUploadTable->prepare_items();
511
 
512
+ // Start with any page-level options
 
 
513
  $options_list = '';
514
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
515
  if ( 'upload' == $value['tab'] ) {
553
  'Status' => __( 'Status', 'media-library-assistant' ),
554
  'No Change' => __( 'No Change', 'media-library-assistant' ),
555
  'Active' => __( 'Active', 'media-library-assistant' ),
556
+ 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( stripslashes( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) ) . '"</h2>' : '',
557
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
558
  'icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'mla_upload_item[icon_type]' ),
559
  'inline_icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'icon_type' ),
560
  'bulk_icon_types' => self::_get_icon_type_dropdown( $page_template_array, 'icon_type', '.nochange.' ),
587
  * @return void echo HTML <tr> markup for updated row or error message, then die()
588
  */
589
  public static function mla_inline_edit_upload_action() {
590
+ if ( isset( $_REQUEST['screen'] ) ) {
591
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
592
+ }
593
 
594
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
595
 
596
  if ( empty( $_REQUEST['original_slug'] ) ) {
597
+ echo esc_html__( 'ERROR', 'media-library-assistant' ) . ': ' . esc_html__( 'No upload slug found', 'media-library-assistant' );
598
  die();
599
  }
600
 
601
+ $request = array();
602
+ $request['original_slug'] = isset( $_REQUEST['original_slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['original_slug'] ) ) : '';
603
+ $request['slug'] = isset( $_REQUEST['slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['slug'] ) ) : '';
604
+ $request['mime_type'] = isset( $_REQUEST['mime_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mime_type'] ) ) : '';
605
+ $request['icon_type'] = isset( $_REQUEST['icon_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['icon_type'] ) ) : '.none.';
606
+ $request['disabled'] = isset( $_REQUEST['disabled'] );
607
 
608
+ $results = MLAMime::mla_update_upload_mime( $request );
609
+
610
  if ( false === strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
611
+ $new_item = (object) MLAMime::mla_get_upload_mime( $request['slug'] );
612
  } else {
613
+ $new_item = (object) MLAMime::mla_get_upload_mime( $request['original_slug'] );
614
  }
615
+
616
+ $new_item->post_ID = isset( $_REQUEST['post_ID'] ) ?absint( $_REQUEST['post_ID'] ) : 0;
617
 
618
  // Create an instance of our package class and echo the new HTML
619
  $MLAListUploadTable = new MLA_Upload_List_Table();
773
  echo " left: 10px;\n";
774
  echo " }\n";
775
  echo " table.upload_types div.upload_types-info {\n";
776
+ echo " margin-left: " . esc_html( $icon_width ) . ";\n";
777
+ echo " min-height: " . esc_html( $icon_height ) . ";\n";
778
  echo " }\n";
779
 
780
  echo "</style>\n";
916
  }
917
 
918
  if ( isset( $_REQUEST['order'] ) ) {
919
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
920
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
921
  }
922
 
923
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
924
+ if ( array_key_exists( $field, MLAMime::$default_sortable_upload_columns ) ) {
925
+ $view_args['orderby'] = urlencode( $field );
 
926
  }
927
 
928
  $actions['edit'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Edit this item', 'media-library-assistant' ) . '">' . __( 'Edit', 'media-library-assistant' ) . '</a>';
1160
 
1161
  $class = ( $view_slug == $current_view ) ? ' class="current"' : '';
1162
 
1163
+ // Calculate the common values once per page load
 
 
1164
  if ( is_null( $base_url ) ) {
1165
+ // Remember the view filters
 
 
1166
  $base_url = 'options-general.php?page=' . MLACoreOptions::MLA_SETTINGS_SLUG . '-upload&mla_tab=upload';
1167
 
1168
  if ( isset( $_REQUEST['s'] ) ) {
1169
+ $base_url = add_query_arg( array( 's' => wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ), $base_url );
1170
  }
1171
  }
1172
 
1187
  */
1188
  function get_views( ) {
1189
  // Find current view
1190
+ $current_view = isset( $_REQUEST['mla_upload_view'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_upload_view'] ) ) : 'all';
1191
 
1192
  // Generate the list of views, retaining keyword search criterion
1193
+ $s = wp_kses( isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '', 'post' );
1194
  $upload_items = MLAMime::mla_tabulate_upload_items( $s );
1195
  $view_links = array();
1196
  foreach ( $upload_items as $slug => $item )
1275
  static $row_class = '';
1276
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1277
 
1278
+ echo '<tr id="upload-' . $item->post_ID . '"' . $row_class . '>'; // phpcs:ignore
1279
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1280
  echo '</tr>';
1281
  }
1282
  } // class MLA_Upload_List_Table
1457
  }
1458
 
1459
  if ( isset( $_REQUEST['order'] ) ) {
1460
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
1461
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
1462
  }
1463
 
1464
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
1465
+ if ( array_key_exists( $field, MLAMime::$default_upload_optional_sortable_columns ) ) {
1466
+ $view_args['orderby'] = urlencode( $field );
 
1467
  }
1468
 
1469
  $actions['select'] = '<a href="' . add_query_arg( $view_args, MLACore::mla_nonce_url( '?mla_admin_action=' . MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE, MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ) . '" title="' . __( 'Select this entry', 'media-library-assistant' ) . '">' . __( 'Select', 'media-library-assistant' ) . '</a>';
1658
  static $row_class = '';
1659
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
1660
 
1661
+ echo '<tr id="optional-upload-' . $item->ID . '"' . $row_class . '>'; // phpcs:ignore
1662
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1663
  echo '</tr>';
1664
  }
1665
  } // class MLA_Upload_Optional_List_Table
includes/class-mla-settings-view-tab.php CHANGED
@@ -38,9 +38,7 @@ class MLASettings_View {
38
  return;
39
  }
40
 
41
- /*
42
- * Initialize common script variables
43
- */
44
  $script_variables = array(
45
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
46
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
@@ -91,9 +89,7 @@ class MLASettings_View {
91
  'body' => ''
92
  );
93
 
94
- /*
95
- * Uncomment this for debugging.
96
- */
97
  // $page_content['message'] .= $message_list;
98
 
99
  return $page_content;
@@ -152,6 +148,35 @@ class MLASettings_View {
152
  );
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  /**
156
  * Compose the Post MIME Type Views tab content for the Settings subpage
157
  *
@@ -167,17 +192,7 @@ class MLASettings_View {
167
  return '';
168
  }
169
 
170
- /*
171
- * Convert checkbox values, if present
172
- */
173
- if ( isset( $_REQUEST['mla_view_item'] ) ) {
174
- $_REQUEST['mla_view_item']['post_mime_type'] = isset( $_REQUEST['mla_view_item']['post_mime_type'] );
175
- $_REQUEST['mla_view_item']['table_view'] = isset( $_REQUEST['mla_view_item']['table_view'] );
176
- }
177
-
178
- /*
179
- * Set default values, check for Add New Post MIME Type View button
180
- */
181
  $add_form_values = array (
182
  'slug' => '',
183
  'singular' => '',
@@ -194,9 +209,9 @@ class MLASettings_View {
194
  $page_content = self::_save_view_settings( );
195
  } elseif ( !empty( $_REQUEST['mla-add-view-submit'] ) ) {
196
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
197
- $page_content = MLAMime::mla_add_post_mime_type( $_REQUEST['mla_view_item'] );
198
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
199
- $add_form_values = $_REQUEST['mla_view_item'];
200
  $add_form_values['post_mime_type'] = $add_form_values['post_mime_type'] ? 'checked="checked"' : '';
201
  $add_form_values['table_view'] = $add_form_values['table_view'] ? 'checked="checked"' : '';
202
  }
@@ -207,18 +222,16 @@ class MLASettings_View {
207
  );
208
  }
209
 
210
- /*
211
- * Process bulk actions that affect an array of items
212
- */
213
  $bulk_action = MLASettings::mla_current_bulk_action();
214
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
215
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
216
- /*
217
- * Convert post-ID to slug; separate loop required because delete changes post_IDs
218
- */
219
  $slugs = array();
220
- foreach ( $_REQUEST['cb_mla_item_ID'] as $post_ID )
 
221
  $slugs[] = MLAMime::mla_get_post_mime_type_slug( $post_ID );
 
222
 
223
  foreach ( $slugs as $slug ) {
224
  switch ( $bulk_action ) {
@@ -227,14 +240,14 @@ class MLASettings_View {
227
  break;
228
  case 'edit':
229
  $request = array( 'slug' => $slug );
230
- if ( '-1' != $_REQUEST['post_mime_type'] ) {
231
- $request['post_mime_type'] = '1' == $_REQUEST['post_mime_type'];
232
  }
233
- if ( '-1' != $_REQUEST['table_view'] ) {
234
- $request['table_view'] = '1' == $_REQUEST['table_view'];
235
  }
236
  if ( !empty( $_REQUEST['menu_order'] ) ) {
237
- $request['menu_order'] = $_REQUEST['menu_order'];
238
  }
239
  $item_content = MLAMime::mla_update_post_mime_type( $request );
240
  break;
@@ -255,32 +268,32 @@ class MLASettings_View {
255
  }
256
  } // $bulk_action
257
 
258
- /*
259
- * Process row-level actions that affect a single item
260
- */
261
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
262
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
 
263
 
264
  switch ( $_REQUEST['mla_admin_action'] ) {
265
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
266
- $page_content = MLAMime::mla_delete_post_mime_type( $_REQUEST['mla_item_slug'] );
267
  break;
268
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
269
- $view = MLAMime::mla_get_post_mime_type( $_REQUEST['mla_item_slug'] );
270
  $page_content = self::_compose_edit_view_tab( $view, $page_template_array['single-item-edit'] );
271
  break;
272
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
 
273
  if ( !empty( $_REQUEST['update'] ) ) {
274
- $page_content = MLAMime::mla_update_post_mime_type( $_REQUEST['mla_view_item'] );
275
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
276
  $message = $page_content['message'];
277
- $page_content = self::_compose_edit_view_tab( $_REQUEST['mla_view_item'], $page_template_array['single-item-edit'] );
278
  $page_content['message'] = $message;
279
  }
280
  } else {
281
  $page_content = array(
282
  /* translators: 1: view name/slug */
283
- 'message' => sprintf( __( 'Edit view "%1$s" cancelled.', 'media-library-assistant' ), $_REQUEST['mla_view_item']['original_slug'] ),
284
  'body' => ''
285
  );
286
  }
@@ -288,7 +301,7 @@ class MLASettings_View {
288
  default:
289
  $page_content = array(
290
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
291
- 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), $_REQUEST['mla_admin_action'] ),
292
  'body' => ''
293
  );
294
  break;
@@ -299,13 +312,9 @@ class MLASettings_View {
299
  return $page_content;
300
  }
301
 
302
- /*
303
- * Check for disabled status
304
- */
305
  if ( 'checked' != MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_POST_MIME_TYPES ) ) {
306
- /*
307
- * Fill in with any page-level options
308
- */
309
  $options_list = '';
310
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
311
  if ( MLACoreOptions::MLA_ENABLE_POST_MIME_TYPES == $key ) {
@@ -325,9 +334,7 @@ class MLASettings_View {
325
  return $page_content;
326
  }
327
 
328
- /*
329
- * Display the View Table
330
- */
331
  $_SERVER['REQUEST_URI'] = remove_query_arg( array(
332
  'mla_admin_action',
333
  'mla_item_slug',
@@ -337,9 +344,7 @@ class MLASettings_View {
337
  'action',
338
  'action2',
339
  'cb_mla_item_ID',
340
- 'mla-optional-uploads-search',
341
- 'mla-optional-uploads-display'
342
- ), $_SERVER['REQUEST_URI'] );
343
 
344
  // Create an instance of our package class
345
  $MLAListViewTable = new MLA_View_List_Table();
@@ -347,9 +352,7 @@ class MLASettings_View {
347
  // Fetch, prepare, sort, and filter our data
348
  $MLAListViewTable->prepare_items();
349
 
350
- /*
351
- * Start with any page-level options
352
- */
353
  $options_list = '';
354
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
355
  if ( 'view' == $value['tab'] ) {
@@ -365,9 +368,9 @@ class MLASettings_View {
365
  'settingsURL' => admin_url('options-general.php'),
366
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-view&mla_tab=view',
367
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
368
- 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( stripslashes( trim( $_REQUEST['s'] ) ) ) . '"</h2>' : '',
369
  'Search Views' => __( 'Search Views', 'media-library-assistant' ),
370
- 's' => isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) ) : '',
371
  'options_list' => $options_list,
372
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
373
  /* translators: %s: add new View */
@@ -425,32 +428,35 @@ class MLASettings_View {
425
  * @return void echo HTML <tr> markup for updated row or error message, then die()
426
  */
427
  public static function mla_inline_edit_view_action() {
428
- set_current_screen( $_REQUEST['screen'] );
 
 
429
 
430
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
431
 
432
  if ( empty( $_REQUEST['original_slug'] ) ) {
433
- echo __( 'ERROR', 'media-library-assistant' ) . ': ' . __( 'No view slug found', 'media-library-assistant' );
434
  die();
435
  }
436
 
437
- $request = array( 'original_slug' => $_REQUEST['original_slug'] );
438
- $request['slug'] = $_REQUEST['slug'];
439
- $request['specification'] = $_REQUEST['specification'];
440
- $request['singular'] = $_REQUEST['singular'];
441
- $request['plural'] = $_REQUEST['plural'];
442
- $request['post_mime_type'] = isset( $_REQUEST['post_mime_type'] ) && ( '1' == $_REQUEST['post_mime_type'] );
443
- $request['table_view'] = isset( $_REQUEST['table_view'] ) && ( '1' == $_REQUEST['table_view'] );
444
- $request['menu_order'] = $_REQUEST['menu_order'];
 
445
  $results = MLAMime::mla_update_post_mime_type( $request );
446
 
447
  if ( false === strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
448
- $new_item = (object) MLAMime::mla_get_post_mime_type( $_REQUEST['slug'] );
449
  } else {
450
- $new_item = (object) MLAMime::mla_get_post_mime_type( $_REQUEST['original_slug'] );
451
  }
452
 
453
- $new_item->post_ID = $_REQUEST['post_ID'];
454
 
455
  // Create an instance of our package class and echo the new HTML
456
  $MLAListViewTable = new MLA_View_List_Table();
@@ -694,13 +700,13 @@ class MLA_View_List_Table extends WP_List_Table {
694
  }
695
 
696
  if ( isset( $_REQUEST['order'] ) ) {
697
- $view_args['order'] = ( 'desc' === strtolower( $_REQUEST['order'] ) ) ? 'desc' : 'asc';
 
698
  }
699
 
700
- if ( isset( $_REQUEST['orderby'] ) ) {
701
- if ( array_key_exists( $_REQUEST['orderby'], MLAMime::$default_sortable_view_columns ) ) {
702
- $view_args['orderby'] = urlencode( $_REQUEST['orderby'] );
703
- }
704
  }
705
 
706
  // Get the standard and custom types
@@ -989,8 +995,8 @@ class MLA_View_List_Table extends WP_List_Table {
989
  static $row_class = '';
990
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
991
 
992
- echo '<tr id="view-' . $item->post_ID . '"' . $row_class . '>';
993
- echo parent::single_row_columns( $item );
994
  echo '</tr>';
995
  }
996
  } // class MLA_View_List_Table
38
  return;
39
  }
40
 
41
+ // Initialize common script variables
 
 
42
  $script_variables = array(
43
  'error' => __( 'Error while making the changes.', 'media-library-assistant' ),
44
  'ntdeltitle' => __( 'Remove From Bulk Edit', 'media-library-assistant' ),
89
  'body' => ''
90
  );
91
 
92
+ // Uncomment this for debugging.
 
 
93
  // $page_content['message'] .= $message_list;
94
 
95
  return $page_content;
148
  );
149
  }
150
 
151
+ /**
152
+ * Validate an incoming $_REQUEST['mla_view_item']
153
+ *
154
+ * @since 2.90
155
+ *
156
+ * @return array Sanitized view item
157
+ */
158
+ private static function _sanitize_view_item() {
159
+ $item = array();
160
+
161
+ if ( isset( $_REQUEST['mla_view_item']['original_slug'] ) ) {
162
+ $item['original_slug'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['original_slug'] ) );
163
+ }
164
+
165
+ $item['slug'] = isset( $_REQUEST['mla_view_item']['slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['slug'] ) ) : '';
166
+ $item['singular'] = isset( $_REQUEST['mla_view_item']['singular'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['singular'] ) ) : '';
167
+ $item['plural'] = isset( $_REQUEST['mla_view_item']['plural'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['plural'] ) ) : '';
168
+ $item['specification'] = isset( $_REQUEST['mla_view_item']['specification'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['specification'] ) ) : '';
169
+ $item['post_mime_type'] = isset( $_REQUEST['mla_view_item']['post_mime_type'] );
170
+ $item['table_view'] = isset( $_REQUEST['mla_view_item']['table_view'] );
171
+ $item['menu_order'] = isset( $_REQUEST['mla_view_item']['menu_order'] ) ? absint( $_REQUEST['mla_view_item']['menu_order'] ) : 0;
172
+
173
+ if ( isset( $_REQUEST['mla_view_item']['description'] ) ) {
174
+ $item['description'] = sanitize_text_field( wp_unslash( $_REQUEST['mla_view_item']['description'] ) );
175
+ }
176
+
177
+ return $item;
178
+ }
179
+
180
  /**
181
  * Compose the Post MIME Type Views tab content for the Settings subpage
182
  *
192
  return '';
193
  }
194
 
195
+ // Set default values, check for Add New Post MIME Type View button
 
 
 
 
 
 
 
 
 
 
196
  $add_form_values = array (
197
  'slug' => '',
198
  'singular' => '',
209
  $page_content = self::_save_view_settings( );
210
  } elseif ( !empty( $_REQUEST['mla-add-view-submit'] ) ) {
211
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
212
+ $page_content = MLAMime::mla_add_post_mime_type( self::_sanitize_view_item() );
213
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
214
+ $add_form_values = self::_sanitize_view_item();
215
  $add_form_values['post_mime_type'] = $add_form_values['post_mime_type'] ? 'checked="checked"' : '';
216
  $add_form_values['table_view'] = $add_form_values['table_view'] ? 'checked="checked"' : '';
217
  }
222
  );
223
  }
224
 
225
+ // Process bulk actions that affect an array of items
 
 
226
  $bulk_action = MLASettings::mla_current_bulk_action();
227
  if ( $bulk_action && ( $bulk_action != 'none' ) ) {
228
  if ( isset( $_REQUEST['cb_mla_item_ID'] ) ) {
229
+ // Convert post-ID to slug; separate loop required because delete changes post_IDs
 
 
230
  $slugs = array();
231
+ $post_ids = !empty( $_REQUEST['cb_mla_item_ID'] ) ? array_map( 'absint', stripslashes_deep( $_REQUEST['cb_mla_item_ID'] ) ) : array();
232
+ foreach ( $post_ids as $post_ID ) {
233
  $slugs[] = MLAMime::mla_get_post_mime_type_slug( $post_ID );
234
+ }
235
 
236
  foreach ( $slugs as $slug ) {
237
  switch ( $bulk_action ) {
240
  break;
241
  case 'edit':
242
  $request = array( 'slug' => $slug );
243
+ if ( isset( $_REQUEST['post_mime_type'] ) && '-1' !== $_REQUEST['post_mime_type'] ) {
244
+ $request['post_mime_type'] = '1' === $_REQUEST['post_mime_type'];
245
  }
246
+ if ( isset( $_REQUEST['table_view'] ) && '-1' !== $_REQUEST['table_view'] ) {
247
+ $request['table_view'] = '1' === $_REQUEST['table_view'];
248
  }
249
  if ( !empty( $_REQUEST['menu_order'] ) ) {
250
+ $request['menu_order'] = absint( $_REQUEST['menu_order'] );
251
  }
252
  $item_content = MLAMime::mla_update_post_mime_type( $request );
253
  break;
268
  }
269
  } // $bulk_action
270
 
271
+ // Process row-level actions that affect a single item
 
 
272
  if ( !empty( $_REQUEST['mla_admin_action'] ) ) {
273
  check_admin_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
274
+ $mla_item_slug = isset( $_REQUEST['mla_item_slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_item_slug'] ) ) : '';
275
 
276
  switch ( $_REQUEST['mla_admin_action'] ) {
277
  case MLACore::MLA_ADMIN_SINGLE_DELETE:
278
+ $page_content = MLAMime::mla_delete_post_mime_type( $mla_item_slug );
279
  break;
280
  case MLACore::MLA_ADMIN_SINGLE_EDIT_DISPLAY:
281
+ $view = MLAMime::mla_get_post_mime_type( $mla_item_slug );
282
  $page_content = self::_compose_edit_view_tab( $view, $page_template_array['single-item-edit'] );
283
  break;
284
  case MLACore::MLA_ADMIN_SINGLE_EDIT_UPDATE:
285
+ $mla_view_item = self::_sanitize_view_item();
286
  if ( !empty( $_REQUEST['update'] ) ) {
287
+ $page_content = MLAMime::mla_update_post_mime_type( $mla_view_item );
288
  if ( false !== strpos( $page_content['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
289
  $message = $page_content['message'];
290
+ $page_content = self::_compose_edit_view_tab( $mla_view_item, $page_template_array['single-item-edit'] );
291
  $page_content['message'] = $message;
292
  }
293
  } else {
294
  $page_content = array(
295
  /* translators: 1: view name/slug */
296
+ 'message' => sprintf( __( 'Edit view "%1$s" cancelled.', 'media-library-assistant' ), $mla_view_item['mla_view_item']['original_slug'] ),
297
  'body' => ''
298
  );
299
  }
301
  default:
302
  $page_content = array(
303
  /* translators: 1: bulk_action, e.g., single_item_delete, single_item_edit */
304
+ 'message' => sprintf( __( 'Unknown mla_admin_action - "%1$s"', 'media-library-assistant' ), sanitize_text_field( wp_unslash( $_REQUEST['mla_admin_action'] ) ) ),
305
  'body' => ''
306
  );
307
  break;
312
  return $page_content;
313
  }
314
 
315
+ // Check for disabled status
 
 
316
  if ( 'checked' != MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_POST_MIME_TYPES ) ) {
317
+ // Fill in with any page-level options
 
 
318
  $options_list = '';
319
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
320
  if ( MLACoreOptions::MLA_ENABLE_POST_MIME_TYPES == $key ) {
334
  return $page_content;
335
  }
336
 
337
+ // Display the View Table
 
 
338
  $_SERVER['REQUEST_URI'] = remove_query_arg( array(
339
  'mla_admin_action',
340
  'mla_item_slug',
344
  'action',
345
  'action2',
346
  'cb_mla_item_ID',
347
+ ), $_SERVER['REQUEST_URI'] ); // phpcs:ignore
 
 
348
 
349
  // Create an instance of our package class
350
  $MLAListViewTable = new MLA_View_List_Table();
352
  // Fetch, prepare, sort, and filter our data
353
  $MLAListViewTable->prepare_items();
354
 
355
+ // Start with any page-level options
 
 
356
  $options_list = '';
357
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
358
  if ( 'view' == $value['tab'] ) {
368
  'settingsURL' => admin_url('options-general.php'),
369
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-view&mla_tab=view',
370
  '_wpnonce' => wp_nonce_field( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false ),
371
+ 'results' => ! empty( $_REQUEST['s'] ) ? '<h2 class="alignleft">' . __( 'Displaying search results for', 'media-library-assistant' ) . ': "' . esc_html( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) . '"</h2>' : '',
372
  'Search Views' => __( 'Search Views', 'media-library-assistant' ),
373
+ 's' => isset( $_REQUEST['s'] ) ? esc_attr( trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) ) ) : '',
374
  'options_list' => $options_list,
375
  'Save Changes' => __( 'Save Changes', 'media-library-assistant' ),
376
  /* translators: %s: add new View */
428
  * @return void echo HTML <tr> markup for updated row or error message, then die()
429
  */
430
  public static function mla_inline_edit_view_action() {
431
+ if ( isset( $_REQUEST['screen'] ) ) {
432
+ set_current_screen( sanitize_text_field( wp_unslash( $_REQUEST['screen'] ) ) );
433
+ }
434
 
435
  check_ajax_referer( MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME );
436
 
437
  if ( empty( $_REQUEST['original_slug'] ) ) {
438
+ echo esc_html__( 'ERROR', 'media-library-assistant' ) . ': ' . esc_html__( 'No view slug found', 'media-library-assistant' );
439
  die();
440
  }
441
 
442
+ $request = array();
443
+ $request['original_slug'] = isset( $_REQUEST['original_slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['original_slug'] ) ) : '';
444
+ $request['slug'] = isset( $_REQUEST['slug'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['slug'] ) ) : '';
445
+ $request['specification'] = isset( $_REQUEST['specification'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['specification'] ) ) : '';
446
+ $request['singular'] = isset( $_REQUEST['singular'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['singular'] ) ) : '';
447
+ $request['plural'] = isset( $_REQUEST['plural'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plural'] ) ) : '';
448
+ $request['post_mime_type'] = isset( $_REQUEST['post_mime_type'] );
449
+ $request['table_view'] = isset( $_REQUEST['table_view'] );
450
+ $request['menu_order'] = isset( $_REQUEST['menu_order'] ) ? absint( $_REQUEST['menu_order'] ) : 0;
451
  $results = MLAMime::mla_update_post_mime_type( $request );
452
 
453
  if ( false === strpos( $results['message'], __( 'ERROR', 'media-library-assistant' ) ) ) {
454
+ $new_item = (object) MLAMime::mla_get_post_mime_type( $request['slug'] );
455
  } else {
456
+ $new_item = (object) MLAMime::mla_get_post_mime_type( $request['original_slug'] );
457
  }
458
 
459
+ $new_item->post_ID = isset( $_REQUEST['post_ID'] ) ? absint( $_REQUEST['post_ID'] ) : 0;
460
 
461
  // Create an instance of our package class and echo the new HTML
462
  $MLAListViewTable = new MLA_View_List_Table();
700
  }
701
 
702
  if ( isset( $_REQUEST['order'] ) ) {
703
+ $field = strtoupper( sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) );
704
+ $view_args['order'] = 'DESC' === $field ? 'DESC' : 'ASC';
705
  }
706
 
707
+ $field = strtolower( sanitize_text_field( isset( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : '' ) );
708
+ if ( array_key_exists( $field, MLAMime::$default_sortable_view_columns ) ) {
709
+ $view_args['orderby'] = urlencode( $field );
 
710
  }
711
 
712
  // Get the standard and custom types
995
  static $row_class = '';
996
  $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
997
 
998
+ echo '<tr id="view-' . $item->post_ID . '"' . $row_class . '>'; // phpcs:ignore
999
+ echo parent::single_row_columns( $item ); // phpcs:ignore
1000
  echo '</tr>';
1001
  }
1002
  } // class MLA_View_List_Table
includes/class-mla-settings.php CHANGED
@@ -121,35 +121,38 @@ class MLASettings {
121
  require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-iptc-exif-tab.php' );
122
  break;
123
  }
124
- } elseif ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) && ( 'mla-settings-menu-' == substr( $_REQUEST['page'], 0, 18 ) ) ) {
125
- // Settings/Media Library Assistant current tab
126
- switch( substr( $_REQUEST['page'], 18 ) ) {
127
- case 'view':
128
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-view-tab.php' );
129
- add_filter( 'set_screen_option_mla_views_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
130
- break;
131
- case 'upload':
132
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-upload-tab.php' );
133
- add_filter( 'set_screen_option_mla_uploads_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
134
- add_filter( 'set_screen_option_mla_types_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
135
- break;
136
- case 'shortcodes':
137
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-shortcodes-tab.php' );
138
- add_filter( 'set_screen_option_mla_shortcode_templates_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
139
- break;
140
- case 'custom_field':
141
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-custom-fields-tab.php' );
142
- add_filter( 'set_screen_option_mla_custom_field_rules_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
143
- break;
144
- case 'iptc_exif':
145
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-iptc-exif-tab.php' );
146
- add_filter( 'set_screen_option_mla_iptc_exif_rules_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
147
- break;
148
- case 'documentation':
149
- require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-documentation-tab.php' );
150
- add_filter( 'set_screen_option_mla_example_plugins_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
151
- break;
152
- }
 
 
 
153
  }
154
  }
155
 
@@ -192,9 +195,7 @@ class MLASettings {
192
  } // version is less than .30
193
 
194
  if ( version_compare( '1.13', $current_version, '>' ) ) {
195
- /*
196
- * Add quick_edit and bulk_edit values to custom field mapping rules
197
- */
198
  $new_values = array();
199
 
200
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
@@ -207,9 +208,7 @@ class MLASettings {
207
  } // version is less than 1.13
208
 
209
  if ( version_compare( '1.30', $current_version, '>' ) ) {
210
- /*
211
- * Add metadata values to custom field mapping rules
212
- */
213
  $new_values = array();
214
 
215
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
@@ -223,9 +222,7 @@ class MLASettings {
223
  } // version is less than 1.30
224
 
225
  if ( version_compare( '1.40', $current_version, '>' ) ) {
226
- /*
227
- * Add metadata values to custom field mapping rules
228
- */
229
  $new_values = array();
230
 
231
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
@@ -249,9 +246,7 @@ class MLASettings {
249
  } // version is less than 1.40
250
 
251
  if ( version_compare( '1.60', $current_version, '>' ) ) {
252
- /*
253
- * Add delimiters values to taxonomy mapping rules
254
- */
255
  $option_value = MLACore::mla_get_option( 'iptc_exif_mapping' );
256
  $new_values = array();
257
 
@@ -265,16 +260,12 @@ class MLASettings {
265
  } // version is less than 1.60
266
 
267
  if ( version_compare( '1.72', $current_version, '>' ) ) {
268
- /*
269
- * Strip default descriptions from the options table
270
- */
271
  MLAMime::mla_update_upload_mime();
272
  } // version is less than 1.72
273
 
274
  if ( version_compare( '2.13', $current_version, '>' ) ) {
275
- /*
276
- * Add format, option and no_null to IPTC/EXIF custom mapping rules
277
- */
278
  $option_value = MLACore::mla_get_option( 'iptc_exif_mapping' );
279
 
280
  if ( !empty( $option_value['custom'] ) ) {
@@ -303,9 +294,7 @@ class MLASettings {
303
  * @return void
304
  */
305
  public static function mla_activation_hook( ) {
306
- /*
307
- * Disable the uninstall file while the plugin is active
308
- */
309
  if ( file_exists( MLA_PLUGIN_PATH . 'uninstall.php' ) ) {
310
  @rename ( MLA_PLUGIN_PATH . 'uninstall.php' , MLA_PLUGIN_PATH . 'mla-uninstall.php' );
311
  }
@@ -395,9 +384,7 @@ class MLASettings {
395
  public static function mla_admin_enqueue_scripts_action( $page_hook ) {
396
  global $wpdb, $wp_locale;
397
 
398
- /*
399
- * Without a tab value, there's nothing to do
400
- */
401
  if ( ( self::$current_page_hook != $page_hook ) || empty( $_REQUEST['mla_tab'] ) ) {
402
  return;
403
  }
@@ -426,11 +413,14 @@ class MLASettings {
426
  * Use the URL suffix, if present. If the URL doesn't have a tab suffix, use '-general'.
427
  * This hack is required to pass the WordPress "referer" validation.
428
  */
429
- if ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) && ( 'mla-settings-menu-' == substr( $_REQUEST['page'], 0, 18 ) ) ) {
430
- $tab = substr( $_REQUEST['page'], 18 );
431
- } else {
432
- $tab = 'general';
433
- }
 
 
 
434
 
435
  $tab = self::_get_options_tablist( $tab ) ? '-' . $tab : '-general';
436
  self::$current_page_hook = add_submenu_page( 'options-general.php', __( 'Media Library Assistant', 'media-library-assistant' ) . ' ' . __( 'Settings', 'media-library-assistant' ), __( 'Media Library Assistant', 'media-library-assistant' ), 'manage_options', MLACoreOptions::MLA_SETTINGS_SLUG . $tab, 'MLASettings::mla_render_settings_page' );
@@ -687,7 +677,7 @@ class MLASettings {
687
  */
688
  if ( ( 'checkbox' != $value['type'] ) && ( 'custom' != $value['type'] ) ) {
689
  if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
690
- $current = $_REQUEST[ MLA_OPTION_PREFIX . $key ];
691
  } else {
692
  $current = $default;
693
  }
@@ -699,6 +689,7 @@ class MLASettings {
699
 
700
  if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
701
  $message = '<br>update_option(' . $key . ")\r\n";
 
702
  switch ( $value['type'] ) {
703
  case 'checkbox':
704
  if ( 'checked' == $default ) {
@@ -713,16 +704,16 @@ class MLASettings {
713
  $message = '';
714
  break;
715
  case 'radio':
716
- MLACore::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ], $option_table );
717
  break;
718
  case 'select':
719
- MLACore::mla_update_option( $key, $_REQUEST[ MLA_OPTION_PREFIX . $key ], $option_table );
720
  break;
721
  case 'text':
722
- MLACore::mla_update_option( $key, stripslashes( trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ], $option_table ) ) );
723
  break;
724
  case 'textarea':
725
- MLACore::mla_update_option( $key, stripslashes( trim( $_REQUEST[ MLA_OPTION_PREFIX . $key ], $option_table ) ) );
726
  break;
727
  case 'custom':
728
  $message = call_user_func( array( 'MLAOptions', $value['update'] ), 'update', $key, $value, $_REQUEST );
@@ -1185,7 +1176,7 @@ class MLASettings {
1185
 
1186
  if ( isset( $_REQUEST['action'] ) ) {
1187
  if ( -1 != $_REQUEST['action'] ) {
1188
- return $_REQUEST['action'];
1189
  }
1190
 
1191
  $action = 'none';
@@ -1193,7 +1184,7 @@ class MLASettings {
1193
 
1194
  if ( isset( $_REQUEST['action2'] ) ) {
1195
  if ( -1 != $_REQUEST['action2'] ) {
1196
- return $_REQUEST['action2'];
1197
  }
1198
 
1199
  $action = 'none';
@@ -1456,15 +1447,15 @@ class MLASettings {
1456
  */
1457
  public static function mla_render_settings_page( ) {
1458
  if ( !current_user_can( 'manage_options' ) ) {
1459
- echo __( 'Media Library Assistant', 'media-library-assistant' ) . ' - ' . __( 'ERROR', 'media-library-assistant' ) . "</h2>\r\n";
1460
- wp_die( __( 'You do not have permission to manage plugin settings.', 'media-library-assistant' ) );
1461
  }
1462
 
1463
  // Load template array and initialize page-level values.
1464
  $development_version = MLA::MLA_DEVELOPMENT_VERSION;
1465
  $development_version = ( ! empty( $development_version ) ) ? ' (' . $development_version . ')' : '';
1466
  self::$page_template_array = MLACore::mla_load_template( 'admin-display-settings-page.tpl' );
1467
- $current_tab_slug = isset( $_REQUEST['mla_tab'] ) ? $_REQUEST['mla_tab']: 'general';
1468
  $current_tab = self::_get_options_tablist( $current_tab_slug );
1469
  $page_values = array(
1470
  'version' => 'v' . MLACore::CURRENT_MLA_VERSION,
@@ -1507,7 +1498,7 @@ class MLASettings {
1507
  }
1508
 
1509
  $page_values['tab_content'] = $page_content['body'];
1510
- echo MLAData::mla_parse_template( self::$page_template_array['page'], $page_values );
1511
  } // mla_render_settings_page
1512
 
1513
  /**
@@ -1551,17 +1542,18 @@ class MLASettings {
1551
 
1552
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
1553
  if ( 'general' == $value['tab'] ) {
 
1554
  switch ( $key ) {
1555
  case MLACoreOptions::MLA_FEATURED_IN_TUNING:
1556
- MLACore::$process_featured_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1557
  break;
1558
  case MLACoreOptions::MLA_INSERTED_IN_TUNING:
1559
- MLACore::$process_inserted_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1560
  break;
1561
  case MLACoreOptions::MLA_GALLERY_IN_TUNING:
1562
- MLACore::$process_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1563
 
1564
- if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
1565
  MLAQuery::mla_flush_mla_galleries( MLACoreOptions::MLA_GALLERY_IN_TUNING );
1566
  /* translators: 1: reference type, e.g., Gallery in */
1567
  $message_list .= "<br>" . sprintf( _x( '%1$s - references updated.', 'message_list', 'media-library-assistant' ), __( 'Gallery in', 'media-library-assistant' ) ) . "\r\n";
@@ -1569,9 +1561,9 @@ class MLASettings {
1569
  }
1570
  break;
1571
  case MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING:
1572
- MLACore::$process_mla_gallery_in = ( 'disabled' != $_REQUEST[ MLA_OPTION_PREFIX . $key ] );
1573
 
1574
- if ( 'refresh' == $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) {
1575
  MLAQuery::mla_flush_mla_galleries( MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING );
1576
  /* translators: 1: reference type, e.g., Gallery in */
1577
  $message_list .= "<br>" . sprintf( _x( '%1$s - references updated.', 'message_list', 'media-library-assistant' ), __( 'MLA Gallery in', 'media-library-assistant' ) ) . "\r\n";
@@ -1842,7 +1834,7 @@ class MLASettings {
1842
  $message_list = '';
1843
 
1844
  if ( isset( $_REQUEST['mla-import-settings-file'] ) ) {
1845
- $filename = $_REQUEST['mla-import-settings-file'];
1846
 
1847
  if ( 'none' != $filename ) {
1848
  $filename = MLA_BACKUP_DIR . $filename;
121
  require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-iptc-exif-tab.php' );
122
  break;
123
  }
124
+ } elseif ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) ) {
125
+ // Settings/Media Library Assistant current tab. General and Debug tabs are in this file.
126
+ $page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) );
127
+ if ( 'mla-settings-menu-' == substr( $page, 0, 18 ) ) {
128
+ switch( substr( $page, 18 ) ) {
129
+ case 'view':
130
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-view-tab.php' );
131
+ add_filter( 'set_screen_option_mla_views_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
132
+ break;
133
+ case 'upload':
134
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-upload-tab.php' );
135
+ add_filter( 'set_screen_option_mla_uploads_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
136
+ add_filter( 'set_screen_option_mla_types_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
137
+ break;
138
+ case 'shortcodes':
139
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-shortcodes-tab.php' );
140
+ add_filter( 'set_screen_option_mla_shortcode_templates_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
141
+ break;
142
+ case 'custom_field':
143
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-custom-fields-tab.php' );
144
+ add_filter( 'set_screen_option_mla_custom_field_rules_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
145
+ break;
146
+ case 'iptc_exif':
147
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-iptc-exif-tab.php' );
148
+ add_filter( 'set_screen_option_mla_iptc_exif_rules_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
149
+ break;
150
+ case 'documentation':
151
+ require_once( MLA_PLUGIN_PATH . 'includes/class-mla-settings-documentation-tab.php' );
152
+ add_filter( 'set_screen_option_mla_example_plugins_per_page', 'MLASettings::mla_set_screen_option_filter', 10, 3 );
153
+ break;
154
+ } // $page
155
+ } // mla-settings-menu-
156
  }
157
  }
158
 
195
  } // version is less than .30
196
 
197
  if ( version_compare( '1.13', $current_version, '>' ) ) {
198
+ // Add quick_edit and bulk_edit values to custom field mapping rules
 
 
199
  $new_values = array();
200
 
201
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
208
  } // version is less than 1.13
209
 
210
  if ( version_compare( '1.30', $current_version, '>' ) ) {
211
+ // Add metadata values to custom field mapping rules
 
 
212
  $new_values = array();
213
 
214
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
222
  } // version is less than 1.30
223
 
224
  if ( version_compare( '1.40', $current_version, '>' ) ) {
225
+ // Add metadata values to custom field mapping rules
 
 
226
  $new_values = array();
227
 
228
  foreach ( MLACore::mla_get_option( 'custom_field_mapping' ) as $key => $value ) {
246
  } // version is less than 1.40
247
 
248
  if ( version_compare( '1.60', $current_version, '>' ) ) {
249
+ // Add delimiters values to taxonomy mapping rules
 
 
250
  $option_value = MLACore::mla_get_option( 'iptc_exif_mapping' );
251
  $new_values = array();
252
 
260
  } // version is less than 1.60
261
 
262
  if ( version_compare( '1.72', $current_version, '>' ) ) {
263
+ // Strip default descriptions from the options table
 
 
264
  MLAMime::mla_update_upload_mime();
265
  } // version is less than 1.72
266
 
267
  if ( version_compare( '2.13', $current_version, '>' ) ) {
268
+ // Add format, option and no_null to IPTC/EXIF custom mapping rules
 
 
269
  $option_value = MLACore::mla_get_option( 'iptc_exif_mapping' );
270
 
271
  if ( !empty( $option_value['custom'] ) ) {
294
  * @return void
295
  */
296
  public static function mla_activation_hook( ) {
297
+ // Disable the uninstall file while the plugin is active
 
 
298
  if ( file_exists( MLA_PLUGIN_PATH . 'uninstall.php' ) ) {
299
  @rename ( MLA_PLUGIN_PATH . 'uninstall.php' , MLA_PLUGIN_PATH . 'mla-uninstall.php' );
300
  }
384
  public static function mla_admin_enqueue_scripts_action( $page_hook ) {
385
  global $wpdb, $wp_locale;
386
 
387
+ // Without a tab value, there's nothing to do
 
 
388
  if ( ( self::$current_page_hook != $page_hook ) || empty( $_REQUEST['mla_tab'] ) ) {
389
  return;
390
  }
413
  * Use the URL suffix, if present. If the URL doesn't have a tab suffix, use '-general'.
414
  * This hack is required to pass the WordPress "referer" validation.
415
  */
416
+ $tab = 'general';
417
+ if ( isset( $_REQUEST['page'] ) && is_string( $_REQUEST['page'] ) ) {
418
+ // Settings/Media Library Assistant current tab.
419
+ $page = sanitize_text_field( wp_unslash( $_REQUEST['page'] ) );
420
+ if ( 'mla-settings-menu-' == substr( $page, 0, 18 ) ) {
421
+ $tab = substr( $page, 18 );
422
+ }
423
+ }
424
 
425
  $tab = self::_get_options_tablist( $tab ) ? '-' . $tab : '-general';
426
  self::$current_page_hook = add_submenu_page( 'options-general.php', __( 'Media Library Assistant', 'media-library-assistant' ) . ' ' . __( 'Settings', 'media-library-assistant' ), __( 'Media Library Assistant', 'media-library-assistant' ), 'manage_options', MLACoreOptions::MLA_SETTINGS_SLUG . $tab, 'MLASettings::mla_render_settings_page' );
677
  */
678
  if ( ( 'checkbox' != $value['type'] ) && ( 'custom' != $value['type'] ) ) {
679
  if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
680
+ $current = wp_kses( wp_unslash( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ), 'post' );
681
  } else {
682
  $current = $default;
683
  }
689
 
690
  if ( isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ) {
691
  $message = '<br>update_option(' . $key . ")\r\n";
692
+ $current = wp_kses( wp_unslash( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ), 'post' );
693
  switch ( $value['type'] ) {
694
  case 'checkbox':
695
  if ( 'checked' == $default ) {
704
  $message = '';
705
  break;
706
  case 'radio':
707
+ MLACore::mla_update_option( $key, $current, $option_table );
708
  break;
709
  case 'select':
710
+ MLACore::mla_update_option( $key, $current, $option_table );
711
  break;
712
  case 'text':
713
+ MLACore::mla_update_option( $key, trim( $current ), $option_table );
714
  break;
715
  case 'textarea':
716
+ MLACore::mla_update_option( $key, trim( $current ), $option_table );
717
  break;
718
  case 'custom':
719
  $message = call_user_func( array( 'MLAOptions', $value['update'] ), 'update', $key, $value, $_REQUEST );
1176
 
1177
  if ( isset( $_REQUEST['action'] ) ) {
1178
  if ( -1 != $_REQUEST['action'] ) {
1179
+ return sanitize_text_field( wp_unslash( $_REQUEST['action'] ) );
1180
  }
1181
 
1182
  $action = 'none';
1184
 
1185
  if ( isset( $_REQUEST['action2'] ) ) {
1186
  if ( -1 != $_REQUEST['action2'] ) {
1187
+ return sanitize_text_field( wp_unslash( $_REQUEST['action2'] ) );
1188
  }
1189
 
1190
  $action = 'none';
1447
  */
1448
  public static function mla_render_settings_page( ) {
1449
  if ( !current_user_can( 'manage_options' ) ) {
1450
+ echo esc_html__( 'Media Library Assistant', 'media-library-assistant' ) . ' - ' . esc_html__( 'ERROR', 'media-library-assistant' ) . "</h2>\r\n";
1451
+ wp_die( esc_html__( 'You do not have permission to manage plugin settings.', 'media-library-assistant' ) );
1452
  }
1453
 
1454
  // Load template array and initialize page-level values.
1455
  $development_version = MLA::MLA_DEVELOPMENT_VERSION;
1456
  $development_version = ( ! empty( $development_version ) ) ? ' (' . $development_version . ')' : '';
1457
  self::$page_template_array = MLACore::mla_load_template( 'admin-display-settings-page.tpl' );
1458
+ $current_tab_slug = isset( $_REQUEST['mla_tab'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_tab'] ) ): 'general';
1459
  $current_tab = self::_get_options_tablist( $current_tab_slug );
1460
  $page_values = array(
1461
  'version' => 'v' . MLACore::CURRENT_MLA_VERSION,
1498
  }
1499
 
1500
  $page_values['tab_content'] = $page_content['body'];
1501
+ echo MLAData::mla_parse_template( self::$page_template_array['page'], $page_values ); // phpcs:ignore
1502
  } // mla_render_settings_page
1503
 
1504
  /**
1542
 
1543
  foreach ( MLACoreOptions::$mla_option_definitions as $key => $value ) {
1544
  if ( 'general' == $value['tab'] ) {
1545
+ $current = isset( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ) ? wp_kses( wp_unslash( $_REQUEST[ MLA_OPTION_PREFIX . $key ] ), 'post' ) : '';
1546
  switch ( $key ) {
1547
  case MLACoreOptions::MLA_FEATURED_IN_TUNING:
1548
+ MLACore::$process_featured_in = ( 'disabled' != $current );
1549
  break;
1550
  case MLACoreOptions::MLA_INSERTED_IN_TUNING:
1551
+ MLACore::$process_inserted_in = ( 'disabled' != $current );
1552
  break;
1553
  case MLACoreOptions::MLA_GALLERY_IN_TUNING:
1554
+ MLACore::$process_gallery_in = ( 'disabled' != $current );
1555
 
1556
+ if ( 'refresh' == $current ) {
1557
  MLAQuery::mla_flush_mla_galleries( MLACoreOptions::MLA_GALLERY_IN_TUNING );
1558
  /* translators: 1: reference type, e.g., Gallery in */
1559
  $message_list .= "<br>" . sprintf( _x( '%1$s - references updated.', 'message_list', 'media-library-assistant' ), __( 'Gallery in', 'media-library-assistant' ) ) . "\r\n";
1561
  }
1562
  break;
1563
  case MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING:
1564
+ MLACore::$process_mla_gallery_in = ( 'disabled' != $current );
1565
 
1566
+ if ( 'refresh' == $current ) {
1567
  MLAQuery::mla_flush_mla_galleries( MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING );
1568
  /* translators: 1: reference type, e.g., Gallery in */
1569
  $message_list .= "<br>" . sprintf( _x( '%1$s - references updated.', 'message_list', 'media-library-assistant' ), __( 'MLA Gallery in', 'media-library-assistant' ) ) . "\r\n";
1834
  $message_list = '';
1835
 
1836
  if ( isset( $_REQUEST['mla-import-settings-file'] ) ) {
1837
+ $filename = sanitize_text_field( wp_unslash( $_REQUEST['mla-import-settings-file'] ) );
1838
 
1839
  if ( 'none' != $filename ) {
1840
  $filename = MLA_BACKUP_DIR . $filename;
includes/class-mla-shortcode-support.php CHANGED
@@ -143,30 +143,6 @@ class MLAShortcode_Support {
143
  return $ghostscript_present = ( $test_path === $return_arg );
144
  }
145
 
146
- /**
147
- * Filters the image src result, returning an icon to represent an attachment.
148
- *
149
- * @since 2.52
150
- *
151
- * @param array|false $image Either array with src, width & height, icon src, or false.
152
- * @param int $attachment_id Image attachment ID.
153
- */
154
- public static function _get_attachment_icon_src( $image, $attachment_id ) {
155
- if ( $src = wp_mime_type_icon( $attachment_id ) ) {
156
- /** This filter is documented in wp-includes/post.php */
157
- $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
158
-
159
- $src_file = $icon_dir . '/' . wp_basename( $src );
160
- @list( $width, $height ) = getimagesize( $src_file );
161
- }
162
-
163
- if ( $src && $width && $height ) {
164
- $image = array( $src, $width, $height );
165
- }
166
-
167
- return $image;
168
- }
169
-
170
  /**
171
  * Removes MIME type restriction from Photonic Gallery query
172
  *
@@ -180,7 +156,16 @@ class MLAShortcode_Support {
180
  }
181
 
182
  /**
183
- * Filters the image src result, returning the "Featured Image" to represent a non-image attachment.
 
 
 
 
 
 
 
 
 
184
  *
185
  * @since 2.76
186
  *
@@ -190,14 +175,19 @@ class MLAShortcode_Support {
190
  * (in that order). Default 'thumbnail'.
191
  * @param bool $icon Whether the image should be treated as an icon. Default false.
192
  */
193
- public static function _get_attachment_featured_image( $image, $attachment_id, $size, $icon ) {
194
- if ( $image ) {
 
 
195
  return $image;
196
  }
197
 
198
- if ( 'checked' == MLACore::mla_get_option( 'enable_featured_image' ) ) {
199
- // Look for the "Featured Image" as an alternate thumbnail for PDFs, etc.
 
200
  $feature = get_the_post_thumbnail( $attachment_id, $size, array( 'class' => 'attachment-thumbnail' ) );
 
 
201
  if ( ! empty( $feature ) ) {
202
  $match_count = preg_match_all( '# width=\"([^\"]+)\" height=\"([^\"]+)\" src=\"([^\"]+)\" #', $feature, $matches, PREG_OFFSET_CAPTURE );
203
  if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
@@ -244,10 +234,17 @@ class MLAShortcode_Support {
244
  public static function mla_validate_attributes( $attr, $content = NULL ) {
245
  //error_log( __LINE__ . " mla_validate_attributes() attr = " . var_export( $attr, true ), 0 );
246
  //error_log( __LINE__ . " mla_validate_attributes() content = " . var_export( $content, true ), 0 );
247
- if ( empty( $attr ) ) {
248
  $attr = array();
249
  } elseif ( is_string( $attr ) ) {
250
  $attr = shortcode_parse_atts( $attr );
 
 
 
 
 
 
 
251
  }
252
  //error_log( __LINE__ . " mla_validate_attributes() attr = " . var_export( $attr, true ), 0 );
253
 
@@ -453,7 +450,7 @@ class MLAShortcode_Support {
453
  */
454
  if ( ! isset( $attr[ $mla_page_parameter ] ) ) {
455
  if ( isset( $_REQUEST[ $mla_page_parameter ] ) ) {
456
- $attr[ $mla_page_parameter ] = $_REQUEST[ $mla_page_parameter ];
457
  }
458
  }
459
 
@@ -477,7 +474,7 @@ class MLAShortcode_Support {
477
  'mla_output' => 'gallery',
478
  'mla_style' => MLACore::mla_get_option('default_style'),
479
  'mla_markup' => MLACore::mla_get_option('default_markup'),
480
- 'mla_float' => is_rtl() ? 'right' : 'left',
481
  'mla_itemwidth' => MLACore::mla_get_option('mla_gallery_itemwidth'),
482
  'mla_margin' => MLACore::mla_get_option('mla_gallery_margin'),
483
  'mla_target' => '',
@@ -731,6 +728,16 @@ class MLAShortcode_Support {
731
  return $output;
732
  } // empty $attachments
733
 
 
 
 
 
 
 
 
 
 
 
734
  // Look for Photonic-enhanced gallery; use the [gallery] shortcode if found
735
  global $photonic;
736
 
@@ -818,7 +825,7 @@ class MLAShortcode_Support {
818
 
819
  if ( $is_photonic ) {
820
  add_filter( 'pre_get_posts', 'MLAShortcode_Support::_photonic_pre_get_posts', 10, 4 );
821
- add_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_featured_image', 10, 4 );
822
  }
823
 
824
  if ( ! empty( $content ) ) {
@@ -828,7 +835,7 @@ class MLAShortcode_Support {
828
  }
829
 
830
  if ( $is_photonic ) {
831
- remove_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_featured_image' );
832
  remove_filter( 'pre_get_posts', 'MLAShortcode_Support::_photonic_pre_get_posts' );
833
  }
834
 
@@ -843,14 +850,6 @@ class MLAShortcode_Support {
843
  }
844
  } // mla_alt_shortcode
845
 
846
- $size_class = $arguments['size'];
847
- $size = strtolower( $size_class );
848
-
849
- $icon_only = 'icon_only' === $size;
850
- if ( $icon_only ) {
851
- $size = $size_class = 'icon';
852
- }
853
-
854
  if ( 'icon' == strtolower( $size) ) {
855
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_MLA_ICONS ) ) {
856
  $size = array( 64, 64 );
@@ -970,7 +969,7 @@ class MLAShortcode_Support {
970
 
971
  $float = strtolower( $arguments['mla_float'] );
972
  if ( ! in_array( $float, array( 'left', 'none', 'right' ) ) ) {
973
- $float = is_rtl() ? 'right' : 'left';
974
  }
975
 
976
  $style_values = array_merge( $page_values, array(
@@ -1320,16 +1319,12 @@ class MLAShortcode_Support {
1320
  $item_values['pagelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', get_permalink( $attachment->ID ), $attachment->post_title );
1321
  $item_values['filelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', $attachment->guid, $attachment->post_title );
1322
  } else {
1323
- if ( $icon_only ) {
1324
- add_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_icon_src', 10, 2 );
1325
- }
1326
 
1327
  $item_values['pagelink'] = wp_get_attachment_link($attachment->ID, $size, true, $show_icon, $link_text);
1328
  $item_values['filelink'] = wp_get_attachment_link($attachment->ID, $size, false, $show_icon, $link_text);
1329
 
1330
- if ( $icon_only ) {
1331
- remove_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_icon_src' );
1332
- }
1333
  }
1334
  } else {
1335
  $item_values['pagelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', $attachment->guid, $attachment->post_title );
@@ -1608,7 +1603,8 @@ class MLAShortcode_Support {
1608
  $item_values['thumbnail_width'] = '';
1609
  $item_values['thumbnail_height'] = '';
1610
  $item_values['thumbnail_url'] = '';
1611
-
 
1612
  if ( ( 'none' !== $arguments['size'] ) && ( 'checked' == MLACore::mla_get_option( 'enable_featured_image' ) ) ) {
1613
  // Look for the "Featured Image" as an alternate thumbnail for PDFs, etc.
1614
  $feature = get_the_post_thumbnail( $attachment->ID, $size, array( 'class' => 'attachment-thumbnail' ) );
@@ -1624,7 +1620,7 @@ class MLAShortcode_Support {
1624
  $item_values['thumbnail_url'] = $matches[3][0][0];
1625
  }
1626
  }
1627
- } // enable_featured_image
1628
  }
1629
 
1630
  // Now that we have thumbnail_content we can check for 'span' and 'none'
@@ -1780,7 +1776,8 @@ class MLAShortcode_Support {
1780
 
1781
  // Conditional caption tag to replicate WP 4.1+, now used in the default markup template.
1782
  if ( $item_values['captiontag'] && trim( $item_values['caption'] ) ) {
1783
- $item_values['captiontag_content'] = '<' . $item_values['captiontag'] . " class='wp-caption-text gallery-caption' id='" . $item_values['selector'] . '-' . $item_values['attachment_ID'] . "'>\n\t\t" . $item_values['caption'] . "\n\t</" . $item_values['captiontag'] . ">\n";
 
1784
  } else {
1785
  $item_values['captiontag_content'] = '';
1786
  }
@@ -1971,7 +1968,7 @@ class MLAShortcode_Support {
1971
  */
1972
  if ( ! isset( $attr[ $mla_page_parameter ] ) ) {
1973
  if ( isset( $_REQUEST[ $mla_page_parameter ] ) ) {
1974
- $attr[ $mla_page_parameter ] = $_REQUEST[ $mla_page_parameter ];
1975
  }
1976
  }
1977
 
@@ -2191,7 +2188,7 @@ class MLAShortcode_Support {
2191
  return $cloud;
2192
  }
2193
 
2194
- echo $cloud;
2195
  return;
2196
  }
2197
 
@@ -2228,7 +2225,7 @@ class MLAShortcode_Support {
2228
  return $cloud;
2229
  }
2230
 
2231
- echo $cloud;
2232
  return;
2233
  }
2234
 
@@ -2280,7 +2277,7 @@ class MLAShortcode_Support {
2280
  return $cloud;
2281
  }
2282
 
2283
- echo $cloud;
2284
  return;
2285
  }
2286
 
@@ -2735,7 +2732,7 @@ class MLAShortcode_Support {
2735
  return $cloud;
2736
  }
2737
 
2738
- echo $cloud;
2739
  }
2740
 
2741
  /**
@@ -3267,7 +3264,7 @@ class MLAShortcode_Support {
3267
  */
3268
  if ( ! isset( $attr[ $mla_item_parameter ] ) ) {
3269
  if ( isset( $_REQUEST[ $mla_item_parameter ] ) ) {
3270
- $attr[ $mla_item_parameter ] = $_REQUEST[ $mla_item_parameter ];
3271
  }
3272
  }
3273
 
@@ -3513,7 +3510,7 @@ class MLAShortcode_Support {
3513
  return $list;
3514
  }
3515
 
3516
- echo $list;
3517
  return;
3518
  }
3519
 
@@ -3593,7 +3590,7 @@ class MLAShortcode_Support {
3593
  return $list;
3594
  }
3595
 
3596
- echo $list;
3597
  return;
3598
  }
3599
  }
@@ -3640,7 +3637,7 @@ class MLAShortcode_Support {
3640
  return $list;
3641
  }
3642
 
3643
- echo $list;
3644
  return;
3645
  }
3646
 
@@ -3672,7 +3669,7 @@ class MLAShortcode_Support {
3672
  return $list;
3673
  }
3674
 
3675
- echo $list;
3676
  return;
3677
  }
3678
 
@@ -3825,7 +3822,7 @@ class MLAShortcode_Support {
3825
  return $list;
3826
  }
3827
 
3828
- echo $list;
3829
  }
3830
 
3831
  /**
@@ -4233,15 +4230,15 @@ class MLAShortcode_Support {
4233
  $markup_values['last_page_text'] = 'mla_paginate_total="[+last_page+]"';
4234
  $markup_values['posts_per_page_text'] = 'posts_per_page="[+posts_per_page+]"';
4235
 
4236
- if ( 'HTTPS' == substr( $_SERVER["SERVER_PROTOCOL"], 0, 5 ) ) {
4237
  $markup_values['scheme'] = 'https://';
4238
  } else {
4239
  $markup_values['scheme'] = 'http://';
4240
  }
4241
 
4242
- $markup_values['http_host'] = $_SERVER['HTTP_HOST'];
4243
 
4244
- $parts = wp_parse_url( $_SERVER['REQUEST_URI'] );
4245
  $uri_path = empty( $parts['path'] ) ? '' : $parts['path'];
4246
  $uri_query = empty( $parts['query'] ) ? '' : $parts['query'];
4247
 
143
  return $ghostscript_present = ( $test_path === $return_arg );
144
  }
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  /**
147
  * Removes MIME type restriction from Photonic Gallery query
148
  *
156
  }
157
 
158
  /**
159
+ * Informs _get_attachment_image_src() of the 'size=icon_feature' setting
160
+ *
161
+ * @since 2.90
162
+ *
163
+ * @var string shortcode 'size' parameter value
164
+ */
165
+ private static $size_parameter = '';
166
+
167
+ /**
168
+ * Filters the image src result, returning the "Featured Image" or an icon to represent a non-image attachment.
169
  *
170
  * @since 2.76
171
  *
175
  * (in that order). Default 'thumbnail'.
176
  * @param bool $icon Whether the image should be treated as an icon. Default false.
177
  */
178
+ public static function _get_attachment_image_src( $image, $attachment_id, $size, $icon ) {
179
+ static $nested_call = false;
180
+
181
+ if ( $nested_call || ( $image && ( 'icon_only' !== self::$size_parameter ) && ( 'icon_feature' !== self::$size_parameter ) ) ) {
182
  return $image;
183
  }
184
 
185
+ // Look for the "Featured Image" as an alternate thumbnail for PDFs, etc.
186
+ if ( ( 'icon_only' !== self::$size_parameter ) && ( 'checked' == MLACore::mla_get_option( 'enable_featured_image' ) ) ) {
187
+ $nested_call = true;
188
  $feature = get_the_post_thumbnail( $attachment_id, $size, array( 'class' => 'attachment-thumbnail' ) );
189
+ $nested_call = false;
190
+
191
  if ( ! empty( $feature ) ) {
192
  $match_count = preg_match_all( '# width=\"([^\"]+)\" height=\"([^\"]+)\" src=\"([^\"]+)\" #', $feature, $matches, PREG_OFFSET_CAPTURE );
193
  if ( ! ( ( $match_count == false ) || ( $match_count == 0 ) ) ) {
234
  public static function mla_validate_attributes( $attr, $content = NULL ) {
235
  //error_log( __LINE__ . " mla_validate_attributes() attr = " . var_export( $attr, true ), 0 );
236
  //error_log( __LINE__ . " mla_validate_attributes() content = " . var_export( $content, true ), 0 );
237
+ /* if ( empty( $attr ) ) {
238
  $attr = array();
239
  } elseif ( is_string( $attr ) ) {
240
  $attr = shortcode_parse_atts( $attr );
241
+ } // */
242
+ if ( is_string( $attr ) ) {
243
+ $attr = shortcode_parse_atts( $attr );
244
+ }
245
+
246
+ if ( empty( $attr ) ) {
247
+ $attr = array();
248
  }
249
  //error_log( __LINE__ . " mla_validate_attributes() attr = " . var_export( $attr, true ), 0 );
250
 
450
  */
451
  if ( ! isset( $attr[ $mla_page_parameter ] ) ) {
452
  if ( isset( $_REQUEST[ $mla_page_parameter ] ) ) {
453
+ $attr[ $mla_page_parameter ] = sanitize_text_field( wp_unslash( $_REQUEST[ $mla_page_parameter ] ) );
454
  }
455
  }
456
 
474
  'mla_output' => 'gallery',
475
  'mla_style' => MLACore::mla_get_option('default_style'),
476
  'mla_markup' => MLACore::mla_get_option('default_markup'),
477
+ 'mla_float' => 'none', // before v2.90: is_rtl() ? 'right' : 'left',
478
  'mla_itemwidth' => MLACore::mla_get_option('mla_gallery_itemwidth'),
479
  'mla_margin' => MLACore::mla_get_option('mla_gallery_margin'),
480
  'mla_target' => '',
728
  return $output;
729
  } // empty $attachments
730
 
731
+ // Pass size argument to _get_attachment_image_src() and replace special values
732
+ $size = strtolower( $arguments['size'] );
733
+ self::$size_parameter = $size;
734
+
735
+ if ( ( 'icon_only' === $size ) || ( 'icon_feature' === $size ) ) {
736
+ $size = 'icon';
737
+ }
738
+
739
+ $size_class = $size;
740
+
741
  // Look for Photonic-enhanced gallery; use the [gallery] shortcode if found
742
  global $photonic;
743
 
825
 
826
  if ( $is_photonic ) {
827
  add_filter( 'pre_get_posts', 'MLAShortcode_Support::_photonic_pre_get_posts', 10, 4 );
828
+ add_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_image_src', 10, 4 );
829
  }
830
 
831
  if ( ! empty( $content ) ) {
835
  }
836
 
837
  if ( $is_photonic ) {
838
+ remove_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_image_src' );
839
  remove_filter( 'pre_get_posts', 'MLAShortcode_Support::_photonic_pre_get_posts' );
840
  }
841
 
850
  }
851
  } // mla_alt_shortcode
852
 
 
 
 
 
 
 
 
 
853
  if ( 'icon' == strtolower( $size) ) {
854
  if ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ENABLE_MLA_ICONS ) ) {
855
  $size = array( 64, 64 );
969
 
970
  $float = strtolower( $arguments['mla_float'] );
971
  if ( ! in_array( $float, array( 'left', 'none', 'right' ) ) ) {
972
+ $float = 'none'; // before v2.90: is_rtl() ? 'right' : 'left';
973
  }
974
 
975
  $style_values = array_merge( $page_values, array(
1319
  $item_values['pagelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', get_permalink( $attachment->ID ), $attachment->post_title );
1320
  $item_values['filelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', $attachment->guid, $attachment->post_title );
1321
  } else {
1322
+ add_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_image_src', 10, 4 );
 
 
1323
 
1324
  $item_values['pagelink'] = wp_get_attachment_link($attachment->ID, $size, true, $show_icon, $link_text);
1325
  $item_values['filelink'] = wp_get_attachment_link($attachment->ID, $size, false, $show_icon, $link_text);
1326
 
1327
+ remove_filter( 'wp_get_attachment_image_src', 'MLAShortcode_Support::_get_attachment_image_src' );
 
 
1328
  }
1329
  } else {
1330
  $item_values['pagelink'] = sprintf( '<a href=\'%1$s\'>%2$s</a>', $attachment->guid, $attachment->post_title );
1603
  $item_values['thumbnail_width'] = '';
1604
  $item_values['thumbnail_height'] = '';
1605
  $item_values['thumbnail_url'] = '';
1606
+
1607
+ /* Replaced by logic in _get_attachment_image_src v2.90
1608
  if ( ( 'none' !== $arguments['size'] ) && ( 'checked' == MLACore::mla_get_option( 'enable_featured_image' ) ) ) {
1609
  // Look for the "Featured Image" as an alternate thumbnail for PDFs, etc.
1610
  $feature = get_the_post_thumbnail( $attachment->ID, $size, array( 'class' => 'attachment-thumbnail' ) );
1620
  $item_values['thumbnail_url'] = $matches[3][0][0];
1621
  }
1622
  }
1623
+ } // enable_featured_image */
1624
  }
1625
 
1626
  // Now that we have thumbnail_content we can check for 'span' and 'none'
1776
 
1777
  // Conditional caption tag to replicate WP 4.1+, now used in the default markup template.
1778
  if ( $item_values['captiontag'] && trim( $item_values['caption'] ) ) {
1779
+ // $item_values['captiontag_content'] = '<' . $item_values['captiontag'] . " class='wp-caption-text gallery-caption' id='" . $item_values['selector'] . '-' . $item_values['attachment_ID'] . "'>\n\t\t" . $item_values['caption'] . "\n\t</" . $item_values['captiontag'] . ">\n";
1780
+ $item_values['captiontag_content'] = '<' . $item_values['captiontag'] . " class='wp-caption-text gallery-caption' id='" . $item_values['selector'] . '-' . $item_values['attachment_ID'] . "'>\n\t" . $item_values['caption'] . "\n\t</" . $item_values['captiontag'] . ">";
1781
  } else {
1782
  $item_values['captiontag_content'] = '';
1783
  }
1968
  */
1969
  if ( ! isset( $attr[ $mla_page_parameter ] ) ) {
1970
  if ( isset( $_REQUEST[ $mla_page_parameter ] ) ) {
1971
+ $attr[ $mla_page_parameter ] = sanitize_text_field( wp_unslash( $_REQUEST[ $mla_page_parameter ] ) );
1972
  }
1973
  }
1974
 
2188
  return $cloud;
2189
  }
2190
 
2191
+ echo $cloud; // phpcs:ignore
2192
  return;
2193
  }
2194
 
2225
  return $cloud;
2226
  }
2227
 
2228
+ echo $cloud; // phpcs:ignore
2229
  return;
2230
  }
2231
 
2277
  return $cloud;
2278
  }
2279
 
2280
+ echo $cloud; // phpcs:ignore
2281
  return;
2282
  }
2283
 
2732
  return $cloud;
2733
  }
2734
 
2735
+ echo $cloud; // phpcs:ignore
2736
  }
2737
 
2738
  /**
3264
  */
3265
  if ( ! isset( $attr[ $mla_item_parameter ] ) ) {
3266
  if ( isset( $_REQUEST[ $mla_item_parameter ] ) ) {
3267
+ $attr[ $mla_item_parameter ] = sanitize_text_field( wp_unslash( $_REQUEST[ $mla_item_parameter ] ) );
3268
  }
3269
  }
3270
 
3510
  return $list;
3511
  }
3512
 
3513
+ echo $list; // phpcs:ignore
3514
  return;
3515
  }
3516
 
3590
  return $list;
3591
  }
3592
 
3593
+ echo $list; // phpcs:ignore
3594
  return;
3595
  }
3596
  }
3637
  return $list;
3638
  }
3639
 
3640
+ echo $list; // phpcs:ignore
3641
  return;
3642
  }
3643
 
3669
  return $list;
3670
  }
3671
 
3672
+ echo $list; // phpcs:ignore
3673
  return;
3674
  }
3675
 
3822
  return $list;
3823
  }
3824
 
3825
+ echo $list; // phpcs:ignore
3826
  }
3827
 
3828
  /**
4230
  $markup_values['last_page_text'] = 'mla_paginate_total="[+last_page+]"';
4231
  $markup_values['posts_per_page_text'] = 'posts_per_page="[+posts_per_page+]"';
4232
 
4233
+ if ( 'HTTPS' == substr( $_SERVER["SERVER_PROTOCOL"], 0, 5 ) ) { // phpcs:ignore
4234
  $markup_values['scheme'] = 'https://';
4235
  } else {
4236
  $markup_values['scheme'] = 'http://';
4237
  }
4238
 
4239
+ $markup_values['http_host'] = $_SERVER['HTTP_HOST']; // phpcs:ignore
4240
 
4241
+ $parts = wp_parse_url( $_SERVER['REQUEST_URI'] ); // phpcs:ignore
4242
  $uri_path = empty( $parts['path'] ) ? '' : $parts['path'];
4243
  $uri_query = empty( $parts['query'] ) ? '' : $parts['query'];
4244
 
includes/class-mla-thumbnail-generation.php CHANGED
@@ -175,9 +175,23 @@ class MLA_Thumbnail {
175
  if ( self::MLA_GFI_ACTION != $bulk_action ) {
176
  return $item_content;
177
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
 
179
  self::$bulk_action_options = array();
180
- $request_options = isset( $_REQUEST['mla_thumbnail_options'] ) ? $_REQUEST['mla_thumbnail_options'] : array();
181
  $request_options['ghostscript_path'] = MLACore::mla_get_option( 'ghostscript_path' );
182
 
183
  if ( empty( $request_options['existing_thumbnails'] ) ) {
@@ -185,6 +199,11 @@ class MLA_Thumbnail {
185
  }
186
 
187
  foreach ( $request_options as $key => $value ) {
 
 
 
 
 
188
  if ( ! empty( $value ) ) {
189
  self::$bulk_action_options[ $key ] = $value;
190
  }
@@ -192,15 +211,16 @@ class MLA_Thumbnail {
192
 
193
  // Convert checkboxes to booleans
194
  self::$bulk_action_options['best_fit'] = isset( $request_options['best_fit'] );
195
- self::$bulk_action_options['clear_filters'] = isset( $request_options['clear_filters'] );
196
 
197
  // Convert page number to frame
198
  if ( isset( self::$bulk_action_options['page'] ) ) {
199
- $page = abs( intval( self::$bulk_action_options['page'] ) );
200
  self::$bulk_action_options['frame'] = ( 0 < $page ) ? $page - 1 : 0;
201
  unset( self::$bulk_action_options['page'] );
202
  }
203
 
 
204
  return $item_content;
205
  } // mla_list_table_begin_bulk_action
206
 
175
  if ( self::MLA_GFI_ACTION != $bulk_action ) {
176
  return $item_content;
177
  }
178
+ error_log( __LINE__ . ' mla_list_table_begin_bulk_action _REQUEST = ' . var_export( $_REQUEST, true ), 0 );
179
+
180
+ /* 'mla_thumbnail_options' =>
181
+ array (
182
+ 'width' => '',
183
+ 'height' => '',
184
+ 'best_fit' => 'checked',
185
+ 'page' => '',
186
+ 'resolution' => '',
187
+ 'quality' => '',
188
+ 'type' => 'WordPress',
189
+ 'existing_thumbnails' => 'keep',
190
+ 'suffix' => '-Thumbnail',
191
+ ), */
192
 
193
  self::$bulk_action_options = array();
194
+ $request_options = isset( $_REQUEST['mla_thumbnail_options'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_thumbnail_options'] ) ) : array();
195
  $request_options['ghostscript_path'] = MLACore::mla_get_option( 'ghostscript_path' );
196
 
197
  if ( empty( $request_options['existing_thumbnails'] ) ) {
199
  }
200
 
201
  foreach ( $request_options as $key => $value ) {
202
+ if ( in_array( $key, array( 'width', 'height', 'page', 'resolution', 'quality', ) ) ) {
203
+ // $value = 0 < absint( $value ) ? absint( $value ) : '';
204
+ $value = absint( $value );
205
+ }
206
+
207
  if ( ! empty( $value ) ) {
208
  self::$bulk_action_options[ $key ] = $value;
209
  }
211
 
212
  // Convert checkboxes to booleans
213
  self::$bulk_action_options['best_fit'] = isset( $request_options['best_fit'] );
214
+ //self::$bulk_action_options['clear_filters'] = isset( $request_options['clear_filters'] );
215
 
216
  // Convert page number to frame
217
  if ( isset( self::$bulk_action_options['page'] ) ) {
218
+ $page = self::$bulk_action_options['page'];
219
  self::$bulk_action_options['frame'] = ( 0 < $page ) ? $page - 1 : 0;
220
  unset( self::$bulk_action_options['page'] );
221
  }
222
 
223
+ error_log( __LINE__ . ' mla_list_table_begin_bulk_action bulk_action_options = ' . var_export( self::$bulk_action_options, true ), 0 );
224
  return $item_content;
225
  } // mla_list_table_begin_bulk_action
226
 
includes/class-mla-wpml-support.php CHANGED
@@ -83,9 +83,7 @@ class MLA_WPML {
83
  * @return void
84
  */
85
  public static function admin_init() {
86
- /*
87
- * Add styles for the language management column
88
- */
89
  if ( isset( $_REQUEST['page'] ) && ( MLACore::ADMIN_PAGE_SLUG == $_REQUEST['page'] ) ) {
90
  add_action( 'admin_print_styles', 'MLA_WPML_Table::mla_list_table_add_icl_styles' );
91
  }
@@ -103,7 +101,7 @@ class MLA_WPML {
103
  $default_language = $sitepress->get_default_language();
104
 
105
  // Look for an ID from the Media/Edit Media screen
106
- $query_string = parse_url( $_SERVER[ 'HTTP_REFERER' ], PHP_URL_QUERY );
107
  $query = array();
108
  parse_str( strval( $query_string ), $query );
109
 
@@ -114,26 +112,25 @@ class MLA_WPML {
114
  }
115
 
116
  // WPML overides switch_lang() from the HTTP_REFERER
117
- $referer = remove_query_arg( 'lang', $_SERVER[ 'HTTP_REFERER' ] );
118
  $_SERVER[ 'HTTP_REFERER' ] = add_query_arg( 'lang', $default_language, $referer );
119
  } // HTTP_REFERER
120
  } // no ID
121
  } // ajax-tag-search
122
  }
123
 
124
- /*
125
- * Localize $mla_language_option_definitions array
126
- */
127
  self::mla_localize_language_option_definitions();
128
 
129
- /*
130
- * Apply the "Always Translate Media" override
131
- */
132
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) && class_exists( 'WPML_Media' ) && ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ADD_NEW_BULK_EDIT ) ) ) {
133
  $content_defaults = WPML_Media::get_setting( 'new_content_settings' );
134
  $wpml_value = isset( $content_defaults['always_translate_media'] ) && $content_defaults['always_translate_media'];
135
 
136
- $args = wp_parse_args( stripslashes( urldecode( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) );
 
 
 
137
  if ( isset( $args['mla_always_translate_media'] ) ) {
138
  $form_value = 'true' == $args['mla_always_translate_media'];
139
  } else {
@@ -270,15 +267,29 @@ class MLA_WPML {
270
 
271
  self::_build_existing_terms( $post_id );
272
  if ( isset( $_REQUEST['action'] ) && 'mla-inline-edit-scripts' === $_REQUEST['action'] && isset( $_REQUEST['tax_input'] ) ) {
273
- MLACore::mla_debug_add( __LINE__ . " MLA_WPML::mla_list_table_inline_action( {$post_id} ) Quick Edit initial \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
274
 
275
  if ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_WPML::$mla_language_option_definitions ) ) {
276
  // Quick Edit calls update_single_item right after this filter
277
- self::_build_tax_input( $post_id, $_REQUEST['tax_input'], NULL, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  $_REQUEST['tax_input'] = self::_apply_tax_input( $post_id );
279
  }
280
 
281
- MLACore::mla_debug_add( __LINE__ . " MLA_WPML::mla_list_table_inline_action( {$post_id} ) Quick Edit final \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
282
  }
283
 
284
  return $item_content;
@@ -397,8 +408,24 @@ class MLA_WPML {
397
  */
398
  public static function mla_list_table_custom_admin_action( $mla_admin_action, $mla_item_ID ) {
399
  if ( 'wpml_create_translation' == $mla_admin_action ) {
400
- $new_item = WPML_Media::create_duplicate_attachment( $mla_item_ID, $_REQUEST['mla_parent_ID'], $_REQUEST['lang'] );
401
- $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => $_REQUEST['mla_source']) : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?action=edit&post=' . $new_item . '&message=201' ), 302 );
403
  exit;
404
  }
@@ -1477,9 +1504,7 @@ class MLA_WPML {
1477
  $already_updating = $post_id;
1478
  }
1479
 
1480
- /*
1481
- * Check for Bulk Edit during Add New Media
1482
- */
1483
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) {
1484
  if ( ! empty( self::$bulk_edit_request['tax_input'] ) ) {
1485
  $tax_inputs = self::$bulk_edit_request['tax_input'];
@@ -1500,27 +1525,35 @@ class MLA_WPML {
1500
  return;
1501
  } // Upload New Media Bulk Edit
1502
 
1503
- /*
1504
- * For the Bulk Edit action on the Media/Assistant screen, only synchronization is needed
1505
- */
1506
  if ( ! ( isset( $_REQUEST['bulk_action'] ) && 'bulk_edit' == $_REQUEST['bulk_action'] ) ) {
1507
  /*
1508
  * This is the Media/Edit Media screen.
1509
  * The category taxonomy (edit screens) is a special case because
1510
  * post_categories_meta_box() changes the input name
1511
  */
 
1512
  if ( isset( $_REQUEST['tax_input'] ) ) {
1513
- $tax_inputs = $_REQUEST['tax_input'];
1514
- } else {
1515
- $tax_inputs = array();
 
 
 
 
 
 
 
 
 
1516
  }
1517
 
1518
  if ( isset( $_REQUEST['post_category'] ) ) {
1519
- $tax_inputs['category'] = $_REQUEST['post_category'];
1520
  }
1521
 
1522
  if ( isset( $_REQUEST['tax_action'] ) ) {
1523
- $tax_actions = $_REQUEST['tax_action'];
1524
  } else {
1525
  $tax_actions = NULL;
1526
  }
@@ -2033,7 +2066,7 @@ class MLA_WPML_Table {
2033
  if ( isset( $_GET['meta_slug'] ) ) {
2034
  $save_lang = $sitepress->get_current_language();
2035
  $sitepress->switch_lang( $lang['code'] );
2036
- $meta_view = $this->mla_list_table->mla_get_view( $_GET['meta_slug'], '' );
2037
  $sitepress->switch_lang( $save_lang );
2038
 
2039
  if ( false !== $meta_view ) {
@@ -2079,7 +2112,7 @@ class MLA_WPML_Table {
2079
  global $sitepress;
2080
 
2081
  if ( isset( $_REQUEST['lang'] ) ) {
2082
- $submenu_arguments['lang'] = $_REQUEST['lang'];
2083
  } else {
2084
  $submenu_arguments['lang'] = self::mla_get_table_language();
2085
  }
@@ -2101,10 +2134,10 @@ class MLA_WPML_Table {
2101
  global $sitepress;
2102
 
2103
  if ( !empty( $_REQUEST['lang'] ) ) {
2104
- $table_language = $_REQUEST['lang'];
2105
  } else {
2106
  if ( empty( $table_language ) && ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) ) ) {
2107
- $query_string = parse_url( $_SERVER[ 'HTTP_REFERER' ], PHP_URL_QUERY );
2108
  $query = array();
2109
  parse_str( strval( $query_string ), $query );
2110
  if ( !empty( $query['lang'] ) ) {
@@ -2146,7 +2179,7 @@ class MLA_WPML_Table {
2146
  $show_language = 'checked' == MLACore::mla_get_option( 'language_column', false, false, MLA_WPML::$mla_language_option_definitions );
2147
  $table_language = self::mla_get_table_language();
2148
  $languages = $sitepress->get_active_languages();
2149
- $view_status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : '';
2150
  if ( 1 < count( $languages ) && $view_status != 'trash' ) {
2151
  $show_translations = 'checked' == MLACore::mla_get_option( 'translations_column', false, false, MLA_WPML::$mla_language_option_definitions );
2152
  } else {
@@ -2216,11 +2249,11 @@ class MLA_WPML_Table {
2216
 
2217
  $current_language = self::mla_get_table_language();
2218
  $languages = count( $sitepress->get_active_languages() );
2219
- $view_status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : '';
2220
 
2221
  if ( 1 < $languages && $view_status != 'trash' ) {
2222
  $w = 22 * ( 'all' == $current_language ? $languages : $languages - 1 );
2223
- echo '<style type="text/css">.column-icl_translations{width:' . $w . 'px;}.column-icl_translations img{margin:2px;}</style>';
2224
  }
2225
  }
2226
 
83
  * @return void
84
  */
85
  public static function admin_init() {
86
+ // Add styles for the language management column
 
 
87
  if ( isset( $_REQUEST['page'] ) && ( MLACore::ADMIN_PAGE_SLUG == $_REQUEST['page'] ) ) {
88
  add_action( 'admin_print_styles', 'MLA_WPML_Table::mla_list_table_add_icl_styles' );
89
  }
101
  $default_language = $sitepress->get_default_language();
102
 
103
  // Look for an ID from the Media/Edit Media screen
104
+ $query_string = parse_url( $_SERVER[ 'HTTP_REFERER' ], PHP_URL_QUERY ); // phpcs:ignore
105
  $query = array();
106
  parse_str( strval( $query_string ), $query );
107
 
112
  }
113
 
114
  // WPML overides switch_lang() from the HTTP_REFERER
115
+ $referer = remove_query_arg( 'lang', $_SERVER[ 'HTTP_REFERER' ] ); // phpcs:ignore
116
  $_SERVER[ 'HTTP_REFERER' ] = add_query_arg( 'lang', $default_language, $referer );
117
  } // HTTP_REFERER
118
  } // no ID
119
  } // ajax-tag-search
120
  }
121
 
122
+ // Localize $mla_language_option_definitions array
 
 
123
  self::mla_localize_language_option_definitions();
124
 
125
+ // Apply the "Always Translate Media" override
 
 
126
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) && class_exists( 'WPML_Media' ) && ( 'checked' == MLACore::mla_get_option( MLACoreOptions::MLA_ADD_NEW_BULK_EDIT ) ) ) {
127
  $content_defaults = WPML_Media::get_setting( 'new_content_settings' );
128
  $wpml_value = isset( $content_defaults['always_translate_media'] ) && $content_defaults['always_translate_media'];
129
 
130
+ //$args = wp_parse_args( stripslashes( urldecode( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) );
131
+ $args = str_replace( '&amp;', '&', str_replace( '%5C%5C', '%5C%5C%5C%5C', wp_kses( wp_unslash( $_REQUEST['mlaAddNewBulkEditFormString'] ), 'post' ) ) );
132
+ $args = wp_parse_args( $args );
133
+
134
  if ( isset( $args['mla_always_translate_media'] ) ) {
135
  $form_value = 'true' == $args['mla_always_translate_media'];
136
  } else {
267
 
268
  self::_build_existing_terms( $post_id );
269
  if ( isset( $_REQUEST['action'] ) && 'mla-inline-edit-scripts' === $_REQUEST['action'] && isset( $_REQUEST['tax_input'] ) ) {
270
+ MLACore::mla_debug_add( __LINE__ . " MLA_WPML::mla_list_table_inline_action( {$post_id} ) Quick Edit initial \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX ); // phpcs:ignore
271
 
272
  if ( 'checked' == MLACore::mla_get_option( 'term_assignment', false, false, MLA_WPML::$mla_language_option_definitions ) ) {
273
  // Quick Edit calls update_single_item right after this filter
274
+ $tax_inputs = array();
275
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_REQUEST['tax_input'] ) ) );
276
+ foreach ( $taxonomies as $tax_name ) {
277
+ if ( isset( $_REQUEST['tax_input'][ $tax_name ] ) ) {
278
+ if ( is_array( $_REQUEST['tax_input'][ $tax_name ] ) ) {
279
+ $tax_value = array_map( 'absint', $_REQUEST['tax_input'][ $tax_name ] );
280
+ } else {
281
+ $tax_value = sanitize_text_field( wp_unslash( $_REQUEST['tax_input'][ $tax_name ] ) );
282
+ }
283
+ }
284
+
285
+ $tax_inputs[$tax_name] = $tax_value;
286
+ } // foreach tax_input
287
+
288
+ self::_build_tax_input( $post_id, $tax_inputs, NULL, true );
289
  $_REQUEST['tax_input'] = self::_apply_tax_input( $post_id );
290
  }
291
 
292
+ MLACore::mla_debug_add( __LINE__ . " MLA_WPML::mla_list_table_inline_action( {$post_id} ) Quick Edit final \$_REQUEST['tax_input'] = " . var_export( $_REQUEST['tax_input'], true ), MLACore::MLA_DEBUG_CATEGORY_AJAX ); // phpcs:ignore
293
  }
294
 
295
  return $item_content;
408
  */
409
  public static function mla_list_table_custom_admin_action( $mla_admin_action, $mla_item_ID ) {
410
  if ( 'wpml_create_translation' == $mla_admin_action ) {
411
+ $mla_parent_ID = isset( $_REQUEST['mla_parent_ID'] ) ? absint( $_REQUEST['mla_parent_ID'] ) : 0;
412
+ $lang = isset( $_REQUEST['lang'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) ) : 'all';
413
+
414
+ if ( method_exists( 'WPML_Media', 'create_duplicate_attachment' ) ) {
415
+ $new_item = WPML_Media::create_duplicate_attachment( $mla_item_ID, $mla_parent_ID, $lang );
416
+ } else {
417
+ global $sitepress, $wpdb, $wpml_language_resolution;
418
+ $media_attachment_duplication = new WPML_Media_Attachments_Duplication(
419
+ $sitepress,
420
+ new WPML_Model_Attachments( $sitepress, wpml_get_post_status_helper() ),
421
+ $wpdb,
422
+ $wpml_language_resolution
423
+ );
424
+
425
+ $new_item = $media_attachment_duplication->create_duplicate_attachment( $mla_item_ID, $mla_parent_ID, $lang );
426
+ }
427
+
428
+ $view_args = isset( $_REQUEST['mla_source'] ) ? array( 'mla_source' => sanitize_text_field( wp_unslash( $_REQUEST['mla_source'] ) ) ) : array();
429
  wp_redirect( add_query_arg( $view_args, admin_url( 'post.php' ) . '?action=edit&post=' . $new_item . '&message=201' ), 302 );
430
  exit;
431
  }
1504
  $already_updating = $post_id;
1505
  }
1506
 
1507
+ // Check for Bulk Edit during Add New Media
 
 
1508
  if ( ! empty( $_REQUEST['mlaAddNewBulkEditFormString'] ) ) {
1509
  if ( ! empty( self::$bulk_edit_request['tax_input'] ) ) {
1510
  $tax_inputs = self::$bulk_edit_request['tax_input'];
1525
  return;
1526
  } // Upload New Media Bulk Edit
1527
 
1528
+ // For the Bulk Edit action on the Media/Assistant screen, only synchronization is needed
 
 
1529
  if ( ! ( isset( $_REQUEST['bulk_action'] ) && 'bulk_edit' == $_REQUEST['bulk_action'] ) ) {
1530
  /*
1531
  * This is the Media/Edit Media screen.
1532
  * The category taxonomy (edit screens) is a special case because
1533
  * post_categories_meta_box() changes the input name
1534
  */
1535
+ $tax_inputs = array();
1536
  if ( isset( $_REQUEST['tax_input'] ) ) {
1537
+ $taxonomies = array_keys( array_map( 'absint', wp_unslash( $_REQUEST['tax_input'] ) ) );
1538
+ foreach ( $taxonomies as $tax_name ) {
1539
+ if ( isset( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1540
+ if ( is_array( $_REQUEST['tax_input'][ $tax_name ] ) ) {
1541
+ $tax_value = array_map( 'absint', $_REQUEST['tax_input'][ $tax_name ] );
1542
+ } else {
1543
+ $tax_value = sanitize_text_field( wp_unslash( $_REQUEST['tax_input'][ $tax_name ] ) );
1544
+ }
1545
+ }
1546
+
1547
+ $tax_inputs[$tax_name] = $tax_value;
1548
+ } // foreach tax_input
1549
  }
1550
 
1551
  if ( isset( $_REQUEST['post_category'] ) ) {
1552
+ $tax_inputs['category'] = array_map( 'absint', wp_unslash( $_REQUEST['post_category'] ) );
1553
  }
1554
 
1555
  if ( isset( $_REQUEST['tax_action'] ) ) {
1556
+ $tax_actions = array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['tax_action'] ) );
1557
  } else {
1558
  $tax_actions = NULL;
1559
  }
2066
  if ( isset( $_GET['meta_slug'] ) ) {
2067
  $save_lang = $sitepress->get_current_language();
2068
  $sitepress->switch_lang( $lang['code'] );
2069
+ $meta_view = $this->mla_list_table->mla_get_view( sanitize_text_field( wp_unslash( $_GET['meta_slug'] ) ), '' );
2070
  $sitepress->switch_lang( $save_lang );
2071
 
2072
  if ( false !== $meta_view ) {
2112
  global $sitepress;
2113
 
2114
  if ( isset( $_REQUEST['lang'] ) ) {
2115
+ $submenu_arguments['lang'] = sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) );
2116
  } else {
2117
  $submenu_arguments['lang'] = self::mla_get_table_language();
2118
  }
2134
  global $sitepress;
2135
 
2136
  if ( !empty( $_REQUEST['lang'] ) ) {
2137
+ $table_language = sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) );
2138
  } else {
2139
  if ( empty( $table_language ) && ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) ) ) {
2140
+ $query_string = parse_url( $_SERVER[ 'HTTP_REFERER' ], PHP_URL_QUERY ); // phpcs:ignore
2141
  $query = array();
2142
  parse_str( strval( $query_string ), $query );
2143
  if ( !empty( $query['lang'] ) ) {
2179
  $show_language = 'checked' == MLACore::mla_get_option( 'language_column', false, false, MLA_WPML::$mla_language_option_definitions );
2180
  $table_language = self::mla_get_table_language();
2181
  $languages = $sitepress->get_active_languages();
2182
+ $view_status = isset( $_REQUEST['status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ) : '';
2183
  if ( 1 < count( $languages ) && $view_status != 'trash' ) {
2184
  $show_translations = 'checked' == MLACore::mla_get_option( 'translations_column', false, false, MLA_WPML::$mla_language_option_definitions );
2185
  } else {
2249
 
2250
  $current_language = self::mla_get_table_language();
2251
  $languages = count( $sitepress->get_active_languages() );
2252
+ $view_status = isset( $_REQUEST['status'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ) : '';
2253
 
2254
  if ( 1 < $languages && $view_status != 'trash' ) {
2255
  $w = 22 * ( 'all' == $current_language ? $languages : $languages - 1 );
2256
+ echo '<style type="text/css">.column-icl_translations{width:' . absint( $w ) . 'px;}.column-icl_translations img{margin:2px;}</style>';
2257
  }
2258
  }
2259
 
includes/mla-main-search-box-template.php CHANGED
@@ -14,9 +14,9 @@
14
  global $post;
15
 
16
  if ( !empty( $_REQUEST['s'] ) ) {
17
- $search_value = esc_attr( stripslashes( trim( $_REQUEST['s'] ) ) );
18
- $search_fields = isset ( $_REQUEST['mla_search_fields'] ) ? $_REQUEST['mla_search_fields'] : array();
19
- $search_connector = $_REQUEST['mla_search_connector'];
20
  } else {
21
  $search_value = MLACore::mla_get_option( MLACoreOptions::MLA_SEARCH_MEDIA_FILTER_DEFAULTS );
22
  $search_fields = $search_value['search_fields'];
@@ -39,25 +39,25 @@ if ( empty( $supported_taxonomies ) ) {
39
  }
40
  ?>
41
  <p class="search-box">
42
- <label class="screen-reader-text" for="mla-media-search-input"><?php _e( 'Search Media', 'media-library-assistant' ); ?></label>
43
- <input name="s" id="mla-media-search-input" type="text" size="45" value="<?php echo $search_value ?>" />
44
- <input name="mla-search-submit" class="button" id="search-submit" type="submit" value="<?php _e( 'Search Media', 'media-library-assistant' ); ?>" /><br />
45
- <span <?php echo $controls_style ?>>
46
  <span id="search-title-span">
47
- <input name="mla_search_fields[]" id="search-title" type="checkbox" <?php echo ( in_array( 'title', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="title" /><?php _e( 'Title', 'media-library-assistant' )?>&nbsp;</span>
48
  <span id="search-title-span">
49
- <input name="mla_search_fields[]" id="search-name" type="checkbox" <?php echo ( in_array( 'name', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="name" /><?php _e( 'Name', 'media-library-assistant' )?>&nbsp;</span>
50
  <span id="search-alt-text-span">
51
- <input name="mla_search_fields[]" id="search-alt-text" type="checkbox" <?php echo ( in_array( 'alt-text', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="alt-text" /><?php _e( 'ALT Text', 'media-library-assistant' )?>&nbsp;</span>
52
  <span id="search-excerpt-span">
53
- <input name="mla_search_fields[]" id="search-excerpt" type="checkbox" <?php echo ( in_array( 'excerpt', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="excerpt" /><?php _e( 'Caption', 'media-library-assistant' )?>&nbsp;</span>
54
  <span id="search-content-span">
55
- <input name="mla_search_fields[]" id="search-content" type="checkbox" <?php echo ( in_array( 'content', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="content" /><?php _e( 'Description', 'media-library-assistant' )?>&nbsp;</span>
56
  <span id="search-file-span">
57
- <input name="mla_search_fields[]" id="search-file" type="checkbox" <?php echo ( in_array( 'file', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="file" /><?php _e( 'File', 'media-library-assistant' )?>&nbsp;</span>
58
- <span id="search-terms-span" <?php echo $terms_style ?>><input name="mla_search_fields[]" id="terms-search" type="checkbox" <?php echo ( in_array( 'terms', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="terms" /><?php _e( 'Terms', 'media-library-assistant' )?></span>
59
  <br />
60
- <input name="mla_search_connector" type="radio" <?php echo ( 'OR' === $search_connector ) ? '' : 'checked="checked"'; ?> value="AND" /><?php _e( 'and', 'media-library-assistant' ); ?>&nbsp;
61
- <input name="mla_search_connector" type="radio" <?php echo ( 'OR' === $search_connector ) ? 'checked="checked"' : ''; ?> value="OR" /><?php _e( 'or', 'media-library-assistant' ); ?>
62
  </span>
63
  </p>
14
  global $post;
15
 
16
  if ( !empty( $_REQUEST['s'] ) ) {
17
+ $search_value = trim( wp_kses( wp_unslash( $_REQUEST['s'] ), 'post' ) );
18
+ $search_fields = isset ( $_REQUEST['mla_search_fields'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['mla_search_fields'] ) ) : array();
19
+ $search_connector = isset ( $_REQUEST['mla_search_connector'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['mla_search_connector'] ) ) : 'AND';
20
  } else {
21
  $search_value = MLACore::mla_get_option( MLACoreOptions::MLA_SEARCH_MEDIA_FILTER_DEFAULTS );
22
  $search_fields = $search_value['search_fields'];
39
  }
40
  ?>
41
  <p class="search-box">
42
+ <label class="screen-reader-text" for="mla-media-search-input"><?php esc_html_e( 'Search Media', 'media-library-assistant' ); ?></label>
43
+ <input name="s" id="mla-media-search-input" type="text" size="45" value="<?php echo esc_attr( $search_value ) ?>" />
44
+ <input name="mla-search-submit" class="button" id="search-submit" type="submit" value="<?php esc_attr_e( 'Search Media', 'media-library-assistant' ); ?>" /><br />
45
+ <span <?php echo esc_html( $controls_style ) ?>>
46
  <span id="search-title-span">
47
+ <input name="mla_search_fields[]" id="search-title" type="checkbox" <?php echo ( in_array( 'title', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="title" /><?php esc_html_e( 'Title', 'media-library-assistant' )?>&nbsp;</span>
48
  <span id="search-title-span">
49
+ <input name="mla_search_fields[]" id="search-name" type="checkbox" <?php echo ( in_array( 'name', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="name" /><?php esc_html_e( 'Name', 'media-library-assistant' )?>&nbsp;</span>
50
  <span id="search-alt-text-span">
51
+ <input name="mla_search_fields[]" id="search-alt-text" type="checkbox" <?php echo ( in_array( 'alt-text', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="alt-text" /><?php esc_html_e( 'ALT Text', 'media-library-assistant' )?>&nbsp;</span>
52
  <span id="search-excerpt-span">
53
+ <input name="mla_search_fields[]" id="search-excerpt" type="checkbox" <?php echo ( in_array( 'excerpt', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="excerpt" /><?php esc_html_e( 'Caption', 'media-library-assistant' )?>&nbsp;</span>
54
  <span id="search-content-span">
55
+ <input name="mla_search_fields[]" id="search-content" type="checkbox" <?php echo ( in_array( 'content', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="content" /><?php esc_html_e( 'Description', 'media-library-assistant' )?>&nbsp;</span>
56
  <span id="search-file-span">
57
+ <input name="mla_search_fields[]" id="search-file" type="checkbox" <?php echo ( in_array( 'file', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="file" /><?php esc_html_e( 'File', 'media-library-assistant' )?>&nbsp;</span>
58
+ <span id="search-terms-span" <?php echo esc_html( $terms_style ) ?>><input name="mla_search_fields[]" id="terms-search" type="checkbox" <?php echo ( in_array( 'terms', $search_fields ) ) ? 'checked="checked"' : ''; ?> value="terms" /><?php esc_html_e( 'Terms', 'media-library-assistant' )?></span>
59
  <br />
60
+ <input name="mla_search_connector" type="radio" <?php echo ( 'OR' === $search_connector ) ? '' : 'checked="checked"'; ?> value="AND" /><?php esc_html_e( 'and', 'media-library-assistant' ); ?>&nbsp;
61
+ <input name="mla_search_connector" type="radio" <?php echo ( 'OR' === $search_connector ) ? 'checked="checked"' : ''; ?> value="OR" /><?php esc_html_e( 'or', 'media-library-assistant' ); ?>
62
  </span>
63
  </p>
includes/mla-media-modal-js-template.php CHANGED
@@ -39,55 +39,55 @@ if ( empty( $supported_taxonomies ) ) {
39
  ?>
40
  <script type="text/html" id="tmpl-mla-search-box">
41
  <div style="display: inline-block">
42
- <label class="screen-reader-text" for="mla-media-search-input"><?php _e( 'Search Media', 'media-library-assistant' ); ?>:</label>
43
  <input name="s[mla_search_value]" class="search" id="mla-media-search-input" style="width: 100%; max-width: 100%" type="search" value="{{ data.searchValue }}" placeholder="{{ data.searchBoxPlaceholder }}" />
44
  </div>
45
- <input name="mla_search_submit" class="button media-button mla-search-submit-button" id="mla-search-submit" type="submit" style="<?php echo $margin; ?>float: none" value="<?php _e( 'Search', 'media-library-assistant' ); ?>" /><br>
46
  <ul class="mla-search-options" style="{{ data.searchBoxControlsStyle }}">
47
  <li>
48
  <input type="radio" name="s[mla_search_connector]" value="AND" <# if ( 'OR' !== data.searchConnector ) { #>checked="checked"<# } #> />
49
- <?php _e( 'and', 'media-library-assistant' ); ?>
50
  </li>
51
  <li>
52
  <input type="radio" name="s[mla_search_connector]" value="OR" <# if ( 'OR' === data.searchConnector ) { #>checked="checked"<# } #> />
53
- <?php _e( 'or', 'media-library-assistant' ); ?>
54
  </li>
55
  <li>
56
  <input type="checkbox" name="s[mla_search_title]" id="search-title" value="title" <# if ( -1 != data.searchFields.indexOf( 'title' ) ) { #>checked<# } #> />
57
- <?php _e( 'Title', 'media-library-assistant' ); ?>
58
  </li>
59
  <li>
60
  <input type="checkbox" name="s[mla_search_name]" id="search-name" value="name" <# if ( -1 != data.searchFields.indexOf( 'name' ) ) { #>checked<# } #> />
61
- <?php _e( 'Name', 'media-library-assistant' ); ?>
62
  </li>
63
  <li>
64
  <input type="checkbox" name="s[mla_search_alt_text]" id="search-alt-text" value="alt-text" <# if ( -1 != data.searchFields.indexOf( 'alt-text' ) ) { #>checked<# } #> />
65
- <?php _e( 'ALT Text', 'media-library-assistant' ); ?>
66
  </li>
67
  <br style="clear: both">
68
  <li>
69
  <input type="checkbox" name="s[mla_search_excerpt]" id="search-excerpt" value="excerpt" <# if ( -1 != data.searchFields.indexOf( 'excerpt' ) ) { #>checked<# } #> />
70
- <?php _e( 'Caption', 'media-library-assistant' ); ?>
71
  </li>
72
  <li>
73
  <input type="checkbox" name="s[mla_search_content]" id="search-content" value="content" <# if ( -1 != data.searchFields.indexOf( 'content' ) ) { #>checked<# } #> />
74
- <?php _e( 'Description', 'media-library-assistant' ); ?>
75
  </li>
76
  <li>
77
  <input type="checkbox" name="s[mla_search_file]" id="search-file" value="file" <# if ( -1 != data.searchFields.indexOf( 'file' ) ) { #>checked<# } #> />
78
- <?php _e( 'File', 'media-library-assistant' ); ?>
79
  </li>
80
- <span <?php echo $terms_style ?>>
81
  <li>
82
  <input type="checkbox" name="s[mla_search_terms]" id="search-terms" value="terms" <# if ( -1 != data.searchFields.indexOf( 'terms' ) ) { #>checked<# } #> />
83
- <?php _e( 'Terms', 'media-library-assistant' ); ?>
84
  </li>
85
  </span>
86
  </ul>
87
  </script>
88
  <script type="text/html" id="tmpl-mla-terms-search-button">
89
- <input name="mla_terms_search" id="mla-terms-search" class="button media-button button-large mla-terms-search-button" style="<?php echo $margin; ?>" type="button" value="<?php _e( 'Terms Search', 'media-library-assistant' ); ?>" />
90
  </script>
91
  <script type="text/html" id="tmpl-mla-simulate-search-button">
92
- <input style="display:none" type="button" name="mla_search_submit" id="mla-search-submit" class="button" value="<?php _e( 'Search', 'media-library-assistant' ); ?>" />
93
  </script>
39
  ?>
40
  <script type="text/html" id="tmpl-mla-search-box">
41
  <div style="display: inline-block">
42
+ <label class="screen-reader-text" for="mla-media-search-input"><?php esc_html_e( 'Search Media', 'media-library-assistant' ); ?>:</label>
43
  <input name="s[mla_search_value]" class="search" id="mla-media-search-input" style="width: 100%; max-width: 100%" type="search" value="{{ data.searchValue }}" placeholder="{{ data.searchBoxPlaceholder }}" />
44
  </div>
45
+ <input name="mla_search_submit" class="button media-button mla-search-submit-button" id="mla-search-submit" type="submit" style="<?php echo esc_attr( $margin ) ?>float: none" value="<?php esc_attr_e( 'Search', 'media-library-assistant' ); ?>" /><br>
46
  <ul class="mla-search-options" style="{{ data.searchBoxControlsStyle }}">
47
  <li>
48
  <input type="radio" name="s[mla_search_connector]" value="AND" <# if ( 'OR' !== data.searchConnector ) { #>checked="checked"<# } #> />
49
+ <?php esc_html_e( 'and', 'media-library-assistant' ); ?>
50
  </li>
51
  <li>
52
  <input type="radio" name="s[mla_search_connector]" value="OR" <# if ( 'OR' === data.searchConnector ) { #>checked="checked"<# } #> />
53
+ <?php esc_html_e( 'or', 'media-library-assistant' ); ?>
54
  </li>
55
  <li>
56
  <input type="checkbox" name="s[mla_search_title]" id="search-title" value="title" <# if ( -1 != data.searchFields.indexOf( 'title' ) ) { #>checked<# } #> />
57
+ <?php esc_html_e( 'Title', 'media-library-assistant' ); ?>
58
  </li>
59
  <li>
60
  <input type="checkbox" name="s[mla_search_name]" id="search-name" value="name" <# if ( -1 != data.searchFields.indexOf( 'name' ) ) { #>checked<# } #> />
61
+ <?php esc_html_e( 'Name', 'media-library-assistant' ); ?>
62
  </li>
63
  <li>
64
  <input type="checkbox" name="s[mla_search_alt_text]" id="search-alt-text" value="alt-text" <# if ( -1 != data.searchFields.indexOf( 'alt-text' ) ) { #>checked<# } #> />
65
+ <?php esc_html_e( 'ALT Text', 'media-library-assistant' ); ?>
66
  </li>
67
  <br style="clear: both">
68
  <li>
69
  <input type="checkbox" name="s[mla_search_excerpt]" id="search-excerpt" value="excerpt" <# if ( -1 != data.searchFields.indexOf( 'excerpt' ) ) { #>checked<# } #> />
70
+ <?php esc_html_e( 'Caption', 'media-library-assistant' ); ?>
71
  </li>
72
  <li>
73
  <input type="checkbox" name="s[mla_search_content]" id="search-content" value="content" <# if ( -1 != data.searchFields.indexOf( 'content' ) ) { #>checked<# } #> />
74
+ <?php esc_html_e( 'Description', 'media-library-assistant' ); ?>
75
  </li>
76
  <li>
77
  <input type="checkbox" name="s[mla_search_file]" id="search-file" value="file" <# if ( -1 != data.searchFields.indexOf( 'file' ) ) { #>checked<# } #> />
78
+ <?php esc_html_e( 'File', 'media-library-assistant' ); ?>
79
  </li>
80
+ <span <?php echo esc_attr( $terms_style ) ?>>
81
  <li>
82
  <input type="checkbox" name="s[mla_search_terms]" id="search-terms" value="terms" <# if ( -1 != data.searchFields.indexOf( 'terms' ) ) { #>checked<# } #> />
83
+ <?php esc_html_e( 'Terms', 'media-library-assistant' ); ?>
84
  </li>
85
  </span>
86
  </ul>
87
  </script>
88
  <script type="text/html" id="tmpl-mla-terms-search-button">
89
+ <input name="mla_terms_search" id="mla-terms-search" class="button media-button button-large mla-terms-search-button" style="<?php echo esc_attr( $margin ) ?>" type="button" value="<?php esc_attr_e( 'Terms Search', 'media-library-assistant' ); ?>" />
90
  </script>
91
  <script type="text/html" id="tmpl-mla-simulate-search-button">
92
+ <input style="display:none" type="button" name="mla_search_submit" id="mla-search-submit" class="button" value="<?php esc_attr_e( 'Search', 'media-library-assistant' ); ?>" />
93
  </script>
includes/mla-plugin-loader.php CHANGED
@@ -47,9 +47,9 @@ $mla_plugin_loader_error_messages = '';
47
  function mla_plugin_loader_reporting_action () {
48
  global $mla_plugin_loader_error_messages;
49
 
50
- echo '<div class="error"><p><strong>' . __( 'The Media Library Assistant cannot load.', 'media-library-assistant' ) . '</strong></p>'."\r\n";
51
- echo "<ul>{$mla_plugin_loader_error_messages}</ul>\r\n";
52
- echo '<p>' . __( 'You must resolve these conflicts before this plugin can safely load.', 'media-library-assistant' ) . '</p></div>'."\r\n";
53
  }
54
 
55
  // Basic library of run-time tests.
@@ -70,7 +70,7 @@ if ( ! empty( $mla_plugin_loader_error_messages ) ) {
70
  add_action( 'init', 'MLACore::initialize', 0x7FFFFFFF );
71
 
72
  // WP/LR Sync plugin has its own protocol to process uploads
73
- $is_wplr_sync = isset( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], '/?wplr-sync-api' );
74
 
75
  // Check for XMLPRC, WP REST API and front end requests
76
  if( !( defined('WP_ADMIN') && WP_ADMIN ) ) {
@@ -82,7 +82,7 @@ if ( ! empty( $mla_plugin_loader_error_messages ) ) {
82
  }
83
 
84
  // WP REST API calls need everything loaded to process uploads
85
- if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json/' ) ) {
86
  $front_end_only = false; // TODO be more selective
87
  }
88
 
47
  function mla_plugin_loader_reporting_action () {
48
  global $mla_plugin_loader_error_messages;
49
 
50
+ echo '<div class="error"><p><strong>' . esc_html__( 'The Media Library Assistant cannot load.', 'media-library-assistant' ) . '</strong></p>'."\r\n";
51
+ echo "<ul>" . esc_html( $mla_plugin_loader_error_messages ) . "</ul>\r\n";
52
+ echo '<p>' . esc_html__( 'You must resolve these conflicts before this plugin can safely load.', 'media-library-assistant' ) . '</p></div>'."\r\n";
53
  }
54
 
55
  // Basic library of run-time tests.
70
  add_action( 'init', 'MLACore::initialize', 0x7FFFFFFF );
71
 
72
  // WP/LR Sync plugin has its own protocol to process uploads
73
+ $is_wplr_sync = isset( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], '/?wplr-sync-api' ); // phpcs:ignore
74
 
75
  // Check for XMLPRC, WP REST API and front end requests
76
  if( !( defined('WP_ADMIN') && WP_ADMIN ) ) {
82
  }
83
 
84
  // WP REST API calls need everything loaded to process uploads
85
+ if ( isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( $_SERVER['REQUEST_URI'], '/wp-json/' ) ) { // phpcs:ignore
86
  $front_end_only = false; // TODO be more selective
87
  }
88
 
index.php CHANGED
@@ -6,7 +6,7 @@
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
- * @version 2.83
10
  */
11
 
12
  /*
@@ -16,7 +16,7 @@ Description: Enhances the Media Library; powerful [mla_gallery] [mla_tag_cloud]
16
  Author: David Lingren
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
- Version: 2.84
20
  Author URI: http://davidlingren.com/
21
 
22
  Copyright 2011-2020 David Lingren
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
+ * @version 2.90
10
  */
11
 
12
  /*
16
  Author: David Lingren
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
+ Version: 2.90
20
  Author URI: http://davidlingren.com/
21
 
22
  Copyright 2011-2020 David Lingren
js/mla-edit-media-scripts.js CHANGED
@@ -209,7 +209,7 @@ var jQuery,
209
  if ( ! $div.length )
210
  return true;
211
 
212
- var attemptedDate, originalDate, currentDate,
213
  aa = $( '#aa', $div ).val(), mm = $( '#mm', $div ).val(), jj = $( '#jj', $div ).val(),
214
  hh = $( '#hh', $div ).val(), mn = $( '#mn', $div ).val();
215
 
@@ -231,15 +231,26 @@ var jQuery,
231
  $( stampdiv ).html( stamp );
232
  } else {
233
  label = '#upload-timestamp' == stampdiv ? mla.settings.uploadLabel : mla.settings.modifyLabel;
234
- $( stampdiv ).html(
235
- label + '<b>' +
236
- postL10n.dateFormat
 
 
 
 
 
 
 
 
237
  .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
238
  .replace( '%2$s', parseInt( jj, 10 ) )
239
  .replace( '%3$s', aa )
240
  .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
241
- .replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
242
- '</b> '
 
 
 
243
  );
244
  }
245
 
209
  if ( ! $div.length )
210
  return true;
211
 
212
+ var attemptedDate, originalDate, currentDate, label, value,
213
  aa = $( '#aa', $div ).val(), mm = $( '#mm', $div ).val(), jj = $( '#jj', $div ).val(),
214
  hh = $( '#hh', $div ).val(), mn = $( '#mn', $div ).val();
215
 
231
  $( stampdiv ).html( stamp );
232
  } else {
233
  label = '#upload-timestamp' == stampdiv ? mla.settings.uploadLabel : mla.settings.modifyLabel;
234
+
235
+ // wp.i18n replaced postL10n in WP 5.0
236
+ if ( 'object' === typeof wp.i18n ) {
237
+ value = wp.i18n.__( '%1$s %2$s, %3$s at %4$s:%5$s' )
238
+ .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
239
+ .replace( '%2$s', parseInt( jj, 10 ) )
240
+ .replace( '%3$s', aa )
241
+ .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
242
+ .replace( '%5$s', ( '00' + mn ).slice( -2 ) );
243
+ } else {
244
+ value = postL10n.dateFormat
245
  .replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
246
  .replace( '%2$s', parseInt( jj, 10 ) )
247
  .replace( '%3$s', aa )
248
  .replace( '%4$s', ( '00' + hh ).slice( -2 ) )
249
+ .replace( '%5$s', ( '00' + mn ).slice( -2 ) );
250
+ }
251
+
252
+ $( stampdiv ).html(
253
+ label + '<b>' + value + '</b> '
254
  );
255
  }
256
 
js/mla-edit-media-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var jQuery,mla_edit_media_vars,mla={settings:{},utility:{},setParent:null,mlaEditAttachment:null};(function(a){mla.settings=typeof mla_edit_media_vars==="undefined"?{}:mla_edit_media_vars;mla_edit_media_vars=void 0;mla.mlaEditAttachment={$uploaddiv:null,uploadtimestamp:"",$modifydiv:null,modifytimestamp:"",init:function(){a("#mla_set_parent").on("click",function(){return mla.mlaEditAttachment.setParentOpen()});a(".categorydiv").each(function(){var d=a(this).attr("id"),c,b;c=d.split("-");c.shift();b=c.join("-");a.extend(a.expr[":"],{matchTerms:function(g,f,e,h){return(g.textContent||g.innerText||"").toLowerCase().indexOf((e[3]||"").toLowerCase())>=0}});a("#search-"+b).keypress(function(e){if(13===e.keyCode){e.preventDefault();a("#search-"+b).val("");a("#"+b+"-searcher").addClass("wp-hidden-children");a("#"+b+"checklist li").show();a("#"+b+"checklist-pop li").show();return}});a("#search-"+b).keyup(function(g){var i,h,j,f,e;if(13===g.keyCode){g.preventDefault();a("#"+b+"-search-toggle").focus();return}i=a("#search-"+b).val();h=a("#"+b+"checklist li");j=a("#"+b+"checklist-pop li");if(0<i.length){h.hide();j.hide()}else{h.show();j.show()}f=a("#"+b+"checklist label:matchTerms('"+i+"')");f.closest("li").find("li").andSelf().show();f.parents("#"+b+"checklist li").show();e=a("#"+b+"checklist-pop label:matchTerms('"+i+"')");e.closest("li").find("li").andSelf().show();e.parents("#"+b+"checklist li").show()});a("#"+b+"-search-toggle").click(function(){a("#"+b+"-adder ").addClass("wp-hidden-children");a("#"+b+"-searcher").toggleClass("wp-hidden-children");a('a[href="#'+b+'-all"]',"#"+b+"-tabs").click();a("#"+b+"checklist li").show();a("#"+b+"checklist-pop li").show();if(false===a("#"+b+"-searcher").hasClass("wp-hidden-children")){a("#search-"+b).val("").removeClass("form-input-tip");a("#search-"+b).focus()}return false});a("#"+b+"-add-toggle").click(function(){a("#"+b+"-searcher").addClass("wp-hidden-children");return false})});if(a("#submitdiv").length){mla.mlaEditAttachment.uploadtimestamp=a("#upload-timestamp").html();mla.mlaEditAttachment.$uploaddiv=a("#timestampdiv");mla.mlaEditAttachment.$uploaddiv.siblings("a.edit-timestamp").click(function(b){if(mla.mlaEditAttachment.$uploaddiv.is(":hidden")){mla.mlaEditAttachment.$uploaddiv.slideDown("fast",function(){a("input, select",mla.mlaEditAttachment.$uploaddiv.find(".timestamp-wrap")).first().focus()});a(this).hide()}b.preventDefault()});mla.mlaEditAttachment.$uploaddiv.find(".cancel-timestamp").click(function(b){mla.mlaEditAttachment.$uploaddiv.slideUp("fast").siblings("a.edit-timestamp").show().focus();a("#mm",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_mm",mla.mlaEditAttachment.$uploaddiv).val());a("#jj",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_jj",mla.mlaEditAttachment.$uploaddiv).val());a("#aa",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_aa",mla.mlaEditAttachment.$uploaddiv).val());a("#hh",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_hh",mla.mlaEditAttachment.$uploaddiv).val());a("#mn",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_mn",mla.mlaEditAttachment.$uploaddiv).val());mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp");b.preventDefault()});mla.mlaEditAttachment.$uploaddiv.find(".save-timestamp").click(function(b){if(mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp")){mla.mlaEditAttachment.$uploaddiv.slideUp("fast");mla.mlaEditAttachment.$uploaddiv.siblings("a.edit-timestamp").show().focus()}b.preventDefault()});a("#post").on("submit",function(b){if(!mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp")){b.preventDefault();mla.mlaEditAttachment.$uploaddiv.show();if(wp.autosave){wp.autosave.enableButtons()}a("#publishing-action .spinner").removeClass("is-active")}})}},setParentOpen:function(){var d,b,c;d=a("#mla_post_parent").val()||"";b=a("#post_ID").val()||"";c=a("#title").val()||"";mla.setParent.open(d,b,c);a("#mla-set-parent-submit").on("click",function(e){e.preventDefault();mla.mlaEditAttachment.setParentSave();return false})},setParentSave:function(){var d=a("#mla-set-parent-response-div input:checked").closest("tr"),f,c,b,e;if(d.length){f=a(":radio",d).val()||"";c=a("label",d).html()||"";b=a("#mla_post_parent").clone(true).val(f);e=a("#mla_parent_info").clone(true).val(c);a("#mla_post_parent").replaceWith(b);a("#mla_parent_info").replaceWith(e);mla.setParent.close()}a("#mla-set-parent-submit").off("click")},updateText:function(k,c,h){if(!k.length){return true}var j,l,d,b=a("#aa",k).val(),g=a("#mm",k).val(),i=a("#jj",k).val(),f=a("#hh",k).val(),e=a("#mn",k).val();j=new Date(b,g-1,i,f,e);l=new Date(a("#hidden_aa",k).val(),a("#hidden_mm",k).val()-1,a("#hidden_jj",k).val(),a("#hidden_hh",k).val(),a("#hidden_mn",k).val());d=new Date(a("#cur_aa",k).val(),a("#cur_mm",k).val()-1,a("#cur_jj",k).val(),a("#cur_hh",k).val(),a("#cur_mn",k).val());if(j.getFullYear()!=b||(1+j.getMonth())!=g||j.getDate()!=i||j.getMinutes()!=e){k.find(".timestamp-wrap").addClass("form-invalid");return false}else{k.find(".timestamp-wrap").removeClass("form-invalid")}if(l.toUTCString()==j.toUTCString()){a(h).html(c)}else{label="#upload-timestamp"==h?mla.settings.uploadLabel:mla.settings.modifyLabel;a(h).html(label+"<b>"+postL10n.dateFormat.replace("%1$s",a('option[value="'+g+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",b).replace("%4$s",("00"+f).slice(-2)).replace("%5$s",("00"+e).slice(-2))+"</b> ")}return true}};a(document).ready(function(){mla.mlaEditAttachment.init()})})(jQuery);
1
+ var jQuery,mla_edit_media_vars,mla={settings:{},utility:{},setParent:null,mlaEditAttachment:null};(function(a){mla.settings=typeof mla_edit_media_vars==="undefined"?{}:mla_edit_media_vars;mla_edit_media_vars=void 0;mla.mlaEditAttachment={$uploaddiv:null,uploadtimestamp:"",$modifydiv:null,modifytimestamp:"",init:function(){a("#mla_set_parent").on("click",function(){return mla.mlaEditAttachment.setParentOpen()});a(".categorydiv").each(function(){var d=a(this).attr("id"),c,b;c=d.split("-");c.shift();b=c.join("-");a.extend(a.expr[":"],{matchTerms:function(g,f,e,h){return(g.textContent||g.innerText||"").toLowerCase().indexOf((e[3]||"").toLowerCase())>=0}});a("#search-"+b).keypress(function(e){if(13===e.keyCode){e.preventDefault();a("#search-"+b).val("");a("#"+b+"-searcher").addClass("wp-hidden-children");a("#"+b+"checklist li").show();a("#"+b+"checklist-pop li").show();return}});a("#search-"+b).keyup(function(g){var i,h,j,f,e;if(13===g.keyCode){g.preventDefault();a("#"+b+"-search-toggle").focus();return}i=a("#search-"+b).val();h=a("#"+b+"checklist li");j=a("#"+b+"checklist-pop li");if(0<i.length){h.hide();j.hide()}else{h.show();j.show()}f=a("#"+b+"checklist label:matchTerms('"+i+"')");f.closest("li").find("li").andSelf().show();f.parents("#"+b+"checklist li").show();e=a("#"+b+"checklist-pop label:matchTerms('"+i+"')");e.closest("li").find("li").andSelf().show();e.parents("#"+b+"checklist li").show()});a("#"+b+"-search-toggle").click(function(){a("#"+b+"-adder ").addClass("wp-hidden-children");a("#"+b+"-searcher").toggleClass("wp-hidden-children");a('a[href="#'+b+'-all"]',"#"+b+"-tabs").click();a("#"+b+"checklist li").show();a("#"+b+"checklist-pop li").show();if(false===a("#"+b+"-searcher").hasClass("wp-hidden-children")){a("#search-"+b).val("").removeClass("form-input-tip");a("#search-"+b).focus()}return false});a("#"+b+"-add-toggle").click(function(){a("#"+b+"-searcher").addClass("wp-hidden-children");return false})});if(a("#submitdiv").length){mla.mlaEditAttachment.uploadtimestamp=a("#upload-timestamp").html();mla.mlaEditAttachment.$uploaddiv=a("#timestampdiv");mla.mlaEditAttachment.$uploaddiv.siblings("a.edit-timestamp").click(function(b){if(mla.mlaEditAttachment.$uploaddiv.is(":hidden")){mla.mlaEditAttachment.$uploaddiv.slideDown("fast",function(){a("input, select",mla.mlaEditAttachment.$uploaddiv.find(".timestamp-wrap")).first().focus()});a(this).hide()}b.preventDefault()});mla.mlaEditAttachment.$uploaddiv.find(".cancel-timestamp").click(function(b){mla.mlaEditAttachment.$uploaddiv.slideUp("fast").siblings("a.edit-timestamp").show().focus();a("#mm",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_mm",mla.mlaEditAttachment.$uploaddiv).val());a("#jj",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_jj",mla.mlaEditAttachment.$uploaddiv).val());a("#aa",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_aa",mla.mlaEditAttachment.$uploaddiv).val());a("#hh",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_hh",mla.mlaEditAttachment.$uploaddiv).val());a("#mn",mla.mlaEditAttachment.$uploaddiv).val(a("#hidden_mn",mla.mlaEditAttachment.$uploaddiv).val());mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp");b.preventDefault()});mla.mlaEditAttachment.$uploaddiv.find(".save-timestamp").click(function(b){if(mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp")){mla.mlaEditAttachment.$uploaddiv.slideUp("fast");mla.mlaEditAttachment.$uploaddiv.siblings("a.edit-timestamp").show().focus()}b.preventDefault()});a("#post").on("submit",function(b){if(!mla.mlaEditAttachment.updateText(mla.mlaEditAttachment.$uploaddiv,mla.mlaEditAttachment.uploadtimestamp,"#upload-timestamp")){b.preventDefault();mla.mlaEditAttachment.$uploaddiv.show();if(wp.autosave){wp.autosave.enableButtons()}a("#publishing-action .spinner").removeClass("is-active")}})}},setParentOpen:function(){var d,b,c;d=a("#mla_post_parent").val()||"";b=a("#post_ID").val()||"";c=a("#title").val()||"";mla.setParent.open(d,b,c);a("#mla-set-parent-submit").on("click",function(e){e.preventDefault();mla.mlaEditAttachment.setParentSave();return false})},setParentSave:function(){var d=a("#mla-set-parent-response-div input:checked").closest("tr"),f,c,b,e;if(d.length){f=a(":radio",d).val()||"";c=a("label",d).html()||"";b=a("#mla_post_parent").clone(true).val(f);e=a("#mla_parent_info").clone(true).val(c);a("#mla_post_parent").replaceWith(b);a("#mla_parent_info").replaceWith(e);mla.setParent.close()}a("#mla-set-parent-submit").off("click")},updateText:function(k,c,h){if(!k.length){return true}var j,l,d,m,n,b=a("#aa",k).val(),g=a("#mm",k).val(),i=a("#jj",k).val(),f=a("#hh",k).val(),e=a("#mn",k).val();j=new Date(b,g-1,i,f,e);l=new Date(a("#hidden_aa",k).val(),a("#hidden_mm",k).val()-1,a("#hidden_jj",k).val(),a("#hidden_hh",k).val(),a("#hidden_mn",k).val());d=new Date(a("#cur_aa",k).val(),a("#cur_mm",k).val()-1,a("#cur_jj",k).val(),a("#cur_hh",k).val(),a("#cur_mn",k).val());if(j.getFullYear()!=b||(1+j.getMonth())!=g||j.getDate()!=i||j.getMinutes()!=e){k.find(".timestamp-wrap").addClass("form-invalid");return false}else{k.find(".timestamp-wrap").removeClass("form-invalid")}if(l.toUTCString()==j.toUTCString()){a(h).html(c)}else{m="#upload-timestamp"==h?mla.settings.uploadLabel:mla.settings.modifyLabel;if("object"===typeof wp.i18n){n=wp.i18n.__("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",a('option[value="'+g+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",b).replace("%4$s",("00"+f).slice(-2)).replace("%5$s",("00"+e).slice(-2))}else{n=postL10n.dateFormat.replace("%1$s",a('option[value="'+g+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",b).replace("%4$s",("00"+f).slice(-2)).replace("%5$s",("00"+e).slice(-2))}a(h).html(m+"<b>"+n+"</b> ")}return true}};a(document).ready(function(){mla.mlaEditAttachment.init()})})(jQuery);
js/mla-media-modal-scripts.js CHANGED
@@ -124,7 +124,7 @@ var wp, wpAjax, ajaxurl, jQuery, _,
124
  */
125
  mlaModal.utility.originalMediaAjax = wp.media.ajax;
126
  wp.media.ajax = function( action, options ) {
127
- var state = mlaModal.settings.state, query, stype, s, searchValues;
128
 
129
  if ( _.isObject( action ) ) {
130
  options = action;
@@ -172,13 +172,22 @@ var wp, wpAjax, ajaxurl, jQuery, _,
172
  'mla_search_clicks': mlaModal.settings.query[state].searchClicks,
173
  'mla_search_value': mlaModal.settings.query[state].searchValue,
174
  'mla_search_fields': mlaModal.settings.query[state].searchFields,
175
- 'mla_search_connector': mlaModal.settings.query[state].searchConnector };
 
176
 
177
  //Terms Search is not sticky
178
  mlaModal.settings.query[state].termsSearch = '';
179
  $( '#mla-terms-search-input' ).html( '' ).val( '' );
180
 
181
  options.data.query.s = searchValues;
 
 
 
 
 
 
 
 
182
  }
183
 
184
  return mlaModal.utility.originalMediaAjax.call(this, options );
@@ -1772,7 +1781,7 @@ this.listenTo( this, 'all', this.selectionEvent );
1772
  var t = $(this), c = t.is(':checked'), id = t.val();
1773
 
1774
  if ( id && t.parents( '#mla-taxonomy-'+ taxonomy ).length ) {
1775
- $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
1776
  }
1777
  });
1778
 
124
  */
125
  mlaModal.utility.originalMediaAjax = wp.media.ajax;
126
  wp.media.ajax = function( action, options ) {
127
+ var state = mlaModal.settings.state, query, stype, s, searchValues, parentArray;
128
 
129
  if ( _.isObject( action ) ) {
130
  options = action;
172
  'mla_search_clicks': mlaModal.settings.query[state].searchClicks,
173
  'mla_search_value': mlaModal.settings.query[state].searchValue,
174
  'mla_search_fields': mlaModal.settings.query[state].searchFields,
175
+ 'mla_search_connector': mlaModal.settings.query[state].searchConnector,
176
+ };
177
 
178
  //Terms Search is not sticky
179
  mlaModal.settings.query[state].termsSearch = '';
180
  $( '#mla-terms-search-input' ).html( '' ).val( '' );
181
 
182
  options.data.query.s = searchValues;
183
+
184
+ // Look for ACF Gallery queries to apply filters
185
+ if ( $( document.activeElement ).hasClass( 'acf-button' ) ) {
186
+ parentArray = $( document.activeElement ).parentsUntil("div.acf-fields");
187
+ if ( parentArray.length ) {
188
+ options.data.query._acfuploader = $( parentArray[parentArray.length - 1] ).attr('data-key');
189
+ }
190
+ }
191
  }
192
 
193
  return mlaModal.utility.originalMediaAjax.call(this, options );
1781
  var t = $(this), c = t.is(':checked'), id = t.val();
1782
 
1783
  if ( id && t.parents( '#mla-taxonomy-'+ taxonomy ).length ) {
1784
+ $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id, '#mla-taxonomy-'+ taxonomy).prop( 'checked', c );
1785
  }
1786
  });
1787
 
js/mla-media-modal-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var wp,wpAjax,ajaxurl,jQuery,_,getUserSetting,setUserSetting,deleteUserSetting,mlaTaxonomy,mlaModal={strings:{},settings:{},initialHTML:{},uploading:false,cid:null,utility:{originalMediaAjax:null,mlaAttachmentsBrowser:null,parseTermsOptions:null,arrayCleanup:null,parseTaxonomyId:null,hookCompatTaxonomies:null,fillCompatTaxonomies:null,supportCompatTaxonomies:null},tagBox:null};(function(d){var c=wp.media.view.AttachmentsBrowser,b=wp.media.view.AttachmentCompat,a=wp.media.model.Selection;mlaModal.strings=typeof wp.media.view.l10n.mla_strings==="undefined"?{}:wp.media.view.l10n.mla_strings;delete wp.media.view.l10n.mla_strings;mlaModal.settings=typeof wp.media.view.settings.mla_settings==="undefined"?{screen:"unknown",enableMediaGrid:false,enableMediaModal:false}:wp.media.view.settings.mla_settings;delete wp.media.view.settings.mla_settings;if(!(mlaModal.settings.enableMediaGrid||mlaModal.settings.enableMediaModal)){return}if(("grid"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaGrid){return}if(("modal"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaModal){return}mlaModal.settings.pagenow=typeof pagenow==="undefined"?"unknown":pagenow;if(mlaModal.settings.pagenow==="toolset_page_views-editor"){return}mlaModal.utility.originalMediaAjax=wp.media.ajax;wp.media.ajax=function(k,g){var j=mlaModal.settings.state,i,f,h,e;if(_.isObject(k)){g=k}else{g=g||{};g.data=_.extend(g.data||{},{action:k})}if("query-attachments"==g.data.action){i=g.data.query;f=typeof i.s;if("object"==f){h=i.s}else{if("string"==f){h={mla_search_value:i.s}}else{h={mla_search_value:""}}}if("undefined"!=typeof i.post_mime_type){mlaModal.settings.query[j].filterMime=i.post_mime_type}else{mlaModal.settings.query[j].filterMime="all"}if("undefined"!=typeof h.mla_filter_month){mlaModal.settings.query[j].filterMonth=h.mla_filter_month}else{if("undefined"!=typeof i.year){mlaModal.settings.query[j].filterMonth=(100*i.year)+(1*i.monthnum)}else{}}if("undefined"!=typeof h.mla_filter_term){mlaModal.settings.query[j].filterTerm=h.mla_filter_term}if("undefined"!=typeof h.mla_search_value){mlaModal.settings.query[j].searchValue=h.mla_search_value}e={mla_filter_month:mlaModal.settings.query[j].filterMonth,mla_filter_term:mlaModal.settings.query[j].filterTerm,mla_terms_search:mlaModal.settings.query[j].termsSearch,mla_search_clicks:mlaModal.settings.query[j].searchClicks,mla_search_value:mlaModal.settings.query[j].searchValue,mla_search_fields:mlaModal.settings.query[j].searchFields,mla_search_connector:mlaModal.settings.query[j].searchConnector};mlaModal.settings.query[j].termsSearch="";d("#mla-terms-search-input").html("").val("");g.data.query.s=e}return mlaModal.utility.originalMediaAjax.call(this,g)};if(mlaModal.settings.enableMimeTypes){wp.media.view.AttachmentFilters.Mla=wp.media.view.AttachmentFilters.extend({createFilters:function(){var f=this.controller._state,e={};_.each(mlaModal.settings.allMimeTypes||{},function(h,g){if(("grid"===mlaModal.settings.screen)||("trash"!==g)){e[g]={text:h,props:{type:g,uploadedTo:null,orderby:"date",order:"DESC"}}}});e.all={text:wp.media.view.l10n.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};if(wp.media.view.settings.post.id){e.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}this.filters=e;if("undefined"===typeof e[mlaModal.settings.query[f].filterMime]){mlaModal.settings.query[f].filterMime="all"}if(mlaModal.settings.query[f].filterMime!="all"){this.model.set(e[mlaModal.settings.query[f].filterMime].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMime,f=e.toJSON();if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}_.find(this.filters,function(j,k){var i=_.all(j.props,function(m,l){return m===(_.isUndefined(f[l])?null:f[l])});if(i){return g=k}});this.$el.val(g)},change:function(){var f=d(this.el).closest("div.media-toolbar"),e=this.filters[this.el.value];if(e){this.model.set(e.props,{silent:true});d("#mla-search-submit",f).click()}}});wp.media.view.AttachmentFilters.MlaUploaded=wp.media.view.AttachmentFilters.extend({createFilters:function(){var f=this.model.get("type"),e=wp.media.view.settings.mimeTypes,i,h=this.controller._state,g={};if(e&&f){i=e[f]}_.each(mlaModal.settings.uploadMimeTypes||{},function(k,j){if(("grid"===mlaModal.settings.screen)||("trash"!==j)){g[j]={text:k,props:{type:j,uploadedTo:null,orderby:"date",order:"DESC"}}}});g.all={text:i||wp.media.view.l10n.allMediaItems,props:{uploadedTo:null,orderby:"date",order:"DESC"},priority:10};g.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20};g.unattached={text:wp.media.view.l10n.unattached,props:{uploadedTo:0,orderby:"menuOrder",order:"ASC"},priority:50};this.filters=g;if("undefined"===typeof g[mlaModal.settings.query[h].filterUploaded]){mlaModal.settings.query[h].filterUploaded="all"}if(mlaModal.settings.query[h].filterUploaded!="all"){this.model.set(g[mlaModal.settings.query[h].filterUploaded].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMime,f=e.toJSON();if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}_.find(this.filters,function(j,k){var i=_.all(j.props,function(m,l){return m===(_.isUndefined(f[l])?null:f[l])});if(i){return g=k}});this.$el.val(g)},change:function(){var f=d(this.el).closest("div.media-toolbar"),e=this.filters[this.el.value];if(e){this.model.set(e.props,{silent:true});d("#mla-search-submit",f).click()}}})}if(mlaModal.settings.enableMonthsDropdown){wp.media.view.AttachmentFilters.MlaMonths=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-date-filters",createFilters:function(){var f=this.controller._state,e={};_.each(mlaModal.settings.months||{},function(h,g){e[g]={text:h,props:{s:{mla_filter_month:g}}}});this.filters=e;if("undefined"===typeof e[mlaModal.settings.query[f].filterMonth]){mlaModal.settings.query[f].filterMonth=0}if(mlaModal.settings.query[f].filterMonth>0){this.model.set(e[mlaModal.settings.query[f].filterMonth].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMonth,f=e.toJSON();if(_.isUndefined(f.s)){f.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}if(_.isUndefined(f.s.mla_filter_month)){f.s.mla_filter_month=mlaModal.settings.query[h].filterMonth}else{mlaModal.settings.query[h].filterMonth=f.s.mla_filter_month}_.find(this.filters,function(j,k){var i=_.all(j.props,function(l){return l.mla_filter_month==mlaModal.settings.query[h].filterMonth});if(i){return g=k}});this.$el.val(g)},change:function(){var e=this.filters[this.el.value],f;if(e){f={s:{mla_filter_month:e.props.s.mla_filter_month}};this.model.set(f)}}})}if(mlaModal.settings.enableTermsDropdown){wp.media.view.AttachmentFilters.MlaTerms=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-term-filters",createFilters:function(){var h=this.controller._state,e,f,g={};_.each(mlaModal.settings.termsText||{},function(j,i){if(mlaModal.settings.termsCustom){f=mlaModal.settings.termsValue[i]}else{f=parseInt(mlaModal.settings.termsValue[i])}g[i]={text:j,props:{s:{mla_filter_term:f}}}});this.filters=g;e=_.indexOf(mlaModal.settings.termsValue,mlaModal.settings.query[h].filterTerm);if(e>0){this.model.set(g[e].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterTerm,f=e.toJSON();if(_.isUndefined(f.s)){f.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}if(_.isUndefined(f.s.mla_filter_term)){f.s.mla_filter_term=mlaModal.settings.query[h].filterTerm}else{mlaModal.settings.query[h].filterTerm=f.s.mla_filter_term}_.find(this.filters,function(j,k){var i=_.all(j.props,function(l){return l.mla_filter_term==mlaModal.settings.query[h].filterTerm});if(i){return g=k}});this.$el.val(g)},change:function(){var e=this.filters[this.el.value],f;if(e){f={s:{mla_filter_term:e.props.s.mla_filter_term}};this.model.set(f)}}})}if(mlaModal.settings.enableTermsSearch){wp.media.view.MlaTermsSearch=wp.media.View.extend({tagName:"span",className:"mla-terms-search",template:wp.media.template("mla-terms-search-button"),attributes:{type:"mla-terms-search-button"},events:{change:"termsSearchOpen",click:"termsSearchOpen"},render:function(){this.$el.html(this.template(mlaModal.strings));return this},termsSearchOpen:function(f){var e=d(this.el).closest("div.media-toolbar");if(("click"==f.type)&&("mla_terms_search"===f.target.name)){mlaTaxonomy.termsSearch.open();d("#mla-terms-search-form").off("submit");d("#mla-terms-search-form").submit(function(j){var g,i,h={phrases:"",taxonomies:[]};j.preventDefault();g=d("#mla-terms-search-form").serializeArray();for(i=0;i<g.length;i++){switch(g[i].name){case"mla_terms_search[phrases]":h.phrases=g[i].value;break;case"mla_terms_search[radio_phrases]":h.radio_phrases=g[i].value;break;case"mla_terms_search[radio_terms]":h.radio_terms=g[i].value;break;case"mla_terms_search[taxonomies][]":h.taxonomies[h.taxonomies.length]=g[i].value;break}}mlaModal.settings.query[mlaModal.settings.state].termsSearch=h;d("#mla-search-submit",e).click();return false});d("#mla-terms-search-input").keypress(function(g){if(13==g.which){g.preventDefault();d("#mla-terms-search-submit").click()}})}}})}if(mlaModal.settings.enableSearchBox){wp.media.view.MlaSearch=wp.media.View.extend({tagName:"div",className:"mla-search-box",template:wp.media.template("mla-search-box"),attributes:{type:"mla-search-box"},events:{input:"search",change:"search",click:"search",search:"search",MlaSearch:"search"},initialize:function(){var e=this.controller._state;if("undefined"===typeof mlaModal.settings.query[e]){mlaModal.settings.query[e]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[e].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}},render:function(){var f=this.controller._state,e=_.extend(mlaModal.strings,mlaModal.settings.query[f]);searchValues={mla_filter_month:mlaModal.settings.query[f].filterMonth,mla_filter_term:mlaModal.settings.query[f].filterTerm,mla_terms_search:mlaModal.settings.query[f].termsSearch,mla_search_clicks:mlaModal.settings.query[f].searchClicks++,mla_search_value:mlaModal.settings.query[f].searchValue,mla_search_fields:mlaModal.settings.query[f].searchFields,mla_search_connector:mlaModal.settings.query[f].searchConnector};this.model.set({s:searchValues});this.$el.html(this.template(e));return this},search:function(g){var h=this.controller._state,e,f;if(("input"==g.type)&&("s[mla_search_value]"==g.target.name)){mlaModal.settings.query[h].searchValue=g.target.value;return}if(("click"==g.type)&&("mla_search_submit"!=g.target.name)){return}switch(g.target.name){case"s[mla_search_value]":mlaModal.settings.query[h].searchValue=g.target.value;break;case"mla_search_submit":e={mla_filter_month:mlaModal.settings.query[h].filterMonth,mla_filter_term:mlaModal.settings.query[h].filterTerm,mla_terms_search:mlaModal.settings.query[h].termsSearch,mla_search_clicks:mlaModal.settings.query[h].searchClicks++,mla_search_value:mlaModal.settings.query[h].searchValue,mla_search_fields:mlaModal.settings.query[h].searchFields,mla_search_connector:mlaModal.settings.query[h].searchConnector};this.model.set({s:e});break;case"s[mla_search_connector]":mlaModal.settings.query[h].searchConnector=g.target.value;break;case"s[mla_search_title]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("title");if(-1==f){mlaModal.settings.query[h].searchFields.push("title")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_name]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("name");if(-1==f){mlaModal.settings.query[h].searchFields.push("name")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_alt_text]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("alt-text");if(-1==f){mlaModal.settings.query[h].searchFields.push("alt-text")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_excerpt]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("excerpt");if(-1==f){mlaModal.settings.query[h].searchFields.push("excerpt")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_content]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("content");if(-1==f){mlaModal.settings.query[h].searchFields.push("content")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_file]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("file");if(-1==f){mlaModal.settings.query[h].searchFields.push("file")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_terms]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("terms");if(-1==f){mlaModal.settings.query[h].searchFields.push("terms")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break}}})}else{wp.media.view.MlaSearch=wp.media.View.extend({tagName:"span",className:"mla-simulate-search-button",template:wp.media.template("mla-simulate-search-button"),attributes:{type:"mla-simulate-search-button"},events:{click:"simulateSearch"},render:function(){this.$el.html(this.template(mlaModal.strings));return this},simulateSearch:function(){var f=this.controller._state,e={mla_filter_month:mlaModal.settings.query[f].filterMonth,mla_filter_term:mlaModal.settings.query[f].filterTerm,mla_terms_search:mlaModal.settings.query[f].termsSearch,mla_search_clicks:mlaModal.settings.query[f].searchClicks++,mla_search_value:mlaModal.settings.query[f].searchValue,mla_search_fields:mlaModal.settings.query[f].searchFields,mla_search_connector:mlaModal.settings.query[f].searchConnector};this.model.set({s:e})}})}if(mlaModal.settings.enableMimeTypes||mlaModal.settings.enableMonthsDropdown||mlaModal.settings.enableTermsDropdown||mlaModal.settings.enableTermsSearch||mlaModal.settings.enableSearchBox){wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({toolbarContentActivateBrowse:function(){var g,e,f;if((null!==this.models)&&this.models.length&&(null!==this.models[0].active)){mlaModal.settings.$el=this.models[0].frame.$el;f=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();e=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(e>f){g=e}else{g=f}if((null!==g)){d(".attachments-browser .attachments",mlaModal.settings.$el).css("top",g);mlaModal.settings.oldHeight=g}}},toolbarOpen:function(){var g,e,f;if((null!==this.models)&&this.models.length&&(null!==this.models[0].active)){mlaModal.settings.$el=this.models[0].frame.$el;f=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();e=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(e>f){g=e}else{g=f}if((null!==g)){d(".attachments-browser .attachments",mlaModal.settings.$el).css("top",g);mlaModal.settings.oldHeight=g}d(window).resize(function(){var j,h,i;i=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();h=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(h>i){j=h}else{j=i}if((null!==j)&&(j!==mlaModal.settings.oldHeight)){d(".attachments-browser .attachments").css("top",j);mlaModal.settings.oldHeight=j}})}},createToolbar:function(){var e,f=this.controller._state;mlaModal.settings.state=f;mlaModal.settings.$el=this.controller.$el;if("undefined"===typeof mlaModal.settings.query[f]){mlaModal.settings.query[f]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[f].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}c.prototype.createToolbar.apply(this,arguments);mlaModal.utility.mlaAttachmentsBrowser=this;e=this.options.filters;mlaModal.settings.oldHeight=0;this.controller.on("open",this.toolbarOpen);this.controller.on("content:activate:browse",this.toolbarContentActivateBrowse);if(typeof window.eml!=="undefined"){d(".media-toolbar",this.$el).css("overflow","hidden")}if(("all"===e)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.Mla({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(("uploaded"===e)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.MlaUploaded({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search&&mlaModal.settings.enableMonthsDropdown){this.toolbar.unset("dateFilter",{silent:true});this.toolbar.set("dateFilter",new wp.media.view.AttachmentFilters.MlaMonths({controller:this.controller,model:this.collection.props,priority:-75}).render())}if(this.options.search&&mlaModal.settings.enableTermsDropdown){this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search&&mlaModal.settings.enableTermsSearch){this.toolbar.set("termsSearch",new wp.media.view.MlaTermsSearch({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search){if(mlaModal.settings.enableSearchBox){this.controller.on("content:activate",this.hideDefaultSearch);this.controller.on("edit:activate",this.hideDefaultSearch);this.controller.on("router:render",this.hideDefaultSearch);this.controller.on("uploader:ready",this.hideDefaultSearch);this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:60}).render())}else{this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:70}).render())}}},hideDefaultSearch:function(){var e=d("#media-search-input",mlaModal.settings.$el),f=d(".media-search-input-label",mlaModal.settings.$el);if(0===e.length){e=d("div.media-toolbar-primary > input.search",mlaModal.settings.$el)}e.hide();f.hide()},updateFilters:function(e,f){var g={};if(this.options.search&&mlaModal.settings.enableTermsDropdown&&mlaModal.settings.termsTaxonomy==e){g=mlaModal.utility.parseTermsOptions(f);mlaModal.settings.termsClass=g.termsClass;mlaModal.settings.termsText=g.termsText;mlaModal.settings.termsValue=g.termsValue;this.toolbar.unset("terms",{silent:true});this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-80}).render())}}})}mlaModal.utility.parseTermsOptions=function(k){var j={termsClass:[mlaModal.settings.termsClass[0],mlaModal.settings.termsClass[1]],termsText:[mlaModal.settings.termsText[0],mlaModal.settings.termsText[1]],termsValue:[mlaModal.settings.termsValue[0],mlaModal.settings.termsValue[1]]},g=2,e,f,i=/\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*/g,h=[];if("object"===typeof k){g=mlaModal.settings.termsValue.length;for(e=2;e<g;e++){h[e]={termsClass:mlaModal.settings.termsClass[e],termsText:mlaModal.settings.termsText[e],termsValue:mlaModal.settings.termsValue[e]};if("undefined"!==typeof k[mlaModal.settings.termsValue[e]]){delete k[mlaModal.settings.termsValue[e]]}}for(f in k){h[e++]={termsClass:"level-0",termsText:k[f],termsValue:f.toString()}}if(g===e){return{termsClass:mlaModal.settings.termsClass,termsText:mlaModal.settings.termsText,termsValue:mlaModal.settings.termsValue}}h.sort(function(m,l){if(m.termsText>l.termsText){return 1}else{if(m.termsText<l.termsText){return -1}else{return 0}}});e=2;for(f in h){j.termsClass[e]=h[f].termsClass;j.termsText[e]=h[f].termsText;j.termsValue[e++]=h[f].termsValue}return j}h=i.exec(k);while(null!==(h=i.exec(k))){j.termsClass[g]=h[3];j.termsValue[g]=("undefined"===typeof h[6])?h[9]:h[7];j.termsText[g++]=h[11].replace("&nbsp;",mlaModal.settings.termsIndent)}return j};mlaModal.utility.arrayCleanup=function(g){var f=[],e=("string"===typeof g);if(e){g=g.split(mlaModal.settings.comma)}jQuery.each(g,function(h,i){i=jQuery.trim(i);if(i&&jQuery.inArray(i,f)==-1){f.push(i)}});f.sort();if(e){f=f.join(mlaModal.settings.comma)}return f};mlaModal.utility.parseTaxonomyId=function(f){var e=f.split("-");e.shift();e.shift();return e.join("-")};mlaModal.tagBox={cleanTags:function(f){var e=mlaModal.settings.comma;if(","!==e){f=f.replace(new RegExp(e,"g"),",")}f=f.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==e){f=f.replace(/,/g,e)}return f},parseTags:function(h){var l=h.id,f=l.split("-check-num-")[1],i=d(h).closest(".tagsdiv"),k=i.find(".the-tags"),e=mlaModal.settings.comma,g=k.val().split(e),j=[];delete g[f];d.each(g,function(m,n){n=d.trim(n);if(n){j.push(n)}});k.val(this.cleanTags(j.join(e)));this.quickClicks(i);return false},quickClicks:function(g){var j=d(".the-tags",g),h=d(".tagchecklist",g),i=d(g).attr("id"),e,f;if(!j.length){return}f=j.prop("disabled");e=j.val().split(mlaModal.settings.comma);h.empty();d.each(e,function(m,n){var l,k;n=d.trim(n);if(!n){return}if(mlaModal.settings.generateTagUl){l=d("<li />").text(n)}else{l=d("<span />").text(n)}if(!f){if(mlaModal.settings.generateTagButtons){k=d('<button class="ntdelbutton" id="'+i+"-check-num-"+m+'" type="button"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+mlaModal.settings.removeTerm+": "+n+"</span></button>")}else{k=d('<a id="'+i+"-check-num-"+m+'" class="ntdelbutton">X</a>')}k.click(function(){mlaModal.tagBox.parseTags(this)});l.prepend("&nbsp;").prepend(k)}h.append(l)})},flushTags:function(k,h,g){var m,e,i,n=d(".the-tags",k),j=d("input.newtag",k),l=mlaModal.settings.comma;h=h||false;i=h?d(h).text():j.val();m=n.val();e=m?m+l+i:i;e=mlaModal.utility.arrayCleanup(this.cleanTags(e));n.val(e);this.quickClicks(k);if(!h){j.val("")}if("undefined"==typeof(g)){j.focus()}return false},getCloud:function(f,e){d.post(ajaxurl,{action:"get-tagcloud",tax:e},function(h,g){if(0===h||"success"!=g){h=wpAjax.broken}h=d('<p id="tagcloud-'+e+'" class="the-tagcloud">'+h+"</p>");d("a",h).click(function(){mlaModal.tagBox.flushTags(d(this).closest(".mla-taxonomy-field").children(".tagsdiv"),this);return false});d("#"+f).after(h)})},init:function(i,e,g){var h,f;h=d("#mla-taxonomy-"+e,g);f=d("div.ajaxtag",h);mlaModal.tagBox.quickClicks(h);d("input.tagadd",f).click(function(){mlaModal.tagBox.flushTags(d(this).closest(".tagsdiv"))});d("input.newtag",f).keyup(function(j){if(13==j.which){mlaModal.tagBox.flushTags(h);return false}}).keypress(function(j){if(13==j.which){j.preventDefault();return false}}).each(function(){d(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+e,{delay:500,resultsClass:"mla_ac_results",selectClass:"mla_ac_over",matchClass:"mla_ac_match",minchars:2,multiple:true,multipleSep:mlaModal.settings.comma+" "})});h.siblings(":first").click(function(){mlaModal.tagBox.getCloud(d("a",this).attr("id"),e);d("a",this).unbind().click(function(){d(this).siblings(".the-tagcloud").toggle();return false});return false});d(".compat-field-"+e+" td",g).on("mouseleave",function(){var m,k=this,j=mlaModal.utility.arrayCleanup(d(".server-tags",k).val()),l=mlaModal.utility.arrayCleanup(d(".the-tags",k).val());if(j===l){return}d(k).css("opacity","0.5");m={id:i};m[e]=l;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,m).done(function(o){var p,n,q;for(n in o){if("object"===typeof(o[n]["object-terms"])){if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(n,o[n]["object-terms"])}delete o[n]["object-terms"]}for(q in o[n]){d("#"+q,k).replaceWith(o[n][q])}p=d("#mla-taxonomy-"+n,k);mlaModal.tagBox.quickClicks(p)}d(k).css("opacity","1.0")})});h.on("change",function(j){j.stopPropagation();return false});d(".the-tags, .server-tags .newtag",h).on("change",function(j){j.stopPropagation();return false})}};if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.view.AttachmentCompat=wp.media.view.AttachmentCompat.extend({initialize:function(){b.prototype.initialize.apply(this,arguments);this.on("ready",function(){mlaModal.utility.hookCompatTaxonomies(this.model.get("id"),this.el)})}})}if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.model.Selection=wp.media.model.Selection.extend({initialize:function(){a.prototype.initialize.apply(this,arguments);this.on("selection:reset",function(){mlaModal.cid=null});this.on("selection:unsingle",function(){mlaModal.cid=null});this.on("selection:single",function(e){mlaModal.cid=e.cid});this.on("change:uploading",function(){mlaModal.uploading=true});this.on("change",function(e){var f=false,g;if(mlaModal.uploading&&mlaModal.cid===e.cid){mlaModal.uploading=false;f=true}else{if(false===e.attributes.uploading){g=_.clone(e.changed);delete g.title;delete g.caption;delete g.alt;delete g.description;if(!_.isEmpty(g)){f=true}}}if(true===f){mlaModal.utility.hookCompatTaxonomies(e.get("id"),mlaModal.settings.$el)}})}})}mlaModal.utility.hookCompatTaxonomies=function(h,f){var e,g=null;d(".mla-taxonomy-field .categorydiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(e)){d(".compat-field-"+e+" th",f).click({id:h,currentTaxonomy:e,el:f},function(i){mlaModal.utility.fillCompatTaxonomies(i.data)});d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).show()}else{d(this).remove()}});if(null===g){g=e}}else{d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).remove()}})}});d(".mla-taxonomy-field .tagsdiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(e)){d(".compat-field-"+e+" th",f).click({id:h,currentTaxonomy:e,el:f},function(i){mlaModal.utility.fillCompatTaxonomies(i.data)});d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).show()}else{d(this).remove()}});if(null===g){g=e}}else{d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).remove()}})}});if(mlaModal.settings.enableTermsAutofill&&null!==g){d(".compat-field-"+g+" th",f).click()}};mlaModal.utility.fillCompatTaxonomies=function(i){var f=i.el,h=[],e,g;d(".mla-taxonomy-field .categorydiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));h[h.length]=e;g=".compat-field-"+e;if("undefined"===typeof(mlaModal.initialHTML[e])){mlaModal.initialHTML[e]=d(g,f).html()}else{d(g,f).html(mlaModal.initialHTML[e])}d(g+" .categorydiv",f).html(mlaModal.strings.loadingText)});d(".mla-taxonomy-field .tagsdiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));h[h.length]=e;g=".compat-field-"+e;if("undefined"===typeof(mlaModal.initialHTML[e])){mlaModal.initialHTML[e]=d(g,f).html()}else{d(g,f).html(mlaModal.initialHTML[e])}d(g+" .tagsdiv",f).html(mlaModal.strings.loadingText)});if(h.length){wp.media.post(mlaModal.settings.ajaxFillCompatAction,{id:i.id,query:h}).done(function(k){var j,l;for(j in k){l=".compat-field-"+j;d(l,f).html(k[j])}mlaModal.utility.supportCompatTaxonomies(i);d(".compat-field-"+i.currentTaxonomy+" td",f).show()})}};mlaModal.utility.supportCompatTaxonomies=function(g){var f=g.id,e=g.el;if(mlaModal.settings.enableDetailsCategory){d(".mla-taxonomy-field .categorydiv",e).each(function(){var j=d(this),h,k,i,n,l,p,o,m;i=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));n=i+"_tab";l="#mla-"+i;p="#mla-new-"+i;o="#mla-search-"+i;m="#mla-attachments-"+f+"-"+i;if(i=="category"){n="cats"}j.find(".category-tabs").show();d(".compat-field-"+i+" th",e).click(function(){d(this).siblings("td").slideToggle()});j.on("mouseleave",function(){var t,q,s=[],r=j.find(l+"-checklist input:checked");r.each(function(){s[s.length]=d(this).val()});s.sort(function(v,u){return v-u});s=s.join(",");q=j.siblings(m).val();if(q===s){return}j.siblings(m).val(s);j.prop("disabled",true);t={id:f};t[i]=s;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,t).done(function(v){var u,w;for(u in v){for(w in v[u]){j.find("#"+w).html(v[u][w])}}j.find(o).val("");j.find(l+"-searcher").addClass("mla-hidden-children");j.prop("disabled",false)})});j.on('change input[type="checkbox"]',function(q){q.stopPropagation();return false});j.find(l+"-tabs a").click(function(){var q=d(this).attr("href");d(this).parent().addClass("tabs").siblings("li").removeClass("tabs");j.find(l+"-tabs").siblings(".tabs-panel").hide();j.find(q).show();d(this).focus();if("#mla-"+i+"-all"==q){deleteUserSetting(n)}else{setUserSetting(n,"pop")}return false});if(getUserSetting(n)){j.find(l+'-tabs a[href="#mla-'+i+'-pop"]').click()}j.find(l+"-add-toggle").click(function(){j.find(l+"-searcher").addClass("mla-hidden-children");j.find(l+"-adder").toggleClass("mla-hidden-children");j.find(l+'-tabs a[href="#mla-'+i+'-all"]').click();j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();if(false===j.find(l+"-adder").hasClass("mla-hidden-children")){j.find(p).val("").removeClass("form-input-tip");j.find(p).focus()}return false});j.find(p).keypress(function(q){if(13===q.keyCode){q.preventDefault();j.find(l+"-add-submit").click()}});j.find(l+"-add-submit").click(function(){j.find(p).focus()});h=function(q){if(!j.find(p).val()){return false}q.data+="&"+j.find(l+"-checklist :checked").serialize();j.prop("disabled",true);return q};k=function(v,u){var t,q=j.find("#new"+i+"_parent");j.prop("disabled",false);if("undefined"!=u.parsed.responses[0]&&(t=u.parsed.responses[0].supplemental.newcat_parent)){q.before(t);q.remove();if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(i,t)}}};j.find(l+"-checklist").wpList({alt:"",response:"mla-"+i+"-ajax-response",addBefore:h,addAfter:k});j.find(l+"-checklist, "+l+"-checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var q=d(this),s=q.is(":checked"),r=q.val();if(r&&q.parents("#mla-taxonomy-"+i).length){d("#in-"+i+"-"+r+", #in-popular-"+i+"-"+r).prop("checked",s)}});d.extend(d.expr[":"],{matchTerms:function(s,r,q,t){return(s.textContent||s.innerText||"").toLowerCase().indexOf((q[3]||"").toLowerCase())>=0}});j.find(o).keypress(function(q){if(13===q.keyCode){q.preventDefault();j.find(o).val("");j.find(l+"-searcher").addClass("mla-hidden-children");j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();return}});j.find(o).keyup(function(s){var u,t,v,r,q;if(13===s.keyCode){s.preventDefault();j.find(l+"-search-toggle").focus();return}u=j.find(o).val();t=j.find(l+"-checklist li");v=j.find(l+"-checklist-pop li");if(0<u.length){t.hide();v.hide()}else{t.show();v.show()}r=j.find(l+"-checklist label:matchTerms('"+u+"')");r.closest("li").find("li").andSelf().show();r.parents(l+"-checklist li").show();q=j.find(l+"-checklist-pop label:matchTerms('"+u+"')");q.closest("li").find("li").andSelf().show();q.parents(l+"-checklist li").show()});j.find(l+"-search-toggle").click(function(){j.find(l+"-adder ").addClass("mla-hidden-children");j.find(l+"-searcher").toggleClass("mla-hidden-children");j.find(l+'-tabs a[href="#mla-'+i+'-all"]').click();j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();if(false===j.find(l+"-searcher").hasClass("mla-hidden-children")){j.find(o).val("").removeClass("form-input-tip");j.find(o).focus()}return false})})}if(mlaModal.settings.enableDetailsTag){d(".mla-taxonomy-field .tagsdiv",e).each(function(){var h=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));d(".compat-field-"+h+" th",e).click(function(){d(this).siblings("td").slideToggle()});mlaModal.tagBox.init(f,h,e)})}}}(jQuery));
1
+ var wp,wpAjax,ajaxurl,jQuery,_,getUserSetting,setUserSetting,deleteUserSetting,mlaTaxonomy,mlaModal={strings:{},settings:{},initialHTML:{},uploading:false,cid:null,utility:{originalMediaAjax:null,mlaAttachmentsBrowser:null,parseTermsOptions:null,arrayCleanup:null,parseTaxonomyId:null,hookCompatTaxonomies:null,fillCompatTaxonomies:null,supportCompatTaxonomies:null},tagBox:null};(function(d){var c=wp.media.view.AttachmentsBrowser,b=wp.media.view.AttachmentCompat,a=wp.media.model.Selection;mlaModal.strings=typeof wp.media.view.l10n.mla_strings==="undefined"?{}:wp.media.view.l10n.mla_strings;delete wp.media.view.l10n.mla_strings;mlaModal.settings=typeof wp.media.view.settings.mla_settings==="undefined"?{screen:"unknown",enableMediaGrid:false,enableMediaModal:false}:wp.media.view.settings.mla_settings;delete wp.media.view.settings.mla_settings;if(!(mlaModal.settings.enableMediaGrid||mlaModal.settings.enableMediaModal)){return}if(("grid"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaGrid){return}if(("modal"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaModal){return}mlaModal.settings.pagenow=typeof pagenow==="undefined"?"unknown":pagenow;if(mlaModal.settings.pagenow==="toolset_page_views-editor"){return}mlaModal.utility.originalMediaAjax=wp.media.ajax;wp.media.ajax=function(k,g){var j=mlaModal.settings.state,i,f,h,e,l;if(_.isObject(k)){g=k}else{g=g||{};g.data=_.extend(g.data||{},{action:k})}if("query-attachments"==g.data.action){i=g.data.query;f=typeof i.s;if("object"==f){h=i.s}else{if("string"==f){h={mla_search_value:i.s}}else{h={mla_search_value:""}}}if("undefined"!=typeof i.post_mime_type){mlaModal.settings.query[j].filterMime=i.post_mime_type}else{mlaModal.settings.query[j].filterMime="all"}if("undefined"!=typeof h.mla_filter_month){mlaModal.settings.query[j].filterMonth=h.mla_filter_month}else{if("undefined"!=typeof i.year){mlaModal.settings.query[j].filterMonth=(100*i.year)+(1*i.monthnum)}else{}}if("undefined"!=typeof h.mla_filter_term){mlaModal.settings.query[j].filterTerm=h.mla_filter_term}if("undefined"!=typeof h.mla_search_value){mlaModal.settings.query[j].searchValue=h.mla_search_value}e={mla_filter_month:mlaModal.settings.query[j].filterMonth,mla_filter_term:mlaModal.settings.query[j].filterTerm,mla_terms_search:mlaModal.settings.query[j].termsSearch,mla_search_clicks:mlaModal.settings.query[j].searchClicks,mla_search_value:mlaModal.settings.query[j].searchValue,mla_search_fields:mlaModal.settings.query[j].searchFields,mla_search_connector:mlaModal.settings.query[j].searchConnector};mlaModal.settings.query[j].termsSearch="";d("#mla-terms-search-input").html("").val("");g.data.query.s=e;if(d(document.activeElement).hasClass("acf-button")){l=d(document.activeElement).parentsUntil("div.acf-fields");if(l.length){g.data.query._acfuploader=d(l[l.length-1]).attr("data-key")}}}return mlaModal.utility.originalMediaAjax.call(this,g)};if(mlaModal.settings.enableMimeTypes){wp.media.view.AttachmentFilters.Mla=wp.media.view.AttachmentFilters.extend({createFilters:function(){var f=this.controller._state,e={};_.each(mlaModal.settings.allMimeTypes||{},function(h,g){if(("grid"===mlaModal.settings.screen)||("trash"!==g)){e[g]={text:h,props:{type:g,uploadedTo:null,orderby:"date",order:"DESC"}}}});e.all={text:wp.media.view.l10n.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};if(wp.media.view.settings.post.id){e.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}this.filters=e;if("undefined"===typeof e[mlaModal.settings.query[f].filterMime]){mlaModal.settings.query[f].filterMime="all"}if(mlaModal.settings.query[f].filterMime!="all"){this.model.set(e[mlaModal.settings.query[f].filterMime].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMime,f=e.toJSON();if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}_.find(this.filters,function(j,k){var i=_.all(j.props,function(m,l){return m===(_.isUndefined(f[l])?null:f[l])});if(i){return g=k}});this.$el.val(g)},change:function(){var f=d(this.el).closest("div.media-toolbar"),e=this.filters[this.el.value];if(e){this.model.set(e.props,{silent:true});d("#mla-search-submit",f).click()}}});wp.media.view.AttachmentFilters.MlaUploaded=wp.media.view.AttachmentFilters.extend({createFilters:function(){var f=this.model.get("type"),e=wp.media.view.settings.mimeTypes,i,h=this.controller._state,g={};if(e&&f){i=e[f]}_.each(mlaModal.settings.uploadMimeTypes||{},function(k,j){if(("grid"===mlaModal.settings.screen)||("trash"!==j)){g[j]={text:k,props:{type:j,uploadedTo:null,orderby:"date",order:"DESC"}}}});g.all={text:i||wp.media.view.l10n.allMediaItems,props:{uploadedTo:null,orderby:"date",order:"DESC"},priority:10};g.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20};g.unattached={text:wp.media.view.l10n.unattached,props:{uploadedTo:0,orderby:"menuOrder",order:"ASC"},priority:50};this.filters=g;if("undefined"===typeof g[mlaModal.settings.query[h].filterUploaded]){mlaModal.settings.query[h].filterUploaded="all"}if(mlaModal.settings.query[h].filterUploaded!="all"){this.model.set(g[mlaModal.settings.query[h].filterUploaded].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMime,f=e.toJSON();if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}_.find(this.filters,function(j,k){var i=_.all(j.props,function(m,l){return m===(_.isUndefined(f[l])?null:f[l])});if(i){return g=k}});this.$el.val(g)},change:function(){var f=d(this.el).closest("div.media-toolbar"),e=this.filters[this.el.value];if(e){this.model.set(e.props,{silent:true});d("#mla-search-submit",f).click()}}})}if(mlaModal.settings.enableMonthsDropdown){wp.media.view.AttachmentFilters.MlaMonths=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-date-filters",createFilters:function(){var f=this.controller._state,e={};_.each(mlaModal.settings.months||{},function(h,g){e[g]={text:h,props:{s:{mla_filter_month:g}}}});this.filters=e;if("undefined"===typeof e[mlaModal.settings.query[f].filterMonth]){mlaModal.settings.query[f].filterMonth=0}if(mlaModal.settings.query[f].filterMonth>0){this.model.set(e[mlaModal.settings.query[f].filterMonth].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterMonth,f=e.toJSON();if(_.isUndefined(f.s)){f.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}if(_.isUndefined(f.s.mla_filter_month)){f.s.mla_filter_month=mlaModal.settings.query[h].filterMonth}else{mlaModal.settings.query[h].filterMonth=f.s.mla_filter_month}_.find(this.filters,function(j,k){var i=_.all(j.props,function(l){return l.mla_filter_month==mlaModal.settings.query[h].filterMonth});if(i){return g=k}});this.$el.val(g)},change:function(){var e=this.filters[this.el.value],f;if(e){f={s:{mla_filter_month:e.props.s.mla_filter_month}};this.model.set(f)}}})}if(mlaModal.settings.enableTermsDropdown){wp.media.view.AttachmentFilters.MlaTerms=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-term-filters",createFilters:function(){var h=this.controller._state,e,f,g={};_.each(mlaModal.settings.termsText||{},function(j,i){if(mlaModal.settings.termsCustom){f=mlaModal.settings.termsValue[i]}else{f=parseInt(mlaModal.settings.termsValue[i])}g[i]={text:j,props:{s:{mla_filter_term:f}}}});this.filters=g;e=_.indexOf(mlaModal.settings.termsValue,mlaModal.settings.query[h].filterTerm);if(e>0){this.model.set(g[e].props,{silent:false})}},select:function(){var h=this.controller._state,e=this.model,g=mlaModal.settings.query[h].filterTerm,f=e.toJSON();if(_.isUndefined(f.s)){f.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof f.search){mlaModal.settings.query[h].searchValue=f.search}else{mlaModal.settings.query[h].searchValue=""}}if(_.isUndefined(f.s.mla_filter_term)){f.s.mla_filter_term=mlaModal.settings.query[h].filterTerm}else{mlaModal.settings.query[h].filterTerm=f.s.mla_filter_term}_.find(this.filters,function(j,k){var i=_.all(j.props,function(l){return l.mla_filter_term==mlaModal.settings.query[h].filterTerm});if(i){return g=k}});this.$el.val(g)},change:function(){var e=this.filters[this.el.value],f;if(e){f={s:{mla_filter_term:e.props.s.mla_filter_term}};this.model.set(f)}}})}if(mlaModal.settings.enableTermsSearch){wp.media.view.MlaTermsSearch=wp.media.View.extend({tagName:"span",className:"mla-terms-search",template:wp.media.template("mla-terms-search-button"),attributes:{type:"mla-terms-search-button"},events:{change:"termsSearchOpen",click:"termsSearchOpen"},render:function(){this.$el.html(this.template(mlaModal.strings));return this},termsSearchOpen:function(f){var e=d(this.el).closest("div.media-toolbar");if(("click"==f.type)&&("mla_terms_search"===f.target.name)){mlaTaxonomy.termsSearch.open();d("#mla-terms-search-form").off("submit");d("#mla-terms-search-form").submit(function(j){var g,i,h={phrases:"",taxonomies:[]};j.preventDefault();g=d("#mla-terms-search-form").serializeArray();for(i=0;i<g.length;i++){switch(g[i].name){case"mla_terms_search[phrases]":h.phrases=g[i].value;break;case"mla_terms_search[radio_phrases]":h.radio_phrases=g[i].value;break;case"mla_terms_search[radio_terms]":h.radio_terms=g[i].value;break;case"mla_terms_search[taxonomies][]":h.taxonomies[h.taxonomies.length]=g[i].value;break}}mlaModal.settings.query[mlaModal.settings.state].termsSearch=h;d("#mla-search-submit",e).click();return false});d("#mla-terms-search-input").keypress(function(g){if(13==g.which){g.preventDefault();d("#mla-terms-search-submit").click()}})}}})}if(mlaModal.settings.enableSearchBox){wp.media.view.MlaSearch=wp.media.View.extend({tagName:"div",className:"mla-search-box",template:wp.media.template("mla-search-box"),attributes:{type:"mla-search-box"},events:{input:"search",change:"search",click:"search",search:"search",MlaSearch:"search"},initialize:function(){var e=this.controller._state;if("undefined"===typeof mlaModal.settings.query[e]){mlaModal.settings.query[e]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[e].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}},render:function(){var f=this.controller._state,e=_.extend(mlaModal.strings,mlaModal.settings.query[f]);searchValues={mla_filter_month:mlaModal.settings.query[f].filterMonth,mla_filter_term:mlaModal.settings.query[f].filterTerm,mla_terms_search:mlaModal.settings.query[f].termsSearch,mla_search_clicks:mlaModal.settings.query[f].searchClicks++,mla_search_value:mlaModal.settings.query[f].searchValue,mla_search_fields:mlaModal.settings.query[f].searchFields,mla_search_connector:mlaModal.settings.query[f].searchConnector};this.model.set({s:searchValues});this.$el.html(this.template(e));return this},search:function(g){var h=this.controller._state,e,f;if(("input"==g.type)&&("s[mla_search_value]"==g.target.name)){mlaModal.settings.query[h].searchValue=g.target.value;return}if(("click"==g.type)&&("mla_search_submit"!=g.target.name)){return}switch(g.target.name){case"s[mla_search_value]":mlaModal.settings.query[h].searchValue=g.target.value;break;case"mla_search_submit":e={mla_filter_month:mlaModal.settings.query[h].filterMonth,mla_filter_term:mlaModal.settings.query[h].filterTerm,mla_terms_search:mlaModal.settings.query[h].termsSearch,mla_search_clicks:mlaModal.settings.query[h].searchClicks++,mla_search_value:mlaModal.settings.query[h].searchValue,mla_search_fields:mlaModal.settings.query[h].searchFields,mla_search_connector:mlaModal.settings.query[h].searchConnector};this.model.set({s:e});break;case"s[mla_search_connector]":mlaModal.settings.query[h].searchConnector=g.target.value;break;case"s[mla_search_title]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("title");if(-1==f){mlaModal.settings.query[h].searchFields.push("title")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_name]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("name");if(-1==f){mlaModal.settings.query[h].searchFields.push("name")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_alt_text]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("alt-text");if(-1==f){mlaModal.settings.query[h].searchFields.push("alt-text")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_excerpt]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("excerpt");if(-1==f){mlaModal.settings.query[h].searchFields.push("excerpt")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_content]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("content");if(-1==f){mlaModal.settings.query[h].searchFields.push("content")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_file]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("file");if(-1==f){mlaModal.settings.query[h].searchFields.push("file")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break;case"s[mla_search_terms]":if("change"!=g.type){break}f=mlaModal.settings.query[h].searchFields.indexOf("terms");if(-1==f){mlaModal.settings.query[h].searchFields.push("terms")}else{mlaModal.settings.query[h].searchFields.splice(f,1)}break}}})}else{wp.media.view.MlaSearch=wp.media.View.extend({tagName:"span",className:"mla-simulate-search-button",template:wp.media.template("mla-simulate-search-button"),attributes:{type:"mla-simulate-search-button"},events:{click:"simulateSearch"},render:function(){this.$el.html(this.template(mlaModal.strings));return this},simulateSearch:function(){var f=this.controller._state,e={mla_filter_month:mlaModal.settings.query[f].filterMonth,mla_filter_term:mlaModal.settings.query[f].filterTerm,mla_terms_search:mlaModal.settings.query[f].termsSearch,mla_search_clicks:mlaModal.settings.query[f].searchClicks++,mla_search_value:mlaModal.settings.query[f].searchValue,mla_search_fields:mlaModal.settings.query[f].searchFields,mla_search_connector:mlaModal.settings.query[f].searchConnector};this.model.set({s:e})}})}if(mlaModal.settings.enableMimeTypes||mlaModal.settings.enableMonthsDropdown||mlaModal.settings.enableTermsDropdown||mlaModal.settings.enableTermsSearch||mlaModal.settings.enableSearchBox){wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({toolbarContentActivateBrowse:function(){var g,e,f;if((null!==this.models)&&this.models.length&&(null!==this.models[0].active)){mlaModal.settings.$el=this.models[0].frame.$el;f=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();e=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(e>f){g=e}else{g=f}if((null!==g)){d(".attachments-browser .attachments",mlaModal.settings.$el).css("top",g);mlaModal.settings.oldHeight=g}}},toolbarOpen:function(){var g,e,f;if((null!==this.models)&&this.models.length&&(null!==this.models[0].active)){mlaModal.settings.$el=this.models[0].frame.$el;f=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();e=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(e>f){g=e}else{g=f}if((null!==g)){d(".attachments-browser .attachments",mlaModal.settings.$el).css("top",g);mlaModal.settings.oldHeight=g}d(window).resize(function(){var j,h,i;i=d(".attachments-browser .media-toolbar-secondary",mlaModal.settings.$el).height();h=d(".media-toolbar-primary .mla-search-box",mlaModal.settings.$el).height();if(h>i){j=h}else{j=i}if((null!==j)&&(j!==mlaModal.settings.oldHeight)){d(".attachments-browser .attachments").css("top",j);mlaModal.settings.oldHeight=j}})}},createToolbar:function(){var e,f=this.controller._state;mlaModal.settings.state=f;mlaModal.settings.$el=this.controller.$el;if("undefined"===typeof mlaModal.settings.query[f]){mlaModal.settings.query[f]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[f].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}c.prototype.createToolbar.apply(this,arguments);mlaModal.utility.mlaAttachmentsBrowser=this;e=this.options.filters;mlaModal.settings.oldHeight=0;this.controller.on("open",this.toolbarOpen);this.controller.on("content:activate:browse",this.toolbarContentActivateBrowse);if(typeof window.eml!=="undefined"){d(".media-toolbar",this.$el).css("overflow","hidden")}if(("all"===e)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.Mla({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(("uploaded"===e)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.MlaUploaded({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search&&mlaModal.settings.enableMonthsDropdown){this.toolbar.unset("dateFilter",{silent:true});this.toolbar.set("dateFilter",new wp.media.view.AttachmentFilters.MlaMonths({controller:this.controller,model:this.collection.props,priority:-75}).render())}if(this.options.search&&mlaModal.settings.enableTermsDropdown){this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search&&mlaModal.settings.enableTermsSearch){this.toolbar.set("termsSearch",new wp.media.view.MlaTermsSearch({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search){if(mlaModal.settings.enableSearchBox){this.controller.on("content:activate",this.hideDefaultSearch);this.controller.on("edit:activate",this.hideDefaultSearch);this.controller.on("router:render",this.hideDefaultSearch);this.controller.on("uploader:ready",this.hideDefaultSearch);this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:60}).render())}else{this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:70}).render())}}},hideDefaultSearch:function(){var e=d("#media-search-input",mlaModal.settings.$el),f=d(".media-search-input-label",mlaModal.settings.$el);if(0===e.length){e=d("div.media-toolbar-primary > input.search",mlaModal.settings.$el)}e.hide();f.hide()},updateFilters:function(e,f){var g={};if(this.options.search&&mlaModal.settings.enableTermsDropdown&&mlaModal.settings.termsTaxonomy==e){g=mlaModal.utility.parseTermsOptions(f);mlaModal.settings.termsClass=g.termsClass;mlaModal.settings.termsText=g.termsText;mlaModal.settings.termsValue=g.termsValue;this.toolbar.unset("terms",{silent:true});this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-80}).render())}}})}mlaModal.utility.parseTermsOptions=function(k){var j={termsClass:[mlaModal.settings.termsClass[0],mlaModal.settings.termsClass[1]],termsText:[mlaModal.settings.termsText[0],mlaModal.settings.termsText[1]],termsValue:[mlaModal.settings.termsValue[0],mlaModal.settings.termsValue[1]]},g=2,e,f,i=/\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*/g,h=[];if("object"===typeof k){g=mlaModal.settings.termsValue.length;for(e=2;e<g;e++){h[e]={termsClass:mlaModal.settings.termsClass[e],termsText:mlaModal.settings.termsText[e],termsValue:mlaModal.settings.termsValue[e]};if("undefined"!==typeof k[mlaModal.settings.termsValue[e]]){delete k[mlaModal.settings.termsValue[e]]}}for(f in k){h[e++]={termsClass:"level-0",termsText:k[f],termsValue:f.toString()}}if(g===e){return{termsClass:mlaModal.settings.termsClass,termsText:mlaModal.settings.termsText,termsValue:mlaModal.settings.termsValue}}h.sort(function(m,l){if(m.termsText>l.termsText){return 1}else{if(m.termsText<l.termsText){return -1}else{return 0}}});e=2;for(f in h){j.termsClass[e]=h[f].termsClass;j.termsText[e]=h[f].termsText;j.termsValue[e++]=h[f].termsValue}return j}h=i.exec(k);while(null!==(h=i.exec(k))){j.termsClass[g]=h[3];j.termsValue[g]=("undefined"===typeof h[6])?h[9]:h[7];j.termsText[g++]=h[11].replace("&nbsp;",mlaModal.settings.termsIndent)}return j};mlaModal.utility.arrayCleanup=function(g){var f=[],e=("string"===typeof g);if(e){g=g.split(mlaModal.settings.comma)}jQuery.each(g,function(h,i){i=jQuery.trim(i);if(i&&jQuery.inArray(i,f)==-1){f.push(i)}});f.sort();if(e){f=f.join(mlaModal.settings.comma)}return f};mlaModal.utility.parseTaxonomyId=function(f){var e=f.split("-");e.shift();e.shift();return e.join("-")};mlaModal.tagBox={cleanTags:function(f){var e=mlaModal.settings.comma;if(","!==e){f=f.replace(new RegExp(e,"g"),",")}f=f.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==e){f=f.replace(/,/g,e)}return f},parseTags:function(h){var l=h.id,f=l.split("-check-num-")[1],i=d(h).closest(".tagsdiv"),k=i.find(".the-tags"),e=mlaModal.settings.comma,g=k.val().split(e),j=[];delete g[f];d.each(g,function(m,n){n=d.trim(n);if(n){j.push(n)}});k.val(this.cleanTags(j.join(e)));this.quickClicks(i);return false},quickClicks:function(g){var j=d(".the-tags",g),h=d(".tagchecklist",g),i=d(g).attr("id"),e,f;if(!j.length){return}f=j.prop("disabled");e=j.val().split(mlaModal.settings.comma);h.empty();d.each(e,function(m,n){var l,k;n=d.trim(n);if(!n){return}if(mlaModal.settings.generateTagUl){l=d("<li />").text(n)}else{l=d("<span />").text(n)}if(!f){if(mlaModal.settings.generateTagButtons){k=d('<button class="ntdelbutton" id="'+i+"-check-num-"+m+'" type="button"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+mlaModal.settings.removeTerm+": "+n+"</span></button>")}else{k=d('<a id="'+i+"-check-num-"+m+'" class="ntdelbutton">X</a>')}k.click(function(){mlaModal.tagBox.parseTags(this)});l.prepend("&nbsp;").prepend(k)}h.append(l)})},flushTags:function(k,h,g){var m,e,i,n=d(".the-tags",k),j=d("input.newtag",k),l=mlaModal.settings.comma;h=h||false;i=h?d(h).text():j.val();m=n.val();e=m?m+l+i:i;e=mlaModal.utility.arrayCleanup(this.cleanTags(e));n.val(e);this.quickClicks(k);if(!h){j.val("")}if("undefined"==typeof(g)){j.focus()}return false},getCloud:function(f,e){d.post(ajaxurl,{action:"get-tagcloud",tax:e},function(h,g){if(0===h||"success"!=g){h=wpAjax.broken}h=d('<p id="tagcloud-'+e+'" class="the-tagcloud">'+h+"</p>");d("a",h).click(function(){mlaModal.tagBox.flushTags(d(this).closest(".mla-taxonomy-field").children(".tagsdiv"),this);return false});d("#"+f).after(h)})},init:function(i,e,g){var h,f;h=d("#mla-taxonomy-"+e,g);f=d("div.ajaxtag",h);mlaModal.tagBox.quickClicks(h);d("input.tagadd",f).click(function(){mlaModal.tagBox.flushTags(d(this).closest(".tagsdiv"))});d("input.newtag",f).keyup(function(j){if(13==j.which){mlaModal.tagBox.flushTags(h);return false}}).keypress(function(j){if(13==j.which){j.preventDefault();return false}}).each(function(){d(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+e,{delay:500,resultsClass:"mla_ac_results",selectClass:"mla_ac_over",matchClass:"mla_ac_match",minchars:2,multiple:true,multipleSep:mlaModal.settings.comma+" "})});h.siblings(":first").click(function(){mlaModal.tagBox.getCloud(d("a",this).attr("id"),e);d("a",this).unbind().click(function(){d(this).siblings(".the-tagcloud").toggle();return false});return false});d(".compat-field-"+e+" td",g).on("mouseleave",function(){var m,k=this,j=mlaModal.utility.arrayCleanup(d(".server-tags",k).val()),l=mlaModal.utility.arrayCleanup(d(".the-tags",k).val());if(j===l){return}d(k).css("opacity","0.5");m={id:i};m[e]=l;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,m).done(function(o){var p,n,q;for(n in o){if("object"===typeof(o[n]["object-terms"])){if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(n,o[n]["object-terms"])}delete o[n]["object-terms"]}for(q in o[n]){d("#"+q,k).replaceWith(o[n][q])}p=d("#mla-taxonomy-"+n,k);mlaModal.tagBox.quickClicks(p)}d(k).css("opacity","1.0")})});h.on("change",function(j){j.stopPropagation();return false});d(".the-tags, .server-tags .newtag",h).on("change",function(j){j.stopPropagation();return false})}};if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.view.AttachmentCompat=wp.media.view.AttachmentCompat.extend({initialize:function(){b.prototype.initialize.apply(this,arguments);this.on("ready",function(){mlaModal.utility.hookCompatTaxonomies(this.model.get("id"),this.el)})}})}if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.model.Selection=wp.media.model.Selection.extend({initialize:function(){a.prototype.initialize.apply(this,arguments);this.on("selection:reset",function(){mlaModal.cid=null});this.on("selection:unsingle",function(){mlaModal.cid=null});this.on("selection:single",function(e){mlaModal.cid=e.cid});this.on("change:uploading",function(){mlaModal.uploading=true});this.on("change",function(e){var f=false,g;if(mlaModal.uploading&&mlaModal.cid===e.cid){mlaModal.uploading=false;f=true}else{if(false===e.attributes.uploading){g=_.clone(e.changed);delete g.title;delete g.caption;delete g.alt;delete g.description;if(!_.isEmpty(g)){f=true}}}if(true===f){mlaModal.utility.hookCompatTaxonomies(e.get("id"),mlaModal.settings.$el)}})}})}mlaModal.utility.hookCompatTaxonomies=function(h,f){var e,g=null;d(".mla-taxonomy-field .categorydiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(e)){d(".compat-field-"+e+" th",f).click({id:h,currentTaxonomy:e,el:f},function(i){mlaModal.utility.fillCompatTaxonomies(i.data)});d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).show()}else{d(this).remove()}});if(null===g){g=e}}else{d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).remove()}})}});d(".mla-taxonomy-field .tagsdiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(e)){d(".compat-field-"+e+" th",f).click({id:h,currentTaxonomy:e,el:f},function(i){mlaModal.utility.fillCompatTaxonomies(i.data)});d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).show()}else{d(this).remove()}});if(null===g){g=e}}else{d("tr.compat-field-"+e,f).each(function(){if(d(this).hasClass("mla-taxonomy-row")){d(this).remove()}})}});if(mlaModal.settings.enableTermsAutofill&&null!==g){d(".compat-field-"+g+" th",f).click()}};mlaModal.utility.fillCompatTaxonomies=function(i){var f=i.el,h=[],e,g;d(".mla-taxonomy-field .categorydiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));h[h.length]=e;g=".compat-field-"+e;if("undefined"===typeof(mlaModal.initialHTML[e])){mlaModal.initialHTML[e]=d(g,f).html()}else{d(g,f).html(mlaModal.initialHTML[e])}d(g+" .categorydiv",f).html(mlaModal.strings.loadingText)});d(".mla-taxonomy-field .tagsdiv",f).each(function(){e=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));h[h.length]=e;g=".compat-field-"+e;if("undefined"===typeof(mlaModal.initialHTML[e])){mlaModal.initialHTML[e]=d(g,f).html()}else{d(g,f).html(mlaModal.initialHTML[e])}d(g+" .tagsdiv",f).html(mlaModal.strings.loadingText)});if(h.length){wp.media.post(mlaModal.settings.ajaxFillCompatAction,{id:i.id,query:h}).done(function(k){var j,l;for(j in k){l=".compat-field-"+j;d(l,f).html(k[j])}mlaModal.utility.supportCompatTaxonomies(i);d(".compat-field-"+i.currentTaxonomy+" td",f).show()})}};mlaModal.utility.supportCompatTaxonomies=function(g){var f=g.id,e=g.el;if(mlaModal.settings.enableDetailsCategory){d(".mla-taxonomy-field .categorydiv",e).each(function(){var j=d(this),h,k,i,n,l,p,o,m;i=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));n=i+"_tab";l="#mla-"+i;p="#mla-new-"+i;o="#mla-search-"+i;m="#mla-attachments-"+f+"-"+i;if(i=="category"){n="cats"}j.find(".category-tabs").show();d(".compat-field-"+i+" th",e).click(function(){d(this).siblings("td").slideToggle()});j.on("mouseleave",function(){var t,q,s=[],r=j.find(l+"-checklist input:checked");r.each(function(){s[s.length]=d(this).val()});s.sort(function(v,u){return v-u});s=s.join(",");q=j.siblings(m).val();if(q===s){return}j.siblings(m).val(s);j.prop("disabled",true);t={id:f};t[i]=s;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,t).done(function(v){var u,w;for(u in v){for(w in v[u]){j.find("#"+w).html(v[u][w])}}j.find(o).val("");j.find(l+"-searcher").addClass("mla-hidden-children");j.prop("disabled",false)})});j.on('change input[type="checkbox"]',function(q){q.stopPropagation();return false});j.find(l+"-tabs a").click(function(){var q=d(this).attr("href");d(this).parent().addClass("tabs").siblings("li").removeClass("tabs");j.find(l+"-tabs").siblings(".tabs-panel").hide();j.find(q).show();d(this).focus();if("#mla-"+i+"-all"==q){deleteUserSetting(n)}else{setUserSetting(n,"pop")}return false});if(getUserSetting(n)){j.find(l+'-tabs a[href="#mla-'+i+'-pop"]').click()}j.find(l+"-add-toggle").click(function(){j.find(l+"-searcher").addClass("mla-hidden-children");j.find(l+"-adder").toggleClass("mla-hidden-children");j.find(l+'-tabs a[href="#mla-'+i+'-all"]').click();j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();if(false===j.find(l+"-adder").hasClass("mla-hidden-children")){j.find(p).val("").removeClass("form-input-tip");j.find(p).focus()}return false});j.find(p).keypress(function(q){if(13===q.keyCode){q.preventDefault();j.find(l+"-add-submit").click()}});j.find(l+"-add-submit").click(function(){j.find(p).focus()});h=function(q){if(!j.find(p).val()){return false}q.data+="&"+j.find(l+"-checklist :checked").serialize();j.prop("disabled",true);return q};k=function(v,u){var t,q=j.find("#new"+i+"_parent");j.prop("disabled",false);if("undefined"!=u.parsed.responses[0]&&(t=u.parsed.responses[0].supplemental.newcat_parent)){q.before(t);q.remove();if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(i,t)}}};j.find(l+"-checklist").wpList({alt:"",response:"mla-"+i+"-ajax-response",addBefore:h,addAfter:k});j.find(l+"-checklist, "+l+"-checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var q=d(this),s=q.is(":checked"),r=q.val();if(r&&q.parents("#mla-taxonomy-"+i).length){d("#in-"+i+"-"+r+", #in-popular-"+i+"-"+r,"#mla-taxonomy-"+i).prop("checked",s)}});d.extend(d.expr[":"],{matchTerms:function(s,r,q,t){return(s.textContent||s.innerText||"").toLowerCase().indexOf((q[3]||"").toLowerCase())>=0}});j.find(o).keypress(function(q){if(13===q.keyCode){q.preventDefault();j.find(o).val("");j.find(l+"-searcher").addClass("mla-hidden-children");j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();return}});j.find(o).keyup(function(s){var u,t,v,r,q;if(13===s.keyCode){s.preventDefault();j.find(l+"-search-toggle").focus();return}u=j.find(o).val();t=j.find(l+"-checklist li");v=j.find(l+"-checklist-pop li");if(0<u.length){t.hide();v.hide()}else{t.show();v.show()}r=j.find(l+"-checklist label:matchTerms('"+u+"')");r.closest("li").find("li").andSelf().show();r.parents(l+"-checklist li").show();q=j.find(l+"-checklist-pop label:matchTerms('"+u+"')");q.closest("li").find("li").andSelf().show();q.parents(l+"-checklist li").show()});j.find(l+"-search-toggle").click(function(){j.find(l+"-adder ").addClass("mla-hidden-children");j.find(l+"-searcher").toggleClass("mla-hidden-children");j.find(l+'-tabs a[href="#mla-'+i+'-all"]').click();j.find(l+"-checklist li").show();j.find(l+"-checklist-pop li").show();if(false===j.find(l+"-searcher").hasClass("mla-hidden-children")){j.find(o).val("").removeClass("form-input-tip");j.find(o).focus()}return false})})}if(mlaModal.settings.enableDetailsTag){d(".mla-taxonomy-field .tagsdiv",e).each(function(){var h=mlaModal.utility.parseTaxonomyId(d(this).attr("id"));d(".compat-field-"+h+" th",e).click(function(){d(this).siblings("td").slideToggle()});mlaModal.tagBox.init(f,h,e)})}}}(jQuery));
languages/media-library-assistant-en_US - References.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Media Library Assistant\n"
5
- "POT-Creation-Date: 2020-08-13 16:18-0700\n"
6
  "PO-Revision-Date: 2015-08-21 21:38-0800\n"
7
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
8
  "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
@@ -14,7 +14,8 @@ msgstr ""
14
  "X-Poedit-Basepath: ..\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
- "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c\n"
 
18
  "X-Poedit-SourceCharset: UTF-8\n"
19
  "X-Poedit-SearchPath-0: includes\n"
20
  "X-Poedit-SearchPath-1: tests\n"
@@ -23,23 +24,23 @@ msgstr ""
23
  #: includes/class-mla-admin-columns-pro-support-423.php:178
24
  #: includes/class-mla-admin-columns-pro-support-44.php:175
25
  #: includes/class-mla-admin-columns-pro-support.php:193
26
- #: includes/class-mla-ajax.php:351 includes/class-mla-edit-media.php:987
27
- #: includes/class-mla-list-table.php:671
28
  msgid "Draft"
29
  msgstr ""
30
 
31
  #: includes/class-mla-admin-columns-pro-support-423.php:181
32
  #: includes/class-mla-admin-columns-pro-support-44.php:178
33
  #: includes/class-mla-admin-columns-pro-support.php:196
34
- #: includes/class-mla-ajax.php:345 includes/class-mla-edit-media.php:981
35
- #: includes/class-mla-list-table.php:674
36
  msgid "Scheduled"
37
  msgstr ""
38
 
39
  #: includes/class-mla-admin-columns-pro-support-423.php:184
40
  #: includes/class-mla-admin-columns-pro-support-44.php:181
41
  #: includes/class-mla-admin-columns-pro-support.php:199
42
- #: includes/class-mla-edit-media.php:984 includes/class-mla-list-table.php:677
43
  msgctxt "post state"
44
  msgid "Pending"
45
  msgstr ""
@@ -47,8 +48,8 @@ msgstr ""
47
  #: includes/class-mla-admin-columns-pro-support-423.php:187
48
  #: includes/class-mla-admin-columns-pro-support-44.php:184
49
  #: includes/class-mla-admin-columns-pro-support.php:202
50
- #: includes/class-mla-list-table.php:680
51
- #: includes/class-mla-thumbnail-generation.php:649
52
  msgid "Trash"
53
  msgstr ""
54
 
@@ -57,7 +58,7 @@ msgstr ""
57
  #: includes/class-mla-admin-columns-pro-support.php:433
58
  #: includes/class-mla-data-references.php:310
59
  #: includes/class-mla-data-references.php:634
60
- #: includes/class-mla-list-table.php:1118
61
  msgid "NO REFERENCE TESTS"
62
  msgstr ""
63
 
@@ -77,10 +78,10 @@ msgstr ""
77
  #: includes/class-mla-core-options.php:462
78
  #: includes/class-mla-core-options.php:472
79
  #: includes/class-mla-core-options.php:482
80
- #: includes/class-mla-list-table.php:1198
81
- #: includes/class-mla-list-table.php:1243
82
- #: includes/class-mla-list-table.php:1293
83
- #: includes/class-mla-list-table.php:1338
84
  msgid "Disabled"
85
  msgstr ""
86
 
@@ -96,14 +97,14 @@ msgstr ""
96
  #: includes/class-mla-admin-columns-pro-support.php:715
97
  #: includes/class-mla-admin-columns-pro-support.php:778
98
  #: includes/class-mla-admin-columns-pro-support.php:840
99
- #: includes/class-mla-edit-media.php:1069
100
- #: includes/class-mla-edit-media.php:1107
101
- #: includes/class-mla-edit-media.php:1143
102
- #: includes/class-mla-edit-media.php:1178
103
- #: includes/class-mla-list-table.php:1216
104
- #: includes/class-mla-list-table.php:1265
105
- #: includes/class-mla-list-table.php:1311
106
- #: includes/class-mla-list-table.php:1356
107
  msgid "PARENT"
108
  msgstr ""
109
 
@@ -114,24 +115,24 @@ msgstr ""
114
  #: includes/class-mla-core-options.php:868
115
  #: includes/class-mla-core-options.php:899
116
  #: includes/class-mla-core-options.php:913
117
- #: includes/class-mla-list-table.php:528 includes/class-mla-list-table.php:1451
118
- #: includes/class-mla-settings-shortcodes-tab.php:629
119
  msgid "None"
120
  msgstr ""
121
 
122
  #: includes/class-mla-admin-columns-pro-support-423.php:1117
123
  #: includes/class-mla-admin-columns-pro-support-44.php:1114
124
  #: includes/class-mla-admin-columns-pro-support.php:1155
125
- #: includes/class-mla-list-table.php:1590
126
  msgid "(Private post)"
127
  msgstr ""
128
 
129
  #: includes/class-mla-admin-columns-pro-support-423.php:1121
130
  #: includes/class-mla-admin-columns-pro-support-44.php:1118
131
  #: includes/class-mla-admin-columns-pro-support.php:1159
132
- #: includes/class-mla-ajax.php:361 includes/class-mla-list-table.php:1501
133
- #: includes/class-mla-list-table.php:1530
134
- #: includes/class-mla-list-table.php:1594
135
  msgid "Y/m/d"
136
  msgstr ""
137
 
@@ -139,15 +140,15 @@ msgstr ""
139
  #: includes/class-mla-admin-columns-pro-support-44.php:1131
140
  #: includes/class-mla-admin-columns-pro-support.php:1172
141
  #: includes/class-mla-core-options.php:1315
142
- #: includes/class-mla-list-table.php:1607
143
  msgctxt "table_view_singular"
144
  msgid "Unattached"
145
  msgstr ""
146
 
147
  #: includes/class-mla-admin-columns-support-deprecated.php:33
148
  #: includes/class-mla-admin-columns-support.php:43
149
- #: includes/class-mla-core-options.php:561 includes/class-mla-settings.php:436
150
- #: includes/class-mla-settings.php:1459 includes/class-mla-settings.php:1475
151
  #: index.php:46
152
  msgid "Media Library Assistant"
153
  msgstr ""
@@ -206,52 +207,52 @@ msgid ""
206
  "\"%3$d\" count = %4$d."
207
  msgstr ""
208
 
209
- #: includes/class-mla-ajax.php:332 includes/class-mla-core-options.php:1191
210
- #: includes/class-mla-data.php:4281 includes/class-mla-edit-media.php:478
211
- #: includes/class-mla-main.php:2056 includes/class-mla-main.php:2361
212
  #: includes/class-mla-objects.php:348 includes/class-mla-options.php:466
213
  #: includes/mla-main-search-box-template.php:47
214
  #: includes/mla-media-modal-js-template.php:57
215
  msgid "Title"
216
  msgstr ""
217
 
218
- #: includes/class-mla-ajax.php:332 includes/class-mla-main.php:2057
219
- #: includes/class-mla-thumbnail-generation.php:641
220
  msgid "Type"
221
  msgstr ""
222
 
223
- #: includes/class-mla-ajax.php:332 includes/class-mla-main.php:2058
224
  msgid "Date"
225
  msgstr ""
226
 
227
- #: includes/class-mla-ajax.php:332 includes/class-mla-main.php:2059
228
- #: includes/class-mla-settings-custom-fields-tab.php:503
229
- #: includes/class-mla-settings-custom-fields-tab.php:803
230
- #: includes/class-mla-settings-iptc-exif-tab.php:515
231
- #: includes/class-mla-settings-iptc-exif-tab.php:897
232
- #: includes/class-mla-settings-upload-tab.php:548
233
  msgid "Status"
234
  msgstr ""
235
 
236
- #: includes/class-mla-ajax.php:336 includes/class-mla-list-table.php:927
237
- #: includes/class-mla-list-table.php:1092 includes/class-mla-main.php:460
238
- #: includes/class-mla-polylang-support.php:374
239
  #: includes/class-mla-thumbnail-generation.php:97
240
  msgid "(no title)"
241
  msgstr ""
242
 
243
- #: includes/class-mla-ajax.php:342
244
  msgid "Published"
245
  msgstr ""
246
 
247
- #: includes/class-mla-ajax.php:348
248
  msgid "Pending Review"
249
  msgstr ""
250
 
251
- #: includes/class-mla-ajax.php:390 includes/class-mla-ajax.php:397
252
- #: includes/class-mla-ajax.php:406 includes/class-mla-core.php:863
253
- #: includes/class-mla-core.php:881 includes/class-mla-core.php:1306
254
- #: includes/class-mla-core.php:1312 includes/class-mla-core.php:1316
255
  #: includes/class-mla-data-office.php:54 includes/class-mla-data-office.php:64
256
  #: includes/class-mla-data-office.php:68 includes/class-mla-data-office.php:83
257
  #: includes/class-mla-data-office.php:88 includes/class-mla-data-pdf.php:216
@@ -265,126 +266,127 @@ msgstr ""
265
  #: includes/class-mla-data.php:1778 includes/class-mla-data.php:1784
266
  #: includes/class-mla-data.php:2134 includes/class-mla-data.php:2138
267
  #: includes/class-mla-data.php:3503 includes/class-mla-data.php:3564
268
- #: includes/class-mla-data.php:3608 includes/class-mla-data.php:3988
269
- #: includes/class-mla-data.php:4001 includes/class-mla-data.php:4023
270
- #: includes/class-mla-data.php:4256 includes/class-mla-data.php:4302
271
- #: includes/class-mla-data.php:4335 includes/class-mla-data.php:4351
272
- #: includes/class-mla-data.php:4622 includes/class-mla-edit-media.php:319
273
- #: includes/class-mla-edit-media.php:893 includes/class-mla-edit-media.php:935
274
- #: includes/class-mla-main.php:708 includes/class-mla-main.php:836
275
- #: includes/class-mla-main.php:838 includes/class-mla-main.php:841
276
- #: includes/class-mla-main.php:901 includes/class-mla-main.php:935
277
- #: includes/class-mla-main.php:944 includes/class-mla-main.php:951
278
- #: includes/class-mla-main.php:1336 includes/class-mla-main.php:1392
279
- #: includes/class-mla-main.php:1417 includes/class-mla-main.php:1554
280
- #: includes/class-mla-main.php:1604 includes/class-mla-main.php:1707
281
- #: includes/class-mla-main.php:1736 includes/class-mla-main.php:1872
282
- #: includes/class-mla-main.php:1879 includes/class-mla-main.php:2042
283
- #: includes/class-mla-main.php:2168 includes/class-mla-main.php:2493
284
- #: includes/class-mla-main.php:2501 includes/class-mla-main.php:2525
285
- #: includes/class-mla-main.php:2533 includes/class-mla-main.php:2565
286
- #: includes/class-mla-main.php:2573 includes/class-mla-media-modal.php:617
287
- #: includes/class-mla-mime-types.php:825 includes/class-mla-mime-types.php:1217
288
- #: includes/class-mla-mime-types.php:1305
289
- #: includes/class-mla-mime-types.php:1451
290
- #: includes/class-mla-mime-types.php:1474
291
- #: includes/class-mla-mime-types.php:2275
292
- #: includes/class-mla-mime-types.php:2286
 
293
  #: includes/class-mla-mime-types.php:2299
294
- #: includes/class-mla-mime-types.php:2307
295
- #: includes/class-mla-mime-types.php:2312
296
- #: includes/class-mla-mime-types.php:2355
297
- #: includes/class-mla-mime-types.php:2374
298
- #: includes/class-mla-mime-types.php:2425
299
- #: includes/class-mla-mime-types.php:2459
300
- #: includes/class-mla-mime-types.php:2544
301
- #: includes/class-mla-mime-types.php:2623
302
- #: includes/class-mla-mime-types.php:2632
303
- #: includes/class-mla-mime-types.php:2664 includes/class-mla-objects.php:245
304
  #: includes/class-mla-options.php:218 includes/class-mla-options.php:434
305
  #: includes/class-mla-options.php:515 includes/class-mla-options.php:570
306
- #: includes/class-mla-options.php:1131 includes/class-mla-options.php:1969
307
- #: includes/class-mla-options.php:2195
308
- #: includes/class-mla-settings-custom-fields-tab.php:173
309
- #: includes/class-mla-settings-custom-fields-tab.php:238
310
- #: includes/class-mla-settings-custom-fields-tab.php:242
311
- #: includes/class-mla-settings-custom-fields-tab.php:276
312
- #: includes/class-mla-settings-custom-fields-tab.php:304
313
- #: includes/class-mla-settings-custom-fields-tab.php:308
314
- #: includes/class-mla-settings-custom-fields-tab.php:341
315
- #: includes/class-mla-settings-custom-fields-tab.php:425
316
- #: includes/class-mla-settings-custom-fields-tab.php:552
317
- #: includes/class-mla-settings-custom-fields-tab.php:718
318
- #: includes/class-mla-settings-custom-fields-tab.php:928
319
- #: includes/class-mla-settings-custom-fields-tab.php:932
320
- #: includes/class-mla-settings-custom-fields-tab.php:956
321
- #: includes/class-mla-settings-custom-fields-tab.php:2034
322
- #: includes/class-mla-settings-documentation-tab.php:131
323
- #: includes/class-mla-settings-documentation-tab.php:323
324
- #: includes/class-mla-settings-documentation-tab.php:1301
325
  #: includes/class-mla-settings-iptc-exif-tab.php:171
326
- #: includes/class-mla-settings-iptc-exif-tab.php:237
327
- #: includes/class-mla-settings-iptc-exif-tab.php:241
328
- #: includes/class-mla-settings-iptc-exif-tab.php:276
329
- #: includes/class-mla-settings-iptc-exif-tab.php:304
330
- #: includes/class-mla-settings-iptc-exif-tab.php:308
331
- #: includes/class-mla-settings-iptc-exif-tab.php:342
332
- #: includes/class-mla-settings-iptc-exif-tab.php:426
333
- #: includes/class-mla-settings-iptc-exif-tab.php:643
334
- #: includes/class-mla-settings-iptc-exif-tab.php:811
335
- #: includes/class-mla-settings-iptc-exif-tab.php:1012
336
- #: includes/class-mla-settings-iptc-exif-tab.php:1016
337
- #: includes/class-mla-settings-iptc-exif-tab.php:1046
338
- #: includes/class-mla-settings-iptc-exif-tab.php:2286
339
- #: includes/class-mla-settings-shortcodes-tab.php:79
340
- #: includes/class-mla-settings-shortcodes-tab.php:90
341
- #: includes/class-mla-settings-shortcodes-tab.php:94
342
- #: includes/class-mla-settings-shortcodes-tab.php:112
343
- #: includes/class-mla-settings-shortcodes-tab.php:139
344
- #: includes/class-mla-settings-shortcodes-tab.php:203
345
- #: includes/class-mla-settings-shortcodes-tab.php:210
346
- #: includes/class-mla-settings-shortcodes-tab.php:214
347
- #: includes/class-mla-settings-shortcodes-tab.php:503
348
- #: includes/class-mla-settings-shortcodes-tab.php:1630
349
- #: includes/class-mla-settings-upload-tab.php:301
350
- #: includes/class-mla-settings-upload-tab.php:353
351
- #: includes/class-mla-settings-upload-tab.php:428
352
- #: includes/class-mla-settings-upload-tab.php:590
353
- #: includes/class-mla-settings-upload-tab.php:601
354
- #: includes/class-mla-settings-view-tab.php:166
355
- #: includes/class-mla-settings-view-tab.php:198
356
- #: includes/class-mla-settings-view-tab.php:275
357
- #: includes/class-mla-settings-view-tab.php:433
358
- #: includes/class-mla-settings-view-tab.php:447
359
- #: includes/class-mla-settings.php:596 includes/class-mla-settings.php:734
360
- #: includes/class-mla-settings.php:771 includes/class-mla-settings.php:911
361
- #: includes/class-mla-settings.php:1320 includes/class-mla-settings.php:1371
362
- #: includes/class-mla-settings.php:1459 includes/class-mla-settings.php:1486
363
- #: includes/class-mla-settings.php:1489 includes/class-mla-settings.php:1493
364
- #: includes/class-mla-settings.php:1786 includes/class-mla-settings.php:1790
365
- #: includes/class-mla-settings.php:1801 includes/class-mla-settings.php:1808
366
- #: includes/class-mla-settings.php:1817 includes/class-mla-settings.php:1854
367
- #: includes/class-mla-settings.php:1862 includes/class-mla-settings.php:1871
368
- #: includes/class-mla-shortcode-support.php:2184
369
- #: includes/class-mla-shortcode-support.php:2273
370
- #: includes/class-mla-shortcode-support.php:3506
371
- #: includes/class-mla-shortcode-support.php:3633
372
- #: includes/class-mla-shortcode-support.php:3665
373
- #: includes/class-mla-shortcode-support.php:4867
374
- #: includes/class-mla-shortcode-support.php:5279
375
- #: includes/class-mla-shortcode-support.php:5310
376
- #: includes/class-mla-thumbnail-generation.php:434
377
- #: includes/class-mla-thumbnail-generation.php:446
378
- #: includes/class-mla-thumbnail-generation.php:458
379
- #: includes/class-mla-thumbnail-generation.php:502
 
380
  msgid "ERROR"
381
  msgstr ""
382
 
383
- #: includes/class-mla-ajax.php:390 includes/class-mla-main.php:1872
384
  msgid "No post ID found"
385
  msgstr ""
386
 
387
- #: includes/class-mla-ajax.php:397 includes/class-mla-main.php:1879
388
  #: includes/class-mla-polylang-support.php:271
389
  msgid "You are not allowed to edit this Attachment."
390
  msgstr ""
@@ -405,7 +407,7 @@ msgstr ""
405
  msgid "Check this option to add support for Attachment Tags."
406
  msgstr ""
407
 
408
- #: includes/class-mla-core-options.php:429 includes/class-mla-settings.php:1069
409
  msgid "Where-used Reporting"
410
  msgstr ""
411
 
@@ -422,7 +424,7 @@ msgid "Where-used database access tuning"
422
  msgstr ""
423
 
424
  #: includes/class-mla-core-options.php:447
425
- #: includes/class-mla-edit-media.php:828 includes/class-mla-edit-media.php:1080
426
  msgid "Featured in"
427
  msgstr ""
428
 
@@ -436,7 +438,7 @@ msgid "Search database posts and pages for Featured Image attachments."
436
  msgstr ""
437
 
438
  #: includes/class-mla-core-options.php:457
439
- #: includes/class-mla-edit-media.php:832 includes/class-mla-edit-media.php:1119
440
  msgid "Inserted in"
441
  msgstr ""
442
 
@@ -452,8 +454,8 @@ msgid ""
452
  msgstr ""
453
 
454
  #: includes/class-mla-core-options.php:467
455
- #: includes/class-mla-edit-media.php:836 includes/class-mla-edit-media.php:1154
456
- #: includes/class-mla-settings.php:1567
457
  msgid "Gallery in"
458
  msgstr ""
459
 
@@ -463,9 +465,9 @@ msgid "Dynamic"
463
  msgstr ""
464
 
465
  #: includes/class-mla-core-options.php:472
466
- #: includes/class-mla-core-options.php:482 includes/class-mla-main.php:2396
467
- #: includes/class-mla-settings-custom-fields-tab.php:733
468
- #: includes/class-mla-settings-iptc-exif-tab.php:826
469
  msgid "Refresh"
470
  msgstr ""
471
 
@@ -482,8 +484,8 @@ msgid ""
482
  msgstr ""
483
 
484
  #: includes/class-mla-core-options.php:477
485
- #: includes/class-mla-edit-media.php:840 includes/class-mla-edit-media.php:1189
486
- #: includes/class-mla-settings.php:1577
487
  msgid "MLA Gallery in"
488
  msgstr ""
489
 
@@ -495,7 +497,7 @@ msgid ""
495
  "Cached."
496
  msgstr ""
497
 
498
- #: includes/class-mla-core-options.php:487 includes/class-mla-settings.php:1069
499
  msgid "Taxonomy Support"
500
  msgstr ""
501
 
@@ -536,14 +538,14 @@ msgid ""
536
  msgstr ""
537
 
538
  #: includes/class-mla-core-options.php:512
539
- #: includes/class-mla-core-options.php:750 includes/class-mla-settings.php:1095
540
- #: includes/class-mla-settings.php:1096 includes/class-mla-settings.php:1097
541
  msgid "For complete documentation"
542
  msgstr ""
543
 
544
  #: includes/class-mla-core-options.php:512
545
- #: includes/class-mla-core-options.php:750 includes/class-mla-settings.php:1095
546
- #: includes/class-mla-settings.php:1096 includes/class-mla-settings.php:1097
547
  msgid "click here"
548
  msgstr ""
549
 
@@ -672,7 +674,7 @@ msgstr ""
672
  msgid "Choose the sort order."
673
  msgstr ""
674
 
675
- #: includes/class-mla-core-options.php:626 includes/class-mla-main.php:629
676
  msgid "Entries per page"
677
  msgstr ""
678
 
@@ -942,7 +944,7 @@ msgstr ""
942
  #: includes/class-mla-core-options.php:877
943
  #: includes/class-mla-core-options.php:899
944
  #: includes/class-mla-core-options.php:913
945
- #: includes/class-mla-core-options.php:927 includes/class-mla-settings.php:1146
946
  msgid "Media Manager Default"
947
  msgstr ""
948
 
@@ -1023,8 +1025,8 @@ msgid "Size"
1023
  msgstr ""
1024
 
1025
  #: includes/class-mla-core-options.php:927
1026
- #: includes/class-mla-thumbnail-generation.php:588
1027
- #: includes/class-mla-thumbnail-generation.php:652
1028
  msgid "Thumbnail"
1029
  msgstr ""
1030
 
@@ -1055,7 +1057,7 @@ msgid ""
1055
  "strong> of your settings below by clicking \""
1056
  msgstr ""
1057
 
1058
- #: includes/class-mla-core-options.php:944 includes/class-mla-settings.php:1071
1059
  msgid "Export ALL Settings"
1060
  msgstr ""
1061
 
@@ -1095,7 +1097,7 @@ msgstr ""
1095
 
1096
  #: includes/class-mla-core-options.php:976
1097
  #: includes/class-mla-core-options.php:1020
1098
- #: includes/class-mla-settings-shortcodes-tab.php:85
1099
  msgid "markup template"
1100
  msgstr ""
1101
 
@@ -1287,34 +1289,34 @@ msgstr ""
1287
  msgid "IPTC/EXIF Mapping help"
1288
  msgstr ""
1289
 
1290
- #: includes/class-mla-core-options.php:1198 includes/class-mla-data.php:4305
1291
- #: includes/class-mla-edit-media.php:479 includes/class-mla-main.php:2362
1292
  msgid "Name/Slug"
1293
  msgstr ""
1294
 
1295
- #: includes/class-mla-core-options.php:1205 includes/class-mla-data.php:4348
1296
- #: includes/class-mla-edit-media.php:482 includes/class-mla-list-table.php:1393
1297
- #: includes/class-mla-main.php:2366 includes/class-mla-options.php:472
1298
  #: includes/mla-main-search-box-template.php:51
1299
  #: includes/mla-media-modal-js-template.php:65
1300
  msgid "ALT Text"
1301
  msgstr ""
1302
 
1303
- #: includes/class-mla-core-options.php:1212 includes/class-mla-data.php:4361
1304
- #: includes/class-mla-edit-media.php:480 includes/class-mla-main.php:2363
1305
  #: includes/class-mla-options.php:475
1306
  #: includes/mla-main-search-box-template.php:53
1307
  #: includes/mla-media-modal-js-template.php:70
1308
  msgid "Caption"
1309
  msgstr ""
1310
 
1311
- #: includes/class-mla-core-options.php:1219 includes/class-mla-data.php:4370
1312
- #: includes/class-mla-edit-media.php:481 includes/class-mla-main.php:2364
1313
  #: includes/class-mla-options.php:478
1314
- #: includes/class-mla-settings-upload-tab.php:174
1315
- #: includes/class-mla-settings-upload-tab.php:538
1316
- #: includes/class-mla-settings-view-tab.php:132
1317
- #: includes/class-mla-settings-view-tab.php:388
1318
  #: includes/class-mla-template-support.php:74
1319
  #: includes/class-mla-template-support.php:92
1320
  #: includes/class-mla-template-support.php:110
@@ -1326,9 +1328,9 @@ msgstr ""
1326
  msgid "Description"
1327
  msgstr ""
1328
 
1329
- #: includes/class-mla-core-options.php:1226 includes/class-mla-data.php:4432
1330
- #: includes/class-mla-data.php:4441 includes/class-mla-edit-media.php:483
1331
- #: includes/class-mla-edit-media.php:678 includes/class-mla-main.php:2368
1332
  msgid "Uploaded on"
1333
  msgstr ""
1334
 
@@ -1347,21 +1349,21 @@ msgid "Post MIME Types help."
1347
  msgstr ""
1348
 
1349
  #: includes/class-mla-core-options.php:1261
1350
- #: includes/class-mla-mime-types.php:1706
1351
- #: includes/class-mla-settings-custom-fields-tab.php:2460
1352
- #: includes/class-mla-settings-documentation-tab.php:1571
1353
- #: includes/class-mla-settings-iptc-exif-tab.php:2749
1354
- #: includes/class-mla-settings-shortcodes-tab.php:1973
1355
  msgctxt "table_view_singular"
1356
  msgid "All"
1357
  msgstr ""
1358
 
1359
  #: includes/class-mla-core-options.php:1262
1360
- #: includes/class-mla-mime-types.php:1707
1361
- #: includes/class-mla-settings-custom-fields-tab.php:2461
1362
- #: includes/class-mla-settings-documentation-tab.php:1572
1363
- #: includes/class-mla-settings-iptc-exif-tab.php:2750
1364
- #: includes/class-mla-settings-shortcodes-tab.php:1974
1365
  msgctxt "table_view_plural"
1366
  msgid "All"
1367
  msgstr ""
@@ -1560,45 +1562,45 @@ msgid ""
1560
  "the existing MLA_DEBUG_LEVEL value."
1561
  msgstr ""
1562
 
1563
- #: includes/class-mla-core.php:863
1564
  #, php-format
1565
  msgctxt "error_log"
1566
  msgid "%1$s: mla_load_template file \"%2$s\" not found."
1567
  msgstr ""
1568
 
1569
- #: includes/class-mla-core.php:881
1570
  #, php-format
1571
  msgctxt "error_log"
1572
  msgid "%1$s: mla_load_template file \"%2$s\" bad source type \"%3$s\"."
1573
  msgstr ""
1574
 
1575
- #: includes/class-mla-core.php:1306
1576
  #, php-format
1577
  msgid "%1$s: Bad specification part \"%2$s\""
1578
  msgstr ""
1579
 
1580
- #: includes/class-mla-core.php:1312
1581
  #, php-format
1582
  msgid "%1$s: Bad specification option \"%2$s\""
1583
  msgstr ""
1584
 
1585
- #: includes/class-mla-core.php:1316
1586
  #, php-format
1587
  msgid "%1$s: Bad specification prefix \"%2$s\""
1588
  msgstr ""
1589
 
1590
- #: includes/class-mla-core.php:1416
1591
  msgid "Most Used"
1592
  msgstr ""
1593
 
1594
- #: includes/class-mla-core.php:1445
1595
  #, php-format
1596
  msgid "+ %s"
1597
  msgstr ""
1598
 
1599
- #: includes/class-mla-core.php:1451 includes/class-mla-edit-media.php:360
1600
- #: includes/class-mla-edit-media.php:416 includes/class-mla-main.php:2048
1601
- #: includes/class-mla-main.php:2229 includes/class-mla-main.php:2293
1602
  #: includes/class-mla-media-modal.php:647
1603
  #: includes/mla-media-modal-js-template.php:45
1604
  #: includes/mla-media-modal-js-template.php:92
@@ -1678,10 +1680,10 @@ msgid "Title"
1678
  msgstr ""
1679
 
1680
  #: includes/class-mla-data-query.php:294
1681
- #: includes/class-mla-settings-custom-fields-tab.php:1208
1682
- #: includes/class-mla-settings-documentation-tab.php:522
1683
- #: includes/class-mla-settings-iptc-exif-tab.php:1302
1684
- #: includes/class-mla-settings-shortcodes-tab.php:956
1685
  msgctxt "list_table_column"
1686
  msgid "Name"
1687
  msgstr ""
@@ -1728,8 +1730,8 @@ msgstr ""
1728
 
1729
  #: includes/class-mla-data-query.php:303 includes/class-mla-mime-types.php:635
1730
  #: includes/class-mla-mime-types.php:708 includes/class-mla-mime-types.php:787
1731
- #: includes/class-mla-settings-documentation-tab.php:525
1732
- #: includes/class-mla-settings-shortcodes-tab.php:959
1733
  msgctxt "list_table_column"
1734
  msgid "Description"
1735
  msgstr ""
@@ -1770,23 +1772,23 @@ msgctxt "list_table_column"
1770
  msgid "Attached to"
1771
  msgstr ""
1772
 
1773
- #: includes/class-mla-data-query.php:843 includes/class-mla-edit-media.php:319
1774
- #: includes/class-mla-main.php:2042 includes/class-mla-main.php:2168
1775
  #: includes/class-mla-media-modal.php:617 includes/class-mla-mime-types.php:825
1776
- #: includes/class-mla-mime-types.php:1474
1777
- #: includes/class-mla-mime-types.php:2664
1778
- #: includes/class-mla-settings-custom-fields-tab.php:552
1779
- #: includes/class-mla-settings-custom-fields-tab.php:718
1780
- #: includes/class-mla-settings-custom-fields-tab.php:2034
1781
- #: includes/class-mla-settings-documentation-tab.php:323
1782
- #: includes/class-mla-settings-documentation-tab.php:1301
1783
- #: includes/class-mla-settings-iptc-exif-tab.php:643
1784
- #: includes/class-mla-settings-iptc-exif-tab.php:811
1785
- #: includes/class-mla-settings-iptc-exif-tab.php:2286
1786
- #: includes/class-mla-settings-shortcodes-tab.php:503
1787
- #: includes/class-mla-settings-shortcodes-tab.php:1630
1788
- #: includes/class-mla-settings-upload-tab.php:301
1789
- #: includes/class-mla-settings-view-tab.php:166
1790
  #, php-format
1791
  msgctxt "error_log"
1792
  msgid "%1$s: %2$s non-array \"%3$s\""
@@ -1848,8 +1850,8 @@ msgstr ""
1848
 
1849
  #: includes/class-mla-data-references.php:316
1850
  #: includes/class-mla-data-references.php:640
1851
- #: includes/class-mla-data-source.php:688
1852
- #: includes/class-mla-data-source.php:689
1853
  msgid "ORPHAN"
1854
  msgstr ""
1855
 
@@ -1953,457 +1955,457 @@ msgid "mla_parse_xml_string set option failed."
1953
  msgstr ""
1954
 
1955
  #: includes/class-mla-data.php:3735
1956
- #: includes/class-mla-settings-custom-fields-tab.php:810
1957
- #: includes/class-mla-settings-custom-fields-tab.php:1520
1958
- #: includes/class-mla-settings-iptc-exif-tab.php:905
1959
- #: includes/class-mla-settings-iptc-exif-tab.php:1645
1960
- #: includes/class-mla-settings-iptc-exif-tab.php:2460
1961
- #: includes/class-mla-settings-view-tab.php:398
1962
- #: includes/class-mla-settings-view-tab.php:796
1963
- #: includes/class-mla-settings-view-tab.php:812
1964
- #: includes/class-mla-wpml-support.php:1562
1965
  msgid "Yes"
1966
  msgstr ""
1967
 
1968
  #: includes/class-mla-data.php:3737
1969
- #: includes/class-mla-settings-custom-fields-tab.php:811
1970
- #: includes/class-mla-settings-custom-fields-tab.php:1522
1971
- #: includes/class-mla-settings-iptc-exif-tab.php:906
1972
- #: includes/class-mla-settings-iptc-exif-tab.php:1647
1973
- #: includes/class-mla-settings-iptc-exif-tab.php:2460
1974
- #: includes/class-mla-settings-view-tab.php:397
1975
- #: includes/class-mla-settings-view-tab.php:798
1976
- #: includes/class-mla-settings-view-tab.php:814
1977
- #: includes/class-mla-wpml-support.php:1563
1978
  msgid "No"
1979
  msgstr ""
1980
 
1981
- #: includes/class-mla-data.php:3985 includes/class-mla-data.php:4102
1982
  #, php-format
1983
  msgid "Deleting %1$s"
1984
  msgstr ""
1985
 
1986
- #: includes/class-mla-data.php:3988
1987
  #, php-format
1988
  msgid "%1$s: meta:%2$s not found"
1989
  msgstr ""
1990
 
1991
- #: includes/class-mla-data.php:3997 includes/class-mla-data.php:4113
1992
- #: includes/class-mla-data.php:4125
1993
  #, php-format
1994
  msgid "Adding %1$s = %2$s"
1995
  msgstr ""
1996
 
1997
- #: includes/class-mla-data.php:4001
1998
  #, php-format
1999
  msgid "%1$s: Adding meta:%2$s; not found"
2000
  msgstr ""
2001
 
2002
- #: includes/class-mla-data.php:4008
2003
  #, php-format
2004
  msgid "Deleting Null meta:%1$s"
2005
  msgstr ""
2006
 
2007
- #: includes/class-mla-data.php:4018 includes/class-mla-data.php:4194
2008
- #: includes/class-mla-data.php:4281 includes/class-mla-data.php:4305
2009
- #: includes/class-mla-data.php:4348 includes/class-mla-data.php:4361
2010
- #: includes/class-mla-data.php:4370 includes/class-mla-data.php:4381
2011
- #: includes/class-mla-data.php:4392 includes/class-mla-data.php:4405
2012
- #: includes/class-mla-data.php:4414 includes/class-mla-data.php:4423
2013
- #: includes/class-mla-data.php:4432 includes/class-mla-data.php:4441
2014
- #: includes/class-mla-mime-types.php:1308
2015
- #: includes/class-mla-mime-types.php:2428
2016
  #, php-format
2017
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\""
2018
  msgstr ""
2019
 
2020
- #: includes/class-mla-data.php:4023
2021
  #, php-format
2022
  msgid "%1$s: Changing meta:%2$s; not found"
2023
  msgstr ""
2024
 
2025
- #: includes/class-mla-data.php:4149
2026
  #, php-format
2027
  msgid "Deleting old %1$s values"
2028
  msgstr ""
2029
 
2030
- #: includes/class-mla-data.php:4179
2031
  #, php-format
2032
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\"; %4$d updates"
2033
  msgstr ""
2034
 
2035
- #: includes/class-mla-data.php:4256
2036
  msgid "Could not retrieve Attachment."
2037
  msgstr ""
2038
 
2039
- #: includes/class-mla-data.php:4302
2040
  #, php-format
2041
  msgid "%1$s: Could not change Name/Slug \"%2$s\"; name already exists"
2042
  msgstr ""
2043
 
2044
- #: includes/class-mla-data.php:4332
2045
  #, php-format
2046
  msgid "Deleting ALT Text, was \"%1$s\""
2047
  msgstr ""
2048
 
2049
- #: includes/class-mla-data.php:4335
2050
  #, php-format
2051
  msgid "%1$s: Could not delete ALT Text, remains \"%2$s\""
2052
  msgstr ""
2053
 
2054
- #: includes/class-mla-data.php:4351
2055
  #, php-format
2056
  msgid "%1$s: Could not change ALT Text from \"%2$s\" to \"%3$s\""
2057
  msgstr ""
2058
 
2059
- #: includes/class-mla-data.php:4381 includes/class-mla-list-table.php:1095
2060
- #: includes/class-mla-list-table.php:1098
2061
- #: includes/class-mla-list-table.php:1101
2062
- #: includes/class-mla-list-table.php:1169 includes/class-mla-options.php:2139
2063
- #: includes/class-mla-settings-iptc-exif-tab.php:488
2064
- #: includes/class-mla-settings-iptc-exif-tab.php:875
2065
  msgid "Parent"
2066
  msgstr ""
2067
 
2068
- #: includes/class-mla-data.php:4392 includes/class-mla-edit-media.php:817
2069
- #: includes/class-mla-edit-media.php:1022 includes/class-mla-main.php:2371
2070
- #: includes/class-mla-settings-view-tab.php:130
2071
- #: includes/class-mla-settings-view-tab.php:386
2072
  msgid "Menu Order"
2073
  msgstr ""
2074
 
2075
- #: includes/class-mla-data.php:4405 includes/class-mla-edit-media.php:447
2076
- #: includes/class-mla-list-table.php:1549
2077
- #: includes/class-mla-list-table.php:1552 includes/class-mla-main.php:2174
2078
- #: includes/class-mla-main.php:2330
2079
  msgid "Author"
2080
  msgstr ""
2081
 
2082
- #: includes/class-mla-data.php:4414 includes/class-mla-edit-media.php:472
2083
- #: includes/class-mla-main.php:2383
2084
  msgid "Comments"
2085
  msgstr ""
2086
 
2087
- #: includes/class-mla-data.php:4423 includes/class-mla-edit-media.php:473
2088
- #: includes/class-mla-main.php:2384
2089
  msgid "Pings"
2090
  msgstr ""
2091
 
2092
- #: includes/class-mla-data.php:4471
2093
  #, php-format
2094
  msgid "You cannot assign \"%1$s\" terms"
2095
  msgstr ""
2096
 
2097
- #: includes/class-mla-data.php:4484
2098
  msgctxt "tag delimiter"
2099
  msgid ","
2100
  msgstr ""
2101
 
2102
- #: includes/class-mla-data.php:4523
2103
  msgid "Adding"
2104
  msgstr ""
2105
 
2106
- #: includes/class-mla-data.php:4528
2107
  msgid "Removing"
2108
  msgstr ""
2109
 
2110
- #: includes/class-mla-data.php:4537
2111
  msgid "Replacing"
2112
  msgstr ""
2113
 
2114
- #: includes/class-mla-data.php:4545
2115
  msgid "Ignoring"
2116
  msgstr ""
2117
 
2118
- #: includes/class-mla-data.php:4562
2119
  #, php-format
2120
  msgid "%1$s \"%2$s\" terms"
2121
  msgstr ""
2122
 
2123
- #: includes/class-mla-data.php:4574 includes/class-mla-main.php:1402
2124
  #, php-format
2125
  msgid "Item %1$d, no changes detected."
2126
  msgstr ""
2127
 
2128
- #: includes/class-mla-data.php:4604
2129
  #, php-format
2130
  msgid "Item %1$d updated."
2131
  msgstr ""
2132
 
2133
- #: includes/class-mla-data.php:4622
2134
  #, php-format
2135
  msgid "%1$s: Item %2$d update failed."
2136
  msgstr ""
2137
 
2138
- #: includes/class-mla-edit-media.php:129 includes/class-mla-edit-media.php:183
2139
- #: includes/class-mla-edit-media.php:236 includes/class-mla-main.php:469
2140
- #: includes/class-mla-main.php:1157 includes/class-mla-main.php:1926
2141
- #: includes/class-mla-media-modal.php:268 includes/class-mla-options.php:1647
2142
- #: includes/class-mla-polylang-support.php:378
2143
- #: includes/class-mla-settings-custom-fields-tab.php:59
2144
- #: includes/class-mla-settings-custom-fields-tab.php:94
2145
  #: includes/class-mla-settings-iptc-exif-tab.php:57
2146
  #: includes/class-mla-settings-iptc-exif-tab.php:90
2147
- #: includes/class-mla-settings-upload-tab.php:48
2148
- #: includes/class-mla-settings-view-tab.php:48
2149
  #: includes/class-mla-thumbnail-generation.php:99
2150
  msgctxt "tag_delimiter"
2151
  msgid ","
2152
  msgstr ""
2153
 
2154
- #: includes/class-mla-edit-media.php:178
2155
  msgid "Upload New Media items"
2156
  msgstr ""
2157
 
2158
- #: includes/class-mla-edit-media.php:179 includes/class-mla-edit-media.php:467
2159
  msgid "Open Bulk Edit area"
2160
  msgstr ""
2161
 
2162
- #: includes/class-mla-edit-media.php:180
2163
  msgid "Close Bulk Edit area"
2164
  msgstr ""
2165
 
2166
- #: includes/class-mla-edit-media.php:184 includes/class-mla-edit-media.php:238
2167
- #: includes/class-mla-main.php:456
2168
  msgid "An ajax.fail error has occurred. Please reload the page and try again."
2169
  msgstr ""
2170
 
2171
- #: includes/class-mla-edit-media.php:185 includes/class-mla-edit-media.php:239
2172
- #: includes/class-mla-main.php:457
2173
  msgid "An ajax.done error has occurred. Please reload the page and try again."
2174
  msgstr ""
2175
 
2176
- #: includes/class-mla-edit-media.php:240 includes/class-mla-main.php:2128
2177
  #, php-format
2178
  msgid "Uploaded on: %s"
2179
  msgstr ""
2180
 
2181
- #: includes/class-mla-edit-media.php:241 includes/class-mla-edit-media.php:690
2182
  msgid "Last modified"
2183
  msgstr ""
2184
 
2185
- #: includes/class-mla-edit-media.php:339 includes/class-mla-edit-media.php:395
2186
- #: includes/class-mla-main.php:2208 includes/class-mla-main.php:2272
2187
  msgid "+&nbsp;Add&nbsp;New&nbsp;Term"
2188
  msgstr ""
2189
 
2190
- #: includes/class-mla-edit-media.php:340 includes/class-mla-edit-media.php:396
2191
- #: includes/class-mla-main.php:2209 includes/class-mla-main.php:2273
2192
  msgid "Add New"
2193
  msgstr ""
2194
 
2195
- #: includes/class-mla-edit-media.php:358 includes/class-mla-edit-media.php:414
2196
- #: includes/class-mla-main.php:2227 includes/class-mla-main.php:2291
2197
  msgid "?&nbsp;Search"
2198
  msgstr ""
2199
 
2200
- #: includes/class-mla-edit-media.php:361 includes/class-mla-edit-media.php:417
2201
- #: includes/class-mla-edit-media.php:426 includes/class-mla-main.php:2230
2202
- #: includes/class-mla-main.php:2294 includes/class-mla-main.php:2303
2203
  msgid "Add"
2204
  msgstr ""
2205
 
2206
- #: includes/class-mla-edit-media.php:362 includes/class-mla-edit-media.php:418
2207
- #: includes/class-mla-edit-media.php:427 includes/class-mla-main.php:2231
2208
- #: includes/class-mla-main.php:2295 includes/class-mla-main.php:2304
2209
  msgid "Remove"
2210
  msgstr ""
2211
 
2212
- #: includes/class-mla-edit-media.php:363 includes/class-mla-edit-media.php:419
2213
- #: includes/class-mla-edit-media.php:428 includes/class-mla-main.php:2232
2214
- #: includes/class-mla-main.php:2296 includes/class-mla-main.php:2305
2215
- #: includes/class-mla-settings-custom-fields-tab.php:481
2216
- #: includes/class-mla-settings-custom-fields-tab.php:781
2217
- #: includes/class-mla-settings-custom-fields-tab.php:1506
2218
- #: includes/class-mla-settings-iptc-exif-tab.php:482
2219
- #: includes/class-mla-settings-iptc-exif-tab.php:872
2220
- #: includes/class-mla-settings-iptc-exif-tab.php:1586
2221
- #: includes/class-mla-settings-iptc-exif-tab.php:2441
2222
  msgid "Replace"
2223
  msgstr ""
2224
 
2225
- #: includes/class-mla-edit-media.php:466
2226
  msgid ""
2227
  "IMPORTANT: Make your entries BEFORE uploading new items. Pull down the Help "
2228
  "menu for more information."
2229
  msgstr ""
2230
 
2231
- #: includes/class-mla-edit-media.php:468 includes/class-mla-main.php:2377
2232
- #: includes/class-mla-settings.php:1404
2233
  msgid "Reset"
2234
  msgstr ""
2235
 
2236
- #: includes/class-mla-edit-media.php:474 includes/class-mla-main.php:2385
2237
- #: includes/class-mla-main.php:2441
2238
- #: includes/class-mla-settings-custom-fields-tab.php:809
2239
- #: includes/class-mla-settings-iptc-exif-tab.php:904
2240
- #: includes/class-mla-settings-upload-tab.php:122
2241
- #: includes/class-mla-settings-upload-tab.php:549
2242
- #: includes/class-mla-settings-view-tab.php:396
2243
  msgid "No Change"
2244
  msgstr ""
2245
 
2246
- #: includes/class-mla-edit-media.php:475 includes/class-mla-main.php:2386
2247
  msgid "Allow"
2248
  msgstr ""
2249
 
2250
- #: includes/class-mla-edit-media.php:476 includes/class-mla-main.php:2387
2251
  msgid "Do not allow"
2252
  msgstr ""
2253
 
2254
- #: includes/class-mla-edit-media.php:484 includes/class-mla-list-table.php:1095
2255
- #: includes/class-mla-list-table.php:1166 includes/class-mla-main.php:2369
2256
  msgid "Parent ID"
2257
  msgstr ""
2258
 
2259
- #: includes/class-mla-edit-media.php:485 includes/class-mla-edit-media.php:1002
2260
- #: includes/class-mla-main.php:2370
2261
- #: includes/class-mla-settings-upload-tab.php:1463
2262
  msgid "Select"
2263
  msgstr ""
2264
 
2265
- #: includes/class-mla-edit-media.php:579
2266
  msgid "Custom field mapping updated."
2267
  msgstr ""
2268
 
2269
- #: includes/class-mla-edit-media.php:580
2270
  msgid "IPTC/EXIF mapping updated."
2271
  msgstr ""
2272
 
2273
- #: includes/class-mla-edit-media.php:581
2274
  msgid "Custom field mapping is disabled."
2275
  msgstr ""
2276
 
2277
- #: includes/class-mla-edit-media.php:582
2278
  msgid "IPTC/EXIF mapping is disabled."
2279
  msgstr ""
2280
 
2281
- #: includes/class-mla-edit-media.php:617 includes/class-mla-main.php:2112
2282
  msgid "Month"
2283
  msgstr ""
2284
 
2285
- #: includes/class-mla-edit-media.php:623 includes/class-mla-main.php:2118
2286
  #, php-format
2287
  msgid "%1$s-%2$s"
2288
  msgstr ""
2289
 
2290
- #: includes/class-mla-edit-media.php:627 includes/class-mla-main.php:2122
2291
  msgid "Day"
2292
  msgstr ""
2293
 
2294
- #: includes/class-mla-edit-media.php:628 includes/class-mla-main.php:2123
2295
  msgid "Year"
2296
  msgstr ""
2297
 
2298
- #: includes/class-mla-edit-media.php:629 includes/class-mla-main.php:2124
2299
  msgid "Hour"
2300
  msgstr ""
2301
 
2302
- #: includes/class-mla-edit-media.php:630 includes/class-mla-main.php:2125
2303
  msgid "Minute"
2304
  msgstr ""
2305
 
2306
- #: includes/class-mla-edit-media.php:634 includes/class-mla-main.php:2130
2307
  #, php-format
2308
  msgid "%1$s %2$s, %3$s @ %4$s:%5$s"
2309
  msgstr ""
2310
 
2311
- #: includes/class-mla-edit-media.php:657
2312
  msgid "OK"
2313
  msgstr ""
2314
 
2315
- #: includes/class-mla-edit-media.php:658 includes/class-mla-main.php:2065
2316
- #: includes/class-mla-main.php:2376
2317
- #: includes/class-mla-polylang-support.php:2065
2318
- #: includes/class-mla-settings-custom-fields-tab.php:509
2319
- #: includes/class-mla-settings-custom-fields-tab.php:730
2320
- #: includes/class-mla-settings-custom-fields-tab.php:812
2321
- #: includes/class-mla-settings-documentation-tab.php:199
2322
- #: includes/class-mla-settings-iptc-exif-tab.php:521
2323
- #: includes/class-mla-settings-iptc-exif-tab.php:823
2324
- #: includes/class-mla-settings-iptc-exif-tab.php:907
2325
- #: includes/class-mla-settings-shortcodes-tab.php:405
2326
- #: includes/class-mla-settings-shortcodes-tab.php:476
2327
- #: includes/class-mla-settings-upload-tab.php:177
2328
- #: includes/class-mla-settings-upload-tab.php:251
2329
- #: includes/class-mla-settings-upload-tab.php:545
2330
- #: includes/class-mla-settings-view-tab.php:135
2331
- #: includes/class-mla-settings-view-tab.php:393
2332
- #: includes/class-mla-thumbnail-generation.php:655
2333
  msgid "Cancel"
2334
  msgstr ""
2335
 
2336
- #: includes/class-mla-edit-media.php:674
2337
  msgid "M j, Y @ H:i"
2338
  msgstr ""
2339
 
2340
- #: includes/class-mla-edit-media.php:680 includes/class-mla-list-table.php:655
2341
- #: includes/class-mla-list-table.php:783 includes/class-mla-list-table.php:1050
2342
- #: includes/class-mla-list-table.php:1221
2343
- #: includes/class-mla-list-table.php:1270
2344
- #: includes/class-mla-list-table.php:1316
2345
- #: includes/class-mla-list-table.php:1361
2346
- #: includes/class-mla-list-table.php:1583
2347
- #: includes/class-mla-list-table.php:1909
2348
- #: includes/class-mla-polylang-support.php:377
2349
- #: includes/class-mla-settings-custom-fields-tab.php:1349
2350
- #: includes/class-mla-settings-custom-fields-tab.php:1688
2351
- #: includes/class-mla-settings-iptc-exif-tab.php:1445
2352
- #: includes/class-mla-settings-iptc-exif-tab.php:1813
2353
- #: includes/class-mla-settings-shortcodes-tab.php:1074
2354
- #: includes/class-mla-settings-upload-tab.php:918
2355
- #: includes/class-mla-settings-upload-tab.php:1207
2356
- #: includes/class-mla-settings-view-tab.php:717
2357
- #: includes/class-mla-settings-view-tab.php:919
2358
  msgid "Edit"
2359
  msgstr ""
2360
 
2361
- #: includes/class-mla-edit-media.php:681
2362
  msgid "Edit upload date and time"
2363
  msgstr ""
2364
 
2365
- #: includes/class-mla-edit-media.php:683
2366
  msgid "Upload Date and time"
2367
  msgstr ""
2368
 
2369
- #: includes/class-mla-edit-media.php:713
2370
  msgid "Map Custom Field metadata for this item"
2371
  msgstr ""
2372
 
2373
- #: includes/class-mla-edit-media.php:713 includes/class-mla-main.php:1840
2374
- #: includes/class-mla-main.php:2392
2375
  msgid "Map Custom Field metadata"
2376
  msgstr ""
2377
 
2378
- #: includes/class-mla-edit-media.php:717
2379
  msgid "Map IPTC/EXIF metadata for this item"
2380
  msgstr ""
2381
 
2382
- #: includes/class-mla-edit-media.php:717 includes/class-mla-main.php:1843
2383
- #: includes/class-mla-main.php:2390
2384
  msgid "Map IPTC/EXIF metadata"
2385
  msgstr ""
2386
 
2387
- #: includes/class-mla-edit-media.php:813 includes/class-mla-edit-media.php:1003
2388
  msgid "Parent Info"
2389
  msgstr ""
2390
 
2391
- #: includes/class-mla-edit-media.php:823 includes/class-mla-edit-media.php:1046
2392
  msgid "Attachment Metadata"
2393
  msgstr ""
2394
 
2395
- #: includes/class-mla-edit-media.php:893 includes/class-mla-edit-media.php:935
2396
- #: includes/class-mla-main.php:708 includes/class-mla-settings.php:596
2397
  #, php-format
2398
  msgctxt "error_log"
2399
  msgid "%1$s: %2$s discarding \"%3$s\"; no title/order"
2400
  msgstr ""
2401
 
2402
- #: includes/class-mla-edit-media.php:1001
2403
  msgid "Post Parent"
2404
  msgstr ""
2405
 
2406
- #: includes/class-mla-edit-media.php:1002 includes/class-mla-main.php:2047
2407
  msgid "Select Parent"
2408
  msgstr ""
2409
 
@@ -2416,314 +2418,319 @@ msgctxt "show_option_none"
2416
  msgid "No"
2417
  msgstr ""
2418
 
2419
- #: includes/class-mla-list-table.php:467
2420
- #: includes/class-mla-settings-custom-fields-tab.php:997
2421
- #: includes/class-mla-settings-iptc-exif-tab.php:1087
2422
- #: includes/class-mla-settings-upload-tab.php:643
2423
- #: includes/class-mla-settings-view-tab.php:490
2424
  msgid "List View"
2425
  msgstr ""
2426
 
2427
- #: includes/class-mla-list-table.php:534 includes/class-mla-list-table.php:587
2428
- #: includes/class-mla-list-table.php:1095
2429
- #: includes/class-mla-list-table.php:1166
2430
- #: includes/class-mla-list-table.php:1389
2431
- #: includes/class-mla-list-table.php:1433
2432
- #: includes/class-mla-list-table.php:1465
2433
- #: includes/class-mla-list-table.php:1549
2434
  msgid "Filter by"
2435
  msgstr ""
2436
 
2437
- #: includes/class-mla-list-table.php:544
2438
- #: includes/class-mla-media-modal-ajax.php:511
2439
  msgid "Not Supported"
2440
  msgstr ""
2441
 
2442
- #: includes/class-mla-list-table.php:607
2443
- #: includes/class-mla-settings-custom-fields-tab.php:1297
2444
- #: includes/class-mla-settings-documentation-tab.php:607
2445
- #: includes/class-mla-settings-iptc-exif-tab.php:1393
2446
- #: includes/class-mla-settings-shortcodes-tab.php:1029
2447
- #: includes/class-mla-settings-upload-tab.php:854
2448
- #: includes/class-mla-settings-upload-tab.php:1411
2449
- #: includes/class-mla-settings-view-tab.php:654
2450
  #, php-format
2451
  msgid "column_default: %1$s, %2$s"
2452
  msgstr ""
2453
 
2454
- #: includes/class-mla-list-table.php:770
2455
  msgid "Restore this item from the Trash"
2456
  msgstr ""
2457
 
2458
- #: includes/class-mla-list-table.php:770 includes/class-mla-list-table.php:1906
2459
  msgid "Restore"
2460
  msgstr ""
2461
 
2462
- #: includes/class-mla-list-table.php:783
2463
- #: includes/class-mla-settings-custom-fields-tab.php:1349
2464
- #: includes/class-mla-settings-iptc-exif-tab.php:1445
2465
- #: includes/class-mla-settings-shortcodes-tab.php:1074
2466
- #: includes/class-mla-settings-upload-tab.php:918
2467
- #: includes/class-mla-settings-view-tab.php:717
2468
  msgid "Edit this item"
2469
  msgstr ""
2470
 
2471
- #: includes/class-mla-list-table.php:784
2472
- #: includes/class-mla-settings-custom-fields-tab.php:1352
2473
- #: includes/class-mla-settings-iptc-exif-tab.php:1448
2474
- #: includes/class-mla-settings-upload-tab.php:920
2475
- #: includes/class-mla-settings-view-tab.php:719
2476
  msgid "Edit this item inline"
2477
  msgstr ""
2478
 
2479
- #: includes/class-mla-list-table.php:784 includes/class-mla-main.php:2360
2480
- #: includes/class-mla-options.php:1242
2481
- #: includes/class-mla-settings-custom-fields-tab.php:472
2482
- #: includes/class-mla-settings-custom-fields-tab.php:772
2483
- #: includes/class-mla-settings-custom-fields-tab.php:1352
2484
- #: includes/class-mla-settings-custom-fields-tab.php:1462
2485
- #: includes/class-mla-settings-iptc-exif-tab.php:851
2486
- #: includes/class-mla-settings-iptc-exif-tab.php:1448
2487
- #: includes/class-mla-settings-upload-tab.php:920
2488
- #: includes/class-mla-settings-view-tab.php:719
2489
  msgid "Quick Edit"
2490
  msgstr ""
2491
 
2492
- #: includes/class-mla-list-table.php:790
2493
  msgid "Move this item to the Trash"
2494
  msgstr ""
2495
 
2496
- #: includes/class-mla-list-table.php:790 includes/class-mla-list-table.php:1912
2497
  msgid "Move to Trash"
2498
  msgstr ""
2499
 
2500
- #: includes/class-mla-list-table.php:795
2501
- #: includes/class-mla-settings-custom-fields-tab.php:1360
2502
- #: includes/class-mla-settings-iptc-exif-tab.php:1458
2503
- #: includes/class-mla-settings-shortcodes-tab.php:1080
2504
- #: includes/class-mla-settings-upload-tab.php:924
2505
- #: includes/class-mla-settings-view-tab.php:725
2506
  msgid "Delete this item Permanently"
2507
  msgstr ""
2508
 
2509
- #: includes/class-mla-list-table.php:795 includes/class-mla-list-table.php:1907
2510
- #: includes/class-mla-list-table.php:1914
2511
- #: includes/class-mla-settings-custom-fields-tab.php:1360
2512
- #: includes/class-mla-settings-custom-fields-tab.php:1689
2513
- #: includes/class-mla-settings-iptc-exif-tab.php:1458
2514
- #: includes/class-mla-settings-iptc-exif-tab.php:1814
2515
- #: includes/class-mla-settings-shortcodes-tab.php:1080
2516
- #: includes/class-mla-settings-upload-tab.php:924
2517
- #: includes/class-mla-settings-view-tab.php:725
2518
- #: includes/class-mla-settings-view-tab.php:920
2519
  msgid "Delete Permanently"
2520
  msgstr ""
2521
 
2522
- #: includes/class-mla-list-table.php:803 includes/class-mla-list-table.php:1919
2523
- #: includes/class-mla-settings-documentation-tab.php:688
2524
- #: includes/class-mla-settings.php:1394
2525
  msgid "Download"
2526
  msgstr ""
2527
 
2528
- #: includes/class-mla-list-table.php:805
2529
- #: includes/class-mla-settings-documentation-tab.php:691
2530
- #: includes/class-mla-settings-shortcodes-tab.php:1072
2531
- #: includes/class-mla-settings-view-tab.php:374
2532
  msgid "View"
2533
  msgstr ""
2534
 
2535
- #: includes/class-mla-list-table.php:1066
2536
  msgid "File name"
2537
  msgstr ""
2538
 
2539
- #: includes/class-mla-list-table.php:1163
2540
  msgid "(no title: bad ID)"
2541
  msgstr ""
2542
 
2543
- #: includes/class-mla-list-table.php:1436
2544
- #: includes/class-mla-settings-upload-tab.php:167
2545
- #: includes/class-mla-settings-upload-tab.php:532
2546
  msgid "MIME Type"
2547
  msgstr ""
2548
 
2549
- #: includes/class-mla-list-table.php:1469
2550
  msgid "Base File"
2551
  msgstr ""
2552
 
2553
- #: includes/class-mla-list-table.php:1485
2554
- #: includes/class-mla-list-table.php:1518
2555
  msgid "Unpublished"
2556
  msgstr ""
2557
 
2558
- #: includes/class-mla-list-table.php:1494
2559
- #: includes/class-mla-list-table.php:1525
2560
  #, php-format
2561
  msgid "%1$s from now"
2562
  msgstr ""
2563
 
2564
- #: includes/class-mla-list-table.php:1497
2565
- #: includes/class-mla-list-table.php:1527
2566
  #, php-format
2567
  msgid "%1$s ago"
2568
  msgstr ""
2569
 
2570
- #: includes/class-mla-list-table.php:1611
2571
  msgid "Set Parent"
2572
  msgstr ""
2573
 
2574
- #: includes/class-mla-list-table.php:1761
2575
  msgctxt "uploaded files"
2576
  msgid "All"
2577
  msgid_plural "All"
2578
  msgstr[0] ""
2579
  msgstr[1] ""
2580
 
2581
- #: includes/class-mla-list-table.php:2010
2582
- #: includes/class-mla-settings-custom-fields-tab.php:1754
2583
- #: includes/class-mla-settings-iptc-exif-tab.php:1879
2584
- #: includes/class-mla-settings-shortcodes-tab.php:1348
2585
  msgid "Filter"
2586
  msgstr ""
2587
 
2588
- #: includes/class-mla-list-table.php:2013
2589
  #: includes/mla-media-modal-js-template.php:89
2590
  msgid "Terms Search"
2591
  msgstr ""
2592
 
2593
- #: includes/class-mla-list-table.php:2018
2594
- #: includes/class-mla-polylang-support.php:2072
2595
- #: includes/class-mla-thumbnail-generation.php:654
2596
  msgid "Clear Filter-by"
2597
  msgstr ""
2598
 
2599
- #: includes/class-mla-list-table.php:2021
2600
  msgid "Empty Trash"
2601
  msgstr ""
2602
 
2603
- #: includes/class-mla-main.php:458
2604
  msgid "Error while saving the changes."
2605
  msgstr ""
2606
 
2607
- #: includes/class-mla-main.php:459
2608
- #: includes/class-mla-settings-custom-fields-tab.php:57
2609
- #: includes/class-mla-settings-custom-fields-tab.php:92
2610
  #: includes/class-mla-settings-iptc-exif-tab.php:55
2611
  #: includes/class-mla-settings-iptc-exif-tab.php:88
2612
- #: includes/class-mla-settings-upload-tab.php:46
2613
- #: includes/class-mla-settings-view-tab.php:46
2614
  msgid "Remove From Bulk Edit"
2615
  msgstr ""
2616
 
2617
- #: includes/class-mla-main.php:461
2618
  msgid "Bulk Edit items"
2619
  msgstr ""
2620
 
2621
- #: includes/class-mla-main.php:462 includes/class-mla-main.php:2393
2622
- #: includes/class-mla-settings-custom-fields-tab.php:63
2623
  #: includes/class-mla-settings-iptc-exif-tab.php:61
2624
  msgid "Waiting"
2625
  msgstr ""
2626
 
2627
- #: includes/class-mla-main.php:463 includes/class-mla-main.php:2395
2628
- #: includes/class-mla-settings-custom-fields-tab.php:65
2629
  #: includes/class-mla-settings-iptc-exif-tab.php:63
2630
  msgid "Complete"
2631
  msgstr ""
2632
 
2633
- #: includes/class-mla-main.php:464
2634
- #: includes/class-mla-settings-custom-fields-tab.php:66
2635
  #: includes/class-mla-settings-iptc-exif-tab.php:64
2636
  msgid "Unchanged"
2637
  msgstr ""
2638
 
2639
- #: includes/class-mla-main.php:465
2640
- #: includes/class-mla-settings-custom-fields-tab.php:67
2641
  #: includes/class-mla-settings-iptc-exif-tab.php:65
2642
  msgid "Succeeded"
2643
  msgstr ""
2644
 
2645
- #: includes/class-mla-main.php:466
2646
- #: includes/class-mla-settings-custom-fields-tab.php:68
2647
  #: includes/class-mla-settings-iptc-exif-tab.php:66
2648
  msgid "Failed"
2649
  msgstr ""
2650
 
2651
- #: includes/class-mla-main.php:467
2652
  msgid "CANCELED"
2653
  msgstr ""
2654
 
2655
- #: includes/class-mla-main.php:605
2656
  #, php-format
2657
  msgid "Item permanently deleted."
2658
  msgid_plural "%d items permanently deleted."
2659
  msgstr[0] ""
2660
  msgstr[1] ""
2661
 
2662
- #: includes/class-mla-main.php:610 includes/class-mla-main.php:2580
2663
  #, php-format
2664
  msgid "Item %1$d moved to Trash."
2665
  msgstr ""
2666
 
2667
- #: includes/class-mla-main.php:836
2668
  msgid "download path out of bounds."
2669
  msgstr ""
2670
 
2671
- #: includes/class-mla-main.php:838
2672
  msgid "download path invalid."
2673
  msgstr ""
2674
 
2675
- #: includes/class-mla-main.php:841
2676
  msgid "download argument(s) not set."
2677
  msgstr ""
2678
 
2679
- #: includes/class-mla-main.php:901
2680
  msgid "no ZipArchive support."
2681
  msgstr ""
2682
 
2683
- #: includes/class-mla-main.php:933
2684
  #, php-format
2685
  msgid "The ZIP archive ( %1$s ) could not be created."
2686
  msgstr ""
2687
 
2688
- #: includes/class-mla-main.php:943
2689
  #, php-format
2690
  msgid "The file ( %1$s ) could not be added to the ZIP archive."
2691
  msgstr ""
2692
 
2693
- #: includes/class-mla-main.php:950
2694
  #, php-format
2695
  msgid "The ZIP archive ( %1$s ) could not be closed."
2696
  msgstr ""
2697
 
2698
- #: includes/class-mla-main.php:1336
2699
  msgid "You are not allowed to edit Attachment: "
2700
  msgstr ""
2701
 
2702
- #: includes/class-mla-main.php:1392
2703
  #, php-format
2704
  msgid "%1$s: Unknown bulk action %2$s"
2705
  msgstr ""
2706
 
2707
- #: includes/class-mla-main.php:1414
2708
  msgid "no changes detected"
2709
  msgstr ""
2710
 
2711
- #: includes/class-mla-main.php:1461
2712
- #: includes/class-mla-settings-custom-fields-tab.php:607
2713
- #: includes/class-mla-settings-documentation-tab.php:275
2714
- #: includes/class-mla-settings-iptc-exif-tab.php:698
2715
- #: includes/class-mla-settings-shortcodes-tab.php:564
2716
- #: includes/class-mla-settings-upload-tab.php:407
2717
- #: includes/class-mla-settings-view-tab.php:254
2718
  #, php-format
2719
  msgid "Bulk Action %1$s - no items selected."
2720
  msgstr ""
2721
 
2722
- #: includes/class-mla-main.php:1555
2723
  msgid "You do not have permission to manage attachments."
2724
  msgstr ""
2725
 
2726
- #: includes/class-mla-main.php:1613
 
 
 
 
 
2727
  #, php-format
2728
  msgctxt "deleted items"
2729
  msgid "%s item deleted."
@@ -2731,143 +2738,143 @@ msgid_plural "%s items deleted."
2731
  msgstr[0] ""
2732
  msgstr[1] ""
2733
 
2734
- #: includes/class-mla-main.php:1615
2735
  msgid "No items deleted."
2736
  msgstr ""
2737
 
2738
- #: includes/class-mla-main.php:1667
2739
  msgid "Empty Terms Search; ignored"
2740
  msgstr ""
2741
 
2742
- #: includes/class-mla-main.php:1679
2743
- #: includes/class-mla-settings-custom-fields-tab.php:634
2744
- #: includes/class-mla-settings-documentation-tab.php:307
2745
- #: includes/class-mla-settings-iptc-exif-tab.php:727
2746
- #: includes/class-mla-settings-shortcodes-tab.php:593
2747
- #: includes/class-mla-settings-upload-tab.php:446
2748
- #: includes/class-mla-settings-view-tab.php:291
2749
  #, php-format
2750
  msgid "Unknown mla_admin_action - \"%1$s\""
2751
  msgstr ""
2752
 
2753
- #: includes/class-mla-main.php:1724
2754
  msgid "term search results for"
2755
  msgstr ""
2756
 
2757
- #: includes/class-mla-main.php:1727
2758
  msgid "post/parent results for"
2759
  msgstr ""
2760
 
2761
- #: includes/class-mla-main.php:1729
2762
  msgid "search results for"
2763
  msgstr ""
2764
 
2765
- #: includes/class-mla-main.php:1846 includes/class-mla-main.php:2069
2766
- #: includes/class-mla-main.php:2378
2767
- #: includes/class-mla-settings-custom-fields-tab.php:511
2768
- #: includes/class-mla-settings-custom-fields-tab.php:813
2769
- #: includes/class-mla-settings-documentation-tab.php:679
2770
- #: includes/class-mla-settings-documentation-tab.php:886
2771
- #: includes/class-mla-settings-iptc-exif-tab.php:523
2772
- #: includes/class-mla-settings-iptc-exif-tab.php:908
2773
- #: includes/class-mla-settings-shortcodes-tab.php:479
2774
- #: includes/class-mla-settings-upload-tab.php:176
2775
- #: includes/class-mla-settings-upload-tab.php:546
2776
- #: includes/class-mla-settings-view-tab.php:134
2777
- #: includes/class-mla-settings-view-tab.php:394
2778
  msgid "Update"
2779
  msgstr ""
2780
 
2781
- #: includes/class-mla-main.php:2004
2782
  msgid "All Post Types"
2783
  msgstr ""
2784
 
2785
- #: includes/class-mla-main.php:2050
2786
  msgid "For"
2787
  msgstr ""
2788
 
2789
- #: includes/class-mla-main.php:2060
2790
- #: includes/class-mla-shortcode-support.php:1184
2791
  msgid "Unattached"
2792
  msgstr ""
2793
 
2794
- #: includes/class-mla-main.php:2379 includes/class-mla-options.php:1256
2795
- #: includes/class-mla-settings-custom-fields-tab.php:475
2796
- #: includes/class-mla-settings-custom-fields-tab.php:775
2797
- #: includes/class-mla-settings-custom-fields-tab.php:1466
2798
- #: includes/class-mla-settings-iptc-exif-tab.php:852
2799
- #: includes/class-mla-settings-upload-tab.php:547
2800
- #: includes/class-mla-settings-view-tab.php:395
2801
  msgid "Bulk Edit"
2802
  msgstr ""
2803
 
2804
- #: includes/class-mla-main.php:2394
2805
  msgid "In-process"
2806
  msgstr ""
2807
 
2808
- #: includes/class-mla-main.php:2493
2809
  msgid "You are not allowed to delete this item."
2810
  msgstr ""
2811
 
2812
- #: includes/class-mla-main.php:2501
2813
  #, php-format
2814
  msgid "%1$s: Item %2$d could NOT be deleted."
2815
  msgstr ""
2816
 
2817
- #: includes/class-mla-main.php:2508
2818
  #, php-format
2819
  msgid "Item %1$d permanently deleted."
2820
  msgstr ""
2821
 
2822
- #: includes/class-mla-main.php:2525
2823
  msgid "You are not allowed to move this item out of the Trash."
2824
  msgstr ""
2825
 
2826
- #: includes/class-mla-main.php:2533
2827
  #, php-format
2828
  msgid "%1$s: Item %2$d could NOT be restored from Trash."
2829
  msgstr ""
2830
 
2831
- #: includes/class-mla-main.php:2548
2832
  #, php-format
2833
  msgid "Item %1$d restored from Trash."
2834
  msgstr ""
2835
 
2836
- #: includes/class-mla-main.php:2565
2837
  msgid "You are not allowed to move this item to the Trash."
2838
  msgstr ""
2839
 
2840
- #: includes/class-mla-main.php:2573
2841
  #, php-format
2842
  msgid "%1$s: Item %2$d could NOT be moved to Trash."
2843
  msgstr ""
2844
 
2845
- #: includes/class-mla-media-modal-ajax.php:291
2846
- #: includes/class-mla-media-modal-ajax.php:297
2847
- #: includes/class-mla-media-modal-ajax.php:397
2848
- #: includes/class-mla-media-modal-ajax.php:432
2849
- #: includes/class-mla-media-modal-ajax.php:505
2850
  msgid "Click to toggle"
2851
  msgstr ""
2852
 
2853
- #: includes/class-mla-media-modal-ajax.php:443
2854
  msgid "Tags"
2855
  msgstr ""
2856
 
2857
- #: includes/class-mla-media-modal-ajax.php:445
2858
  #: includes/class-mla-objects.php:50 includes/class-mla-objects.php:83
2859
- #: includes/class-mla-settings-upload-tab.php:528
2860
- #: includes/class-mla-settings-view-tab.php:374
2861
  #, php-format
2862
  msgid "Add New %1$s"
2863
  msgstr ""
2864
 
2865
- #: includes/class-mla-media-modal-ajax.php:469
2866
  #: includes/class-mla-media-modal.php:295
2867
  msgid "Remove term"
2868
  msgstr ""
2869
 
2870
- #: includes/class-mla-media-modal-ajax.php:489
2871
  msgid "Choose from the most used tags"
2872
  msgstr ""
2873
 
@@ -2937,14 +2944,14 @@ msgid "Icon Type"
2937
  msgstr ""
2938
 
2939
  #: includes/class-mla-mime-types.php:629
2940
- #: includes/class-mla-settings-custom-fields-tab.php:1210
2941
  msgctxt "list_table_column"
2942
  msgid "Source"
2943
  msgstr ""
2944
 
2945
  #: includes/class-mla-mime-types.php:630
2946
- #: includes/class-mla-settings-custom-fields-tab.php:1213
2947
- #: includes/class-mla-settings-iptc-exif-tab.php:1308
2948
  msgctxt "list_table_column"
2949
  msgid "Status"
2950
  msgstr ""
@@ -3004,201 +3011,201 @@ msgctxt "list_table_column"
3004
  msgid "Order"
3005
  msgstr ""
3006
 
3007
- #: includes/class-mla-mime-types.php:1102
3008
  msgctxt "post_mime_types_description"
3009
  msgid "Copied from previous filter/plugin"
3010
  msgstr ""
3011
 
3012
- #: includes/class-mla-mime-types.php:1203
3013
- #: includes/class-mla-mime-types.php:1320
3014
  msgid "Ignoring specification for Post MIME Type; using slug"
3015
  msgstr ""
3016
 
3017
- #: includes/class-mla-mime-types.php:1209
3018
- #: includes/class-mla-mime-types.php:2291
3019
  #, php-format
3020
  msgid "<br>Changing %1$s \"%2$s\" to valid value \"%3$s\""
3021
  msgstr ""
3022
 
3023
- #: includes/class-mla-mime-types.php:1209
3024
- #: includes/class-mla-mime-types.php:1297
3025
- #: includes/class-mla-mime-types.php:1308
3026
- #: includes/class-mla-settings-view-tab.php:119
3027
- #: includes/class-mla-settings-view-tab.php:375
3028
  msgid "Slug"
3029
  msgstr ""
3030
 
3031
- #: includes/class-mla-mime-types.php:1217
3032
- #: includes/class-mla-mime-types.php:1305
3033
  #, php-format
3034
  msgid "%1$s: Could not add Slug \"%2$s\"; value already exists"
3035
  msgstr ""
3036
 
3037
- #: includes/class-mla-mime-types.php:1252
3038
  #, php-format
3039
  msgid "Edit view \"%1$s\"; added"
3040
  msgstr ""
3041
 
3042
- #: includes/class-mla-mime-types.php:1297
3043
- #: includes/class-mla-mime-types.php:2417
3044
  #, php-format
3045
  msgid "<br>Changing new %1$s \"%2$s\" to valid value \"%3$s\""
3046
  msgstr ""
3047
 
3048
- #: includes/class-mla-mime-types.php:1350
3049
  #, php-format
3050
  msgid "Edit view \"%1$s\"; no changes detected"
3051
  msgstr ""
3052
 
3053
- #: includes/class-mla-mime-types.php:1364
3054
  #, php-format
3055
  msgid "Edit view \"%1$s\"; updated"
3056
  msgstr ""
3057
 
3058
- #: includes/class-mla-mime-types.php:1437
3059
  #, php-format
3060
  msgid "View \"%1$s\" reverted to standard"
3061
  msgstr ""
3062
 
3063
- #: includes/class-mla-mime-types.php:1443
3064
  #, php-format
3065
  msgid "View \"%1$s\" deleted"
3066
  msgstr ""
3067
 
3068
- #: includes/class-mla-mime-types.php:1451
3069
  #, php-format
3070
  msgid "%1$s: Did not find view \"%2$s\""
3071
  msgstr ""
3072
 
3073
- #: includes/class-mla-mime-types.php:1710
3074
- #: includes/class-mla-settings-documentation-tab.php:1579
3075
  msgctxt "table_view_singular"
3076
  msgid "Active"
3077
  msgstr ""
3078
 
3079
- #: includes/class-mla-mime-types.php:1711
3080
- #: includes/class-mla-settings-documentation-tab.php:1580
3081
  msgctxt "table_view_plural"
3082
  msgid "Active"
3083
  msgstr ""
3084
 
3085
- #: includes/class-mla-mime-types.php:1714
3086
- #: includes/class-mla-settings-documentation-tab.php:1583
3087
  msgctxt "table_view_singular"
3088
  msgid "Inactive"
3089
  msgstr ""
3090
 
3091
- #: includes/class-mla-mime-types.php:1715
3092
- #: includes/class-mla-settings-documentation-tab.php:1584
3093
  msgctxt "table_view_plural"
3094
  msgid "Inactive"
3095
  msgstr ""
3096
 
3097
- #: includes/class-mla-mime-types.php:1718
3098
  msgctxt "table_view_singular"
3099
  msgid "WordPress"
3100
  msgstr ""
3101
 
3102
- #: includes/class-mla-mime-types.php:1719
3103
  msgctxt "table_view_plural"
3104
  msgid "WordPress"
3105
  msgstr ""
3106
 
3107
- #: includes/class-mla-mime-types.php:1722
3108
  msgctxt "table_view_singular"
3109
  msgid "MLA"
3110
  msgstr ""
3111
 
3112
- #: includes/class-mla-mime-types.php:1723
3113
  msgctxt "table_view_plural"
3114
  msgid "MLA"
3115
  msgstr ""
3116
 
3117
- #: includes/class-mla-mime-types.php:1726
3118
- #: includes/class-mla-settings-iptc-exif-tab.php:2761
3119
  msgctxt "table_view_singular"
3120
  msgid "Custom"
3121
  msgstr ""
3122
 
3123
- #: includes/class-mla-mime-types.php:1727
3124
- #: includes/class-mla-settings-iptc-exif-tab.php:2762
3125
  msgctxt "table_view_plural"
3126
  msgid "Custom"
3127
  msgstr ""
3128
 
3129
- #: includes/class-mla-mime-types.php:1982
3130
  msgid "icon"
3131
  msgstr ""
3132
 
3133
- #: includes/class-mla-mime-types.php:2275
3134
- #: includes/class-mla-mime-types.php:2374
3135
  msgid "Cannot load Upload MIME Types"
3136
  msgstr ""
3137
 
3138
- #: includes/class-mla-mime-types.php:2286
3139
  msgid "Extension is required"
3140
  msgstr ""
3141
 
3142
- #: includes/class-mla-mime-types.php:2291
3143
- #: includes/class-mla-mime-types.php:2417
3144
- #: includes/class-mla-mime-types.php:2428
3145
- #: includes/class-mla-settings-upload-tab.php:165
3146
- #: includes/class-mla-settings-upload-tab.php:530
3147
  msgid "Extension"
3148
  msgstr ""
3149
 
3150
- #: includes/class-mla-mime-types.php:2299
3151
  #, php-format
3152
  msgid "%1$s: Could not add extension \"%2$s\"; value already exists"
3153
  msgstr ""
3154
 
3155
- #: includes/class-mla-mime-types.php:2307
3156
  msgid "MIME type is required"
3157
  msgstr ""
3158
 
3159
- #: includes/class-mla-mime-types.php:2312
3160
- #: includes/class-mla-mime-types.php:2459
3161
  #, php-format
3162
  msgid "%1$s: Bad MIME type; try \"%2$s\""
3163
  msgstr ""
3164
 
3165
- #: includes/class-mla-mime-types.php:2349
3166
  #, php-format
3167
  msgid "Upload MIME Type \"%1$s\"; added"
3168
  msgstr ""
3169
 
3170
- #: includes/class-mla-mime-types.php:2355
3171
- #: includes/class-mla-mime-types.php:2544
3172
- #: includes/class-mla-mime-types.php:2623
3173
  msgid "Cannot update Upload MIME Types"
3174
  msgstr ""
3175
 
3176
- #: includes/class-mla-mime-types.php:2425
3177
  #, php-format
3178
  msgid "%1$s: Could not add new extension \"%2$s\"; value already exists"
3179
  msgstr ""
3180
 
3181
- #: includes/class-mla-mime-types.php:2524
3182
  #, php-format
3183
  msgid "Edit type \"%1$s\"; no changes detected"
3184
  msgstr ""
3185
 
3186
- #: includes/class-mla-mime-types.php:2538
3187
  #, php-format
3188
  msgid "Edit type \"%1$s\"; updated"
3189
  msgstr ""
3190
 
3191
- #: includes/class-mla-mime-types.php:2611
3192
  #, php-format
3193
  msgid "Upload MIME Type \"%1$s\"; reverted to standard"
3194
  msgstr ""
3195
 
3196
- #: includes/class-mla-mime-types.php:2617
3197
  #, php-format
3198
  msgid "Upload MIME Type \"%1$s\"; deleted"
3199
  msgstr ""
3200
 
3201
- #: includes/class-mla-mime-types.php:2632
3202
  #, php-format
3203
  msgid "%1$s: Did not find Upload type \"%2$s\""
3204
  msgstr ""
@@ -3415,12 +3422,12 @@ msgid "or"
3415
  msgstr ""
3416
 
3417
  #: includes/class-mla-options.php:469
3418
- #: includes/class-mla-settings-custom-fields-tab.php:455
3419
- #: includes/class-mla-settings-custom-fields-tab.php:759
3420
- #: includes/class-mla-settings-iptc-exif-tab.php:459
3421
- #: includes/class-mla-settings-iptc-exif-tab.php:853
3422
- #: includes/class-mla-settings-shortcodes-tab.php:401
3423
- #: includes/class-mla-settings-shortcodes-tab.php:472
3424
  #: includes/mla-main-search-box-template.php:49
3425
  #: includes/mla-media-modal-js-template.php:61
3426
  msgid "Name"
@@ -3438,172 +3445,172 @@ msgstr ""
3438
  msgid "Terms"
3439
  msgstr ""
3440
 
3441
- #: includes/class-mla-options.php:999 includes/class-mla-options.php:1045
3442
- #: includes/class-mla-options.php:1877 includes/class-mla-options.php:1908
3443
- #: includes/class-mla-options.php:1913
3444
- #: includes/class-mla-settings-upload-tab.php:128
3445
  msgid "None (select a value)"
3446
  msgstr ""
3447
 
3448
- #: includes/class-mla-options.php:1052
3449
  msgid "Metadata (see below)"
3450
  msgstr ""
3451
 
3452
- #: includes/class-mla-options.php:1059
3453
  msgid "Template (see below)"
3454
  msgstr ""
3455
 
3456
- #: includes/class-mla-options.php:1131 includes/class-mla-options.php:2195
3457
  #, php-format
3458
  msgid "%1$s: New field %2$s already exists."
3459
  msgstr ""
3460
 
3461
- #: includes/class-mla-options.php:1136 includes/class-mla-options.php:2200
3462
  #, php-format
3463
  msgid "Adding new field %1$s."
3464
  msgstr ""
3465
 
3466
- #: includes/class-mla-options.php:1144 includes/class-mla-options.php:2208
3467
  #, php-format
3468
  msgid "Adding new rule for %1$s."
3469
  msgstr ""
3470
 
3471
- #: includes/class-mla-options.php:1170 includes/class-mla-options.php:2065
3472
- #: includes/class-mla-options.php:2234
3473
  #, php-format
3474
  msgid "Deleting rule for %1$s."
3475
  msgstr ""
3476
 
3477
- #: includes/class-mla-options.php:1193 includes/class-mla-options.php:1214
3478
- #: includes/class-mla-options.php:1264 includes/class-mla-options.php:1271
3479
- #: includes/class-mla-options.php:1981 includes/class-mla-options.php:1988
3480
- #: includes/class-mla-options.php:1995 includes/class-mla-options.php:2090
3481
- #: includes/class-mla-options.php:2097 includes/class-mla-options.php:2132
3482
- #: includes/class-mla-options.php:2139 includes/class-mla-options.php:2244
3483
- #: includes/class-mla-options.php:2251 includes/class-mla-options.php:2286
3484
- #: includes/class-mla-options.php:2293
3485
  #, php-format
3486
  msgid "%1$s changing %2$s from %3$s to %4$s."
3487
  msgstr ""
3488
 
3489
- #: includes/class-mla-options.php:1193
3490
- #: includes/class-mla-settings-custom-fields-tab.php:463
3491
- #: includes/class-mla-settings-custom-fields-tab.php:763
3492
  msgid "Data Source"
3493
  msgstr ""
3494
 
3495
- #: includes/class-mla-options.php:1199 includes/class-mla-options.php:2015
3496
- #: includes/class-mla-options.php:2117 includes/class-mla-options.php:2271
3497
  msgid "Replace to Keep"
3498
  msgstr ""
3499
 
3500
- #: includes/class-mla-options.php:1202 includes/class-mla-options.php:2018
3501
- #: includes/class-mla-options.php:2120 includes/class-mla-options.php:2274
3502
  msgid "Keep to Replace"
3503
  msgstr ""
3504
 
3505
- #: includes/class-mla-options.php:1207 includes/class-mla-options.php:1228
3506
- #: includes/class-mla-options.php:1242 includes/class-mla-options.php:1256
3507
- #: includes/class-mla-options.php:1285 includes/class-mla-options.php:2009
3508
- #: includes/class-mla-options.php:2023 includes/class-mla-options.php:2111
3509
- #: includes/class-mla-options.php:2125 includes/class-mla-options.php:2265
3510
- #: includes/class-mla-options.php:2279 includes/class-mla-options.php:2307
3511
  #, php-format
3512
  msgid "%1$s changing %2$s value from %3$s."
3513
  msgstr ""
3514
 
3515
- #: includes/class-mla-options.php:1207 includes/class-mla-options.php:2023
3516
- #: includes/class-mla-options.php:2125 includes/class-mla-options.php:2279
3517
- #: includes/class-mla-settings-custom-fields-tab.php:477
3518
- #: includes/class-mla-settings-custom-fields-tab.php:777
3519
- #: includes/class-mla-settings-iptc-exif-tab.php:478
3520
- #: includes/class-mla-settings-iptc-exif-tab.php:868
3521
  msgid "Existing Text"
3522
  msgstr ""
3523
 
3524
- #: includes/class-mla-options.php:1214 includes/class-mla-options.php:2286
3525
- #: includes/class-mla-settings-custom-fields-tab.php:482
3526
- #: includes/class-mla-settings-custom-fields-tab.php:782
3527
- #: includes/class-mla-settings-iptc-exif-tab.php:493
3528
- #: includes/class-mla-settings-iptc-exif-tab.php:876
3529
  msgid "Format"
3530
  msgstr ""
3531
 
3532
- #: includes/class-mla-options.php:1220 includes/class-mla-options.php:1234
3533
- #: includes/class-mla-options.php:1248 includes/class-mla-options.php:1277
3534
- #: includes/class-mla-options.php:2299
3535
  msgid "unchecked to checked"
3536
  msgstr ""
3537
 
3538
- #: includes/class-mla-options.php:1223 includes/class-mla-options.php:1237
3539
- #: includes/class-mla-options.php:1251 includes/class-mla-options.php:1280
3540
- #: includes/class-mla-options.php:2302
3541
  msgid "checked to unchecked"
3542
  msgstr ""
3543
 
3544
- #: includes/class-mla-options.php:1228
3545
- #: includes/class-mla-settings-custom-fields-tab.php:469
3546
- #: includes/class-mla-settings-custom-fields-tab.php:769
3547
- #: includes/class-mla-settings-custom-fields-tab.php:1458
3548
  msgid "MLA Column"
3549
  msgstr ""
3550
 
3551
- #: includes/class-mla-options.php:1264
3552
  msgid "Metavalue name"
3553
  msgstr ""
3554
 
3555
- #: includes/class-mla-options.php:1271 includes/class-mla-options.php:2293
3556
- #: includes/class-mla-settings-custom-fields-tab.php:489
3557
- #: includes/class-mla-settings-custom-fields-tab.php:789
3558
- #: includes/class-mla-settings-iptc-exif-tab.php:500
3559
- #: includes/class-mla-settings-iptc-exif-tab.php:883
3560
  msgid "Option"
3561
  msgstr ""
3562
 
3563
- #: includes/class-mla-options.php:1285 includes/class-mla-options.php:2307
3564
- #: includes/class-mla-settings-iptc-exif-tab.php:512
3565
  msgid "Delete NULL values"
3566
  msgstr ""
3567
 
3568
- #: includes/class-mla-options.php:1969
3569
  #, php-format
3570
  msgid "%1$s: No old values for %2$s."
3571
  msgstr ""
3572
 
3573
- #: includes/class-mla-options.php:1981
3574
  msgid "Field Title"
3575
  msgstr ""
3576
 
3577
- #: includes/class-mla-options.php:1988 includes/class-mla-options.php:2090
3578
- #: includes/class-mla-options.php:2244
3579
- #: includes/class-mla-settings-iptc-exif-tab.php:467
3580
- #: includes/class-mla-settings-iptc-exif-tab.php:857
3581
  msgid "IPTC Value"
3582
  msgstr ""
3583
 
3584
- #: includes/class-mla-options.php:1995 includes/class-mla-options.php:2097
3585
- #: includes/class-mla-options.php:2251
3586
  msgid "EXIF Value"
3587
  msgstr ""
3588
 
3589
- #: includes/class-mla-options.php:2001 includes/class-mla-options.php:2103
3590
- #: includes/class-mla-options.php:2257
3591
  msgid "EXIF to IPTC"
3592
  msgstr ""
3593
 
3594
- #: includes/class-mla-options.php:2004 includes/class-mla-options.php:2106
3595
- #: includes/class-mla-options.php:2260
3596
  msgid "IPTC to EXIF"
3597
  msgstr ""
3598
 
3599
- #: includes/class-mla-options.php:2009 includes/class-mla-options.php:2111
3600
- #: includes/class-mla-options.php:2265
3601
- #: includes/class-mla-settings-iptc-exif-tab.php:473
3602
- #: includes/class-mla-settings-iptc-exif-tab.php:863
3603
  msgid "Priority"
3604
  msgstr ""
3605
 
3606
- #: includes/class-mla-options.php:2132
3607
  msgid "Delimiter(s)"
3608
  msgstr ""
3609
 
@@ -3611,163 +3618,163 @@ msgstr ""
3611
  msgid "ERROR: No post ID found"
3612
  msgstr ""
3613
 
3614
- #: includes/class-mla-polylang-support.php:372
3615
  msgid "Error while saving the translations."
3616
  msgstr ""
3617
 
3618
- #: includes/class-mla-polylang-support.php:373
3619
  msgid "Remove From Bulk Translate"
3620
  msgstr ""
3621
 
3622
- #: includes/class-mla-polylang-support.php:375
3623
  msgid "Bulk Translate items"
3624
  msgstr ""
3625
 
3626
- #: includes/class-mla-polylang-support.php:376
3627
  msgid "Add new"
3628
  msgstr ""
3629
 
3630
- #: includes/class-mla-polylang-support.php:1903
3631
- #: includes/class-mla-polylang-support.php:2270
3632
  msgid "Bulk Translations"
3633
  msgstr ""
3634
 
3635
- #: includes/class-mla-polylang-support.php:1927
3636
  msgid "Translate"
3637
  msgstr ""
3638
 
3639
- #: includes/class-mla-polylang-support.php:2055
3640
  msgid "All Languages"
3641
  msgstr ""
3642
 
3643
- #: includes/class-mla-polylang-support.php:2062
3644
- #: includes/class-mla-polylang-support.php:2335
3645
- #: includes/class-mla-polylang-support.php:2495
3646
  msgid "Quick Translate"
3647
  msgstr ""
3648
 
3649
- #: includes/class-mla-polylang-support.php:2066
3650
  msgid "Set Language"
3651
  msgstr ""
3652
 
3653
- #: includes/class-mla-polylang-support.php:2067
3654
- #: includes/class-mla-polylang-support.php:2502
3655
  msgid "Bulk Translate"
3656
  msgstr ""
3657
 
3658
- #: includes/class-mla-polylang-support.php:2068
3659
  msgid "Add or Modify Translation"
3660
  msgstr ""
3661
 
3662
- #: includes/class-mla-polylang-support.php:2069
3663
- #: includes/class-mla-polylang-support.php:2126
3664
- #: includes/class-mla-polylang-support.php:2439
3665
- #: includes/class-mla-polylang-support.php:2554
3666
- #: includes/class-mla-wpml-support.php:1584
3667
- #: includes/class-mla-wpml-support.php:1674
3668
- #: includes/class-mla-wpml-support.php:2159
3669
  msgid "Language"
3670
  msgstr ""
3671
 
3672
- #: includes/class-mla-polylang-support.php:2071
3673
- #: includes/class-mla-thumbnail-generation.php:653
3674
  msgid "Options"
3675
  msgstr ""
3676
 
3677
- #: includes/class-mla-polylang-support.php:2335
3678
  msgid "Translate this item inline"
3679
  msgstr ""
3680
 
3681
- #: includes/class-mla-polylang-support.php:2476
3682
- #: includes/class-mla-polylang-support.php:2581
3683
- #: includes/class-mla-wpml-support.php:1619
3684
- #: includes/class-mla-wpml-support.php:1722
3685
  msgid "Media/Assistant submenu table"
3686
  msgstr ""
3687
 
3688
- #: includes/class-mla-polylang-support.php:2481
3689
- #: includes/class-mla-wpml-support.php:1624
3690
  msgid "Language Column"
3691
  msgstr ""
3692
 
3693
- #: includes/class-mla-polylang-support.php:2484
3694
- #: includes/class-mla-wpml-support.php:1627
3695
  msgid ""
3696
  "Check this option to add a Language column to the Media/Assistant submenu "
3697
  "table."
3698
  msgstr ""
3699
 
3700
- #: includes/class-mla-polylang-support.php:2488
3701
- #: includes/class-mla-wpml-support.php:1631
3702
  msgid "Translations Column"
3703
  msgstr ""
3704
 
3705
- #: includes/class-mla-polylang-support.php:2491
3706
- #: includes/class-mla-wpml-support.php:1634
3707
  msgid ""
3708
  "Check this option to add a Translation Status column to the Media/Assistant "
3709
  "submenu table."
3710
  msgstr ""
3711
 
3712
- #: includes/class-mla-polylang-support.php:2498
3713
  msgid ""
3714
  "Check this option to add a Quick Translate rollover action to the Media/"
3715
  "Assistant submenu table."
3716
  msgstr ""
3717
 
3718
- #: includes/class-mla-polylang-support.php:2505
3719
  msgid ""
3720
  "Check this option to add \"Translate\" to the \"Bulk Actions\" control on "
3721
  "the Media/Assistant submenu table."
3722
  msgstr ""
3723
 
3724
- #: includes/class-mla-polylang-support.php:2509
3725
- #: includes/class-mla-polylang-support.php:2581
3726
- #: includes/class-mla-wpml-support.php:1638
3727
- #: includes/class-mla-wpml-support.php:1722
3728
  msgid "Term Management"
3729
  msgstr ""
3730
 
3731
- #: includes/class-mla-polylang-support.php:2514
3732
- #: includes/class-mla-wpml-support.php:1643
3733
  msgid "Term Assignment"
3734
  msgstr ""
3735
 
3736
- #: includes/class-mla-polylang-support.php:2517
3737
- #: includes/class-mla-wpml-support.php:1646
3738
  msgid ""
3739
  "Check this option to assign language-specific terms when items are updated."
3740
  msgstr ""
3741
 
3742
- #: includes/class-mla-polylang-support.php:2521
3743
- #: includes/class-mla-wpml-support.php:1650
3744
  msgid "Term Synchronization"
3745
  msgstr ""
3746
 
3747
- #: includes/class-mla-polylang-support.php:2524
3748
- #: includes/class-mla-wpml-support.php:1653
3749
  msgid ""
3750
  "Check this option to synchronize common terms among all item translations."
3751
  msgstr ""
3752
 
3753
- #: includes/class-mla-polylang-support.php:2528
3754
- #: includes/class-mla-wpml-support.php:1657
3755
  msgid "Term Mapping Replication"
3756
  msgstr ""
3757
 
3758
- #: includes/class-mla-polylang-support.php:2531
3759
- #: includes/class-mla-wpml-support.php:1660
3760
  msgid ""
3761
  "When mapping IPTC/EXIF metadata to taxonomy terms, make them available in "
3762
  "all languages."
3763
  msgstr ""
3764
 
3765
- #: includes/class-mla-polylang-support.php:2579
3766
- #: includes/class-mla-wpml-support.php:1720
3767
  msgid "Language Options"
3768
  msgstr ""
3769
 
3770
- #: includes/class-mla-polylang-support.php:2581
3771
  #, php-format
3772
  msgid ""
3773
  "In this tab you can find a number of options for controlling Polylang-"
@@ -3776,430 +3783,431 @@ msgid ""
3776
  "make."
3777
  msgstr ""
3778
 
3779
- #: includes/class-mla-polylang-support.php:2583
3780
- #: includes/class-mla-wpml-support.php:1724
3781
  #, php-format
3782
  msgid ""
3783
  "You can find more information about multilingual features in the %1$s "
3784
  "section of the Documentation."
3785
  msgstr ""
3786
 
3787
- #: includes/class-mla-polylang-support.php:2583
3788
- #: includes/class-mla-wpml-support.php:1724
3789
  msgid "Language Options documentation"
3790
  msgstr ""
3791
 
3792
- #: includes/class-mla-polylang-support.php:2583
3793
- #: includes/class-mla-wpml-support.php:1724
3794
  msgid "WPML &amp; Polylang Multilingual Support; the MLA Language Tab"
3795
  msgstr ""
3796
 
3797
- #: includes/class-mla-polylang-support.php:2586
3798
- #: includes/class-mla-settings-custom-fields-tab.php:657
3799
- #: includes/class-mla-settings-custom-fields-tab.php:756
3800
- #: includes/class-mla-settings-iptc-exif-tab.php:750
3801
- #: includes/class-mla-settings-iptc-exif-tab.php:848
3802
- #: includes/class-mla-settings-shortcodes-tab.php:713
3803
- #: includes/class-mla-settings-upload-tab.php:476
3804
- #: includes/class-mla-settings-upload-tab.php:526
3805
- #: includes/class-mla-settings-view-tab.php:320
3806
- #: includes/class-mla-settings-view-tab.php:372
3807
- #: includes/class-mla-settings.php:1070 includes/class-mla-settings.php:1439
3808
- #: includes/class-mla-settings.php:1441
3809
- #: includes/class-mla-wpml-support.php:1727
3810
  msgid "Save Changes"
3811
  msgstr ""
3812
 
3813
- #: includes/class-mla-polylang-support.php:2587
3814
- #: includes/class-mla-wpml-support.php:1728
3815
  msgid "Delete Language options and restore default settings"
3816
  msgstr ""
3817
 
3818
- #: includes/class-mla-polylang-support.php:2590
3819
- #: includes/class-mla-settings.php:808 includes/class-mla-settings.php:1075
3820
- #: includes/class-mla-wpml-support.php:1731
3821
  msgid "Go to Top"
3822
  msgstr ""
3823
 
3824
- #: includes/class-mla-polylang-support.php:2627
3825
- #: includes/class-mla-wpml-support.php:1768
3826
  msgid "Language settings saved."
3827
  msgstr ""
3828
 
3829
- #: includes/class-mla-polylang-support.php:2658
3830
- #: includes/class-mla-settings.php:1651
3831
- #: includes/class-mla-wpml-support.php:1799
3832
  #, php-format
3833
  msgctxt "message_list"
3834
  msgid "delete_option \"%1$s\""
3835
  msgstr ""
3836
 
3837
- #: includes/class-mla-polylang-support.php:2666
3838
- #: includes/class-mla-wpml-support.php:1807
3839
  msgid "Language settings reset to default values."
3840
  msgstr ""
3841
 
3842
- #: includes/class-mla-settings-custom-fields-tab.php:56
3843
- #: includes/class-mla-settings-custom-fields-tab.php:91
3844
  #: includes/class-mla-settings-iptc-exif-tab.php:54
3845
  #: includes/class-mla-settings-iptc-exif-tab.php:87
3846
- #: includes/class-mla-settings-upload-tab.php:45
3847
- #: includes/class-mla-settings-view-tab.php:45
3848
  msgid "Error while making the changes."
3849
  msgstr ""
3850
 
3851
- #: includes/class-mla-settings-custom-fields-tab.php:58
3852
- #: includes/class-mla-settings-custom-fields-tab.php:93
3853
  #: includes/class-mla-settings-iptc-exif-tab.php:56
3854
  #: includes/class-mla-settings-iptc-exif-tab.php:89
3855
- #: includes/class-mla-settings-upload-tab.php:47
3856
- #: includes/class-mla-settings-view-tab.php:47
3857
  msgid "no slug"
3858
  msgstr ""
3859
 
3860
- #: includes/class-mla-settings-custom-fields-tab.php:64
3861
  #: includes/class-mla-settings-iptc-exif-tab.php:62
3862
  msgid "Running"
3863
  msgstr ""
3864
 
3865
- #: includes/class-mla-settings-custom-fields-tab.php:69
3866
  #: includes/class-mla-settings-iptc-exif-tab.php:67
3867
  msgid "Skipped"
3868
  msgstr ""
3869
 
3870
- #: includes/class-mla-settings-custom-fields-tab.php:70
3871
  #: includes/class-mla-settings-iptc-exif-tab.php:68
3872
  msgid "Reprocessed"
3873
  msgstr ""
3874
 
3875
- #: includes/class-mla-settings-custom-fields-tab.php:71
3876
  #: includes/class-mla-settings-iptc-exif-tab.php:69
3877
  msgid "PAUSED"
3878
  msgstr ""
3879
 
3880
- #: includes/class-mla-settings-custom-fields-tab.php:142
3881
  msgid "Custom field mapping settings updated."
3882
  msgstr ""
3883
 
3884
- #: includes/class-mla-settings-custom-fields-tab.php:144
3885
  msgid "Custom field no mapping changes detected."
3886
  msgstr ""
3887
 
3888
- #: includes/class-mla-settings-custom-fields-tab.php:173
3889
  #: includes/class-mla-settings-iptc-exif-tab.php:171
3890
  msgid "No custom field mapping rules to process."
3891
  msgstr ""
3892
 
3893
- #: includes/class-mla-settings-custom-fields-tab.php:206
3894
  #: includes/class-mla-settings-iptc-exif-tab.php:205
3895
  #, php-format
3896
  msgid "%1$s mapping completed; %2$d attachment(s) examined, %3$d updated."
3897
  msgstr ""
3898
 
3899
- #: includes/class-mla-settings-custom-fields-tab.php:206
3900
- #: includes/class-mla-settings-custom-fields-tab.php:209
3901
  #: includes/class-mla-settings-iptc-exif-tab.php:205
3902
  #: includes/class-mla-settings-iptc-exif-tab.php:208
3903
  msgid "Custom field"
3904
  msgstr ""
3905
 
3906
- #: includes/class-mla-settings-custom-fields-tab.php:209
3907
  #: includes/class-mla-settings-iptc-exif-tab.php:208
3908
  #, php-format
3909
  msgid ""
3910
  "%1$s mapping completed; %2$d attachment(s) examined, no changes detected."
3911
  msgstr ""
3912
 
3913
- #: includes/class-mla-settings-custom-fields-tab.php:238
3914
- #: includes/class-mla-settings-iptc-exif-tab.php:237
3915
  msgid ": No custom field name selected/entered"
3916
  msgstr ""
3917
 
3918
- #: includes/class-mla-settings-custom-fields-tab.php:242
3919
- #: includes/class-mla-settings-custom-fields-tab.php:304
3920
- #: includes/class-mla-settings-iptc-exif-tab.php:241
3921
- #: includes/class-mla-settings-iptc-exif-tab.php:304
3922
  msgid ": Rule already exists for the new name"
3923
  msgstr ""
3924
 
3925
- #: includes/class-mla-settings-custom-fields-tab.php:273
3926
- #: includes/class-mla-settings-iptc-exif-tab.php:273
3927
  msgid "Rule added"
3928
  msgstr ""
3929
 
3930
- #: includes/class-mla-settings-custom-fields-tab.php:276
3931
- #: includes/class-mla-settings-iptc-exif-tab.php:276
3932
  msgid ": Rule addition failed"
3933
  msgstr ""
3934
 
3935
- #: includes/class-mla-settings-custom-fields-tab.php:308
3936
- #: includes/class-mla-settings-iptc-exif-tab.php:308
3937
  msgid ": Invalid rule name must be changed"
3938
  msgstr ""
3939
 
3940
- #: includes/class-mla-settings-custom-fields-tab.php:341
3941
- #: includes/class-mla-settings-custom-fields-tab.php:425
3942
- #: includes/class-mla-settings-custom-fields-tab.php:956
3943
- #: includes/class-mla-settings-iptc-exif-tab.php:342
3944
- #: includes/class-mla-settings-iptc-exif-tab.php:426
3945
- #: includes/class-mla-settings-iptc-exif-tab.php:1046
 
3946
  msgid ": Rule update failed"
3947
  msgstr ""
3948
 
3949
- #: includes/class-mla-settings-custom-fields-tab.php:346
3950
- #: includes/class-mla-settings-custom-fields-tab.php:428
3951
- #: includes/class-mla-settings-iptc-exif-tab.php:347
3952
- #: includes/class-mla-settings-iptc-exif-tab.php:429
3953
  msgid "Rule updated"
3954
  msgstr ""
3955
 
3956
- #: includes/class-mla-settings-custom-fields-tab.php:370
3957
- #: includes/class-mla-settings-iptc-exif-tab.php:371
3958
  #, php-format
3959
  msgid "Custom Field Rule \"%1$s\" deleted."
3960
  msgstr ""
3961
 
3962
- #: includes/class-mla-settings-custom-fields-tab.php:449
3963
- #: includes/class-mla-settings-iptc-exif-tab.php:450
3964
  msgid "Edit Rule"
3965
  msgstr ""
3966
 
3967
- #: includes/class-mla-settings-custom-fields-tab.php:458
3968
- #: includes/class-mla-settings-iptc-exif-tab.php:462
3969
  msgid ""
3970
  "This is the name of the custom field to which the rule applies.<br>Only one "
3971
  "rule is allowed for each custom field."
3972
  msgstr ""
3973
 
3974
- #: includes/class-mla-settings-custom-fields-tab.php:459
3975
- #: includes/class-mla-settings-iptc-exif-tab.php:463
3976
  msgid "Change Name"
3977
  msgstr ""
3978
 
3979
- #: includes/class-mla-settings-custom-fields-tab.php:460
3980
- #: includes/class-mla-settings-iptc-exif-tab.php:464
3981
  msgid "Cancel Name Change"
3982
  msgstr ""
3983
 
3984
- #: includes/class-mla-settings-custom-fields-tab.php:461
3985
- #: includes/class-mla-settings-custom-fields-tab.php:761
3986
- #: includes/class-mla-settings-iptc-exif-tab.php:465
3987
- #: includes/class-mla-settings-iptc-exif-tab.php:855
3988
  msgid "Enter new field"
3989
  msgstr ""
3990
 
3991
- #: includes/class-mla-settings-custom-fields-tab.php:462
3992
- #: includes/class-mla-settings-custom-fields-tab.php:762
3993
- #: includes/class-mla-settings-iptc-exif-tab.php:466
3994
- #: includes/class-mla-settings-iptc-exif-tab.php:856
3995
  msgid "Cancel new field"
3996
  msgstr ""
3997
 
3998
- #: includes/class-mla-settings-custom-fields-tab.php:465
3999
- #: includes/class-mla-settings-custom-fields-tab.php:765
4000
  msgid "Meta/Template"
4001
  msgstr ""
4002
 
4003
- #: includes/class-mla-settings-custom-fields-tab.php:467
4004
- #: includes/class-mla-settings-custom-fields-tab.php:767
4005
  msgid "WordPress attachment metadata element or Content Template"
4006
  msgstr ""
4007
 
4008
- #: includes/class-mla-settings-custom-fields-tab.php:470
4009
- #: includes/class-mla-settings-custom-fields-tab.php:770
4010
  msgid "Display as Media/Assistant column"
4011
  msgstr ""
4012
 
4013
- #: includes/class-mla-settings-custom-fields-tab.php:473
4014
- #: includes/class-mla-settings-custom-fields-tab.php:773
4015
  msgid "Add to Media/Assistant Quick Edit area"
4016
  msgstr ""
4017
 
4018
- #: includes/class-mla-settings-custom-fields-tab.php:476
4019
- #: includes/class-mla-settings-custom-fields-tab.php:776
4020
  msgid "Add to Media/Assistant Bulk Edit area"
4021
  msgstr ""
4022
 
4023
- #: includes/class-mla-settings-custom-fields-tab.php:479
4024
- #: includes/class-mla-settings-custom-fields-tab.php:779
4025
- #: includes/class-mla-settings-custom-fields-tab.php:1504
4026
- #: includes/class-mla-settings-iptc-exif-tab.php:480
4027
- #: includes/class-mla-settings-iptc-exif-tab.php:870
4028
- #: includes/class-mla-settings-iptc-exif-tab.php:1584
4029
- #: includes/class-mla-settings-iptc-exif-tab.php:2441
4030
- #: includes/class-mla-thumbnail-generation.php:647
4031
  msgid "Keep"
4032
  msgstr ""
4033
 
4034
- #: includes/class-mla-settings-custom-fields-tab.php:484
4035
- #: includes/class-mla-settings-custom-fields-tab.php:784
4036
- #: includes/class-mla-settings-iptc-exif-tab.php:495
4037
- #: includes/class-mla-settings-iptc-exif-tab.php:878
4038
  msgid "Native"
4039
  msgstr ""
4040
 
4041
- #: includes/class-mla-settings-custom-fields-tab.php:486
4042
- #: includes/class-mla-settings-custom-fields-tab.php:786
4043
- #: includes/class-mla-settings-iptc-exif-tab.php:497
4044
- #: includes/class-mla-settings-iptc-exif-tab.php:880
4045
  msgid "Commas"
4046
  msgstr ""
4047
 
4048
- #: includes/class-mla-settings-custom-fields-tab.php:488
4049
- #: includes/class-mla-settings-custom-fields-tab.php:788
4050
- #: includes/class-mla-settings-iptc-exif-tab.php:499
4051
- #: includes/class-mla-settings-iptc-exif-tab.php:882
4052
  msgid "Raw"
4053
  msgstr ""
4054
 
4055
- #: includes/class-mla-settings-custom-fields-tab.php:491
4056
- #: includes/class-mla-settings-custom-fields-tab.php:791
4057
- #: includes/class-mla-settings-iptc-exif-tab.php:502
4058
- #: includes/class-mla-settings-iptc-exif-tab.php:885
4059
  msgid "Text"
4060
  msgstr ""
4061
 
4062
- #: includes/class-mla-settings-custom-fields-tab.php:493
4063
- #: includes/class-mla-settings-custom-fields-tab.php:793
4064
- #: includes/class-mla-settings-iptc-exif-tab.php:504
4065
- #: includes/class-mla-settings-iptc-exif-tab.php:887
4066
  msgid "Single"
4067
  msgstr ""
4068
 
4069
- #: includes/class-mla-settings-custom-fields-tab.php:495
4070
- #: includes/class-mla-settings-custom-fields-tab.php:795
4071
- #: includes/class-mla-settings-iptc-exif-tab.php:506
4072
- #: includes/class-mla-settings-iptc-exif-tab.php:889
4073
  msgid "Export"
4074
  msgstr ""
4075
 
4076
- #: includes/class-mla-settings-custom-fields-tab.php:497
4077
- #: includes/class-mla-settings-custom-fields-tab.php:797
4078
- #: includes/class-mla-settings-iptc-exif-tab.php:508
4079
- #: includes/class-mla-settings-iptc-exif-tab.php:891
4080
  msgid "Array"
4081
  msgstr ""
4082
 
4083
- #: includes/class-mla-settings-custom-fields-tab.php:499
4084
- #: includes/class-mla-settings-custom-fields-tab.php:799
4085
- #: includes/class-mla-settings-iptc-exif-tab.php:510
4086
- #: includes/class-mla-settings-iptc-exif-tab.php:893
4087
  msgid "Multi"
4088
  msgstr ""
4089
 
4090
- #: includes/class-mla-settings-custom-fields-tab.php:501
4091
- #: includes/class-mla-settings-custom-fields-tab.php:801
4092
- #: includes/class-mla-settings-iptc-exif-tab.php:895
4093
  msgid "Delete NULL Values"
4094
  msgstr ""
4095
 
4096
- #: includes/class-mla-settings-custom-fields-tab.php:502
4097
- #: includes/class-mla-settings-custom-fields-tab.php:802
4098
- #: includes/class-mla-settings-iptc-exif-tab.php:513
4099
- #: includes/class-mla-settings-iptc-exif-tab.php:896
4100
  msgid "Do not store empty custom field values"
4101
  msgstr ""
4102
 
4103
- #: includes/class-mla-settings-custom-fields-tab.php:505
4104
- #: includes/class-mla-settings-custom-fields-tab.php:805
4105
- #: includes/class-mla-settings-custom-fields-tab.php:1488
4106
- #: includes/class-mla-settings-custom-fields-tab.php:1711
4107
- #: includes/class-mla-settings-documentation-tab.php:1249
4108
- #: includes/class-mla-settings-iptc-exif-tab.php:517
4109
- #: includes/class-mla-settings-iptc-exif-tab.php:899
4110
- #: includes/class-mla-settings-iptc-exif-tab.php:1600
4111
- #: includes/class-mla-settings-iptc-exif-tab.php:1836
4112
- #: includes/class-mla-settings-iptc-exif-tab.php:2444
4113
- #: includes/class-mla-settings-upload-tab.php:550
4114
- #: includes/class-mla-settings-upload-tab.php:1031
4115
  msgid "Active"
4116
  msgstr ""
4117
 
4118
- #: includes/class-mla-settings-custom-fields-tab.php:507
4119
- #: includes/class-mla-settings-custom-fields-tab.php:807
4120
- #: includes/class-mla-settings-custom-fields-tab.php:1490
4121
- #: includes/class-mla-settings-custom-fields-tab.php:1714
4122
- #: includes/class-mla-settings-documentation-tab.php:1251
4123
- #: includes/class-mla-settings-iptc-exif-tab.php:519
4124
- #: includes/class-mla-settings-iptc-exif-tab.php:901
4125
- #: includes/class-mla-settings-iptc-exif-tab.php:1602
4126
- #: includes/class-mla-settings-iptc-exif-tab.php:1839
4127
- #: includes/class-mla-settings-iptc-exif-tab.php:2444
4128
- #: includes/class-mla-settings-upload-tab.php:172
4129
- #: includes/class-mla-settings-upload-tab.php:536
4130
- #: includes/class-mla-settings-upload-tab.php:1029
4131
  msgid "Inactive"
4132
  msgstr ""
4133
 
4134
- #: includes/class-mla-settings-custom-fields-tab.php:534
4135
- #: includes/class-mla-settings-iptc-exif-tab.php:625
4136
  #, php-format
4137
  msgid "Custom Field Rule \"%1$s\": %2$s"
4138
  msgstr ""
4139
 
4140
- #: includes/class-mla-settings-custom-fields-tab.php:570
4141
  msgid "Edit Custom Field Rule cancelled."
4142
  msgstr ""
4143
 
4144
- #: includes/class-mla-settings-custom-fields-tab.php:583
4145
- #: includes/class-mla-settings-custom-fields-tab.php:611
4146
- #: includes/class-mla-settings-documentation-tab.php:265
4147
- #: includes/class-mla-settings-iptc-exif-tab.php:674
4148
- #: includes/class-mla-settings-iptc-exif-tab.php:702
4149
- #: includes/class-mla-settings-shortcodes-tab.php:552
4150
- #: includes/class-mla-settings-upload-tab.php:396
4151
- #: includes/class-mla-settings-view-tab.php:244
4152
  #, php-format
4153
  msgid "Unknown bulk action %1$s"
4154
  msgstr ""
4155
 
4156
- #: includes/class-mla-settings-custom-fields-tab.php:654
4157
  msgid "Custom Field Mapping Support is disabled"
4158
  msgstr ""
4159
 
4160
- #: includes/class-mla-settings-custom-fields-tab.php:723
4161
  msgid "Custom Field Mapping Progress"
4162
  msgstr ""
4163
 
4164
- #: includes/class-mla-settings-custom-fields-tab.php:724
4165
- #: includes/class-mla-settings-iptc-exif-tab.php:817
4166
  msgid "DO NOT DO THE FOLLOWING (they will cause mapping to fail)"
4167
  msgstr ""
4168
 
4169
- #: includes/class-mla-settings-custom-fields-tab.php:725
4170
- #: includes/class-mla-settings-iptc-exif-tab.php:818
4171
  msgid "Close the window"
4172
  msgstr ""
4173
 
4174
- #: includes/class-mla-settings-custom-fields-tab.php:726
4175
- #: includes/class-mla-settings-iptc-exif-tab.php:819
4176
  msgid "Reload the page"
4177
  msgstr ""
4178
 
4179
- #: includes/class-mla-settings-custom-fields-tab.php:727
4180
- #: includes/class-mla-settings-iptc-exif-tab.php:820
4181
  msgid "Click the browser&rsquo;s Stop, Back or forward buttons"
4182
  msgstr ""
4183
 
4184
- #: includes/class-mla-settings-custom-fields-tab.php:728
4185
- #: includes/class-mla-settings-iptc-exif-tab.php:821
4186
  msgid "Progress"
4187
  msgstr ""
4188
 
4189
- #: includes/class-mla-settings-custom-fields-tab.php:729
4190
- #: includes/class-mla-settings-iptc-exif-tab.php:822
4191
  msgid "Pause"
4192
  msgstr ""
4193
 
4194
- #: includes/class-mla-settings-custom-fields-tab.php:731
4195
- #: includes/class-mla-settings-iptc-exif-tab.php:824
4196
  msgid "Resume"
4197
  msgstr ""
4198
 
4199
- #: includes/class-mla-settings-custom-fields-tab.php:732
4200
- #: includes/class-mla-settings-documentation-tab.php:141
4201
- #: includes/class-mla-settings-iptc-exif-tab.php:825
4202
- #: includes/class-mla-settings-shortcodes-tab.php:476
4203
  #: includes/class-mla-template-support.php:160
4204
  #: includes/class-mla-template-support.php:166
4205
  #: includes/class-mla-template-support.php:208
@@ -4209,11 +4217,11 @@ msgstr ""
4209
  msgid "Close"
4210
  msgstr ""
4211
 
4212
- #: includes/class-mla-settings-custom-fields-tab.php:741
4213
  msgid "Custom Field and Attachment Metadata Processing Options"
4214
  msgstr ""
4215
 
4216
- #: includes/class-mla-settings-custom-fields-tab.php:743
4217
  msgid ""
4218
  "In this tab you can define the rules for mapping several types of image "
4219
  "metadata to WordPress custom fields. You can also use this screen to define "
@@ -4222,202 +4230,202 @@ msgid ""
4222
  "field."
4223
  msgstr ""
4224
 
4225
- #: includes/class-mla-settings-custom-fields-tab.php:745
4226
- #: includes/class-mla-settings-iptc-exif-tab.php:838
4227
  msgid ""
4228
  "You can find more information about using the controls in this tab to define "
4229
  "mapping rules and apply them by clicking the \"Help\" control in the upper-"
4230
  "right corner of the screen."
4231
  msgstr ""
4232
 
4233
- #: includes/class-mla-settings-custom-fields-tab.php:750
4234
- #: includes/class-mla-settings-iptc-exif-tab.php:843
4235
- #: includes/class-mla-settings-shortcodes-tab.php:711
4236
  msgid "Search results for"
4237
  msgstr ""
4238
 
4239
- #: includes/class-mla-settings-custom-fields-tab.php:752
4240
- #: includes/class-mla-settings-iptc-exif-tab.php:844
4241
  msgid "Search Rules Text"
4242
  msgstr ""
4243
 
4244
- #: includes/class-mla-settings-custom-fields-tab.php:754
4245
- #: includes/class-mla-settings-iptc-exif-tab.php:846
4246
  msgid "Search Rules"
4247
  msgstr ""
4248
 
4249
- #: includes/class-mla-settings-custom-fields-tab.php:757
4250
- #: includes/class-mla-settings-iptc-exif-tab.php:849
4251
  msgid "Execute All Rules"
4252
  msgstr ""
4253
 
4254
- #: includes/class-mla-settings-custom-fields-tab.php:758
4255
- #: includes/class-mla-settings-iptc-exif-tab.php:850
4256
  msgid "Add New Custom Field Rule"
4257
  msgstr ""
4258
 
4259
- #: includes/class-mla-settings-custom-fields-tab.php:808
4260
- #: includes/class-mla-settings-iptc-exif-tab.php:902
4261
  msgid "Add Rule"
4262
  msgstr ""
4263
 
4264
- #: includes/class-mla-settings-custom-fields-tab.php:872
4265
- #: includes/class-mla-settings-custom-fields-tab.php:894
4266
- #: includes/class-mla-settings-iptc-exif-tab.php:977
4267
  msgid "Nothing to execute"
4268
  msgstr ""
4269
 
4270
- #: includes/class-mla-settings-custom-fields-tab.php:928
4271
- #: includes/class-mla-settings-iptc-exif-tab.php:1012
4272
- msgid "Rule ID not found"
4273
  msgstr ""
4274
 
4275
- #: includes/class-mla-settings-custom-fields-tab.php:932
4276
- #: includes/class-mla-settings-iptc-exif-tab.php:1016
4277
- msgid "Rule not found"
4278
  msgstr ""
4279
 
4280
- #: includes/class-mla-settings-custom-fields-tab.php:1209
4281
- #: includes/class-mla-settings-iptc-exif-tab.php:1303
4282
  msgctxt "list_table_column"
4283
  msgid "Bad Name"
4284
  msgstr ""
4285
 
4286
- #: includes/class-mla-settings-custom-fields-tab.php:1211
4287
  msgctxt "list_table_column"
4288
  msgid "Meta/Template"
4289
  msgstr ""
4290
 
4291
- #: includes/class-mla-settings-custom-fields-tab.php:1212
4292
  msgctxt "list_table_column"
4293
  msgid "Visibility"
4294
  msgstr ""
4295
 
4296
- #: includes/class-mla-settings-custom-fields-tab.php:1214
4297
- #: includes/class-mla-settings-iptc-exif-tab.php:1307
4298
  msgctxt "list_table_column"
4299
  msgid "Existing Text"
4300
  msgstr ""
4301
 
4302
- #: includes/class-mla-settings-custom-fields-tab.php:1215
4303
- #: includes/class-mla-settings-iptc-exif-tab.php:1311
4304
  msgctxt "list_table_column"
4305
  msgid "Delete NULL"
4306
  msgstr ""
4307
 
4308
- #: includes/class-mla-settings-custom-fields-tab.php:1216
4309
- #: includes/class-mla-settings-iptc-exif-tab.php:1312
4310
  msgctxt "list_table_column"
4311
  msgid "Format"
4312
  msgstr ""
4313
 
4314
- #: includes/class-mla-settings-custom-fields-tab.php:1217
4315
- #: includes/class-mla-settings-iptc-exif-tab.php:1313
4316
  msgctxt "list_table_column"
4317
  msgid "Option"
4318
  msgstr ""
4319
 
4320
- #: includes/class-mla-settings-custom-fields-tab.php:1355
4321
- #: includes/class-mla-settings-iptc-exif-tab.php:1451
4322
  msgid "Map All Attachments"
4323
  msgstr ""
4324
 
4325
- #: includes/class-mla-settings-custom-fields-tab.php:1355
4326
- #: includes/class-mla-settings-custom-fields-tab.php:1690
4327
- #: includes/class-mla-settings-iptc-exif-tab.php:1451
4328
- #: includes/class-mla-settings-iptc-exif-tab.php:1815
4329
  msgid "Execute"
4330
  msgstr ""
4331
 
4332
- #: includes/class-mla-settings-custom-fields-tab.php:1357
4333
  msgid "Purge custom field values"
4334
  msgstr ""
4335
 
4336
- #: includes/class-mla-settings-custom-fields-tab.php:1357
4337
- #: includes/class-mla-settings-custom-fields-tab.php:1691
4338
- #: includes/class-mla-settings-iptc-exif-tab.php:1454
4339
- #: includes/class-mla-settings-iptc-exif-tab.php:1816
4340
  msgid "Purge Values"
4341
  msgstr ""
4342
 
4343
- #: includes/class-mla-settings-custom-fields-tab.php:1708
4344
- #: includes/class-mla-settings-iptc-exif-tab.php:1833
4345
- #: includes/class-mla-settings-shortcodes-tab.php:1302
4346
  msgid "Any Status"
4347
  msgstr ""
4348
 
4349
- #: includes/class-mla-settings-custom-fields-tab.php:2464
4350
  msgctxt "table_view_singular"
4351
  msgid "MLA Column"
4352
  msgstr ""
4353
 
4354
- #: includes/class-mla-settings-custom-fields-tab.php:2465
4355
  msgctxt "table_view_plural"
4356
  msgid "MLA Column"
4357
  msgstr ""
4358
 
4359
- #: includes/class-mla-settings-custom-fields-tab.php:2468
4360
  msgctxt "table_view_singular"
4361
  msgid "Quick Edit"
4362
  msgstr ""
4363
 
4364
- #: includes/class-mla-settings-custom-fields-tab.php:2469
4365
  msgctxt "table_view_plural"
4366
  msgid "Quick Edit"
4367
  msgstr ""
4368
 
4369
- #: includes/class-mla-settings-custom-fields-tab.php:2472
4370
  msgctxt "table_view_singular"
4371
  msgid "Bulk Edit"
4372
  msgstr ""
4373
 
4374
- #: includes/class-mla-settings-custom-fields-tab.php:2473
4375
  msgctxt "table_view_plural"
4376
  msgid "Bulk Edit"
4377
  msgstr ""
4378
 
4379
- #: includes/class-mla-settings-custom-fields-tab.php:2476
4380
- #: includes/class-mla-settings-iptc-exif-tab.php:2765
4381
  msgctxt "table_view_singular"
4382
  msgid "Read Only"
4383
  msgstr ""
4384
 
4385
- #: includes/class-mla-settings-custom-fields-tab.php:2477
4386
- #: includes/class-mla-settings-iptc-exif-tab.php:2766
4387
  msgctxt "table_view_plural"
4388
  msgid "Read Only"
4389
  msgstr ""
4390
 
4391
- #: includes/class-mla-settings-documentation-tab.php:82
4392
- #: includes/class-mla-settings-documentation-tab.php:974
4393
- #: includes/class-mla-settings-documentation-tab.php:1061
4394
- #: includes/class-mla-settings-documentation-tab.php:1091
4395
  #, php-format
4396
  msgid "Example plugin \"%1$s\" not found"
4397
  msgstr ""
4398
 
4399
- #: includes/class-mla-settings-documentation-tab.php:131
4400
- #: includes/class-mla-settings.php:1371
4401
  #, php-format
4402
  msgid "%1$s: Reading the %2$s file ( %3$s ) \"%4$s\"."
4403
  msgstr ""
4404
 
4405
- #: includes/class-mla-settings-documentation-tab.php:131
4406
  msgid "plugin"
4407
  msgstr ""
4408
 
4409
- #: includes/class-mla-settings-documentation-tab.php:138
4410
  msgid "View Plugin"
4411
  msgstr ""
4412
 
4413
- #: includes/class-mla-settings-documentation-tab.php:186
4414
- #: includes/class-mla-settings-upload-tab.php:246
4415
- #: includes/class-mla-settings-upload-tab.php:551
4416
- #: includes/class-mla-settings-view-tab.php:368
4417
  msgid "Displaying search results for"
4418
  msgstr ""
4419
 
4420
- #: includes/class-mla-settings-documentation-tab.php:187
4421
  msgid ""
4422
  "In this tab you can browse the list of MLA example plugins, install or "
4423
  "update them in the Plugins/Installed Plugins area and see which examples you "
@@ -4425,7 +4433,7 @@ msgid ""
4425
  "the plugins you must go to the Plugins/Installed Plugins admin submenu."
4426
  msgstr ""
4427
 
4428
- #: includes/class-mla-settings-documentation-tab.php:189
4429
  #, php-format
4430
  msgid ""
4431
  "You can find more information about using the example plugins in the %1$s "
@@ -4433,144 +4441,144 @@ msgid ""
4433
  "tab in the upper-right corner of this screen."
4434
  msgstr ""
4435
 
4436
- #: includes/class-mla-settings-documentation-tab.php:189
4437
  msgid "Example plugin documentation"
4438
  msgstr ""
4439
 
4440
- #: includes/class-mla-settings-documentation-tab.php:189
4441
  msgid "The Example Plugins"
4442
  msgstr ""
4443
 
4444
- #: includes/class-mla-settings-documentation-tab.php:194
4445
  msgid "Example Plugins"
4446
  msgstr ""
4447
 
4448
- #: includes/class-mla-settings-documentation-tab.php:195
4449
  msgid "Search Example Plugins"
4450
  msgstr ""
4451
 
4452
- #: includes/class-mla-settings-documentation-tab.php:197
4453
  msgid "Search Plugins"
4454
  msgstr ""
4455
 
4456
- #: includes/class-mla-settings-documentation-tab.php:198
4457
  msgid "Searches Name, Description, File Name and Tags"
4458
  msgstr ""
4459
 
4460
- #: includes/class-mla-settings-documentation-tab.php:288
4461
  #, php-format
4462
  msgid "Empty mla_item_ID - \"%1$s\""
4463
  msgstr ""
4464
 
4465
- #: includes/class-mla-settings-documentation-tab.php:523
4466
  msgctxt "list_table_column"
4467
  msgid "Current Version"
4468
  msgstr ""
4469
 
4470
- #: includes/class-mla-settings-documentation-tab.php:524
4471
  msgctxt "list_table_column"
4472
  msgid "Installed Version"
4473
  msgstr ""
4474
 
4475
- #: includes/class-mla-settings-documentation-tab.php:526
4476
  msgctxt "list_table_column"
4477
  msgid "File Name"
4478
  msgstr ""
4479
 
4480
- #: includes/class-mla-settings-documentation-tab.php:527
4481
  msgctxt "list_table_column"
4482
  msgid "Tags"
4483
  msgstr ""
4484
 
4485
- #: includes/class-mla-settings-documentation-tab.php:675
4486
  msgid "Install this plugin"
4487
  msgstr ""
4488
 
4489
- #: includes/class-mla-settings-documentation-tab.php:675
4490
- #: includes/class-mla-settings-documentation-tab.php:885
4491
  msgid "Install"
4492
  msgstr ""
4493
 
4494
- #: includes/class-mla-settings-documentation-tab.php:679
4495
  msgid "Update this plugin"
4496
  msgstr ""
4497
 
4498
- #: includes/class-mla-settings-documentation-tab.php:691
4499
- #: includes/class-mla-settings-shortcodes-tab.php:1072
4500
  msgid "View this item"
4501
  msgstr ""
4502
 
4503
- #: includes/class-mla-settings-documentation-tab.php:1002
4504
  #, php-format
4505
  msgid "Example plugin \"%1$s\" fs_connect failed; no action taken. Error: %2$s"
4506
  msgstr ""
4507
 
4508
- #: includes/class-mla-settings-documentation-tab.php:1007
4509
  #, php-format
4510
  msgid "Example plugin \"%1$s\" fs_connect failed; no action taken"
4511
  msgstr ""
4512
 
4513
- #: includes/class-mla-settings-documentation-tab.php:1030
4514
  #, php-format
4515
  msgid ""
4516
  "Example plugin \"%1$s\" install_package failed; no action taken. Error: %2$s"
4517
  msgstr ""
4518
 
4519
- #: includes/class-mla-settings-documentation-tab.php:1041
4520
  #, php-format
4521
  msgid "Example plugin \"%1$s\" remove old single file failed."
4522
  msgstr ""
4523
 
4524
- #: includes/class-mla-settings-documentation-tab.php:1066
4525
  #, php-format
4526
  msgid "Example plugin \"%1$s\" already installed; no action taken"
4527
  msgstr ""
4528
 
4529
- #: includes/class-mla-settings-documentation-tab.php:1072
4530
  #, php-format
4531
  msgid "Example plugin \"%1$s\" installed"
4532
  msgstr ""
4533
 
4534
- #: includes/class-mla-settings-documentation-tab.php:1096
4535
  #, php-format
4536
  msgid "Example plugin \"%1$s\" not installed; no action taken"
4537
  msgstr ""
4538
 
4539
- #: includes/class-mla-settings-documentation-tab.php:1102
4540
  #, php-format
4541
  msgid "Example plugin \"%1$s\" updated"
4542
  msgstr ""
4543
 
4544
- #: includes/class-mla-settings-documentation-tab.php:1247
4545
  msgid "Network"
4546
  msgstr ""
4547
 
4548
- #: includes/class-mla-settings-documentation-tab.php:1575
4549
  msgctxt "table_view_singular"
4550
  msgid "Installed"
4551
  msgstr ""
4552
 
4553
- #: includes/class-mla-settings-documentation-tab.php:1576
4554
  msgctxt "table_view_plural"
4555
  msgid "Installed"
4556
  msgstr ""
4557
 
4558
- #: includes/class-mla-settings-documentation-tab.php:1587
4559
  msgctxt "table_view_singular"
4560
  msgid "Network"
4561
  msgstr ""
4562
 
4563
- #: includes/class-mla-settings-documentation-tab.php:1588
4564
  msgctxt "table_view_plural"
4565
  msgid "Network"
4566
  msgstr ""
4567
 
4568
- #: includes/class-mla-settings-documentation-tab.php:1591
4569
  msgctxt "table_view_singular"
4570
  msgid "Uninstalled"
4571
  msgstr ""
4572
 
4573
- #: includes/class-mla-settings-documentation-tab.php:1592
4574
  msgctxt "table_view_plural"
4575
  msgid "Uninstalled"
4576
  msgstr ""
@@ -4587,304 +4595,304 @@ msgstr ""
4587
  msgid "updated."
4588
  msgstr ""
4589
 
4590
- #: includes/class-mla-settings-iptc-exif-tab.php:469
4591
- #: includes/class-mla-settings-iptc-exif-tab.php:859
4592
  msgid "EXIF/Template Value"
4593
  msgstr ""
4594
 
4595
- #: includes/class-mla-settings-iptc-exif-tab.php:472
4596
- #: includes/class-mla-settings-iptc-exif-tab.php:862
4597
  msgid "EXIF element name or Content Template"
4598
  msgstr ""
4599
 
4600
- #: includes/class-mla-settings-iptc-exif-tab.php:472
4601
  msgid " (starting with \"template:\")"
4602
  msgstr ""
4603
 
4604
- #: includes/class-mla-settings-iptc-exif-tab.php:475
4605
- #: includes/class-mla-settings-iptc-exif-tab.php:865
4606
- #: includes/class-mla-settings-iptc-exif-tab.php:1568
4607
  msgid "IPTC"
4608
  msgstr ""
4609
 
4610
- #: includes/class-mla-settings-iptc-exif-tab.php:477
4611
- #: includes/class-mla-settings-iptc-exif-tab.php:867
4612
- #: includes/class-mla-settings-iptc-exif-tab.php:1571
4613
  msgid "EXIF"
4614
  msgstr ""
4615
 
4616
- #: includes/class-mla-settings-iptc-exif-tab.php:485
4617
- #: includes/class-mla-settings-iptc-exif-tab.php:873
4618
  msgid "Delimiters"
4619
  msgstr ""
4620
 
4621
- #: includes/class-mla-settings-iptc-exif-tab.php:540
4622
  msgid "Standard field mapping"
4623
  msgstr ""
4624
 
4625
- #: includes/class-mla-settings-iptc-exif-tab.php:543
4626
  msgid "Taxonomy term mapping"
4627
  msgstr ""
4628
 
4629
- #: includes/class-mla-settings-iptc-exif-tab.php:566
4630
  msgid "Custom field mapping"
4631
  msgstr ""
4632
 
4633
- #: includes/class-mla-settings-iptc-exif-tab.php:661
4634
  msgid "Edit IPTC EXIF Rule cancelled."
4635
  msgstr ""
4636
 
4637
- #: includes/class-mla-settings-iptc-exif-tab.php:747
4638
  msgid "IPTC/EXIF Mapping Support is disabled"
4639
  msgstr ""
4640
 
4641
- #: includes/class-mla-settings-iptc-exif-tab.php:816
4642
  msgid "IPTC &amp; EXIF Mapping Progress"
4643
  msgstr ""
4644
 
4645
- #: includes/class-mla-settings-iptc-exif-tab.php:834
4646
  msgid "IPTC &amp; EXIF Processing Options"
4647
  msgstr ""
4648
 
4649
- #: includes/class-mla-settings-iptc-exif-tab.php:836
4650
  msgid ""
4651
  "In this tab you can define the rules for mapping IPTC (International Press "
4652
  "Telecommunications Council) and EXIF (EXchangeable Image File) metadata to "
4653
  "WordPress standard attachment fields, taxonomy terms and custom fields."
4654
  msgstr ""
4655
 
4656
- #: includes/class-mla-settings-iptc-exif-tab.php:1304
4657
  msgctxt "list_table_column"
4658
  msgid "IPTC Value"
4659
  msgstr ""
4660
 
4661
- #: includes/class-mla-settings-iptc-exif-tab.php:1305
4662
  msgctxt "list_table_column"
4663
  msgid "EXIF/Template Value"
4664
  msgstr ""
4665
 
4666
- #: includes/class-mla-settings-iptc-exif-tab.php:1306
4667
  msgctxt "list_table_column"
4668
  msgid "Priority "
4669
  msgstr ""
4670
 
4671
- #: includes/class-mla-settings-iptc-exif-tab.php:1309
4672
  msgctxt "list_table_column"
4673
  msgid "Delimiter(s)"
4674
  msgstr ""
4675
 
4676
- #: includes/class-mla-settings-iptc-exif-tab.php:1310
4677
  msgctxt "list_table_column"
4678
  msgid "Parent"
4679
  msgstr ""
4680
 
4681
- #: includes/class-mla-settings-iptc-exif-tab.php:1454
4682
  msgid "Purge IPTC EXIF values"
4683
  msgstr ""
4684
 
4685
- #: includes/class-mla-settings-iptc-exif-tab.php:2753
4686
  msgctxt "table_view_singular"
4687
  msgid "Standard"
4688
  msgstr ""
4689
 
4690
- #: includes/class-mla-settings-iptc-exif-tab.php:2754
4691
  msgctxt "table_view_plural"
4692
  msgid "Standard"
4693
  msgstr ""
4694
 
4695
- #: includes/class-mla-settings-iptc-exif-tab.php:2757
4696
  msgctxt "table_view_singular"
4697
  msgid "Taxonomy"
4698
  msgstr ""
4699
 
4700
- #: includes/class-mla-settings-iptc-exif-tab.php:2758
4701
  msgctxt "table_view_plural"
4702
  msgid "Taxonomy"
4703
  msgstr ""
4704
 
4705
- #: includes/class-mla-settings-shortcodes-tab.php:79
4706
  #, php-format
4707
  msgid "%1$s: %2$s type or shortcode not specified."
4708
  msgstr ""
4709
 
4710
- #: includes/class-mla-settings-shortcodes-tab.php:79
4711
- #: includes/class-mla-settings-shortcodes-tab.php:144
4712
- #: includes/class-mla-settings-shortcodes-tab.php:176
4713
- #: includes/class-mla-settings-shortcodes-tab.php:241
4714
- #: includes/class-mla-settings-shortcodes-tab.php:244
4715
- #: includes/class-mla-settings-shortcodes-tab.php:263
4716
  msgid "Template"
4717
  msgstr ""
4718
 
4719
- #: includes/class-mla-settings-shortcodes-tab.php:85
4720
  msgid "style template"
4721
  msgstr ""
4722
 
4723
- #: includes/class-mla-settings-shortcodes-tab.php:90
4724
  #, php-format
4725
  msgid "%1$s: Blank %2$s name, reverting to \"%3$s\"."
4726
  msgstr ""
4727
 
4728
- #: includes/class-mla-settings-shortcodes-tab.php:94
4729
  #, php-format
4730
  msgid "%1$s: Reserved %2$s name \"%3$s\", reverting to \"%4$s\"."
4731
  msgstr ""
4732
 
4733
- #: includes/class-mla-settings-shortcodes-tab.php:112
4734
  #, php-format
4735
  msgid "%1$s: Duplicate new %2$s name \"%3$s\", reverting to \"%4$s\"."
4736
  msgstr ""
4737
 
4738
- #: includes/class-mla-settings-shortcodes-tab.php:139
4739
  #, php-format
4740
  msgid "%1$s: New %2$s \"%3$s\" has no content; not added."
4741
  msgstr ""
4742
 
4743
- #: includes/class-mla-settings-shortcodes-tab.php:144
4744
  #, php-format
4745
  msgid "%1$s \"%2$s\" added."
4746
  msgstr ""
4747
 
4748
- #: includes/class-mla-settings-shortcodes-tab.php:176
4749
  #, php-format
4750
  msgid "%1$s \"%2$s\" copied to \"%3$s\"."
4751
  msgstr ""
4752
 
4753
- #: includes/class-mla-settings-shortcodes-tab.php:198
4754
  msgid "style template name"
4755
  msgstr ""
4756
 
4757
- #: includes/class-mla-settings-shortcodes-tab.php:198
4758
  msgid "markup template name"
4759
  msgstr ""
4760
 
4761
- #: includes/class-mla-settings-shortcodes-tab.php:203
4762
  #, php-format
4763
  msgid "%1$s: Blank %2$s, reverting to \"%3$s\"."
4764
  msgstr ""
4765
 
4766
- #: includes/class-mla-settings-shortcodes-tab.php:210
4767
  #, php-format
4768
  msgid "%1$s: Duplicate new %2$s \"%3$s\", reverting to \"%4$s\"."
4769
  msgstr ""
4770
 
4771
- #: includes/class-mla-settings-shortcodes-tab.php:214
4772
  #, php-format
4773
  msgid "%1$s: Reserved %2$s \"%3$s\", reverting to \"%4$s\"."
4774
  msgstr ""
4775
 
4776
- #: includes/class-mla-settings-shortcodes-tab.php:218
4777
  #, php-format
4778
  msgctxt "message_list"
4779
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\""
4780
  msgstr ""
4781
 
4782
- #: includes/class-mla-settings-shortcodes-tab.php:241
4783
  #, php-format
4784
  msgid "%1$s \"%2$s\" updated."
4785
  msgstr ""
4786
 
4787
- #: includes/class-mla-settings-shortcodes-tab.php:244
4788
  #, php-format
4789
  msgid "%1$s \"%2$s\" no changes detected."
4790
  msgstr ""
4791
 
4792
- #: includes/class-mla-settings-shortcodes-tab.php:263
4793
  #, php-format
4794
  msgid "%1$s \"%2$s\" deleted."
4795
  msgstr ""
4796
 
4797
- #: includes/class-mla-settings-shortcodes-tab.php:319
4798
  #, php-format
4799
  msgid "%1$s settings saved."
4800
  msgstr ""
4801
 
4802
- #: includes/class-mla-settings-shortcodes-tab.php:319
4803
- #: includes/class-mla-settings-shortcodes-tab.php:322
4804
- #: includes/class-mla-settings.php:963
4805
  msgid "Shortcodes"
4806
  msgstr ""
4807
 
4808
- #: includes/class-mla-settings-shortcodes-tab.php:322
4809
  #, php-format
4810
  msgid "%1$s no changes detected."
4811
  msgstr ""
4812
 
4813
- #: includes/class-mla-settings-shortcodes-tab.php:354
4814
  msgid "select template type"
4815
  msgstr ""
4816
 
4817
- #: includes/class-mla-settings-shortcodes-tab.php:355
4818
  msgid "select template shortcode"
4819
  msgstr ""
4820
 
4821
- #: includes/class-mla-settings-shortcodes-tab.php:357
4822
  msgid "Select a template type and shortcode to generate the section areas."
4823
  msgstr ""
4824
 
4825
- #: includes/class-mla-settings-shortcodes-tab.php:393
4826
- #: includes/class-mla-settings-shortcodes-tab.php:407
4827
  msgid "Add Template"
4828
  msgstr ""
4829
 
4830
- #: includes/class-mla-settings-shortcodes-tab.php:402
4831
- #: includes/class-mla-settings-shortcodes-tab.php:473
4832
  msgid ""
4833
  "The name/&#8220;slug&#8221; is the URL-friendly, unique key for the "
4834
  "template. It must be all lowercase and contain only letters, numbers and "
4835
  "hyphens (-)."
4836
  msgstr ""
4837
 
4838
- #: includes/class-mla-settings-shortcodes-tab.php:410
4839
- #: includes/class-mla-settings-shortcodes-tab.php:482
4840
- #: includes/class-mla-settings-shortcodes-tab.php:1077
4841
- #: includes/class-mla-settings-shortcodes-tab.php:1286
4842
  msgid "Copy"
4843
  msgstr ""
4844
 
4845
- #: includes/class-mla-settings-shortcodes-tab.php:463
4846
  msgid "View Template"
4847
  msgstr ""
4848
 
4849
- #: includes/class-mla-settings-shortcodes-tab.php:463
4850
  msgid "Edit Template"
4851
  msgstr ""
4852
 
4853
- #: includes/class-mla-settings-shortcodes-tab.php:524
4854
  msgid "Add Template cancelled."
4855
  msgstr ""
4856
 
4857
- #: includes/class-mla-settings-shortcodes-tab.php:527
4858
  msgid "Edit Template cancelled."
4859
  msgstr ""
4860
 
4861
- #: includes/class-mla-settings-shortcodes-tab.php:631
4862
  msgid "Theme"
4863
  msgstr ""
4864
 
4865
- #: includes/class-mla-settings-shortcodes-tab.php:652
4866
  msgid "Imagick support is not installed."
4867
  msgstr ""
4868
 
4869
- #: includes/class-mla-settings-shortcodes-tab.php:659
4870
  msgid "Ghostscript support is not installed."
4871
  msgstr ""
4872
 
4873
- #: includes/class-mla-settings-shortcodes-tab.php:663
4874
- #: includes/class-mla-wpml-support.php:1714
4875
- #: includes/class-mla-wpml-support.php:1716
4876
  msgid "WARNING:"
4877
  msgstr ""
4878
 
4879
- #: includes/class-mla-settings-shortcodes-tab.php:663
4880
  msgid " MLA Viewer support may not be available"
4881
  msgstr ""
4882
 
4883
- #: includes/class-mla-settings-shortcodes-tab.php:699
4884
  msgid "MLA Shortcode Options"
4885
  msgstr ""
4886
 
4887
- #: includes/class-mla-settings-shortcodes-tab.php:700
4888
  msgid ""
4889
  "In this tab you can view the default style and markup templates. You can "
4890
  "also define additional templates and use the <code>mla_style</code> and "
@@ -4892,7 +4900,7 @@ msgid ""
4892
  "shortcodes."
4893
  msgstr ""
4894
 
4895
- #: includes/class-mla-settings-shortcodes-tab.php:702
4896
  #, php-format
4897
  msgid ""
4898
  "You can find more information about shortcode templates and how MLA and "
@@ -4900,195 +4908,195 @@ msgid ""
4900
  "the <strong>\"Help\"</strong> tab in the upper-right corner of this screen."
4901
  msgstr ""
4902
 
4903
- #: includes/class-mla-settings-shortcodes-tab.php:702
4904
  msgid "Style and Markup Templates documentation"
4905
  msgstr ""
4906
 
4907
- #: includes/class-mla-settings-shortcodes-tab.php:702
4908
  msgid "Style and Markup Templates"
4909
  msgstr ""
4910
 
4911
- #: includes/class-mla-settings-shortcodes-tab.php:708
4912
  msgid "Add New Template"
4913
  msgstr ""
4914
 
4915
- #: includes/class-mla-settings-shortcodes-tab.php:709
4916
  msgid "Search Templates"
4917
  msgstr ""
4918
 
4919
- #: includes/class-mla-settings-shortcodes-tab.php:957
4920
  msgctxt "list_table_column"
4921
  msgid "Type"
4922
  msgstr ""
4923
 
4924
- #: includes/class-mla-settings-shortcodes-tab.php:958
4925
  msgctxt "list_table_column"
4926
  msgid "Shortcode"
4927
  msgstr ""
4928
 
4929
- #: includes/class-mla-settings-shortcodes-tab.php:1077
4930
  msgid "Make a copy"
4931
  msgstr ""
4932
 
4933
- #: includes/class-mla-settings-shortcodes-tab.php:1097
4934
  msgid "default"
4935
  msgstr ""
4936
 
4937
- #: includes/class-mla-settings-shortcodes-tab.php:1110
4938
- #: includes/class-mla-settings-shortcodes-tab.php:1977
4939
  msgctxt "table_view_singular"
4940
  msgid "Style"
4941
  msgstr ""
4942
 
4943
- #: includes/class-mla-settings-shortcodes-tab.php:1110
4944
- #: includes/class-mla-settings-shortcodes-tab.php:1981
4945
  msgctxt "table_view_singular"
4946
  msgid "Markup"
4947
  msgstr ""
4948
 
4949
- #: includes/class-mla-settings-shortcodes-tab.php:1285
4950
- #: includes/class-mla-thumbnail-generation.php:650
4951
  msgid "Delete"
4952
  msgstr ""
4953
 
4954
- #: includes/class-mla-settings-shortcodes-tab.php:1305
4955
  msgid "Default"
4956
  msgstr ""
4957
 
4958
- #: includes/class-mla-settings-shortcodes-tab.php:1308
4959
  msgid "Custom"
4960
  msgstr ""
4961
 
4962
- #: includes/class-mla-settings-shortcodes-tab.php:1978
4963
  msgctxt "table_view_plural"
4964
  msgid "Style"
4965
  msgstr ""
4966
 
4967
- #: includes/class-mla-settings-shortcodes-tab.php:1982
4968
  msgctxt "table_view_plural"
4969
  msgid "Markup"
4970
  msgstr ""
4971
 
4972
- #: includes/class-mla-settings-shortcodes-tab.php:1985
4973
  #: includes/class-mla-template-support.php:70
4974
  #: includes/class-mla-template-support.php:126
4975
  msgctxt "table_view_singular"
4976
  msgid "Gallery"
4977
  msgstr ""
4978
 
4979
- #: includes/class-mla-settings-shortcodes-tab.php:1986
4980
  msgctxt "table_view_plural"
4981
  msgid "Gallery"
4982
  msgstr ""
4983
 
4984
- #: includes/class-mla-settings-shortcodes-tab.php:1989
4985
  #: includes/class-mla-template-support.php:88
4986
  #: includes/class-mla-template-support.php:174
4987
  msgctxt "table_view_singular"
4988
  msgid "Tag Cloud"
4989
  msgstr ""
4990
 
4991
- #: includes/class-mla-settings-shortcodes-tab.php:1990
4992
  msgctxt "table_view_plural"
4993
  msgid "Tag Cloud"
4994
  msgstr ""
4995
 
4996
- #: includes/class-mla-settings-shortcodes-tab.php:1993
4997
  #: includes/class-mla-template-support.php:106
4998
  #: includes/class-mla-template-support.php:222
4999
  msgctxt "table_view_singular"
5000
  msgid "Term List"
5001
  msgstr ""
5002
 
5003
- #: includes/class-mla-settings-shortcodes-tab.php:1994
5004
  msgctxt "table_view_plural"
5005
  msgid "Term List"
5006
  msgstr ""
5007
 
5008
- #: includes/class-mla-settings-upload-tab.php:93
5009
  msgid "Upload MIME Type settings saved."
5010
  msgstr ""
5011
 
5012
- #: includes/class-mla-settings-upload-tab.php:160
5013
  msgid "Edit Upload MIME Type"
5014
  msgstr ""
5015
 
5016
- #: includes/class-mla-settings-upload-tab.php:166
5017
  msgid ""
5018
  "The &#8220;extension&#8221; is the file extension for this type, and a "
5019
  "unique key for the item. It must be all lowercase and contain only letters "
5020
  "and numbers."
5021
  msgstr ""
5022
 
5023
- #: includes/class-mla-settings-upload-tab.php:168
5024
- #: includes/class-mla-settings-upload-tab.php:533
5025
  msgid ""
5026
  "The MIME Type must be all lowercase and contain only letters, numbers, "
5027
  "periods (.), slashes (/) and hyphens (-). It <strong>must be a valid MIME</"
5028
  "strong> type, e.g., &#8220;image&#8221; or &#8220;image/jpeg&#8221;."
5029
  msgstr ""
5030
 
5031
- #: includes/class-mla-settings-upload-tab.php:169
5032
- #: includes/class-mla-settings-upload-tab.php:534
5033
  msgid "Icon Type"
5034
  msgstr ""
5035
 
5036
- #: includes/class-mla-settings-upload-tab.php:171
5037
- #: includes/class-mla-settings-upload-tab.php:535
5038
  msgid ""
5039
  "The Icon Type selects a thumbnail image displayed for non-image file types, "
5040
  "such as PDF documents."
5041
  msgstr ""
5042
 
5043
- #: includes/class-mla-settings-upload-tab.php:173
5044
- #: includes/class-mla-settings-upload-tab.php:537
5045
  msgid ""
5046
  "Check this box if you want to remove this entry from the list of Upload MIME "
5047
  "Types returned by get_allowed_mime_types()."
5048
  msgstr ""
5049
 
5050
- #: includes/class-mla-settings-upload-tab.php:175
5051
- #: includes/class-mla-settings-upload-tab.php:539
5052
- #: includes/class-mla-settings-view-tab.php:133
5053
- #: includes/class-mla-settings-view-tab.php:389
5054
  msgid ""
5055
  "The description can contain any documentation or notes you need to "
5056
  "understand or use the item."
5057
  msgstr ""
5058
 
5059
- #: includes/class-mla-settings-upload-tab.php:245
5060
  msgid "Known File Extension/MIME Type Associations"
5061
  msgstr ""
5062
 
5063
- #: includes/class-mla-settings-upload-tab.php:247
5064
  msgid "Search Known MIME Types"
5065
  msgstr ""
5066
 
5067
- #: includes/class-mla-settings-upload-tab.php:249
5068
  msgid "Search Types"
5069
  msgstr ""
5070
 
5071
- #: includes/class-mla-settings-upload-tab.php:250
5072
- #: includes/class-mla-settings-upload-tab.php:522
5073
  msgid "To search by extension, use \".\", e.g., \".doc\""
5074
  msgstr ""
5075
 
5076
- #: includes/class-mla-settings-upload-tab.php:438
5077
- #: includes/class-mla-settings-view-tab.php:283
5078
  #, php-format
5079
  msgid "Edit view \"%1$s\" cancelled."
5080
  msgstr ""
5081
 
5082
- #: includes/class-mla-settings-upload-tab.php:473
5083
  msgid "Upload MIME Type Support is disabled"
5084
  msgstr ""
5085
 
5086
- #: includes/class-mla-settings-upload-tab.php:516
5087
- #: includes/class-mla-settings-upload-tab.php:519
5088
  msgid "File Extension and MIME Type Processing"
5089
  msgstr ""
5090
 
5091
- #: includes/class-mla-settings-upload-tab.php:517
5092
  msgid ""
5093
  "In this tab you can manage the list of file extension/MIME Type "
5094
  "associations, which are used by WordPress to decide what kind of files can "
@@ -5097,7 +5105,7 @@ msgid ""
5097
  "extension must be in this list and be active."
5098
  msgstr ""
5099
 
5100
- #: includes/class-mla-settings-upload-tab.php:519
5101
  #, php-format
5102
  msgid ""
5103
  "You can find more information about file extensions, MIME types and how "
@@ -5105,80 +5113,80 @@ msgid ""
5105
  "the <strong>\"Help\"</strong> tab in the upper-right corner of this screen."
5106
  msgstr ""
5107
 
5108
- #: includes/class-mla-settings-upload-tab.php:519
5109
  msgid "File Extension Processing documentation"
5110
  msgstr ""
5111
 
5112
- #: includes/class-mla-settings-upload-tab.php:521
5113
  msgid "Search Uploads"
5114
  msgstr ""
5115
 
5116
- #: includes/class-mla-settings-upload-tab.php:528
5117
  msgid "Upload MIME Type"
5118
  msgstr ""
5119
 
5120
- #: includes/class-mla-settings-upload-tab.php:529
5121
  msgid ""
5122
  "To search the database of over 1,500 known extension/type associations, "
5123
  "click \"Search Known Types\" below the form."
5124
  msgstr ""
5125
 
5126
- #: includes/class-mla-settings-upload-tab.php:531
5127
  msgid ""
5128
  "The &#8220;extension&#8221; is the file extension for this type, and unique "
5129
  "key for the item. It must be all lowercase and contain only letters and "
5130
  "numbers."
5131
  msgstr ""
5132
 
5133
- #: includes/class-mla-settings-upload-tab.php:540
5134
  msgid "Add Upload MIME Type"
5135
  msgstr ""
5136
 
5137
- #: includes/class-mla-settings-upload-tab.php:542
5138
  msgid "Search Known Types"
5139
  msgstr ""
5140
 
5141
- #: includes/class-mla-settings-upload-tab.php:544
5142
- #: includes/class-mla-settings-view-tab.php:392
5143
  msgid "<strong>Quick Edit</strong>"
5144
  msgstr ""
5145
 
5146
- #: includes/class-mla-settings-upload-tab.php:590
5147
  msgid "No upload slug found"
5148
  msgstr ""
5149
 
5150
- #: includes/class-mla-settings-upload-tab.php:926
5151
- #: includes/class-mla-settings-view-tab.php:723
5152
  msgid "Revert to standard item"
5153
  msgstr ""
5154
 
5155
- #: includes/class-mla-settings-upload-tab.php:926
5156
- #: includes/class-mla-settings-view-tab.php:723
5157
  msgid "Revert to Standard"
5158
  msgstr ""
5159
 
5160
- #: includes/class-mla-settings-upload-tab.php:1208
5161
  msgid "Delete/Revert Custom"
5162
  msgstr ""
5163
 
5164
- #: includes/class-mla-settings-upload-tab.php:1463
5165
  msgid "Select this entry"
5166
  msgstr ""
5167
 
5168
- #: includes/class-mla-settings-upload-tab.php:1583
5169
  msgid "Select these entries"
5170
  msgstr ""
5171
 
5172
- #: includes/class-mla-settings-view-tab.php:90
5173
  msgid "View settings saved."
5174
  msgstr ""
5175
 
5176
- #: includes/class-mla-settings-view-tab.php:114
5177
  msgid "Edit View"
5178
  msgstr ""
5179
 
5180
- #: includes/class-mla-settings-view-tab.php:120
5181
- #: includes/class-mla-settings-view-tab.php:376
5182
  msgid ""
5183
  "The &#8220;slug&#8221; is the URL-friendly, unique key for the view. It must "
5184
  "be all lowercase and contain only letters, numbers, periods (.), slashes (/) "
@@ -5187,30 +5195,30 @@ msgid ""
5187
  "MIME</strong> type, e.g., &#8220;image&#8221; or &#8220;image/jpeg&#8221;."
5188
  msgstr ""
5189
 
5190
- #: includes/class-mla-settings-view-tab.php:121
5191
- #: includes/class-mla-settings-view-tab.php:377
5192
  msgid "Singular Label"
5193
  msgstr ""
5194
 
5195
- #: includes/class-mla-settings-view-tab.php:122
5196
- #: includes/class-mla-settings-view-tab.php:378
5197
  msgid "Plural Label"
5198
  msgstr ""
5199
 
5200
- #: includes/class-mla-settings-view-tab.php:123
5201
- #: includes/class-mla-settings-view-tab.php:379
5202
  msgid ""
5203
  "The labels, e.g., &#8220;Image&#8221; and &#8220;Images&#8221; are used for "
5204
  "column headers and other display purposes."
5205
  msgstr ""
5206
 
5207
- #: includes/class-mla-settings-view-tab.php:124
5208
- #: includes/class-mla-settings-view-tab.php:380
5209
  msgid "Specification"
5210
  msgstr ""
5211
 
5212
- #: includes/class-mla-settings-view-tab.php:125
5213
- #: includes/class-mla-settings-view-tab.php:381
5214
  msgid ""
5215
  "If the MIME type specification differs from the slug, enter it here. You may "
5216
  "include multiple MIME types, e.g., &#8220;audio,video&#8221; and/or wildcard "
@@ -5218,47 +5226,47 @@ msgid ""
5218
  "MIME Type box is checked."
5219
  msgstr ""
5220
 
5221
- #: includes/class-mla-settings-view-tab.php:126
5222
- #: includes/class-mla-settings-view-tab.php:382
5223
  msgid "Post MIME Type"
5224
  msgstr ""
5225
 
5226
- #: includes/class-mla-settings-view-tab.php:127
5227
- #: includes/class-mla-settings-view-tab.php:383
5228
  msgid ""
5229
  "Check this box if you want to add this entry to the list of MIME types "
5230
  "returned by wp_get_mime_types()."
5231
  msgstr ""
5232
 
5233
- #: includes/class-mla-settings-view-tab.php:128
5234
- #: includes/class-mla-settings-view-tab.php:384
5235
  msgid "Table View"
5236
  msgstr ""
5237
 
5238
- #: includes/class-mla-settings-view-tab.php:129
5239
- #: includes/class-mla-settings-view-tab.php:385
5240
  msgid ""
5241
  "Check this box if you want to add this entry to the list of Media/Assistant "
5242
  "table views."
5243
  msgstr ""
5244
 
5245
- #: includes/class-mla-settings-view-tab.php:131
5246
- #: includes/class-mla-settings-view-tab.php:387
5247
  msgid ""
5248
  "You can choose your own table view order by entering a number (1 for first, "
5249
  "etc.) in this field."
5250
  msgstr ""
5251
 
5252
- #: includes/class-mla-settings-view-tab.php:317
5253
  msgid "View and Post MIME Type Support is disabled"
5254
  msgstr ""
5255
 
5256
- #: includes/class-mla-settings-view-tab.php:361
5257
  #: includes/class-mla-settings-view-tab.php:364
 
5258
  msgid "Library Views/Post MIME Type Processing"
5259
  msgstr ""
5260
 
5261
- #: includes/class-mla-settings-view-tab.php:362
5262
  msgid ""
5263
  "In this tab you can manage the list of \"Post MIME Types\", which are used "
5264
  "by WordPress to define the views for the <em><strong>Media/Library</strong></"
@@ -5269,7 +5277,7 @@ msgid ""
5269
  "specifications (e.g. \"*/*ms*\")."
5270
  msgstr ""
5271
 
5272
- #: includes/class-mla-settings-view-tab.php:364
5273
  #, php-format
5274
  msgid ""
5275
  "You can find more information about library views, Post MIME types and how "
@@ -5278,99 +5286,99 @@ msgid ""
5278
  "screen."
5279
  msgstr ""
5280
 
5281
- #: includes/class-mla-settings-view-tab.php:364
5282
  msgid "Library View Processing documentation"
5283
  msgstr ""
5284
 
5285
- #: includes/class-mla-settings-view-tab.php:369
5286
  msgid "Search Views"
5287
  msgstr ""
5288
 
5289
- #: includes/class-mla-settings-view-tab.php:390
5290
  msgid "Add View"
5291
  msgstr ""
5292
 
5293
- #: includes/class-mla-settings-view-tab.php:433
5294
  msgid "No view slug found"
5295
  msgstr ""
5296
 
5297
- #: includes/class-mla-settings.php:436 includes/class-mla-settings.php:662
5298
- #: includes/class-mla-settings.php:1476
5299
  msgid "Settings"
5300
  msgstr ""
5301
 
5302
- #: includes/class-mla-settings.php:455
5303
  msgid "Views per page"
5304
  msgstr ""
5305
 
5306
- #: includes/class-mla-settings.php:466
5307
  msgid "Types per page"
5308
  msgstr ""
5309
 
5310
- #: includes/class-mla-settings.php:477
5311
  msgid "Upload types per page"
5312
  msgstr ""
5313
 
5314
- #: includes/class-mla-settings.php:488
5315
  msgid "Shortcode templates per page"
5316
  msgstr ""
5317
 
5318
- #: includes/class-mla-settings.php:499 includes/class-mla-settings.php:510
5319
  msgid "Rules per page"
5320
  msgstr ""
5321
 
5322
- #: includes/class-mla-settings.php:522
5323
  msgid "Plugins per page"
5324
  msgstr ""
5325
 
5326
- #: includes/class-mla-settings.php:660
5327
  msgid "Guide"
5328
  msgstr ""
5329
 
5330
- #: includes/class-mla-settings.php:734 includes/class-mla-settings.php:771
5331
- #: includes/class-mla-settings.php:911
5332
  #, php-format
5333
  msgctxt "error_log"
5334
  msgid "%1$s: %2$s unknown type = \"%3$s\""
5335
  msgstr ""
5336
 
5337
- #: includes/class-mla-settings.php:809 includes/class-mla-settings.php:1076
5338
  msgid "Go to Bottom"
5339
  msgstr ""
5340
 
5341
- #: includes/class-mla-settings.php:960
5342
  msgid "General"
5343
  msgstr ""
5344
 
5345
- #: includes/class-mla-settings.php:961
5346
  msgid "Views"
5347
  msgstr ""
5348
 
5349
- #: includes/class-mla-settings.php:962
5350
  msgid "Uploads"
5351
  msgstr ""
5352
 
5353
- #: includes/class-mla-settings.php:964
5354
  msgid "Custom Fields"
5355
  msgstr ""
5356
 
5357
- #: includes/class-mla-settings.php:965
5358
  msgid "IPTC/EXIF"
5359
  msgstr ""
5360
 
5361
- #: includes/class-mla-settings.php:966
5362
  msgid "Documentation"
5363
  msgstr ""
5364
 
5365
- #: includes/class-mla-settings.php:967
5366
  msgid "Debug"
5367
  msgstr ""
5368
 
5369
- #: includes/class-mla-settings.php:1067
5370
  msgid "General Processing Options"
5371
  msgstr ""
5372
 
5373
- #: includes/class-mla-settings.php:1069
5374
  #, php-format
5375
  msgid ""
5376
  "In this tab you can find a number of options for controlling the "
@@ -5379,369 +5387,369 @@ msgid ""
5379
  "any changes you make."
5380
  msgstr ""
5381
 
5382
- #: includes/class-mla-settings.php:1069
5383
  msgid "Media/Assistant Table Defaults"
5384
  msgstr ""
5385
 
5386
- #: includes/class-mla-settings.php:1069
5387
  msgid "Media Manager Enhancements"
5388
  msgstr ""
5389
 
5390
- #: includes/class-mla-settings.php:1072
5391
  msgid "Delete General options and restore default settings"
5392
  msgstr ""
5393
 
5394
- #: includes/class-mla-settings.php:1095
5395
  msgid "enhanced version of the WordPress [gallery] shortcode."
5396
  msgstr ""
5397
 
5398
- #: includes/class-mla-settings.php:1096
5399
  msgid "enhanced version of the WordPress Tag Cloud."
5400
  msgstr ""
5401
 
5402
- #: includes/class-mla-settings.php:1097
5403
  msgid ""
5404
  "provides flat or hierarchical lists, dropdown controls and checkbox lists of "
5405
  "taxonomy terms."
5406
  msgstr ""
5407
 
5408
- #: includes/class-mla-settings.php:1109
5409
  msgid "Shortcodes made available by this plugin"
5410
  msgstr ""
5411
 
5412
- #: includes/class-mla-settings.php:1224
5413
  msgid "Debug settings saved."
5414
  msgstr ""
5415
 
5416
- #: includes/class-mla-settings.php:1320
5417
  #, php-format
5418
  msgid "%1$s: Reseting the %2$s file ( %3$s ) \"%4$s\"."
5419
  msgstr ""
5420
 
5421
- #: includes/class-mla-settings.php:1320 includes/class-mla-settings.php:1371
5422
- #: includes/class-mla-settings.php:1394 includes/class-mla-settings.php:1404
5423
- #: includes/class-mla-settings.php:1430
5424
  msgid "Error Log"
5425
  msgstr ""
5426
 
5427
- #: includes/class-mla-settings.php:1381
5428
  #, php-format
5429
  msgid "Error log file (%1$s) not found; click Reset to create it."
5430
  msgstr ""
5431
 
5432
- #: includes/class-mla-settings.php:1425 includes/class-mla-settings.php:1441
5433
  msgid "Debug Options"
5434
  msgstr ""
5435
 
5436
- #: includes/class-mla-settings.php:1428
5437
  msgid "Debug Settings"
5438
  msgstr ""
5439
 
5440
- #: includes/class-mla-settings.php:1432
5441
  #, php-format
5442
  msgid ""
5443
  "You can find more information about the MLA Reporting/MLA_DEBUG_LEVEL values "
5444
  "in the %1$s section of the Documentation tab."
5445
  msgstr ""
5446
 
5447
- #: includes/class-mla-settings.php:1432
5448
  msgid "MLA Debug Tab documentation"
5449
  msgstr ""
5450
 
5451
- #: includes/class-mla-settings.php:1432
5452
  msgid "MLA Debug Tab"
5453
  msgstr ""
5454
 
5455
- #: includes/class-mla-settings.php:1441
5456
  #, php-format
5457
  msgid "Click %1$s to update the %2$s."
5458
  msgstr ""
5459
 
5460
- #: includes/class-mla-settings.php:1460
5461
  msgid "You do not have permission to manage plugin settings."
5462
  msgstr ""
5463
 
5464
- #: includes/class-mla-settings.php:1486
5465
  msgid "Cannot render content tab"
5466
  msgstr ""
5467
 
5468
- #: includes/class-mla-settings.php:1489
5469
  msgid "Unknown content tab"
5470
  msgstr ""
5471
 
5472
- #: includes/class-mla-settings.php:1505
5473
  msgid "Dismiss this notice"
5474
  msgstr ""
5475
 
5476
- #: includes/class-mla-settings.php:1532
5477
  #, php-format
5478
  msgid "%s attachment"
5479
  msgid_plural "%s attachments"
5480
  msgstr[0] ""
5481
  msgstr[1] ""
5482
 
5483
- #: includes/class-mla-settings.php:1534
5484
  #, php-format
5485
  msgid "Deleted custom field value from %1$s."
5486
  msgstr ""
5487
 
5488
- #: includes/class-mla-settings.php:1537
5489
  msgid "No attachments contained this custom field."
5490
  msgstr ""
5491
 
5492
- #: includes/class-mla-settings.php:1567 includes/class-mla-settings.php:1577
5493
  #, php-format
5494
  msgctxt "message_list"
5495
  msgid "%1$s - references updated."
5496
  msgstr ""
5497
 
5498
- #: includes/class-mla-settings.php:1620
5499
  msgid "General settings saved."
5500
  msgstr ""
5501
 
5502
- #: includes/class-mla-settings.php:1659
5503
  msgid "General settings reset to default values."
5504
  msgstr ""
5505
 
5506
- #: includes/class-mla-settings.php:1701
5507
  msgid "select settings"
5508
  msgstr ""
5509
 
5510
- #: includes/class-mla-settings.php:1721
5511
  msgid "Import ALL Settings"
5512
  msgstr ""
5513
 
5514
- #: includes/class-mla-settings.php:1750 includes/class-mla-settings.php:1766
5515
  msgctxt "message_list"
5516
  msgid "exported"
5517
  msgstr ""
5518
 
5519
- #: includes/class-mla-settings.php:1752 includes/class-mla-settings.php:1768
5520
  msgctxt "message_list"
5521
  msgid "skipped"
5522
  msgstr ""
5523
 
5524
- #: includes/class-mla-settings.php:1775
5525
  msgid "ALL settings exported."
5526
  msgstr ""
5527
 
5528
- #: includes/class-mla-settings.php:1786
5529
  #, php-format
5530
  msgid "%1$s: The settings directory ( %2$s ) cannot be created."
5531
  msgstr ""
5532
 
5533
- #: includes/class-mla-settings.php:1790
5534
  #, php-format
5535
  msgid "%1$s: The settings directory ( %2$s ) is not writable."
5536
  msgstr ""
5537
 
5538
- #: includes/class-mla-settings.php:1801
5539
  #, php-format
5540
  msgid "%1$s: The settings file ( %2$s ) could not be opened."
5541
  msgstr ""
5542
 
5543
- #: includes/class-mla-settings.php:1808
5544
  #, php-format
5545
  msgctxt "error_log"
5546
  msgid "%1$s: _export_settings $error_info = \"%2$s\"."
5547
  msgstr ""
5548
 
5549
- #: includes/class-mla-settings.php:1817
5550
  #, php-format
5551
  msgid "%1$s: Writing the settings file ( %2$s ) \"%3$s\"."
5552
  msgstr ""
5553
 
5554
- #: includes/class-mla-settings.php:1823
5555
  #, php-format
5556
  msgid "Settings exported; %1$s settings recorded."
5557
  msgstr ""
5558
 
5559
- #: includes/class-mla-settings.php:1841
5560
  msgid "No settings imported."
5561
  msgstr ""
5562
 
5563
- #: includes/class-mla-settings.php:1850
5564
  msgid "Please select an import settings file from the dropdown list."
5565
  msgstr ""
5566
 
5567
- #: includes/class-mla-settings.php:1854
5568
  msgid "The import settings dropdown selection is missing."
5569
  msgstr ""
5570
 
5571
- #: includes/class-mla-settings.php:1862
5572
  #, php-format
5573
  msgctxt "error_log"
5574
  msgid "%1$s: _import_settings $error_info = \"%2$s\"."
5575
  msgstr ""
5576
 
5577
- #: includes/class-mla-settings.php:1871
5578
  #, php-format
5579
  msgid "%1$s: Reading the settings file ( %2$s ) \"%3$s\"."
5580
  msgstr ""
5581
 
5582
- #: includes/class-mla-settings.php:1890 includes/class-mla-settings.php:1906
5583
  msgctxt "message_list"
5584
  msgid "updated"
5585
  msgstr ""
5586
 
5587
- #: includes/class-mla-settings.php:1893 includes/class-mla-settings.php:1909
5588
  msgctxt "message_list"
5589
  msgid "unchanged"
5590
  msgstr ""
5591
 
5592
- #: includes/class-mla-settings.php:1914
5593
  #, php-format
5594
  msgid "Settings imported; %1$s updated, %2$s unchanged."
5595
  msgstr ""
5596
 
5597
- #: includes/class-mla-shortcode-support.php:511
5598
- #: includes/class-mla-shortcode-support.php:1944
5599
- #: includes/class-mla-shortcode-support.php:4030
5600
- #: includes/class-mla-shortcode-support.php:4330
5601
  msgid "Previous"
5602
  msgstr ""
5603
 
5604
- #: includes/class-mla-shortcode-support.php:512
5605
- #: includes/class-mla-shortcode-support.php:1945
5606
- #: includes/class-mla-shortcode-support.php:4077
5607
- #: includes/class-mla-shortcode-support.php:4336
5608
  msgid "Next"
5609
  msgstr ""
5610
 
5611
- #: includes/class-mla-shortcode-support.php:584
5612
- #: includes/class-mla-shortcode-support.php:590
5613
- #: includes/class-mla-shortcode-support.php:2083
5614
- #: includes/class-mla-shortcode-support.php:2090
5615
- #: includes/class-mla-shortcode-support.php:3403
5616
- #: includes/class-mla-shortcode-support.php:3410
5617
  #: includes/class-mla-template-support.php:598
5618
  msgid "not found"
5619
  msgstr ""
5620
 
5621
- #: includes/class-mla-shortcode-support.php:614
5622
- #: includes/class-mla-shortcode-support.php:2075
5623
- #: includes/class-mla-shortcode-support.php:3395
5624
  msgid "mla_debug REQUEST"
5625
  msgstr ""
5626
 
5627
- #: includes/class-mla-shortcode-support.php:618
5628
- #: includes/class-mla-shortcode-support.php:620
5629
  msgid "mla_debug attributes_errors"
5630
  msgstr ""
5631
 
5632
- #: includes/class-mla-shortcode-support.php:626
5633
- #: includes/class-mla-shortcode-support.php:2076
5634
- #: includes/class-mla-shortcode-support.php:3396
5635
  msgid "mla_debug attributes"
5636
  msgstr ""
5637
 
5638
- #: includes/class-mla-shortcode-support.php:627
5639
- #: includes/class-mla-shortcode-support.php:2077
5640
- #: includes/class-mla-shortcode-support.php:3397
5641
  msgid "mla_debug arguments"
5642
  msgstr ""
5643
 
5644
- #: includes/class-mla-shortcode-support.php:719
5645
  msgid "mla_debug empty gallery"
5646
  msgstr ""
5647
 
5648
- #: includes/class-mla-shortcode-support.php:740
5649
  msgid ""
5650
  "<strong>Photonic-enhanced [mla_gallery]</strong> type must be "
5651
  "<strong>default</strong>, query = "
5652
  msgstr ""
5653
 
5654
- #: includes/class-mla-shortcode-support.php:1208
5655
  msgid "unknown"
5656
  msgstr ""
5657
 
5658
- #: includes/class-mla-shortcode-support.php:2208
5659
  msgid "mla_debug empty cloud"
5660
  msgstr ""
5661
 
5662
- #: includes/class-mla-shortcode-support.php:3531
5663
  msgid "mla_debug empty list"
5664
  msgstr ""
5665
 
5666
- #: includes/class-mla-shortcode-support.php:3554
5667
  msgid "no-terms"
5668
  msgstr ""
5669
 
5670
- #: includes/class-mla-shortcode-support.php:4867
5671
- #: includes/class-mla-shortcode-support.php:5279
5672
- #: includes/class-mla-shortcode-support.php:5310
5673
  msgid "Invalid mla_gallery"
5674
  msgstr ""
5675
 
5676
- #: includes/class-mla-shortcode-support.php:5601
5677
  msgid "mla_debug query"
5678
  msgstr ""
5679
 
5680
- #: includes/class-mla-shortcode-support.php:5602
5681
  msgid "mla_debug request"
5682
  msgstr ""
5683
 
5684
- #: includes/class-mla-shortcode-support.php:5603
5685
  msgid "mla_debug query_vars"
5686
  msgstr ""
5687
 
5688
- #: includes/class-mla-shortcode-support.php:5604
5689
  msgid "mla_debug post_count"
5690
  msgstr ""
5691
 
5692
- #: includes/class-mla-shortcode-support.php:5628
5693
  msgid "mla_debug JOIN filter"
5694
  msgstr ""
5695
 
5696
- #: includes/class-mla-shortcode-support.php:5668
5697
  msgid "mla_debug modified JOIN filter"
5698
  msgstr ""
5699
 
5700
- #: includes/class-mla-shortcode-support.php:5693
5701
  msgid "mla_debug WHERE filter"
5702
  msgstr ""
5703
 
5704
- #: includes/class-mla-shortcode-support.php:5722
5705
  msgid "mla_debug modified WHERE filter"
5706
  msgstr ""
5707
 
5708
- #: includes/class-mla-shortcode-support.php:5745
5709
  msgid "mla_debug ORDER BY filter, incoming"
5710
  msgstr ""
5711
 
5712
- #: includes/class-mla-shortcode-support.php:5745
5713
  msgid "Replacement ORDER BY clause"
5714
  msgstr ""
5715
 
5716
- #: includes/class-mla-shortcode-support.php:5768
5717
  msgid "mla_debug posts_clauses filter"
5718
  msgstr ""
5719
 
5720
- #: includes/class-mla-shortcode-support.php:5786
5721
  msgid "mla_debug posts_clauses_request filter"
5722
  msgstr ""
5723
 
5724
- #: includes/class-mla-shortcode-support.php:6018
5725
  msgid "Invalid taxonomy"
5726
  msgstr ""
5727
 
5728
- #: includes/class-mla-shortcode-support.php:6209
5729
  msgid "mla_debug query arguments"
5730
  msgstr ""
5731
 
5732
- #: includes/class-mla-shortcode-support.php:6210
5733
  msgid "mla_debug last_query"
5734
  msgstr ""
5735
 
5736
- #: includes/class-mla-shortcode-support.php:6211
5737
  msgid "mla_debug last_error"
5738
  msgstr ""
5739
 
5740
- #: includes/class-mla-shortcode-support.php:6212
5741
  msgid "mla_debug num_rows"
5742
  msgstr ""
5743
 
5744
- #: includes/class-mla-shortcode-support.php:6213
5745
  msgid "mla_debug found_rows"
5746
  msgstr ""
5747
 
@@ -5903,122 +5911,122 @@ msgstr ""
5903
 
5904
  #: includes/class-mla-thumbnail-generation.php:96
5905
  #: includes/class-mla-thumbnail-generation.php:98
5906
- #: includes/class-mla-thumbnail-generation.php:633
5907
  msgid "Generate Thumbnails"
5908
  msgstr ""
5909
 
5910
- #: includes/class-mla-thumbnail-generation.php:387
5911
  #, php-format
5912
  msgid "Item %1$d"
5913
  msgstr ""
5914
 
5915
- #: includes/class-mla-thumbnail-generation.php:405
5916
  msgid "has native thumbnail."
5917
  msgstr ""
5918
 
5919
- #: includes/class-mla-thumbnail-generation.php:426
5920
  msgid "Featured Image retained."
5921
  msgstr ""
5922
 
5923
- #: includes/class-mla-thumbnail-generation.php:434
5924
  #, php-format
5925
  msgid "%1$s: %2$sno attached file."
5926
  msgstr ""
5927
 
5928
- #: includes/class-mla-thumbnail-generation.php:438
5929
  msgid "unsupported file type."
5930
  msgstr ""
5931
 
5932
- #: includes/class-mla-thumbnail-generation.php:446
5933
- #: includes/class-mla-thumbnail-generation.php:458
5934
  #, php-format
5935
  msgid "%1$s: %2$sthumbnail generation failed"
5936
  msgstr ""
5937
 
5938
- #: includes/class-mla-thumbnail-generation.php:454
5939
  #, php-format
5940
  msgid "%1$sWordPress-style thumbnail generated."
5941
  msgstr ""
5942
 
5943
- #: includes/class-mla-thumbnail-generation.php:502
5944
  #, php-format
5945
  msgid "%1$s: %2$swp_insert_attachment failed."
5946
  msgstr ""
5947
 
5948
- #: includes/class-mla-thumbnail-generation.php:519
5949
  #, php-format
5950
  msgid "%1$sthumbnail generated as new item %2$s."
5951
  msgstr ""
5952
 
5953
- #: includes/class-mla-thumbnail-generation.php:568
5954
- #: includes/class-mla-thumbnail-generation.php:677
5955
  msgid "Generated Thumbnails"
5956
  msgstr ""
5957
 
5958
- #: includes/class-mla-thumbnail-generation.php:623
5959
  msgid ""
5960
  "Type &ldquo;WP&rdquo; generates native WordPress thumbnails without creating "
5961
  "a separate image item."
5962
  msgstr ""
5963
 
5964
- #: includes/class-mla-thumbnail-generation.php:634
5965
  msgid ""
5966
  "Pull down the Help menu and select Thumbnail Generation for setting details"
5967
  msgstr ""
5968
 
5969
- #: includes/class-mla-thumbnail-generation.php:635
5970
  msgid "Width"
5971
  msgstr ""
5972
 
5973
- #: includes/class-mla-thumbnail-generation.php:636
5974
  msgid "Height"
5975
  msgstr ""
5976
 
5977
- #: includes/class-mla-thumbnail-generation.php:637
5978
  msgid "Best Fit"
5979
  msgstr ""
5980
 
5981
- #: includes/class-mla-thumbnail-generation.php:638
5982
  msgid "Page"
5983
  msgstr ""
5984
 
5985
- #: includes/class-mla-thumbnail-generation.php:639
5986
  msgid "Resolution"
5987
  msgstr ""
5988
 
5989
- #: includes/class-mla-thumbnail-generation.php:640
5990
  msgid "Quality"
5991
  msgstr ""
5992
 
5993
- #: includes/class-mla-thumbnail-generation.php:646
5994
  msgid "Existing Items"
5995
  msgstr ""
5996
 
5997
- #: includes/class-mla-thumbnail-generation.php:648
5998
  msgid "Ignore"
5999
  msgstr ""
6000
 
6001
- #: includes/class-mla-thumbnail-generation.php:651
6002
  msgid "Suffix"
6003
  msgstr ""
6004
 
6005
- #: includes/class-mla-wpml-support.php:418
6006
  msgid "Duplicate translation created; update as desired."
6007
  msgstr ""
6008
 
6009
- #: includes/class-mla-wpml-support.php:1564
6010
  msgid "Make media available in all languages"
6011
  msgstr ""
6012
 
6013
- #: includes/class-mla-wpml-support.php:1714
6014
  msgid " WPML Media is not installed."
6015
  msgstr ""
6016
 
6017
- #: includes/class-mla-wpml-support.php:1716
6018
  msgid " WPML Media is not active."
6019
  msgstr ""
6020
 
6021
- #: includes/class-mla-wpml-support.php:1722
6022
  #, php-format
6023
  msgid ""
6024
  "In this tab you can find a number of options for controlling WPML-specific "
@@ -6026,13 +6034,13 @@ msgid ""
6026
  "\"Save Changes\" at the bottom of the tab to save any changes you make."
6027
  msgstr ""
6028
 
6029
- #: includes/class-mla-wpml-support.php:2273
6030
- #: includes/class-mla-wpml-support.php:2279
6031
  #, php-format
6032
  msgid "Edit the %s translation"
6033
  msgstr ""
6034
 
6035
- #: includes/class-mla-wpml-support.php:2285
6036
  #, php-format
6037
  msgid "Add translation to %s"
6038
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Media Library Assistant\n"
5
+ "POT-Creation-Date: 2020-11-20 16:51-0800\n"
6
  "PO-Revision-Date: 2015-08-21 21:38-0800\n"
7
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
8
  "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
+ "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
18
+ "esc_html__;esc_html_e;esc_html_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c\n"
19
  "X-Poedit-SourceCharset: UTF-8\n"
20
  "X-Poedit-SearchPath-0: includes\n"
21
  "X-Poedit-SearchPath-1: tests\n"
24
  #: includes/class-mla-admin-columns-pro-support-423.php:178
25
  #: includes/class-mla-admin-columns-pro-support-44.php:175
26
  #: includes/class-mla-admin-columns-pro-support.php:193
27
+ #: includes/class-mla-ajax.php:356 includes/class-mla-edit-media.php:993
28
+ #: includes/class-mla-list-table.php:682
29
  msgid "Draft"
30
  msgstr ""
31
 
32
  #: includes/class-mla-admin-columns-pro-support-423.php:181
33
  #: includes/class-mla-admin-columns-pro-support-44.php:178
34
  #: includes/class-mla-admin-columns-pro-support.php:196
35
+ #: includes/class-mla-ajax.php:350 includes/class-mla-edit-media.php:987
36
+ #: includes/class-mla-list-table.php:685
37
  msgid "Scheduled"
38
  msgstr ""
39
 
40
  #: includes/class-mla-admin-columns-pro-support-423.php:184
41
  #: includes/class-mla-admin-columns-pro-support-44.php:181
42
  #: includes/class-mla-admin-columns-pro-support.php:199
43
+ #: includes/class-mla-edit-media.php:990 includes/class-mla-list-table.php:688
44
  msgctxt "post state"
45
  msgid "Pending"
46
  msgstr ""
48
  #: includes/class-mla-admin-columns-pro-support-423.php:187
49
  #: includes/class-mla-admin-columns-pro-support-44.php:184
50
  #: includes/class-mla-admin-columns-pro-support.php:202
51
+ #: includes/class-mla-list-table.php:691
52
+ #: includes/class-mla-thumbnail-generation.php:669
53
  msgid "Trash"
54
  msgstr ""
55
 
58
  #: includes/class-mla-admin-columns-pro-support.php:433
59
  #: includes/class-mla-data-references.php:310
60
  #: includes/class-mla-data-references.php:634
61
+ #: includes/class-mla-list-table.php:1127
62
  msgid "NO REFERENCE TESTS"
63
  msgstr ""
64
 
78
  #: includes/class-mla-core-options.php:462
79
  #: includes/class-mla-core-options.php:472
80
  #: includes/class-mla-core-options.php:482
81
+ #: includes/class-mla-list-table.php:1207
82
+ #: includes/class-mla-list-table.php:1252
83
+ #: includes/class-mla-list-table.php:1302
84
+ #: includes/class-mla-list-table.php:1347
85
  msgid "Disabled"
86
  msgstr ""
87
 
97
  #: includes/class-mla-admin-columns-pro-support.php:715
98
  #: includes/class-mla-admin-columns-pro-support.php:778
99
  #: includes/class-mla-admin-columns-pro-support.php:840
100
+ #: includes/class-mla-edit-media.php:1075
101
+ #: includes/class-mla-edit-media.php:1112
102
+ #: includes/class-mla-edit-media.php:1147
103
+ #: includes/class-mla-edit-media.php:1181
104
+ #: includes/class-mla-list-table.php:1225
105
+ #: includes/class-mla-list-table.php:1274
106
+ #: includes/class-mla-list-table.php:1320
107
+ #: includes/class-mla-list-table.php:1365
108
  msgid "PARENT"
109
  msgstr ""
110
 
115
  #: includes/class-mla-core-options.php:868
116
  #: includes/class-mla-core-options.php:899
117
  #: includes/class-mla-core-options.php:913
118
+ #: includes/class-mla-list-table.php:539 includes/class-mla-list-table.php:1460
119
+ #: includes/class-mla-settings-shortcodes-tab.php:651
120
  msgid "None"
121
  msgstr ""
122
 
123
  #: includes/class-mla-admin-columns-pro-support-423.php:1117
124
  #: includes/class-mla-admin-columns-pro-support-44.php:1114
125
  #: includes/class-mla-admin-columns-pro-support.php:1155
126
+ #: includes/class-mla-list-table.php:1599
127
  msgid "(Private post)"
128
  msgstr ""
129
 
130
  #: includes/class-mla-admin-columns-pro-support-423.php:1121
131
  #: includes/class-mla-admin-columns-pro-support-44.php:1118
132
  #: includes/class-mla-admin-columns-pro-support.php:1159
133
+ #: includes/class-mla-ajax.php:366 includes/class-mla-list-table.php:1510
134
+ #: includes/class-mla-list-table.php:1539
135
+ #: includes/class-mla-list-table.php:1603
136
  msgid "Y/m/d"
137
  msgstr ""
138
 
140
  #: includes/class-mla-admin-columns-pro-support-44.php:1131
141
  #: includes/class-mla-admin-columns-pro-support.php:1172
142
  #: includes/class-mla-core-options.php:1315
143
+ #: includes/class-mla-list-table.php:1616
144
  msgctxt "table_view_singular"
145
  msgid "Unattached"
146
  msgstr ""
147
 
148
  #: includes/class-mla-admin-columns-support-deprecated.php:33
149
  #: includes/class-mla-admin-columns-support.php:43
150
+ #: includes/class-mla-core-options.php:561 includes/class-mla-settings.php:426
151
+ #: includes/class-mla-settings.php:1450 includes/class-mla-settings.php:1466
152
  #: index.php:46
153
  msgid "Media Library Assistant"
154
  msgstr ""
207
  "\"%3$d\" count = %4$d."
208
  msgstr ""
209
 
210
+ #: includes/class-mla-ajax.php:337 includes/class-mla-core-options.php:1191
211
+ #: includes/class-mla-data.php:4286 includes/class-mla-edit-media.php:480
212
+ #: includes/class-mla-main.php:2075 includes/class-mla-main.php:2380
213
  #: includes/class-mla-objects.php:348 includes/class-mla-options.php:466
214
  #: includes/mla-main-search-box-template.php:47
215
  #: includes/mla-media-modal-js-template.php:57
216
  msgid "Title"
217
  msgstr ""
218
 
219
+ #: includes/class-mla-ajax.php:337 includes/class-mla-main.php:2076
220
+ #: includes/class-mla-thumbnail-generation.php:661
221
  msgid "Type"
222
  msgstr ""
223
 
224
+ #: includes/class-mla-ajax.php:337 includes/class-mla-main.php:2077
225
  msgid "Date"
226
  msgstr ""
227
 
228
+ #: includes/class-mla-ajax.php:337 includes/class-mla-main.php:2078
229
+ #: includes/class-mla-settings-custom-fields-tab.php:516
230
+ #: includes/class-mla-settings-custom-fields-tab.php:826
231
+ #: includes/class-mla-settings-iptc-exif-tab.php:539
232
+ #: includes/class-mla-settings-iptc-exif-tab.php:927
233
+ #: includes/class-mla-settings-upload-tab.php:553
234
  msgid "Status"
235
  msgstr ""
236
 
237
+ #: includes/class-mla-ajax.php:341 includes/class-mla-list-table.php:936
238
+ #: includes/class-mla-list-table.php:1101 includes/class-mla-main.php:461
239
+ #: includes/class-mla-polylang-support.php:375
240
  #: includes/class-mla-thumbnail-generation.php:97
241
  msgid "(no title)"
242
  msgstr ""
243
 
244
+ #: includes/class-mla-ajax.php:347
245
  msgid "Published"
246
  msgstr ""
247
 
248
+ #: includes/class-mla-ajax.php:353
249
  msgid "Pending Review"
250
  msgstr ""
251
 
252
+ #: includes/class-mla-ajax.php:395 includes/class-mla-ajax.php:402
253
+ #: includes/class-mla-ajax.php:411 includes/class-mla-core.php:893
254
+ #: includes/class-mla-core.php:911 includes/class-mla-core.php:1342
255
+ #: includes/class-mla-core.php:1348 includes/class-mla-core.php:1352
256
  #: includes/class-mla-data-office.php:54 includes/class-mla-data-office.php:64
257
  #: includes/class-mla-data-office.php:68 includes/class-mla-data-office.php:83
258
  #: includes/class-mla-data-office.php:88 includes/class-mla-data-pdf.php:216
266
  #: includes/class-mla-data.php:1778 includes/class-mla-data.php:1784
267
  #: includes/class-mla-data.php:2134 includes/class-mla-data.php:2138
268
  #: includes/class-mla-data.php:3503 includes/class-mla-data.php:3564
269
+ #: includes/class-mla-data.php:3608 includes/class-mla-data.php:3986
270
+ #: includes/class-mla-data.php:3999 includes/class-mla-data.php:4021
271
+ #: includes/class-mla-data.php:4261 includes/class-mla-data.php:4307
272
+ #: includes/class-mla-data.php:4340 includes/class-mla-data.php:4356
273
+ #: includes/class-mla-data.php:4627 includes/class-mla-edit-media.php:321
274
+ #: includes/class-mla-edit-media.php:899 includes/class-mla-edit-media.php:941
275
+ #: includes/class-mla-main.php:709 includes/class-mla-main.php:837
276
+ #: includes/class-mla-main.php:839 includes/class-mla-main.php:842
277
+ #: includes/class-mla-main.php:902 includes/class-mla-main.php:936
278
+ #: includes/class-mla-main.php:945 includes/class-mla-main.php:952
279
+ #: includes/class-mla-main.php:1337 includes/class-mla-main.php:1393
280
+ #: includes/class-mla-main.php:1418 includes/class-mla-main.php:1556
281
+ #: includes/class-mla-main.php:1606 includes/class-mla-main.php:1716
282
+ #: includes/class-mla-main.php:1745 includes/class-mla-main.php:1882
283
+ #: includes/class-mla-main.php:1889 includes/class-mla-main.php:2061
284
+ #: includes/class-mla-main.php:2187 includes/class-mla-main.php:2512
285
+ #: includes/class-mla-main.php:2520 includes/class-mla-main.php:2544
286
+ #: includes/class-mla-main.php:2552 includes/class-mla-main.php:2584
287
+ #: includes/class-mla-main.php:2592 includes/class-mla-media-modal.php:617
288
+ #: includes/class-mla-mime-types.php:825 includes/class-mla-mime-types.php:1211
289
+ #: includes/class-mla-mime-types.php:1299
290
+ #: includes/class-mla-mime-types.php:1445
291
+ #: includes/class-mla-mime-types.php:1468
292
+ #: includes/class-mla-mime-types.php:2267
293
+ #: includes/class-mla-mime-types.php:2278
294
+ #: includes/class-mla-mime-types.php:2291
295
  #: includes/class-mla-mime-types.php:2299
296
+ #: includes/class-mla-mime-types.php:2304
297
+ #: includes/class-mla-mime-types.php:2347
298
+ #: includes/class-mla-mime-types.php:2366
299
+ #: includes/class-mla-mime-types.php:2411
300
+ #: includes/class-mla-mime-types.php:2446
301
+ #: includes/class-mla-mime-types.php:2527
302
+ #: includes/class-mla-mime-types.php:2606
303
+ #: includes/class-mla-mime-types.php:2615
304
+ #: includes/class-mla-mime-types.php:2647 includes/class-mla-objects.php:245
 
305
  #: includes/class-mla-options.php:218 includes/class-mla-options.php:434
306
  #: includes/class-mla-options.php:515 includes/class-mla-options.php:570
307
+ #: includes/class-mla-options.php:1133 includes/class-mla-options.php:1973
308
+ #: includes/class-mla-options.php:2199
309
+ #: includes/class-mla-settings-custom-fields-tab.php:169
310
+ #: includes/class-mla-settings-custom-fields-tab.php:251
311
+ #: includes/class-mla-settings-custom-fields-tab.php:255
312
+ #: includes/class-mla-settings-custom-fields-tab.php:275
313
+ #: includes/class-mla-settings-custom-fields-tab.php:320
314
+ #: includes/class-mla-settings-custom-fields-tab.php:324
315
+ #: includes/class-mla-settings-custom-fields-tab.php:346
316
+ #: includes/class-mla-settings-custom-fields-tab.php:438
317
+ #: includes/class-mla-settings-custom-fields-tab.php:570
318
+ #: includes/class-mla-settings-custom-fields-tab.php:741
319
+ #: includes/class-mla-settings-custom-fields-tab.php:964
320
+ #: includes/class-mla-settings-custom-fields-tab.php:967
321
+ #: includes/class-mla-settings-custom-fields-tab.php:990
322
+ #: includes/class-mla-settings-custom-fields-tab.php:2052
323
+ #: includes/class-mla-settings-documentation-tab.php:142
324
+ #: includes/class-mla-settings-documentation-tab.php:337
325
+ #: includes/class-mla-settings-documentation-tab.php:1278
326
  #: includes/class-mla-settings-iptc-exif-tab.php:171
327
+ #: includes/class-mla-settings-iptc-exif-tab.php:257
328
+ #: includes/class-mla-settings-iptc-exif-tab.php:261
329
+ #: includes/class-mla-settings-iptc-exif-tab.php:280
330
+ #: includes/class-mla-settings-iptc-exif-tab.php:328
331
+ #: includes/class-mla-settings-iptc-exif-tab.php:332
332
+ #: includes/class-mla-settings-iptc-exif-tab.php:355
333
+ #: includes/class-mla-settings-iptc-exif-tab.php:360
334
+ #: includes/class-mla-settings-iptc-exif-tab.php:450
335
+ #: includes/class-mla-settings-iptc-exif-tab.php:672
336
+ #: includes/class-mla-settings-iptc-exif-tab.php:841
337
+ #: includes/class-mla-settings-iptc-exif-tab.php:1049
338
+ #: includes/class-mla-settings-iptc-exif-tab.php:1053
339
+ #: includes/class-mla-settings-iptc-exif-tab.php:1083
340
+ #: includes/class-mla-settings-iptc-exif-tab.php:2311
341
+ #: includes/class-mla-settings-shortcodes-tab.php:102
342
+ #: includes/class-mla-settings-shortcodes-tab.php:113
343
+ #: includes/class-mla-settings-shortcodes-tab.php:117
344
+ #: includes/class-mla-settings-shortcodes-tab.php:135
345
+ #: includes/class-mla-settings-shortcodes-tab.php:162
346
+ #: includes/class-mla-settings-shortcodes-tab.php:227
347
+ #: includes/class-mla-settings-shortcodes-tab.php:234
348
+ #: includes/class-mla-settings-shortcodes-tab.php:238
349
+ #: includes/class-mla-settings-shortcodes-tab.php:526
350
+ #: includes/class-mla-settings-shortcodes-tab.php:1645
351
+ #: includes/class-mla-settings-upload-tab.php:322
352
+ #: includes/class-mla-settings-upload-tab.php:365
353
+ #: includes/class-mla-settings-upload-tab.php:441
354
+ #: includes/class-mla-settings-upload-tab.php:597
355
+ #: includes/class-mla-settings-upload-tab.php:610
356
+ #: includes/class-mla-settings-view-tab.php:191
357
+ #: includes/class-mla-settings-view-tab.php:213
358
+ #: includes/class-mla-settings-view-tab.php:288
359
+ #: includes/class-mla-settings-view-tab.php:438
360
+ #: includes/class-mla-settings-view-tab.php:453
361
+ #: includes/class-mla-settings.php:586 includes/class-mla-settings.php:725
362
+ #: includes/class-mla-settings.php:762 includes/class-mla-settings.php:902
363
+ #: includes/class-mla-settings.php:1311 includes/class-mla-settings.php:1362
364
+ #: includes/class-mla-settings.php:1450 includes/class-mla-settings.php:1477
365
+ #: includes/class-mla-settings.php:1480 includes/class-mla-settings.php:1484
366
+ #: includes/class-mla-settings.php:1778 includes/class-mla-settings.php:1782
367
+ #: includes/class-mla-settings.php:1793 includes/class-mla-settings.php:1800
368
+ #: includes/class-mla-settings.php:1809 includes/class-mla-settings.php:1846
369
+ #: includes/class-mla-settings.php:1854 includes/class-mla-settings.php:1863
370
+ #: includes/class-mla-shortcode-support.php:2181
371
+ #: includes/class-mla-shortcode-support.php:2270
372
+ #: includes/class-mla-shortcode-support.php:3503
373
+ #: includes/class-mla-shortcode-support.php:3630
374
+ #: includes/class-mla-shortcode-support.php:3662
375
+ #: includes/class-mla-shortcode-support.php:4864
376
+ #: includes/class-mla-shortcode-support.php:5276
377
+ #: includes/class-mla-shortcode-support.php:5307
378
+ #: includes/class-mla-thumbnail-generation.php:454
379
+ #: includes/class-mla-thumbnail-generation.php:466
380
+ #: includes/class-mla-thumbnail-generation.php:478
381
+ #: includes/class-mla-thumbnail-generation.php:522
382
  msgid "ERROR"
383
  msgstr ""
384
 
385
+ #: includes/class-mla-ajax.php:395 includes/class-mla-main.php:1882
386
  msgid "No post ID found"
387
  msgstr ""
388
 
389
+ #: includes/class-mla-ajax.php:402 includes/class-mla-main.php:1889
390
  #: includes/class-mla-polylang-support.php:271
391
  msgid "You are not allowed to edit this Attachment."
392
  msgstr ""
407
  msgid "Check this option to add support for Attachment Tags."
408
  msgstr ""
409
 
410
+ #: includes/class-mla-core-options.php:429 includes/class-mla-settings.php:1060
411
  msgid "Where-used Reporting"
412
  msgstr ""
413
 
424
  msgstr ""
425
 
426
  #: includes/class-mla-core-options.php:447
427
+ #: includes/class-mla-edit-media.php:834 includes/class-mla-edit-media.php:1086
428
  msgid "Featured in"
429
  msgstr ""
430
 
438
  msgstr ""
439
 
440
  #: includes/class-mla-core-options.php:457
441
+ #: includes/class-mla-edit-media.php:838 includes/class-mla-edit-media.php:1124
442
  msgid "Inserted in"
443
  msgstr ""
444
 
454
  msgstr ""
455
 
456
  #: includes/class-mla-core-options.php:467
457
+ #: includes/class-mla-edit-media.php:842 includes/class-mla-edit-media.php:1158
458
+ #: includes/class-mla-settings.php:1559
459
  msgid "Gallery in"
460
  msgstr ""
461
 
465
  msgstr ""
466
 
467
  #: includes/class-mla-core-options.php:472
468
+ #: includes/class-mla-core-options.php:482 includes/class-mla-main.php:2415
469
+ #: includes/class-mla-settings-custom-fields-tab.php:756
470
+ #: includes/class-mla-settings-iptc-exif-tab.php:856
471
  msgid "Refresh"
472
  msgstr ""
473
 
484
  msgstr ""
485
 
486
  #: includes/class-mla-core-options.php:477
487
+ #: includes/class-mla-edit-media.php:846 includes/class-mla-edit-media.php:1192
488
+ #: includes/class-mla-settings.php:1569
489
  msgid "MLA Gallery in"
490
  msgstr ""
491
 
497
  "Cached."
498
  msgstr ""
499
 
500
+ #: includes/class-mla-core-options.php:487 includes/class-mla-settings.php:1060
501
  msgid "Taxonomy Support"
502
  msgstr ""
503
 
538
  msgstr ""
539
 
540
  #: includes/class-mla-core-options.php:512
541
+ #: includes/class-mla-core-options.php:750 includes/class-mla-settings.php:1086
542
+ #: includes/class-mla-settings.php:1087 includes/class-mla-settings.php:1088
543
  msgid "For complete documentation"
544
  msgstr ""
545
 
546
  #: includes/class-mla-core-options.php:512
547
+ #: includes/class-mla-core-options.php:750 includes/class-mla-settings.php:1086
548
+ #: includes/class-mla-settings.php:1087 includes/class-mla-settings.php:1088
549
  msgid "click here"
550
  msgstr ""
551
 
674
  msgid "Choose the sort order."
675
  msgstr ""
676
 
677
+ #: includes/class-mla-core-options.php:626 includes/class-mla-main.php:630
678
  msgid "Entries per page"
679
  msgstr ""
680
 
944
  #: includes/class-mla-core-options.php:877
945
  #: includes/class-mla-core-options.php:899
946
  #: includes/class-mla-core-options.php:913
947
+ #: includes/class-mla-core-options.php:927 includes/class-mla-settings.php:1137
948
  msgid "Media Manager Default"
949
  msgstr ""
950
 
1025
  msgstr ""
1026
 
1027
  #: includes/class-mla-core-options.php:927
1028
+ #: includes/class-mla-thumbnail-generation.php:608
1029
+ #: includes/class-mla-thumbnail-generation.php:672
1030
  msgid "Thumbnail"
1031
  msgstr ""
1032
 
1057
  "strong> of your settings below by clicking \""
1058
  msgstr ""
1059
 
1060
+ #: includes/class-mla-core-options.php:944 includes/class-mla-settings.php:1062
1061
  msgid "Export ALL Settings"
1062
  msgstr ""
1063
 
1097
 
1098
  #: includes/class-mla-core-options.php:976
1099
  #: includes/class-mla-core-options.php:1020
1100
+ #: includes/class-mla-settings-shortcodes-tab.php:108
1101
  msgid "markup template"
1102
  msgstr ""
1103
 
1289
  msgid "IPTC/EXIF Mapping help"
1290
  msgstr ""
1291
 
1292
+ #: includes/class-mla-core-options.php:1198 includes/class-mla-data.php:4310
1293
+ #: includes/class-mla-edit-media.php:481 includes/class-mla-main.php:2381
1294
  msgid "Name/Slug"
1295
  msgstr ""
1296
 
1297
+ #: includes/class-mla-core-options.php:1205 includes/class-mla-data.php:4353
1298
+ #: includes/class-mla-edit-media.php:484 includes/class-mla-list-table.php:1402
1299
+ #: includes/class-mla-main.php:2385 includes/class-mla-options.php:472
1300
  #: includes/mla-main-search-box-template.php:51
1301
  #: includes/mla-media-modal-js-template.php:65
1302
  msgid "ALT Text"
1303
  msgstr ""
1304
 
1305
+ #: includes/class-mla-core-options.php:1212 includes/class-mla-data.php:4366
1306
+ #: includes/class-mla-edit-media.php:482 includes/class-mla-main.php:2382
1307
  #: includes/class-mla-options.php:475
1308
  #: includes/mla-main-search-box-template.php:53
1309
  #: includes/mla-media-modal-js-template.php:70
1310
  msgid "Caption"
1311
  msgstr ""
1312
 
1313
+ #: includes/class-mla-core-options.php:1219 includes/class-mla-data.php:4375
1314
+ #: includes/class-mla-edit-media.php:483 includes/class-mla-main.php:2383
1315
  #: includes/class-mla-options.php:478
1316
+ #: includes/class-mla-settings-upload-tab.php:199
1317
+ #: includes/class-mla-settings-upload-tab.php:543
1318
+ #: includes/class-mla-settings-view-tab.php:128
1319
+ #: includes/class-mla-settings-view-tab.php:391
1320
  #: includes/class-mla-template-support.php:74
1321
  #: includes/class-mla-template-support.php:92
1322
  #: includes/class-mla-template-support.php:110
1328
  msgid "Description"
1329
  msgstr ""
1330
 
1331
+ #: includes/class-mla-core-options.php:1226 includes/class-mla-data.php:4437
1332
+ #: includes/class-mla-data.php:4446 includes/class-mla-edit-media.php:485
1333
+ #: includes/class-mla-edit-media.php:683 includes/class-mla-main.php:2387
1334
  msgid "Uploaded on"
1335
  msgstr ""
1336
 
1349
  msgstr ""
1350
 
1351
  #: includes/class-mla-core-options.php:1261
1352
+ #: includes/class-mla-mime-types.php:1698
1353
+ #: includes/class-mla-settings-custom-fields-tab.php:2470
1354
+ #: includes/class-mla-settings-documentation-tab.php:1545
1355
+ #: includes/class-mla-settings-iptc-exif-tab.php:2766
1356
+ #: includes/class-mla-settings-shortcodes-tab.php:1986
1357
  msgctxt "table_view_singular"
1358
  msgid "All"
1359
  msgstr ""
1360
 
1361
  #: includes/class-mla-core-options.php:1262
1362
+ #: includes/class-mla-mime-types.php:1699
1363
+ #: includes/class-mla-settings-custom-fields-tab.php:2471
1364
+ #: includes/class-mla-settings-documentation-tab.php:1546
1365
+ #: includes/class-mla-settings-iptc-exif-tab.php:2767
1366
+ #: includes/class-mla-settings-shortcodes-tab.php:1987
1367
  msgctxt "table_view_plural"
1368
  msgid "All"
1369
  msgstr ""
1562
  "the existing MLA_DEBUG_LEVEL value."
1563
  msgstr ""
1564
 
1565
+ #: includes/class-mla-core.php:893
1566
  #, php-format
1567
  msgctxt "error_log"
1568
  msgid "%1$s: mla_load_template file \"%2$s\" not found."
1569
  msgstr ""
1570
 
1571
+ #: includes/class-mla-core.php:911
1572
  #, php-format
1573
  msgctxt "error_log"
1574
  msgid "%1$s: mla_load_template file \"%2$s\" bad source type \"%3$s\"."
1575
  msgstr ""
1576
 
1577
+ #: includes/class-mla-core.php:1342
1578
  #, php-format
1579
  msgid "%1$s: Bad specification part \"%2$s\""
1580
  msgstr ""
1581
 
1582
+ #: includes/class-mla-core.php:1348
1583
  #, php-format
1584
  msgid "%1$s: Bad specification option \"%2$s\""
1585
  msgstr ""
1586
 
1587
+ #: includes/class-mla-core.php:1352
1588
  #, php-format
1589
  msgid "%1$s: Bad specification prefix \"%2$s\""
1590
  msgstr ""
1591
 
1592
+ #: includes/class-mla-core.php:1452
1593
  msgid "Most Used"
1594
  msgstr ""
1595
 
1596
+ #: includes/class-mla-core.php:1481
1597
  #, php-format
1598
  msgid "+ %s"
1599
  msgstr ""
1600
 
1601
+ #: includes/class-mla-core.php:1487 includes/class-mla-edit-media.php:362
1602
+ #: includes/class-mla-edit-media.php:418 includes/class-mla-main.php:2067
1603
+ #: includes/class-mla-main.php:2248 includes/class-mla-main.php:2312
1604
  #: includes/class-mla-media-modal.php:647
1605
  #: includes/mla-media-modal-js-template.php:45
1606
  #: includes/mla-media-modal-js-template.php:92
1680
  msgstr ""
1681
 
1682
  #: includes/class-mla-data-query.php:294
1683
+ #: includes/class-mla-settings-custom-fields-tab.php:1240
1684
+ #: includes/class-mla-settings-documentation-tab.php:536
1685
+ #: includes/class-mla-settings-iptc-exif-tab.php:1337
1686
+ #: includes/class-mla-settings-shortcodes-tab.php:980
1687
  msgctxt "list_table_column"
1688
  msgid "Name"
1689
  msgstr ""
1730
 
1731
  #: includes/class-mla-data-query.php:303 includes/class-mla-mime-types.php:635
1732
  #: includes/class-mla-mime-types.php:708 includes/class-mla-mime-types.php:787
1733
+ #: includes/class-mla-settings-documentation-tab.php:539
1734
+ #: includes/class-mla-settings-shortcodes-tab.php:983
1735
  msgctxt "list_table_column"
1736
  msgid "Description"
1737
  msgstr ""
1772
  msgid "Attached to"
1773
  msgstr ""
1774
 
1775
+ #: includes/class-mla-data-query.php:843 includes/class-mla-edit-media.php:321
1776
+ #: includes/class-mla-main.php:2061 includes/class-mla-main.php:2187
1777
  #: includes/class-mla-media-modal.php:617 includes/class-mla-mime-types.php:825
1778
+ #: includes/class-mla-mime-types.php:1468
1779
+ #: includes/class-mla-mime-types.php:2647
1780
+ #: includes/class-mla-settings-custom-fields-tab.php:570
1781
+ #: includes/class-mla-settings-custom-fields-tab.php:741
1782
+ #: includes/class-mla-settings-custom-fields-tab.php:2052
1783
+ #: includes/class-mla-settings-documentation-tab.php:337
1784
+ #: includes/class-mla-settings-documentation-tab.php:1278
1785
+ #: includes/class-mla-settings-iptc-exif-tab.php:672
1786
+ #: includes/class-mla-settings-iptc-exif-tab.php:841
1787
+ #: includes/class-mla-settings-iptc-exif-tab.php:2311
1788
+ #: includes/class-mla-settings-shortcodes-tab.php:526
1789
+ #: includes/class-mla-settings-shortcodes-tab.php:1645
1790
+ #: includes/class-mla-settings-upload-tab.php:322
1791
+ #: includes/class-mla-settings-view-tab.php:191
1792
  #, php-format
1793
  msgctxt "error_log"
1794
  msgid "%1$s: %2$s non-array \"%3$s\""
1850
 
1851
  #: includes/class-mla-data-references.php:316
1852
  #: includes/class-mla-data-references.php:640
1853
+ #: includes/class-mla-data-source.php:701
1854
+ #: includes/class-mla-data-source.php:702
1855
  msgid "ORPHAN"
1856
  msgstr ""
1857
 
1955
  msgstr ""
1956
 
1957
  #: includes/class-mla-data.php:3735
1958
+ #: includes/class-mla-settings-custom-fields-tab.php:833
1959
+ #: includes/class-mla-settings-custom-fields-tab.php:1552
1960
+ #: includes/class-mla-settings-iptc-exif-tab.php:935
1961
+ #: includes/class-mla-settings-iptc-exif-tab.php:1680
1962
+ #: includes/class-mla-settings-iptc-exif-tab.php:2479
1963
+ #: includes/class-mla-settings-view-tab.php:401
1964
+ #: includes/class-mla-settings-view-tab.php:802
1965
+ #: includes/class-mla-settings-view-tab.php:818
1966
+ #: includes/class-mla-wpml-support.php:1595
1967
  msgid "Yes"
1968
  msgstr ""
1969
 
1970
  #: includes/class-mla-data.php:3737
1971
+ #: includes/class-mla-settings-custom-fields-tab.php:834
1972
+ #: includes/class-mla-settings-custom-fields-tab.php:1554
1973
+ #: includes/class-mla-settings-iptc-exif-tab.php:936
1974
+ #: includes/class-mla-settings-iptc-exif-tab.php:1682
1975
+ #: includes/class-mla-settings-iptc-exif-tab.php:2479
1976
+ #: includes/class-mla-settings-view-tab.php:400
1977
+ #: includes/class-mla-settings-view-tab.php:804
1978
+ #: includes/class-mla-settings-view-tab.php:820
1979
+ #: includes/class-mla-wpml-support.php:1596
1980
  msgid "No"
1981
  msgstr ""
1982
 
1983
+ #: includes/class-mla-data.php:3983 includes/class-mla-data.php:4107
1984
  #, php-format
1985
  msgid "Deleting %1$s"
1986
  msgstr ""
1987
 
1988
+ #: includes/class-mla-data.php:3986
1989
  #, php-format
1990
  msgid "%1$s: meta:%2$s not found"
1991
  msgstr ""
1992
 
1993
+ #: includes/class-mla-data.php:3995 includes/class-mla-data.php:4118
1994
+ #: includes/class-mla-data.php:4130
1995
  #, php-format
1996
  msgid "Adding %1$s = %2$s"
1997
  msgstr ""
1998
 
1999
+ #: includes/class-mla-data.php:3999
2000
  #, php-format
2001
  msgid "%1$s: Adding meta:%2$s; not found"
2002
  msgstr ""
2003
 
2004
+ #: includes/class-mla-data.php:4006
2005
  #, php-format
2006
  msgid "Deleting Null meta:%1$s"
2007
  msgstr ""
2008
 
2009
+ #: includes/class-mla-data.php:4016 includes/class-mla-data.php:4199
2010
+ #: includes/class-mla-data.php:4286 includes/class-mla-data.php:4310
2011
+ #: includes/class-mla-data.php:4353 includes/class-mla-data.php:4366
2012
+ #: includes/class-mla-data.php:4375 includes/class-mla-data.php:4386
2013
+ #: includes/class-mla-data.php:4397 includes/class-mla-data.php:4410
2014
+ #: includes/class-mla-data.php:4419 includes/class-mla-data.php:4428
2015
+ #: includes/class-mla-data.php:4437 includes/class-mla-data.php:4446
2016
+ #: includes/class-mla-mime-types.php:1302
2017
+ #: includes/class-mla-mime-types.php:2414
2018
  #, php-format
2019
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\""
2020
  msgstr ""
2021
 
2022
+ #: includes/class-mla-data.php:4021
2023
  #, php-format
2024
  msgid "%1$s: Changing meta:%2$s; not found"
2025
  msgstr ""
2026
 
2027
+ #: includes/class-mla-data.php:4154
2028
  #, php-format
2029
  msgid "Deleting old %1$s values"
2030
  msgstr ""
2031
 
2032
+ #: includes/class-mla-data.php:4184
2033
  #, php-format
2034
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\"; %4$d updates"
2035
  msgstr ""
2036
 
2037
+ #: includes/class-mla-data.php:4261
2038
  msgid "Could not retrieve Attachment."
2039
  msgstr ""
2040
 
2041
+ #: includes/class-mla-data.php:4307
2042
  #, php-format
2043
  msgid "%1$s: Could not change Name/Slug \"%2$s\"; name already exists"
2044
  msgstr ""
2045
 
2046
+ #: includes/class-mla-data.php:4337
2047
  #, php-format
2048
  msgid "Deleting ALT Text, was \"%1$s\""
2049
  msgstr ""
2050
 
2051
+ #: includes/class-mla-data.php:4340
2052
  #, php-format
2053
  msgid "%1$s: Could not delete ALT Text, remains \"%2$s\""
2054
  msgstr ""
2055
 
2056
+ #: includes/class-mla-data.php:4356
2057
  #, php-format
2058
  msgid "%1$s: Could not change ALT Text from \"%2$s\" to \"%3$s\""
2059
  msgstr ""
2060
 
2061
+ #: includes/class-mla-data.php:4386 includes/class-mla-list-table.php:1104
2062
+ #: includes/class-mla-list-table.php:1107
2063
+ #: includes/class-mla-list-table.php:1110
2064
+ #: includes/class-mla-list-table.php:1178 includes/class-mla-options.php:2143
2065
+ #: includes/class-mla-settings-iptc-exif-tab.php:512
2066
+ #: includes/class-mla-settings-iptc-exif-tab.php:905
2067
  msgid "Parent"
2068
  msgstr ""
2069
 
2070
+ #: includes/class-mla-data.php:4397 includes/class-mla-edit-media.php:823
2071
+ #: includes/class-mla-edit-media.php:1028 includes/class-mla-main.php:2390
2072
+ #: includes/class-mla-settings-view-tab.php:126
2073
+ #: includes/class-mla-settings-view-tab.php:389
2074
  msgid "Menu Order"
2075
  msgstr ""
2076
 
2077
+ #: includes/class-mla-data.php:4410 includes/class-mla-edit-media.php:449
2078
+ #: includes/class-mla-list-table.php:1558
2079
+ #: includes/class-mla-list-table.php:1561 includes/class-mla-main.php:2193
2080
+ #: includes/class-mla-main.php:2349
2081
  msgid "Author"
2082
  msgstr ""
2083
 
2084
+ #: includes/class-mla-data.php:4419 includes/class-mla-edit-media.php:474
2085
+ #: includes/class-mla-main.php:2402
2086
  msgid "Comments"
2087
  msgstr ""
2088
 
2089
+ #: includes/class-mla-data.php:4428 includes/class-mla-edit-media.php:475
2090
+ #: includes/class-mla-main.php:2403
2091
  msgid "Pings"
2092
  msgstr ""
2093
 
2094
+ #: includes/class-mla-data.php:4476
2095
  #, php-format
2096
  msgid "You cannot assign \"%1$s\" terms"
2097
  msgstr ""
2098
 
2099
+ #: includes/class-mla-data.php:4489
2100
  msgctxt "tag delimiter"
2101
  msgid ","
2102
  msgstr ""
2103
 
2104
+ #: includes/class-mla-data.php:4528
2105
  msgid "Adding"
2106
  msgstr ""
2107
 
2108
+ #: includes/class-mla-data.php:4533
2109
  msgid "Removing"
2110
  msgstr ""
2111
 
2112
+ #: includes/class-mla-data.php:4542
2113
  msgid "Replacing"
2114
  msgstr ""
2115
 
2116
+ #: includes/class-mla-data.php:4550
2117
  msgid "Ignoring"
2118
  msgstr ""
2119
 
2120
+ #: includes/class-mla-data.php:4567
2121
  #, php-format
2122
  msgid "%1$s \"%2$s\" terms"
2123
  msgstr ""
2124
 
2125
+ #: includes/class-mla-data.php:4579 includes/class-mla-main.php:1403
2126
  #, php-format
2127
  msgid "Item %1$d, no changes detected."
2128
  msgstr ""
2129
 
2130
+ #: includes/class-mla-data.php:4609
2131
  #, php-format
2132
  msgid "Item %1$d updated."
2133
  msgstr ""
2134
 
2135
+ #: includes/class-mla-data.php:4627
2136
  #, php-format
2137
  msgid "%1$s: Item %2$d update failed."
2138
  msgstr ""
2139
 
2140
+ #: includes/class-mla-edit-media.php:131 includes/class-mla-edit-media.php:185
2141
+ #: includes/class-mla-edit-media.php:238 includes/class-mla-main.php:470
2142
+ #: includes/class-mla-main.php:1158 includes/class-mla-main.php:1939
2143
+ #: includes/class-mla-media-modal.php:268 includes/class-mla-options.php:1649
2144
+ #: includes/class-mla-polylang-support.php:379
2145
+ #: includes/class-mla-settings-custom-fields-tab.php:57
2146
+ #: includes/class-mla-settings-custom-fields-tab.php:90
2147
  #: includes/class-mla-settings-iptc-exif-tab.php:57
2148
  #: includes/class-mla-settings-iptc-exif-tab.php:90
2149
+ #: includes/class-mla-settings-upload-tab.php:46
2150
+ #: includes/class-mla-settings-view-tab.php:46
2151
  #: includes/class-mla-thumbnail-generation.php:99
2152
  msgctxt "tag_delimiter"
2153
  msgid ","
2154
  msgstr ""
2155
 
2156
+ #: includes/class-mla-edit-media.php:180
2157
  msgid "Upload New Media items"
2158
  msgstr ""
2159
 
2160
+ #: includes/class-mla-edit-media.php:181 includes/class-mla-edit-media.php:469
2161
  msgid "Open Bulk Edit area"
2162
  msgstr ""
2163
 
2164
+ #: includes/class-mla-edit-media.php:182
2165
  msgid "Close Bulk Edit area"
2166
  msgstr ""
2167
 
2168
+ #: includes/class-mla-edit-media.php:186 includes/class-mla-edit-media.php:240
2169
+ #: includes/class-mla-main.php:457
2170
  msgid "An ajax.fail error has occurred. Please reload the page and try again."
2171
  msgstr ""
2172
 
2173
+ #: includes/class-mla-edit-media.php:187 includes/class-mla-edit-media.php:241
2174
+ #: includes/class-mla-main.php:458
2175
  msgid "An ajax.done error has occurred. Please reload the page and try again."
2176
  msgstr ""
2177
 
2178
+ #: includes/class-mla-edit-media.php:242 includes/class-mla-main.php:2147
2179
  #, php-format
2180
  msgid "Uploaded on: %s"
2181
  msgstr ""
2182
 
2183
+ #: includes/class-mla-edit-media.php:243 includes/class-mla-edit-media.php:695
2184
  msgid "Last modified"
2185
  msgstr ""
2186
 
2187
+ #: includes/class-mla-edit-media.php:341 includes/class-mla-edit-media.php:397
2188
+ #: includes/class-mla-main.php:2227 includes/class-mla-main.php:2291
2189
  msgid "+&nbsp;Add&nbsp;New&nbsp;Term"
2190
  msgstr ""
2191
 
2192
+ #: includes/class-mla-edit-media.php:342 includes/class-mla-edit-media.php:398
2193
+ #: includes/class-mla-main.php:2228 includes/class-mla-main.php:2292
2194
  msgid "Add New"
2195
  msgstr ""
2196
 
2197
+ #: includes/class-mla-edit-media.php:360 includes/class-mla-edit-media.php:416
2198
+ #: includes/class-mla-main.php:2246 includes/class-mla-main.php:2310
2199
  msgid "?&nbsp;Search"
2200
  msgstr ""
2201
 
2202
+ #: includes/class-mla-edit-media.php:363 includes/class-mla-edit-media.php:419
2203
+ #: includes/class-mla-edit-media.php:428 includes/class-mla-main.php:2249
2204
+ #: includes/class-mla-main.php:2313 includes/class-mla-main.php:2322
2205
  msgid "Add"
2206
  msgstr ""
2207
 
2208
+ #: includes/class-mla-edit-media.php:364 includes/class-mla-edit-media.php:420
2209
+ #: includes/class-mla-edit-media.php:429 includes/class-mla-main.php:2250
2210
+ #: includes/class-mla-main.php:2314 includes/class-mla-main.php:2323
2211
  msgid "Remove"
2212
  msgstr ""
2213
 
2214
+ #: includes/class-mla-edit-media.php:365 includes/class-mla-edit-media.php:421
2215
+ #: includes/class-mla-edit-media.php:430 includes/class-mla-main.php:2251
2216
+ #: includes/class-mla-main.php:2315 includes/class-mla-main.php:2324
2217
+ #: includes/class-mla-settings-custom-fields-tab.php:494
2218
+ #: includes/class-mla-settings-custom-fields-tab.php:804
2219
+ #: includes/class-mla-settings-custom-fields-tab.php:1538
2220
+ #: includes/class-mla-settings-iptc-exif-tab.php:506
2221
+ #: includes/class-mla-settings-iptc-exif-tab.php:902
2222
+ #: includes/class-mla-settings-iptc-exif-tab.php:1621
2223
+ #: includes/class-mla-settings-iptc-exif-tab.php:2460
2224
  msgid "Replace"
2225
  msgstr ""
2226
 
2227
+ #: includes/class-mla-edit-media.php:468
2228
  msgid ""
2229
  "IMPORTANT: Make your entries BEFORE uploading new items. Pull down the Help "
2230
  "menu for more information."
2231
  msgstr ""
2232
 
2233
+ #: includes/class-mla-edit-media.php:470 includes/class-mla-main.php:2396
2234
+ #: includes/class-mla-settings.php:1395
2235
  msgid "Reset"
2236
  msgstr ""
2237
 
2238
+ #: includes/class-mla-edit-media.php:476 includes/class-mla-main.php:2404
2239
+ #: includes/class-mla-main.php:2460
2240
+ #: includes/class-mla-settings-custom-fields-tab.php:832
2241
+ #: includes/class-mla-settings-iptc-exif-tab.php:934
2242
+ #: includes/class-mla-settings-upload-tab.php:120
2243
+ #: includes/class-mla-settings-upload-tab.php:554
2244
+ #: includes/class-mla-settings-view-tab.php:399
2245
  msgid "No Change"
2246
  msgstr ""
2247
 
2248
+ #: includes/class-mla-edit-media.php:477 includes/class-mla-main.php:2405
2249
  msgid "Allow"
2250
  msgstr ""
2251
 
2252
+ #: includes/class-mla-edit-media.php:478 includes/class-mla-main.php:2406
2253
  msgid "Do not allow"
2254
  msgstr ""
2255
 
2256
+ #: includes/class-mla-edit-media.php:486 includes/class-mla-list-table.php:1104
2257
+ #: includes/class-mla-list-table.php:1175 includes/class-mla-main.php:2388
2258
  msgid "Parent ID"
2259
  msgstr ""
2260
 
2261
+ #: includes/class-mla-edit-media.php:487 includes/class-mla-edit-media.php:1008
2262
+ #: includes/class-mla-main.php:2389
2263
+ #: includes/class-mla-settings-upload-tab.php:1469
2264
  msgid "Select"
2265
  msgstr ""
2266
 
2267
+ #: includes/class-mla-edit-media.php:584
2268
  msgid "Custom field mapping updated."
2269
  msgstr ""
2270
 
2271
+ #: includes/class-mla-edit-media.php:585
2272
  msgid "IPTC/EXIF mapping updated."
2273
  msgstr ""
2274
 
2275
+ #: includes/class-mla-edit-media.php:586
2276
  msgid "Custom field mapping is disabled."
2277
  msgstr ""
2278
 
2279
+ #: includes/class-mla-edit-media.php:587
2280
  msgid "IPTC/EXIF mapping is disabled."
2281
  msgstr ""
2282
 
2283
+ #: includes/class-mla-edit-media.php:622 includes/class-mla-main.php:2131
2284
  msgid "Month"
2285
  msgstr ""
2286
 
2287
+ #: includes/class-mla-edit-media.php:628 includes/class-mla-main.php:2137
2288
  #, php-format
2289
  msgid "%1$s-%2$s"
2290
  msgstr ""
2291
 
2292
+ #: includes/class-mla-edit-media.php:632 includes/class-mla-main.php:2141
2293
  msgid "Day"
2294
  msgstr ""
2295
 
2296
+ #: includes/class-mla-edit-media.php:633 includes/class-mla-main.php:2142
2297
  msgid "Year"
2298
  msgstr ""
2299
 
2300
+ #: includes/class-mla-edit-media.php:634 includes/class-mla-main.php:2143
2301
  msgid "Hour"
2302
  msgstr ""
2303
 
2304
+ #: includes/class-mla-edit-media.php:635 includes/class-mla-main.php:2144
2305
  msgid "Minute"
2306
  msgstr ""
2307
 
2308
+ #: includes/class-mla-edit-media.php:639 includes/class-mla-main.php:2149
2309
  #, php-format
2310
  msgid "%1$s %2$s, %3$s @ %4$s:%5$s"
2311
  msgstr ""
2312
 
2313
+ #: includes/class-mla-edit-media.php:662
2314
  msgid "OK"
2315
  msgstr ""
2316
 
2317
+ #: includes/class-mla-edit-media.php:663 includes/class-mla-main.php:2084
2318
+ #: includes/class-mla-main.php:2395
2319
+ #: includes/class-mla-polylang-support.php:2083
2320
+ #: includes/class-mla-settings-custom-fields-tab.php:522
2321
+ #: includes/class-mla-settings-custom-fields-tab.php:753
2322
+ #: includes/class-mla-settings-custom-fields-tab.php:835
2323
+ #: includes/class-mla-settings-documentation-tab.php:210
2324
+ #: includes/class-mla-settings-iptc-exif-tab.php:545
2325
+ #: includes/class-mla-settings-iptc-exif-tab.php:853
2326
+ #: includes/class-mla-settings-iptc-exif-tab.php:937
2327
+ #: includes/class-mla-settings-shortcodes-tab.php:428
2328
+ #: includes/class-mla-settings-shortcodes-tab.php:499
2329
+ #: includes/class-mla-settings-upload-tab.php:202
2330
+ #: includes/class-mla-settings-upload-tab.php:272
2331
+ #: includes/class-mla-settings-upload-tab.php:550
2332
+ #: includes/class-mla-settings-view-tab.php:131
2333
+ #: includes/class-mla-settings-view-tab.php:396
2334
+ #: includes/class-mla-thumbnail-generation.php:675
2335
  msgid "Cancel"
2336
  msgstr ""
2337
 
2338
+ #: includes/class-mla-edit-media.php:679
2339
  msgid "M j, Y @ H:i"
2340
  msgstr ""
2341
 
2342
+ #: includes/class-mla-edit-media.php:685 includes/class-mla-list-table.php:666
2343
+ #: includes/class-mla-list-table.php:792 includes/class-mla-list-table.php:1059
2344
+ #: includes/class-mla-list-table.php:1230
2345
+ #: includes/class-mla-list-table.php:1279
2346
+ #: includes/class-mla-list-table.php:1325
2347
+ #: includes/class-mla-list-table.php:1370
2348
+ #: includes/class-mla-list-table.php:1592
2349
+ #: includes/class-mla-list-table.php:1914
2350
+ #: includes/class-mla-polylang-support.php:378
2351
+ #: includes/class-mla-settings-custom-fields-tab.php:1381
2352
+ #: includes/class-mla-settings-custom-fields-tab.php:1716
2353
+ #: includes/class-mla-settings-iptc-exif-tab.php:1480
2354
+ #: includes/class-mla-settings-iptc-exif-tab.php:1844
2355
+ #: includes/class-mla-settings-shortcodes-tab.php:1098
2356
+ #: includes/class-mla-settings-upload-tab.php:928
2357
+ #: includes/class-mla-settings-upload-tab.php:1213
2358
+ #: includes/class-mla-settings-view-tab.php:723
2359
+ #: includes/class-mla-settings-view-tab.php:925
2360
  msgid "Edit"
2361
  msgstr ""
2362
 
2363
+ #: includes/class-mla-edit-media.php:686
2364
  msgid "Edit upload date and time"
2365
  msgstr ""
2366
 
2367
+ #: includes/class-mla-edit-media.php:688
2368
  msgid "Upload Date and time"
2369
  msgstr ""
2370
 
2371
+ #: includes/class-mla-edit-media.php:719
2372
  msgid "Map Custom Field metadata for this item"
2373
  msgstr ""
2374
 
2375
+ #: includes/class-mla-edit-media.php:719 includes/class-mla-main.php:1847
2376
+ #: includes/class-mla-main.php:2411
2377
  msgid "Map Custom Field metadata"
2378
  msgstr ""
2379
 
2380
+ #: includes/class-mla-edit-media.php:723
2381
  msgid "Map IPTC/EXIF metadata for this item"
2382
  msgstr ""
2383
 
2384
+ #: includes/class-mla-edit-media.php:723 includes/class-mla-main.php:1850
2385
+ #: includes/class-mla-main.php:2409
2386
  msgid "Map IPTC/EXIF metadata"
2387
  msgstr ""
2388
 
2389
+ #: includes/class-mla-edit-media.php:819 includes/class-mla-edit-media.php:1009
2390
  msgid "Parent Info"
2391
  msgstr ""
2392
 
2393
+ #: includes/class-mla-edit-media.php:829 includes/class-mla-edit-media.php:1052
2394
  msgid "Attachment Metadata"
2395
  msgstr ""
2396
 
2397
+ #: includes/class-mla-edit-media.php:899 includes/class-mla-edit-media.php:941
2398
+ #: includes/class-mla-main.php:709 includes/class-mla-settings.php:586
2399
  #, php-format
2400
  msgctxt "error_log"
2401
  msgid "%1$s: %2$s discarding \"%3$s\"; no title/order"
2402
  msgstr ""
2403
 
2404
+ #: includes/class-mla-edit-media.php:1007
2405
  msgid "Post Parent"
2406
  msgstr ""
2407
 
2408
+ #: includes/class-mla-edit-media.php:1008 includes/class-mla-main.php:2066
2409
  msgid "Select Parent"
2410
  msgstr ""
2411
 
2418
  msgid "No"
2419
  msgstr ""
2420
 
2421
+ #: includes/class-mla-list-table.php:478
2422
+ #: includes/class-mla-settings-custom-fields-tab.php:1029
2423
+ #: includes/class-mla-settings-iptc-exif-tab.php:1122
2424
+ #: includes/class-mla-settings-upload-tab.php:653
2425
+ #: includes/class-mla-settings-view-tab.php:496
2426
  msgid "List View"
2427
  msgstr ""
2428
 
2429
+ #: includes/class-mla-list-table.php:545 includes/class-mla-list-table.php:598
2430
+ #: includes/class-mla-list-table.php:1104
2431
+ #: includes/class-mla-list-table.php:1175
2432
+ #: includes/class-mla-list-table.php:1398
2433
+ #: includes/class-mla-list-table.php:1442
2434
+ #: includes/class-mla-list-table.php:1474
2435
+ #: includes/class-mla-list-table.php:1558
2436
  msgid "Filter by"
2437
  msgstr ""
2438
 
2439
+ #: includes/class-mla-list-table.php:555
2440
+ #: includes/class-mla-media-modal-ajax.php:534
2441
  msgid "Not Supported"
2442
  msgstr ""
2443
 
2444
+ #: includes/class-mla-list-table.php:618
2445
+ #: includes/class-mla-settings-custom-fields-tab.php:1329
2446
+ #: includes/class-mla-settings-documentation-tab.php:620
2447
+ #: includes/class-mla-settings-iptc-exif-tab.php:1428
2448
+ #: includes/class-mla-settings-shortcodes-tab.php:1053
2449
+ #: includes/class-mla-settings-upload-tab.php:864
2450
+ #: includes/class-mla-settings-upload-tab.php:1417
2451
+ #: includes/class-mla-settings-view-tab.php:660
2452
  #, php-format
2453
  msgid "column_default: %1$s, %2$s"
2454
  msgstr ""
2455
 
2456
+ #: includes/class-mla-list-table.php:779
2457
  msgid "Restore this item from the Trash"
2458
  msgstr ""
2459
 
2460
+ #: includes/class-mla-list-table.php:779 includes/class-mla-list-table.php:1911
2461
  msgid "Restore"
2462
  msgstr ""
2463
 
2464
+ #: includes/class-mla-list-table.php:792
2465
+ #: includes/class-mla-settings-custom-fields-tab.php:1381
2466
+ #: includes/class-mla-settings-iptc-exif-tab.php:1480
2467
+ #: includes/class-mla-settings-shortcodes-tab.php:1098
2468
+ #: includes/class-mla-settings-upload-tab.php:928
2469
+ #: includes/class-mla-settings-view-tab.php:723
2470
  msgid "Edit this item"
2471
  msgstr ""
2472
 
2473
+ #: includes/class-mla-list-table.php:793
2474
+ #: includes/class-mla-settings-custom-fields-tab.php:1384
2475
+ #: includes/class-mla-settings-iptc-exif-tab.php:1483
2476
+ #: includes/class-mla-settings-upload-tab.php:930
2477
+ #: includes/class-mla-settings-view-tab.php:725
2478
  msgid "Edit this item inline"
2479
  msgstr ""
2480
 
2481
+ #: includes/class-mla-list-table.php:793 includes/class-mla-main.php:2379
2482
+ #: includes/class-mla-options.php:1244
2483
+ #: includes/class-mla-settings-custom-fields-tab.php:485
2484
+ #: includes/class-mla-settings-custom-fields-tab.php:795
2485
+ #: includes/class-mla-settings-custom-fields-tab.php:1384
2486
+ #: includes/class-mla-settings-custom-fields-tab.php:1494
2487
+ #: includes/class-mla-settings-iptc-exif-tab.php:881
2488
+ #: includes/class-mla-settings-iptc-exif-tab.php:1483
2489
+ #: includes/class-mla-settings-upload-tab.php:930
2490
+ #: includes/class-mla-settings-view-tab.php:725
2491
  msgid "Quick Edit"
2492
  msgstr ""
2493
 
2494
+ #: includes/class-mla-list-table.php:799
2495
  msgid "Move this item to the Trash"
2496
  msgstr ""
2497
 
2498
+ #: includes/class-mla-list-table.php:799 includes/class-mla-list-table.php:1917
2499
  msgid "Move to Trash"
2500
  msgstr ""
2501
 
2502
+ #: includes/class-mla-list-table.php:804
2503
+ #: includes/class-mla-settings-custom-fields-tab.php:1392
2504
+ #: includes/class-mla-settings-iptc-exif-tab.php:1493
2505
+ #: includes/class-mla-settings-shortcodes-tab.php:1104
2506
+ #: includes/class-mla-settings-upload-tab.php:934
2507
+ #: includes/class-mla-settings-view-tab.php:731
2508
  msgid "Delete this item Permanently"
2509
  msgstr ""
2510
 
2511
+ #: includes/class-mla-list-table.php:804 includes/class-mla-list-table.php:1912
2512
+ #: includes/class-mla-list-table.php:1919
2513
+ #: includes/class-mla-settings-custom-fields-tab.php:1392
2514
+ #: includes/class-mla-settings-custom-fields-tab.php:1717
2515
+ #: includes/class-mla-settings-iptc-exif-tab.php:1493
2516
+ #: includes/class-mla-settings-iptc-exif-tab.php:1845
2517
+ #: includes/class-mla-settings-shortcodes-tab.php:1104
2518
+ #: includes/class-mla-settings-upload-tab.php:934
2519
+ #: includes/class-mla-settings-view-tab.php:731
2520
+ #: includes/class-mla-settings-view-tab.php:926
2521
  msgid "Delete Permanently"
2522
  msgstr ""
2523
 
2524
+ #: includes/class-mla-list-table.php:812 includes/class-mla-list-table.php:1924
2525
+ #: includes/class-mla-settings-documentation-tab.php:673
2526
+ #: includes/class-mla-settings.php:1385
2527
  msgid "Download"
2528
  msgstr ""
2529
 
2530
+ #: includes/class-mla-list-table.php:814
2531
+ #: includes/class-mla-settings-documentation-tab.php:676
2532
+ #: includes/class-mla-settings-shortcodes-tab.php:1096
2533
+ #: includes/class-mla-settings-view-tab.php:377
2534
  msgid "View"
2535
  msgstr ""
2536
 
2537
+ #: includes/class-mla-list-table.php:1075
2538
  msgid "File name"
2539
  msgstr ""
2540
 
2541
+ #: includes/class-mla-list-table.php:1172
2542
  msgid "(no title: bad ID)"
2543
  msgstr ""
2544
 
2545
+ #: includes/class-mla-list-table.php:1445
2546
+ #: includes/class-mla-settings-upload-tab.php:192
2547
+ #: includes/class-mla-settings-upload-tab.php:537
2548
  msgid "MIME Type"
2549
  msgstr ""
2550
 
2551
+ #: includes/class-mla-list-table.php:1478
2552
  msgid "Base File"
2553
  msgstr ""
2554
 
2555
+ #: includes/class-mla-list-table.php:1494
2556
+ #: includes/class-mla-list-table.php:1527
2557
  msgid "Unpublished"
2558
  msgstr ""
2559
 
2560
+ #: includes/class-mla-list-table.php:1503
2561
+ #: includes/class-mla-list-table.php:1534
2562
  #, php-format
2563
  msgid "%1$s from now"
2564
  msgstr ""
2565
 
2566
+ #: includes/class-mla-list-table.php:1506
2567
+ #: includes/class-mla-list-table.php:1536
2568
  #, php-format
2569
  msgid "%1$s ago"
2570
  msgstr ""
2571
 
2572
+ #: includes/class-mla-list-table.php:1620
2573
  msgid "Set Parent"
2574
  msgstr ""
2575
 
2576
+ #: includes/class-mla-list-table.php:1770
2577
  msgctxt "uploaded files"
2578
  msgid "All"
2579
  msgid_plural "All"
2580
  msgstr[0] ""
2581
  msgstr[1] ""
2582
 
2583
+ #: includes/class-mla-list-table.php:2013
2584
+ #: includes/class-mla-settings-custom-fields-tab.php:1780
2585
+ #: includes/class-mla-settings-iptc-exif-tab.php:1908
2586
+ #: includes/class-mla-settings-shortcodes-tab.php:1363
2587
  msgid "Filter"
2588
  msgstr ""
2589
 
2590
+ #: includes/class-mla-list-table.php:2016
2591
  #: includes/mla-media-modal-js-template.php:89
2592
  msgid "Terms Search"
2593
  msgstr ""
2594
 
2595
+ #: includes/class-mla-list-table.php:2021
2596
+ #: includes/class-mla-polylang-support.php:2090
2597
+ #: includes/class-mla-thumbnail-generation.php:674
2598
  msgid "Clear Filter-by"
2599
  msgstr ""
2600
 
2601
+ #: includes/class-mla-list-table.php:2024
2602
  msgid "Empty Trash"
2603
  msgstr ""
2604
 
2605
+ #: includes/class-mla-main.php:459
2606
  msgid "Error while saving the changes."
2607
  msgstr ""
2608
 
2609
+ #: includes/class-mla-main.php:460
2610
+ #: includes/class-mla-settings-custom-fields-tab.php:55
2611
+ #: includes/class-mla-settings-custom-fields-tab.php:88
2612
  #: includes/class-mla-settings-iptc-exif-tab.php:55
2613
  #: includes/class-mla-settings-iptc-exif-tab.php:88
2614
+ #: includes/class-mla-settings-upload-tab.php:44
2615
+ #: includes/class-mla-settings-view-tab.php:44
2616
  msgid "Remove From Bulk Edit"
2617
  msgstr ""
2618
 
2619
+ #: includes/class-mla-main.php:462
2620
  msgid "Bulk Edit items"
2621
  msgstr ""
2622
 
2623
+ #: includes/class-mla-main.php:463 includes/class-mla-main.php:2412
2624
+ #: includes/class-mla-settings-custom-fields-tab.php:61
2625
  #: includes/class-mla-settings-iptc-exif-tab.php:61
2626
  msgid "Waiting"
2627
  msgstr ""
2628
 
2629
+ #: includes/class-mla-main.php:464 includes/class-mla-main.php:2414
2630
+ #: includes/class-mla-settings-custom-fields-tab.php:63
2631
  #: includes/class-mla-settings-iptc-exif-tab.php:63
2632
  msgid "Complete"
2633
  msgstr ""
2634
 
2635
+ #: includes/class-mla-main.php:465
2636
+ #: includes/class-mla-settings-custom-fields-tab.php:64
2637
  #: includes/class-mla-settings-iptc-exif-tab.php:64
2638
  msgid "Unchanged"
2639
  msgstr ""
2640
 
2641
+ #: includes/class-mla-main.php:466
2642
+ #: includes/class-mla-settings-custom-fields-tab.php:65
2643
  #: includes/class-mla-settings-iptc-exif-tab.php:65
2644
  msgid "Succeeded"
2645
  msgstr ""
2646
 
2647
+ #: includes/class-mla-main.php:467
2648
+ #: includes/class-mla-settings-custom-fields-tab.php:66
2649
  #: includes/class-mla-settings-iptc-exif-tab.php:66
2650
  msgid "Failed"
2651
  msgstr ""
2652
 
2653
+ #: includes/class-mla-main.php:468
2654
  msgid "CANCELED"
2655
  msgstr ""
2656
 
2657
+ #: includes/class-mla-main.php:606
2658
  #, php-format
2659
  msgid "Item permanently deleted."
2660
  msgid_plural "%d items permanently deleted."
2661
  msgstr[0] ""
2662
  msgstr[1] ""
2663
 
2664
+ #: includes/class-mla-main.php:611 includes/class-mla-main.php:2599
2665
  #, php-format
2666
  msgid "Item %1$d moved to Trash."
2667
  msgstr ""
2668
 
2669
+ #: includes/class-mla-main.php:837
2670
  msgid "download path out of bounds."
2671
  msgstr ""
2672
 
2673
+ #: includes/class-mla-main.php:839
2674
  msgid "download path invalid."
2675
  msgstr ""
2676
 
2677
+ #: includes/class-mla-main.php:842
2678
  msgid "download argument(s) not set."
2679
  msgstr ""
2680
 
2681
+ #: includes/class-mla-main.php:902
2682
  msgid "no ZipArchive support."
2683
  msgstr ""
2684
 
2685
+ #: includes/class-mla-main.php:934
2686
  #, php-format
2687
  msgid "The ZIP archive ( %1$s ) could not be created."
2688
  msgstr ""
2689
 
2690
+ #: includes/class-mla-main.php:944
2691
  #, php-format
2692
  msgid "The file ( %1$s ) could not be added to the ZIP archive."
2693
  msgstr ""
2694
 
2695
+ #: includes/class-mla-main.php:951
2696
  #, php-format
2697
  msgid "The ZIP archive ( %1$s ) could not be closed."
2698
  msgstr ""
2699
 
2700
+ #: includes/class-mla-main.php:1337
2701
  msgid "You are not allowed to edit Attachment: "
2702
  msgstr ""
2703
 
2704
+ #: includes/class-mla-main.php:1393
2705
  #, php-format
2706
  msgid "%1$s: Unknown bulk action %2$s"
2707
  msgstr ""
2708
 
2709
+ #: includes/class-mla-main.php:1415
2710
  msgid "no changes detected"
2711
  msgstr ""
2712
 
2713
+ #: includes/class-mla-main.php:1462
2714
+ #: includes/class-mla-settings-custom-fields-tab.php:627
2715
+ #: includes/class-mla-settings-documentation-tab.php:287
2716
+ #: includes/class-mla-settings-iptc-exif-tab.php:729
2717
+ #: includes/class-mla-settings-shortcodes-tab.php:588
2718
+ #: includes/class-mla-settings-upload-tab.php:421
2719
+ #: includes/class-mla-settings-view-tab.php:267
2720
  #, php-format
2721
  msgid "Bulk Action %1$s - no items selected."
2722
  msgstr ""
2723
 
2724
+ #: includes/class-mla-main.php:1557
2725
  msgid "You do not have permission to manage attachments."
2726
  msgstr ""
2727
 
2728
+ #: includes/class-mla-main.php:1560
2729
+ msgctxt "file"
2730
+ msgid "Add New"
2731
+ msgstr ""
2732
+
2733
+ #: includes/class-mla-main.php:1615
2734
  #, php-format
2735
  msgctxt "deleted items"
2736
  msgid "%s item deleted."
2738
  msgstr[0] ""
2739
  msgstr[1] ""
2740
 
2741
+ #: includes/class-mla-main.php:1617
2742
  msgid "No items deleted."
2743
  msgstr ""
2744
 
2745
+ #: includes/class-mla-main.php:1676
2746
  msgid "Empty Terms Search; ignored"
2747
  msgstr ""
2748
 
2749
+ #: includes/class-mla-main.php:1688
2750
+ #: includes/class-mla-settings-custom-fields-tab.php:655
2751
+ #: includes/class-mla-settings-documentation-tab.php:321
2752
+ #: includes/class-mla-settings-iptc-exif-tab.php:757
2753
+ #: includes/class-mla-settings-shortcodes-tab.php:615
2754
+ #: includes/class-mla-settings-upload-tab.php:459
2755
+ #: includes/class-mla-settings-view-tab.php:304
2756
  #, php-format
2757
  msgid "Unknown mla_admin_action - \"%1$s\""
2758
  msgstr ""
2759
 
2760
+ #: includes/class-mla-main.php:1733
2761
  msgid "term search results for"
2762
  msgstr ""
2763
 
2764
+ #: includes/class-mla-main.php:1736
2765
  msgid "post/parent results for"
2766
  msgstr ""
2767
 
2768
+ #: includes/class-mla-main.php:1738
2769
  msgid "search results for"
2770
  msgstr ""
2771
 
2772
+ #: includes/class-mla-main.php:1853 includes/class-mla-main.php:2088
2773
+ #: includes/class-mla-main.php:2397
2774
+ #: includes/class-mla-settings-custom-fields-tab.php:524
2775
+ #: includes/class-mla-settings-custom-fields-tab.php:836
2776
+ #: includes/class-mla-settings-documentation-tab.php:664
2777
+ #: includes/class-mla-settings-documentation-tab.php:863
2778
+ #: includes/class-mla-settings-iptc-exif-tab.php:547
2779
+ #: includes/class-mla-settings-iptc-exif-tab.php:938
2780
+ #: includes/class-mla-settings-shortcodes-tab.php:502
2781
+ #: includes/class-mla-settings-upload-tab.php:201
2782
+ #: includes/class-mla-settings-upload-tab.php:551
2783
+ #: includes/class-mla-settings-view-tab.php:130
2784
+ #: includes/class-mla-settings-view-tab.php:397
2785
  msgid "Update"
2786
  msgstr ""
2787
 
2788
+ #: includes/class-mla-main.php:2023
2789
  msgid "All Post Types"
2790
  msgstr ""
2791
 
2792
+ #: includes/class-mla-main.php:2069
2793
  msgid "For"
2794
  msgstr ""
2795
 
2796
+ #: includes/class-mla-main.php:2079
2797
+ #: includes/class-mla-shortcode-support.php:1183
2798
  msgid "Unattached"
2799
  msgstr ""
2800
 
2801
+ #: includes/class-mla-main.php:2398 includes/class-mla-options.php:1258
2802
+ #: includes/class-mla-settings-custom-fields-tab.php:488
2803
+ #: includes/class-mla-settings-custom-fields-tab.php:798
2804
+ #: includes/class-mla-settings-custom-fields-tab.php:1498
2805
+ #: includes/class-mla-settings-iptc-exif-tab.php:882
2806
+ #: includes/class-mla-settings-upload-tab.php:552
2807
+ #: includes/class-mla-settings-view-tab.php:398
2808
  msgid "Bulk Edit"
2809
  msgstr ""
2810
 
2811
+ #: includes/class-mla-main.php:2413
2812
  msgid "In-process"
2813
  msgstr ""
2814
 
2815
+ #: includes/class-mla-main.php:2512
2816
  msgid "You are not allowed to delete this item."
2817
  msgstr ""
2818
 
2819
+ #: includes/class-mla-main.php:2520
2820
  #, php-format
2821
  msgid "%1$s: Item %2$d could NOT be deleted."
2822
  msgstr ""
2823
 
2824
+ #: includes/class-mla-main.php:2527
2825
  #, php-format
2826
  msgid "Item %1$d permanently deleted."
2827
  msgstr ""
2828
 
2829
+ #: includes/class-mla-main.php:2544
2830
  msgid "You are not allowed to move this item out of the Trash."
2831
  msgstr ""
2832
 
2833
+ #: includes/class-mla-main.php:2552
2834
  #, php-format
2835
  msgid "%1$s: Item %2$d could NOT be restored from Trash."
2836
  msgstr ""
2837
 
2838
+ #: includes/class-mla-main.php:2567
2839
  #, php-format
2840
  msgid "Item %1$d restored from Trash."
2841
  msgstr ""
2842
 
2843
+ #: includes/class-mla-main.php:2584
2844
  msgid "You are not allowed to move this item to the Trash."
2845
  msgstr ""
2846
 
2847
+ #: includes/class-mla-main.php:2592
2848
  #, php-format
2849
  msgid "%1$s: Item %2$d could NOT be moved to Trash."
2850
  msgstr ""
2851
 
2852
+ #: includes/class-mla-media-modal-ajax.php:311
2853
+ #: includes/class-mla-media-modal-ajax.php:317
2854
+ #: includes/class-mla-media-modal-ajax.php:422
2855
+ #: includes/class-mla-media-modal-ajax.php:457
2856
+ #: includes/class-mla-media-modal-ajax.php:528
2857
  msgid "Click to toggle"
2858
  msgstr ""
2859
 
2860
+ #: includes/class-mla-media-modal-ajax.php:468
2861
  msgid "Tags"
2862
  msgstr ""
2863
 
2864
+ #: includes/class-mla-media-modal-ajax.php:470
2865
  #: includes/class-mla-objects.php:50 includes/class-mla-objects.php:83
2866
+ #: includes/class-mla-settings-upload-tab.php:533
2867
+ #: includes/class-mla-settings-view-tab.php:377
2868
  #, php-format
2869
  msgid "Add New %1$s"
2870
  msgstr ""
2871
 
2872
+ #: includes/class-mla-media-modal-ajax.php:494
2873
  #: includes/class-mla-media-modal.php:295
2874
  msgid "Remove term"
2875
  msgstr ""
2876
 
2877
+ #: includes/class-mla-media-modal-ajax.php:514
2878
  msgid "Choose from the most used tags"
2879
  msgstr ""
2880
 
2944
  msgstr ""
2945
 
2946
  #: includes/class-mla-mime-types.php:629
2947
+ #: includes/class-mla-settings-custom-fields-tab.php:1242
2948
  msgctxt "list_table_column"
2949
  msgid "Source"
2950
  msgstr ""
2951
 
2952
  #: includes/class-mla-mime-types.php:630
2953
+ #: includes/class-mla-settings-custom-fields-tab.php:1245
2954
+ #: includes/class-mla-settings-iptc-exif-tab.php:1343
2955
  msgctxt "list_table_column"
2956
  msgid "Status"
2957
  msgstr ""
3011
  msgid "Order"
3012
  msgstr ""
3013
 
3014
+ #: includes/class-mla-mime-types.php:1096
3015
  msgctxt "post_mime_types_description"
3016
  msgid "Copied from previous filter/plugin"
3017
  msgstr ""
3018
 
3019
+ #: includes/class-mla-mime-types.php:1197
3020
+ #: includes/class-mla-mime-types.php:1314
3021
  msgid "Ignoring specification for Post MIME Type; using slug"
3022
  msgstr ""
3023
 
3024
+ #: includes/class-mla-mime-types.php:1203
3025
+ #: includes/class-mla-mime-types.php:2283
3026
  #, php-format
3027
  msgid "<br>Changing %1$s \"%2$s\" to valid value \"%3$s\""
3028
  msgstr ""
3029
 
3030
+ #: includes/class-mla-mime-types.php:1203
3031
+ #: includes/class-mla-mime-types.php:1291
3032
+ #: includes/class-mla-mime-types.php:1302
3033
+ #: includes/class-mla-settings-view-tab.php:115
3034
+ #: includes/class-mla-settings-view-tab.php:378
3035
  msgid "Slug"
3036
  msgstr ""
3037
 
3038
+ #: includes/class-mla-mime-types.php:1211
3039
+ #: includes/class-mla-mime-types.php:1299
3040
  #, php-format
3041
  msgid "%1$s: Could not add Slug \"%2$s\"; value already exists"
3042
  msgstr ""
3043
 
3044
+ #: includes/class-mla-mime-types.php:1246
3045
  #, php-format
3046
  msgid "Edit view \"%1$s\"; added"
3047
  msgstr ""
3048
 
3049
+ #: includes/class-mla-mime-types.php:1291
3050
+ #: includes/class-mla-mime-types.php:2405
3051
  #, php-format
3052
  msgid "<br>Changing new %1$s \"%2$s\" to valid value \"%3$s\""
3053
  msgstr ""
3054
 
3055
+ #: includes/class-mla-mime-types.php:1344
3056
  #, php-format
3057
  msgid "Edit view \"%1$s\"; no changes detected"
3058
  msgstr ""
3059
 
3060
+ #: includes/class-mla-mime-types.php:1358
3061
  #, php-format
3062
  msgid "Edit view \"%1$s\"; updated"
3063
  msgstr ""
3064
 
3065
+ #: includes/class-mla-mime-types.php:1431
3066
  #, php-format
3067
  msgid "View \"%1$s\" reverted to standard"
3068
  msgstr ""
3069
 
3070
+ #: includes/class-mla-mime-types.php:1437
3071
  #, php-format
3072
  msgid "View \"%1$s\" deleted"
3073
  msgstr ""
3074
 
3075
+ #: includes/class-mla-mime-types.php:1445
3076
  #, php-format
3077
  msgid "%1$s: Did not find view \"%2$s\""
3078
  msgstr ""
3079
 
3080
+ #: includes/class-mla-mime-types.php:1702
3081
+ #: includes/class-mla-settings-documentation-tab.php:1553
3082
  msgctxt "table_view_singular"
3083
  msgid "Active"
3084
  msgstr ""
3085
 
3086
+ #: includes/class-mla-mime-types.php:1703
3087
+ #: includes/class-mla-settings-documentation-tab.php:1554
3088
  msgctxt "table_view_plural"
3089
  msgid "Active"
3090
  msgstr ""
3091
 
3092
+ #: includes/class-mla-mime-types.php:1706
3093
+ #: includes/class-mla-settings-documentation-tab.php:1557
3094
  msgctxt "table_view_singular"
3095
  msgid "Inactive"
3096
  msgstr ""
3097
 
3098
+ #: includes/class-mla-mime-types.php:1707
3099
+ #: includes/class-mla-settings-documentation-tab.php:1558
3100
  msgctxt "table_view_plural"
3101
  msgid "Inactive"
3102
  msgstr ""
3103
 
3104
+ #: includes/class-mla-mime-types.php:1710
3105
  msgctxt "table_view_singular"
3106
  msgid "WordPress"
3107
  msgstr ""
3108
 
3109
+ #: includes/class-mla-mime-types.php:1711
3110
  msgctxt "table_view_plural"
3111
  msgid "WordPress"
3112
  msgstr ""
3113
 
3114
+ #: includes/class-mla-mime-types.php:1714
3115
  msgctxt "table_view_singular"
3116
  msgid "MLA"
3117
  msgstr ""
3118
 
3119
+ #: includes/class-mla-mime-types.php:1715
3120
  msgctxt "table_view_plural"
3121
  msgid "MLA"
3122
  msgstr ""
3123
 
3124
+ #: includes/class-mla-mime-types.php:1718
3125
+ #: includes/class-mla-settings-iptc-exif-tab.php:2778
3126
  msgctxt "table_view_singular"
3127
  msgid "Custom"
3128
  msgstr ""
3129
 
3130
+ #: includes/class-mla-mime-types.php:1719
3131
+ #: includes/class-mla-settings-iptc-exif-tab.php:2779
3132
  msgctxt "table_view_plural"
3133
  msgid "Custom"
3134
  msgstr ""
3135
 
3136
+ #: includes/class-mla-mime-types.php:1974
3137
  msgid "icon"
3138
  msgstr ""
3139
 
3140
+ #: includes/class-mla-mime-types.php:2267
3141
+ #: includes/class-mla-mime-types.php:2366
3142
  msgid "Cannot load Upload MIME Types"
3143
  msgstr ""
3144
 
3145
+ #: includes/class-mla-mime-types.php:2278
3146
  msgid "Extension is required"
3147
  msgstr ""
3148
 
3149
+ #: includes/class-mla-mime-types.php:2283
3150
+ #: includes/class-mla-mime-types.php:2405
3151
+ #: includes/class-mla-mime-types.php:2414
3152
+ #: includes/class-mla-settings-upload-tab.php:190
3153
+ #: includes/class-mla-settings-upload-tab.php:535
3154
  msgid "Extension"
3155
  msgstr ""
3156
 
3157
+ #: includes/class-mla-mime-types.php:2291
3158
  #, php-format
3159
  msgid "%1$s: Could not add extension \"%2$s\"; value already exists"
3160
  msgstr ""
3161
 
3162
+ #: includes/class-mla-mime-types.php:2299
3163
  msgid "MIME type is required"
3164
  msgstr ""
3165
 
3166
+ #: includes/class-mla-mime-types.php:2304
3167
+ #: includes/class-mla-mime-types.php:2446
3168
  #, php-format
3169
  msgid "%1$s: Bad MIME type; try \"%2$s\""
3170
  msgstr ""
3171
 
3172
+ #: includes/class-mla-mime-types.php:2341
3173
  #, php-format
3174
  msgid "Upload MIME Type \"%1$s\"; added"
3175
  msgstr ""
3176
 
3177
+ #: includes/class-mla-mime-types.php:2347
3178
+ #: includes/class-mla-mime-types.php:2527
3179
+ #: includes/class-mla-mime-types.php:2606
3180
  msgid "Cannot update Upload MIME Types"
3181
  msgstr ""
3182
 
3183
+ #: includes/class-mla-mime-types.php:2411
3184
  #, php-format
3185
  msgid "%1$s: Could not add new extension \"%2$s\"; value already exists"
3186
  msgstr ""
3187
 
3188
+ #: includes/class-mla-mime-types.php:2507
3189
  #, php-format
3190
  msgid "Edit type \"%1$s\"; no changes detected"
3191
  msgstr ""
3192
 
3193
+ #: includes/class-mla-mime-types.php:2521
3194
  #, php-format
3195
  msgid "Edit type \"%1$s\"; updated"
3196
  msgstr ""
3197
 
3198
+ #: includes/class-mla-mime-types.php:2594
3199
  #, php-format
3200
  msgid "Upload MIME Type \"%1$s\"; reverted to standard"
3201
  msgstr ""
3202
 
3203
+ #: includes/class-mla-mime-types.php:2600
3204
  #, php-format
3205
  msgid "Upload MIME Type \"%1$s\"; deleted"
3206
  msgstr ""
3207
 
3208
+ #: includes/class-mla-mime-types.php:2615
3209
  #, php-format
3210
  msgid "%1$s: Did not find Upload type \"%2$s\""
3211
  msgstr ""
3422
  msgstr ""
3423
 
3424
  #: includes/class-mla-options.php:469
3425
+ #: includes/class-mla-settings-custom-fields-tab.php:468
3426
+ #: includes/class-mla-settings-custom-fields-tab.php:782
3427
+ #: includes/class-mla-settings-iptc-exif-tab.php:483
3428
+ #: includes/class-mla-settings-iptc-exif-tab.php:883
3429
+ #: includes/class-mla-settings-shortcodes-tab.php:424
3430
+ #: includes/class-mla-settings-shortcodes-tab.php:495
3431
  #: includes/mla-main-search-box-template.php:49
3432
  #: includes/mla-media-modal-js-template.php:61
3433
  msgid "Name"
3445
  msgid "Terms"
3446
  msgstr ""
3447
 
3448
+ #: includes/class-mla-options.php:1001 includes/class-mla-options.php:1047
3449
+ #: includes/class-mla-options.php:1881 includes/class-mla-options.php:1912
3450
+ #: includes/class-mla-options.php:1917
3451
+ #: includes/class-mla-settings-upload-tab.php:126
3452
  msgid "None (select a value)"
3453
  msgstr ""
3454
 
3455
+ #: includes/class-mla-options.php:1054
3456
  msgid "Metadata (see below)"
3457
  msgstr ""
3458
 
3459
+ #: includes/class-mla-options.php:1061
3460
  msgid "Template (see below)"
3461
  msgstr ""
3462
 
3463
+ #: includes/class-mla-options.php:1133 includes/class-mla-options.php:2199
3464
  #, php-format
3465
  msgid "%1$s: New field %2$s already exists."
3466
  msgstr ""
3467
 
3468
+ #: includes/class-mla-options.php:1138 includes/class-mla-options.php:2204
3469
  #, php-format
3470
  msgid "Adding new field %1$s."
3471
  msgstr ""
3472
 
3473
+ #: includes/class-mla-options.php:1146 includes/class-mla-options.php:2212
3474
  #, php-format
3475
  msgid "Adding new rule for %1$s."
3476
  msgstr ""
3477
 
3478
+ #: includes/class-mla-options.php:1172 includes/class-mla-options.php:2069
3479
+ #: includes/class-mla-options.php:2238
3480
  #, php-format
3481
  msgid "Deleting rule for %1$s."
3482
  msgstr ""
3483
 
3484
+ #: includes/class-mla-options.php:1195 includes/class-mla-options.php:1216
3485
+ #: includes/class-mla-options.php:1266 includes/class-mla-options.php:1273
3486
+ #: includes/class-mla-options.php:1985 includes/class-mla-options.php:1992
3487
+ #: includes/class-mla-options.php:1999 includes/class-mla-options.php:2094
3488
+ #: includes/class-mla-options.php:2101 includes/class-mla-options.php:2136
3489
+ #: includes/class-mla-options.php:2143 includes/class-mla-options.php:2248
3490
+ #: includes/class-mla-options.php:2255 includes/class-mla-options.php:2290
3491
+ #: includes/class-mla-options.php:2297
3492
  #, php-format
3493
  msgid "%1$s changing %2$s from %3$s to %4$s."
3494
  msgstr ""
3495
 
3496
+ #: includes/class-mla-options.php:1195
3497
+ #: includes/class-mla-settings-custom-fields-tab.php:476
3498
+ #: includes/class-mla-settings-custom-fields-tab.php:786
3499
  msgid "Data Source"
3500
  msgstr ""
3501
 
3502
+ #: includes/class-mla-options.php:1201 includes/class-mla-options.php:2019
3503
+ #: includes/class-mla-options.php:2121 includes/class-mla-options.php:2275
3504
  msgid "Replace to Keep"
3505
  msgstr ""
3506
 
3507
+ #: includes/class-mla-options.php:1204 includes/class-mla-options.php:2022
3508
+ #: includes/class-mla-options.php:2124 includes/class-mla-options.php:2278
3509
  msgid "Keep to Replace"
3510
  msgstr ""
3511
 
3512
+ #: includes/class-mla-options.php:1209 includes/class-mla-options.php:1230
3513
+ #: includes/class-mla-options.php:1244 includes/class-mla-options.php:1258
3514
+ #: includes/class-mla-options.php:1287 includes/class-mla-options.php:2013
3515
+ #: includes/class-mla-options.php:2027 includes/class-mla-options.php:2115
3516
+ #: includes/class-mla-options.php:2129 includes/class-mla-options.php:2269
3517
+ #: includes/class-mla-options.php:2283 includes/class-mla-options.php:2311
3518
  #, php-format
3519
  msgid "%1$s changing %2$s value from %3$s."
3520
  msgstr ""
3521
 
3522
+ #: includes/class-mla-options.php:1209 includes/class-mla-options.php:2027
3523
+ #: includes/class-mla-options.php:2129 includes/class-mla-options.php:2283
3524
+ #: includes/class-mla-settings-custom-fields-tab.php:490
3525
+ #: includes/class-mla-settings-custom-fields-tab.php:800
3526
+ #: includes/class-mla-settings-iptc-exif-tab.php:502
3527
+ #: includes/class-mla-settings-iptc-exif-tab.php:898
3528
  msgid "Existing Text"
3529
  msgstr ""
3530
 
3531
+ #: includes/class-mla-options.php:1216 includes/class-mla-options.php:2290
3532
+ #: includes/class-mla-settings-custom-fields-tab.php:495
3533
+ #: includes/class-mla-settings-custom-fields-tab.php:805
3534
+ #: includes/class-mla-settings-iptc-exif-tab.php:517
3535
+ #: includes/class-mla-settings-iptc-exif-tab.php:906
3536
  msgid "Format"
3537
  msgstr ""
3538
 
3539
+ #: includes/class-mla-options.php:1222 includes/class-mla-options.php:1236
3540
+ #: includes/class-mla-options.php:1250 includes/class-mla-options.php:1279
3541
+ #: includes/class-mla-options.php:2303
3542
  msgid "unchecked to checked"
3543
  msgstr ""
3544
 
3545
+ #: includes/class-mla-options.php:1225 includes/class-mla-options.php:1239
3546
+ #: includes/class-mla-options.php:1253 includes/class-mla-options.php:1282
3547
+ #: includes/class-mla-options.php:2306
3548
  msgid "checked to unchecked"
3549
  msgstr ""
3550
 
3551
+ #: includes/class-mla-options.php:1230
3552
+ #: includes/class-mla-settings-custom-fields-tab.php:482
3553
+ #: includes/class-mla-settings-custom-fields-tab.php:792
3554
+ #: includes/class-mla-settings-custom-fields-tab.php:1490
3555
  msgid "MLA Column"
3556
  msgstr ""
3557
 
3558
+ #: includes/class-mla-options.php:1266
3559
  msgid "Metavalue name"
3560
  msgstr ""
3561
 
3562
+ #: includes/class-mla-options.php:1273 includes/class-mla-options.php:2297
3563
+ #: includes/class-mla-settings-custom-fields-tab.php:502
3564
+ #: includes/class-mla-settings-custom-fields-tab.php:812
3565
+ #: includes/class-mla-settings-iptc-exif-tab.php:524
3566
+ #: includes/class-mla-settings-iptc-exif-tab.php:913
3567
  msgid "Option"
3568
  msgstr ""
3569
 
3570
+ #: includes/class-mla-options.php:1287 includes/class-mla-options.php:2311
3571
+ #: includes/class-mla-settings-iptc-exif-tab.php:536
3572
  msgid "Delete NULL values"
3573
  msgstr ""
3574
 
3575
+ #: includes/class-mla-options.php:1973
3576
  #, php-format
3577
  msgid "%1$s: No old values for %2$s."
3578
  msgstr ""
3579
 
3580
+ #: includes/class-mla-options.php:1985
3581
  msgid "Field Title"
3582
  msgstr ""
3583
 
3584
+ #: includes/class-mla-options.php:1992 includes/class-mla-options.php:2094
3585
+ #: includes/class-mla-options.php:2248
3586
+ #: includes/class-mla-settings-iptc-exif-tab.php:491
3587
+ #: includes/class-mla-settings-iptc-exif-tab.php:887
3588
  msgid "IPTC Value"
3589
  msgstr ""
3590
 
3591
+ #: includes/class-mla-options.php:1999 includes/class-mla-options.php:2101
3592
+ #: includes/class-mla-options.php:2255
3593
  msgid "EXIF Value"
3594
  msgstr ""
3595
 
3596
+ #: includes/class-mla-options.php:2005 includes/class-mla-options.php:2107
3597
+ #: includes/class-mla-options.php:2261
3598
  msgid "EXIF to IPTC"
3599
  msgstr ""
3600
 
3601
+ #: includes/class-mla-options.php:2008 includes/class-mla-options.php:2110
3602
+ #: includes/class-mla-options.php:2264
3603
  msgid "IPTC to EXIF"
3604
  msgstr ""
3605
 
3606
+ #: includes/class-mla-options.php:2013 includes/class-mla-options.php:2115
3607
+ #: includes/class-mla-options.php:2269
3608
+ #: includes/class-mla-settings-iptc-exif-tab.php:497
3609
+ #: includes/class-mla-settings-iptc-exif-tab.php:893
3610
  msgid "Priority"
3611
  msgstr ""
3612
 
3613
+ #: includes/class-mla-options.php:2136
3614
  msgid "Delimiter(s)"
3615
  msgstr ""
3616
 
3618
  msgid "ERROR: No post ID found"
3619
  msgstr ""
3620
 
3621
+ #: includes/class-mla-polylang-support.php:373
3622
  msgid "Error while saving the translations."
3623
  msgstr ""
3624
 
3625
+ #: includes/class-mla-polylang-support.php:374
3626
  msgid "Remove From Bulk Translate"
3627
  msgstr ""
3628
 
3629
+ #: includes/class-mla-polylang-support.php:376
3630
  msgid "Bulk Translate items"
3631
  msgstr ""
3632
 
3633
+ #: includes/class-mla-polylang-support.php:377
3634
  msgid "Add new"
3635
  msgstr ""
3636
 
3637
+ #: includes/class-mla-polylang-support.php:1921
3638
+ #: includes/class-mla-polylang-support.php:2286
3639
  msgid "Bulk Translations"
3640
  msgstr ""
3641
 
3642
+ #: includes/class-mla-polylang-support.php:1945
3643
  msgid "Translate"
3644
  msgstr ""
3645
 
3646
+ #: includes/class-mla-polylang-support.php:2073
3647
  msgid "All Languages"
3648
  msgstr ""
3649
 
3650
+ #: includes/class-mla-polylang-support.php:2080
3651
+ #: includes/class-mla-polylang-support.php:2351
3652
+ #: includes/class-mla-polylang-support.php:2511
3653
  msgid "Quick Translate"
3654
  msgstr ""
3655
 
3656
+ #: includes/class-mla-polylang-support.php:2084
3657
  msgid "Set Language"
3658
  msgstr ""
3659
 
3660
+ #: includes/class-mla-polylang-support.php:2085
3661
+ #: includes/class-mla-polylang-support.php:2518
3662
  msgid "Bulk Translate"
3663
  msgstr ""
3664
 
3665
+ #: includes/class-mla-polylang-support.php:2086
3666
  msgid "Add or Modify Translation"
3667
  msgstr ""
3668
 
3669
+ #: includes/class-mla-polylang-support.php:2087
3670
+ #: includes/class-mla-polylang-support.php:2142
3671
+ #: includes/class-mla-polylang-support.php:2455
3672
+ #: includes/class-mla-polylang-support.php:2570
3673
+ #: includes/class-mla-wpml-support.php:1617
3674
+ #: includes/class-mla-wpml-support.php:1707
3675
+ #: includes/class-mla-wpml-support.php:2192
3676
  msgid "Language"
3677
  msgstr ""
3678
 
3679
+ #: includes/class-mla-polylang-support.php:2089
3680
+ #: includes/class-mla-thumbnail-generation.php:673
3681
  msgid "Options"
3682
  msgstr ""
3683
 
3684
+ #: includes/class-mla-polylang-support.php:2351
3685
  msgid "Translate this item inline"
3686
  msgstr ""
3687
 
3688
+ #: includes/class-mla-polylang-support.php:2492
3689
+ #: includes/class-mla-polylang-support.php:2597
3690
+ #: includes/class-mla-wpml-support.php:1652
3691
+ #: includes/class-mla-wpml-support.php:1755
3692
  msgid "Media/Assistant submenu table"
3693
  msgstr ""
3694
 
3695
+ #: includes/class-mla-polylang-support.php:2497
3696
+ #: includes/class-mla-wpml-support.php:1657
3697
  msgid "Language Column"
3698
  msgstr ""
3699
 
3700
+ #: includes/class-mla-polylang-support.php:2500
3701
+ #: includes/class-mla-wpml-support.php:1660
3702
  msgid ""
3703
  "Check this option to add a Language column to the Media/Assistant submenu "
3704
  "table."
3705
  msgstr ""
3706
 
3707
+ #: includes/class-mla-polylang-support.php:2504
3708
+ #: includes/class-mla-wpml-support.php:1664
3709
  msgid "Translations Column"
3710
  msgstr ""
3711
 
3712
+ #: includes/class-mla-polylang-support.php:2507
3713
+ #: includes/class-mla-wpml-support.php:1667
3714
  msgid ""
3715
  "Check this option to add a Translation Status column to the Media/Assistant "
3716
  "submenu table."
3717
  msgstr ""
3718
 
3719
+ #: includes/class-mla-polylang-support.php:2514
3720
  msgid ""
3721
  "Check this option to add a Quick Translate rollover action to the Media/"
3722
  "Assistant submenu table."
3723
  msgstr ""
3724
 
3725
+ #: includes/class-mla-polylang-support.php:2521
3726
  msgid ""
3727
  "Check this option to add \"Translate\" to the \"Bulk Actions\" control on "
3728
  "the Media/Assistant submenu table."
3729
  msgstr ""
3730
 
3731
+ #: includes/class-mla-polylang-support.php:2525
3732
+ #: includes/class-mla-polylang-support.php:2597
3733
+ #: includes/class-mla-wpml-support.php:1671
3734
+ #: includes/class-mla-wpml-support.php:1755
3735
  msgid "Term Management"
3736
  msgstr ""
3737
 
3738
+ #: includes/class-mla-polylang-support.php:2530
3739
+ #: includes/class-mla-wpml-support.php:1676
3740
  msgid "Term Assignment"
3741
  msgstr ""
3742
 
3743
+ #: includes/class-mla-polylang-support.php:2533
3744
+ #: includes/class-mla-wpml-support.php:1679
3745
  msgid ""
3746
  "Check this option to assign language-specific terms when items are updated."
3747
  msgstr ""
3748
 
3749
+ #: includes/class-mla-polylang-support.php:2537
3750
+ #: includes/class-mla-wpml-support.php:1683
3751
  msgid "Term Synchronization"
3752
  msgstr ""
3753
 
3754
+ #: includes/class-mla-polylang-support.php:2540
3755
+ #: includes/class-mla-wpml-support.php:1686
3756
  msgid ""
3757
  "Check this option to synchronize common terms among all item translations."
3758
  msgstr ""
3759
 
3760
+ #: includes/class-mla-polylang-support.php:2544
3761
+ #: includes/class-mla-wpml-support.php:1690
3762
  msgid "Term Mapping Replication"
3763
  msgstr ""
3764
 
3765
+ #: includes/class-mla-polylang-support.php:2547
3766
+ #: includes/class-mla-wpml-support.php:1693
3767
  msgid ""
3768
  "When mapping IPTC/EXIF metadata to taxonomy terms, make them available in "
3769
  "all languages."
3770
  msgstr ""
3771
 
3772
+ #: includes/class-mla-polylang-support.php:2595
3773
+ #: includes/class-mla-wpml-support.php:1753
3774
  msgid "Language Options"
3775
  msgstr ""
3776
 
3777
+ #: includes/class-mla-polylang-support.php:2597
3778
  #, php-format
3779
  msgid ""
3780
  "In this tab you can find a number of options for controlling Polylang-"
3783
  "make."
3784
  msgstr ""
3785
 
3786
+ #: includes/class-mla-polylang-support.php:2599
3787
+ #: includes/class-mla-wpml-support.php:1757
3788
  #, php-format
3789
  msgid ""
3790
  "You can find more information about multilingual features in the %1$s "
3791
  "section of the Documentation."
3792
  msgstr ""
3793
 
3794
+ #: includes/class-mla-polylang-support.php:2599
3795
+ #: includes/class-mla-wpml-support.php:1757
3796
  msgid "Language Options documentation"
3797
  msgstr ""
3798
 
3799
+ #: includes/class-mla-polylang-support.php:2599
3800
+ #: includes/class-mla-wpml-support.php:1757
3801
  msgid "WPML &amp; Polylang Multilingual Support; the MLA Language Tab"
3802
  msgstr ""
3803
 
3804
+ #: includes/class-mla-polylang-support.php:2602
3805
+ #: includes/class-mla-settings-custom-fields-tab.php:678
3806
+ #: includes/class-mla-settings-custom-fields-tab.php:779
3807
+ #: includes/class-mla-settings-iptc-exif-tab.php:780
3808
+ #: includes/class-mla-settings-iptc-exif-tab.php:878
3809
+ #: includes/class-mla-settings-shortcodes-tab.php:735
3810
+ #: includes/class-mla-settings-upload-tab.php:485
3811
+ #: includes/class-mla-settings-upload-tab.php:531
3812
+ #: includes/class-mla-settings-view-tab.php:329
3813
+ #: includes/class-mla-settings-view-tab.php:375
3814
+ #: includes/class-mla-settings.php:1061 includes/class-mla-settings.php:1430
3815
+ #: includes/class-mla-settings.php:1432
3816
+ #: includes/class-mla-wpml-support.php:1760
3817
  msgid "Save Changes"
3818
  msgstr ""
3819
 
3820
+ #: includes/class-mla-polylang-support.php:2603
3821
+ #: includes/class-mla-wpml-support.php:1761
3822
  msgid "Delete Language options and restore default settings"
3823
  msgstr ""
3824
 
3825
+ #: includes/class-mla-polylang-support.php:2606
3826
+ #: includes/class-mla-settings.php:799 includes/class-mla-settings.php:1066
3827
+ #: includes/class-mla-wpml-support.php:1764
3828
  msgid "Go to Top"
3829
  msgstr ""
3830
 
3831
+ #: includes/class-mla-polylang-support.php:2643
3832
+ #: includes/class-mla-wpml-support.php:1801
3833
  msgid "Language settings saved."
3834
  msgstr ""
3835
 
3836
+ #: includes/class-mla-polylang-support.php:2674
3837
+ #: includes/class-mla-settings.php:1643
3838
+ #: includes/class-mla-wpml-support.php:1832
3839
  #, php-format
3840
  msgctxt "message_list"
3841
  msgid "delete_option \"%1$s\""
3842
  msgstr ""
3843
 
3844
+ #: includes/class-mla-polylang-support.php:2682
3845
+ #: includes/class-mla-wpml-support.php:1840
3846
  msgid "Language settings reset to default values."
3847
  msgstr ""
3848
 
3849
+ #: includes/class-mla-settings-custom-fields-tab.php:54
3850
+ #: includes/class-mla-settings-custom-fields-tab.php:87
3851
  #: includes/class-mla-settings-iptc-exif-tab.php:54
3852
  #: includes/class-mla-settings-iptc-exif-tab.php:87
3853
+ #: includes/class-mla-settings-upload-tab.php:43
3854
+ #: includes/class-mla-settings-view-tab.php:43
3855
  msgid "Error while making the changes."
3856
  msgstr ""
3857
 
3858
+ #: includes/class-mla-settings-custom-fields-tab.php:56
3859
+ #: includes/class-mla-settings-custom-fields-tab.php:89
3860
  #: includes/class-mla-settings-iptc-exif-tab.php:56
3861
  #: includes/class-mla-settings-iptc-exif-tab.php:89
3862
+ #: includes/class-mla-settings-upload-tab.php:45
3863
+ #: includes/class-mla-settings-view-tab.php:45
3864
  msgid "no slug"
3865
  msgstr ""
3866
 
3867
+ #: includes/class-mla-settings-custom-fields-tab.php:62
3868
  #: includes/class-mla-settings-iptc-exif-tab.php:62
3869
  msgid "Running"
3870
  msgstr ""
3871
 
3872
+ #: includes/class-mla-settings-custom-fields-tab.php:67
3873
  #: includes/class-mla-settings-iptc-exif-tab.php:67
3874
  msgid "Skipped"
3875
  msgstr ""
3876
 
3877
+ #: includes/class-mla-settings-custom-fields-tab.php:68
3878
  #: includes/class-mla-settings-iptc-exif-tab.php:68
3879
  msgid "Reprocessed"
3880
  msgstr ""
3881
 
3882
+ #: includes/class-mla-settings-custom-fields-tab.php:69
3883
  #: includes/class-mla-settings-iptc-exif-tab.php:69
3884
  msgid "PAUSED"
3885
  msgstr ""
3886
 
3887
+ #: includes/class-mla-settings-custom-fields-tab.php:138
3888
  msgid "Custom field mapping settings updated."
3889
  msgstr ""
3890
 
3891
+ #: includes/class-mla-settings-custom-fields-tab.php:140
3892
  msgid "Custom field no mapping changes detected."
3893
  msgstr ""
3894
 
3895
+ #: includes/class-mla-settings-custom-fields-tab.php:169
3896
  #: includes/class-mla-settings-iptc-exif-tab.php:171
3897
  msgid "No custom field mapping rules to process."
3898
  msgstr ""
3899
 
3900
+ #: includes/class-mla-settings-custom-fields-tab.php:202
3901
  #: includes/class-mla-settings-iptc-exif-tab.php:205
3902
  #, php-format
3903
  msgid "%1$s mapping completed; %2$d attachment(s) examined, %3$d updated."
3904
  msgstr ""
3905
 
3906
+ #: includes/class-mla-settings-custom-fields-tab.php:202
3907
+ #: includes/class-mla-settings-custom-fields-tab.php:205
3908
  #: includes/class-mla-settings-iptc-exif-tab.php:205
3909
  #: includes/class-mla-settings-iptc-exif-tab.php:208
3910
  msgid "Custom field"
3911
  msgstr ""
3912
 
3913
+ #: includes/class-mla-settings-custom-fields-tab.php:205
3914
  #: includes/class-mla-settings-iptc-exif-tab.php:208
3915
  #, php-format
3916
  msgid ""
3917
  "%1$s mapping completed; %2$d attachment(s) examined, no changes detected."
3918
  msgstr ""
3919
 
3920
+ #: includes/class-mla-settings-custom-fields-tab.php:251
3921
+ #: includes/class-mla-settings-iptc-exif-tab.php:257
3922
  msgid ": No custom field name selected/entered"
3923
  msgstr ""
3924
 
3925
+ #: includes/class-mla-settings-custom-fields-tab.php:255
3926
+ #: includes/class-mla-settings-custom-fields-tab.php:320
3927
+ #: includes/class-mla-settings-iptc-exif-tab.php:261
3928
+ #: includes/class-mla-settings-iptc-exif-tab.php:328
3929
  msgid ": Rule already exists for the new name"
3930
  msgstr ""
3931
 
3932
+ #: includes/class-mla-settings-custom-fields-tab.php:272
3933
+ #: includes/class-mla-settings-iptc-exif-tab.php:277
3934
  msgid "Rule added"
3935
  msgstr ""
3936
 
3937
+ #: includes/class-mla-settings-custom-fields-tab.php:275
3938
+ #: includes/class-mla-settings-iptc-exif-tab.php:280
3939
  msgid ": Rule addition failed"
3940
  msgstr ""
3941
 
3942
+ #: includes/class-mla-settings-custom-fields-tab.php:324
3943
+ #: includes/class-mla-settings-iptc-exif-tab.php:332
3944
  msgid ": Invalid rule name must be changed"
3945
  msgstr ""
3946
 
3947
+ #: includes/class-mla-settings-custom-fields-tab.php:346
3948
+ #: includes/class-mla-settings-custom-fields-tab.php:438
3949
+ #: includes/class-mla-settings-custom-fields-tab.php:990
3950
+ #: includes/class-mla-settings-iptc-exif-tab.php:355
3951
+ #: includes/class-mla-settings-iptc-exif-tab.php:360
3952
+ #: includes/class-mla-settings-iptc-exif-tab.php:450
3953
+ #: includes/class-mla-settings-iptc-exif-tab.php:1083
3954
  msgid ": Rule update failed"
3955
  msgstr ""
3956
 
3957
+ #: includes/class-mla-settings-custom-fields-tab.php:351
3958
+ #: includes/class-mla-settings-custom-fields-tab.php:441
3959
+ #: includes/class-mla-settings-iptc-exif-tab.php:365
3960
+ #: includes/class-mla-settings-iptc-exif-tab.php:453
3961
  msgid "Rule updated"
3962
  msgstr ""
3963
 
3964
+ #: includes/class-mla-settings-custom-fields-tab.php:375
3965
+ #: includes/class-mla-settings-iptc-exif-tab.php:389
3966
  #, php-format
3967
  msgid "Custom Field Rule \"%1$s\" deleted."
3968
  msgstr ""
3969
 
3970
+ #: includes/class-mla-settings-custom-fields-tab.php:462
3971
+ #: includes/class-mla-settings-iptc-exif-tab.php:474
3972
  msgid "Edit Rule"
3973
  msgstr ""
3974
 
3975
+ #: includes/class-mla-settings-custom-fields-tab.php:471
3976
+ #: includes/class-mla-settings-iptc-exif-tab.php:486
3977
  msgid ""
3978
  "This is the name of the custom field to which the rule applies.<br>Only one "
3979
  "rule is allowed for each custom field."
3980
  msgstr ""
3981
 
3982
+ #: includes/class-mla-settings-custom-fields-tab.php:472
3983
+ #: includes/class-mla-settings-iptc-exif-tab.php:487
3984
  msgid "Change Name"
3985
  msgstr ""
3986
 
3987
+ #: includes/class-mla-settings-custom-fields-tab.php:473
3988
+ #: includes/class-mla-settings-iptc-exif-tab.php:488
3989
  msgid "Cancel Name Change"
3990
  msgstr ""
3991
 
3992
+ #: includes/class-mla-settings-custom-fields-tab.php:474
3993
+ #: includes/class-mla-settings-custom-fields-tab.php:784
3994
+ #: includes/class-mla-settings-iptc-exif-tab.php:489
3995
+ #: includes/class-mla-settings-iptc-exif-tab.php:885
3996
  msgid "Enter new field"
3997
  msgstr ""
3998
 
3999
+ #: includes/class-mla-settings-custom-fields-tab.php:475
4000
+ #: includes/class-mla-settings-custom-fields-tab.php:785
4001
+ #: includes/class-mla-settings-iptc-exif-tab.php:490
4002
+ #: includes/class-mla-settings-iptc-exif-tab.php:886
4003
  msgid "Cancel new field"
4004
  msgstr ""
4005
 
4006
+ #: includes/class-mla-settings-custom-fields-tab.php:478
4007
+ #: includes/class-mla-settings-custom-fields-tab.php:788
4008
  msgid "Meta/Template"
4009
  msgstr ""
4010
 
4011
+ #: includes/class-mla-settings-custom-fields-tab.php:480
4012
+ #: includes/class-mla-settings-custom-fields-tab.php:790
4013
  msgid "WordPress attachment metadata element or Content Template"
4014
  msgstr ""
4015
 
4016
+ #: includes/class-mla-settings-custom-fields-tab.php:483
4017
+ #: includes/class-mla-settings-custom-fields-tab.php:793
4018
  msgid "Display as Media/Assistant column"
4019
  msgstr ""
4020
 
4021
+ #: includes/class-mla-settings-custom-fields-tab.php:486
4022
+ #: includes/class-mla-settings-custom-fields-tab.php:796
4023
  msgid "Add to Media/Assistant Quick Edit area"
4024
  msgstr ""
4025
 
4026
+ #: includes/class-mla-settings-custom-fields-tab.php:489
4027
+ #: includes/class-mla-settings-custom-fields-tab.php:799
4028
  msgid "Add to Media/Assistant Bulk Edit area"
4029
  msgstr ""
4030
 
4031
+ #: includes/class-mla-settings-custom-fields-tab.php:492
4032
+ #: includes/class-mla-settings-custom-fields-tab.php:802
4033
+ #: includes/class-mla-settings-custom-fields-tab.php:1536
4034
+ #: includes/class-mla-settings-iptc-exif-tab.php:504
4035
+ #: includes/class-mla-settings-iptc-exif-tab.php:900
4036
+ #: includes/class-mla-settings-iptc-exif-tab.php:1619
4037
+ #: includes/class-mla-settings-iptc-exif-tab.php:2460
4038
+ #: includes/class-mla-thumbnail-generation.php:667
4039
  msgid "Keep"
4040
  msgstr ""
4041
 
4042
+ #: includes/class-mla-settings-custom-fields-tab.php:497
4043
+ #: includes/class-mla-settings-custom-fields-tab.php:807
4044
+ #: includes/class-mla-settings-iptc-exif-tab.php:519
4045
+ #: includes/class-mla-settings-iptc-exif-tab.php:908
4046
  msgid "Native"
4047
  msgstr ""
4048
 
4049
+ #: includes/class-mla-settings-custom-fields-tab.php:499
4050
+ #: includes/class-mla-settings-custom-fields-tab.php:809
4051
+ #: includes/class-mla-settings-iptc-exif-tab.php:521
4052
+ #: includes/class-mla-settings-iptc-exif-tab.php:910
4053
  msgid "Commas"
4054
  msgstr ""
4055
 
4056
+ #: includes/class-mla-settings-custom-fields-tab.php:501
4057
+ #: includes/class-mla-settings-custom-fields-tab.php:811
4058
+ #: includes/class-mla-settings-iptc-exif-tab.php:523
4059
+ #: includes/class-mla-settings-iptc-exif-tab.php:912
4060
  msgid "Raw"
4061
  msgstr ""
4062
 
4063
+ #: includes/class-mla-settings-custom-fields-tab.php:504
4064
+ #: includes/class-mla-settings-custom-fields-tab.php:814
4065
+ #: includes/class-mla-settings-iptc-exif-tab.php:526
4066
+ #: includes/class-mla-settings-iptc-exif-tab.php:915
4067
  msgid "Text"
4068
  msgstr ""
4069
 
4070
+ #: includes/class-mla-settings-custom-fields-tab.php:506
4071
+ #: includes/class-mla-settings-custom-fields-tab.php:816
4072
+ #: includes/class-mla-settings-iptc-exif-tab.php:528
4073
+ #: includes/class-mla-settings-iptc-exif-tab.php:917
4074
  msgid "Single"
4075
  msgstr ""
4076
 
4077
+ #: includes/class-mla-settings-custom-fields-tab.php:508
4078
+ #: includes/class-mla-settings-custom-fields-tab.php:818
4079
+ #: includes/class-mla-settings-iptc-exif-tab.php:530
4080
+ #: includes/class-mla-settings-iptc-exif-tab.php:919
4081
  msgid "Export"
4082
  msgstr ""
4083
 
4084
+ #: includes/class-mla-settings-custom-fields-tab.php:510
4085
+ #: includes/class-mla-settings-custom-fields-tab.php:820
4086
+ #: includes/class-mla-settings-iptc-exif-tab.php:532
4087
+ #: includes/class-mla-settings-iptc-exif-tab.php:921
4088
  msgid "Array"
4089
  msgstr ""
4090
 
4091
+ #: includes/class-mla-settings-custom-fields-tab.php:512
4092
+ #: includes/class-mla-settings-custom-fields-tab.php:822
4093
+ #: includes/class-mla-settings-iptc-exif-tab.php:534
4094
+ #: includes/class-mla-settings-iptc-exif-tab.php:923
4095
  msgid "Multi"
4096
  msgstr ""
4097
 
4098
+ #: includes/class-mla-settings-custom-fields-tab.php:514
4099
+ #: includes/class-mla-settings-custom-fields-tab.php:824
4100
+ #: includes/class-mla-settings-iptc-exif-tab.php:925
4101
  msgid "Delete NULL Values"
4102
  msgstr ""
4103
 
4104
+ #: includes/class-mla-settings-custom-fields-tab.php:515
4105
+ #: includes/class-mla-settings-custom-fields-tab.php:825
4106
+ #: includes/class-mla-settings-iptc-exif-tab.php:537
4107
+ #: includes/class-mla-settings-iptc-exif-tab.php:926
4108
  msgid "Do not store empty custom field values"
4109
  msgstr ""
4110
 
4111
+ #: includes/class-mla-settings-custom-fields-tab.php:518
4112
+ #: includes/class-mla-settings-custom-fields-tab.php:828
4113
+ #: includes/class-mla-settings-custom-fields-tab.php:1520
4114
+ #: includes/class-mla-settings-custom-fields-tab.php:1739
4115
+ #: includes/class-mla-settings-documentation-tab.php:1226
4116
+ #: includes/class-mla-settings-iptc-exif-tab.php:541
4117
+ #: includes/class-mla-settings-iptc-exif-tab.php:929
4118
+ #: includes/class-mla-settings-iptc-exif-tab.php:1635
4119
+ #: includes/class-mla-settings-iptc-exif-tab.php:1867
4120
+ #: includes/class-mla-settings-iptc-exif-tab.php:2463
4121
+ #: includes/class-mla-settings-upload-tab.php:555
4122
+ #: includes/class-mla-settings-upload-tab.php:1041
4123
  msgid "Active"
4124
  msgstr ""
4125
 
4126
+ #: includes/class-mla-settings-custom-fields-tab.php:520
4127
+ #: includes/class-mla-settings-custom-fields-tab.php:830
4128
+ #: includes/class-mla-settings-custom-fields-tab.php:1522
4129
+ #: includes/class-mla-settings-custom-fields-tab.php:1742
4130
+ #: includes/class-mla-settings-documentation-tab.php:1228
4131
+ #: includes/class-mla-settings-iptc-exif-tab.php:543
4132
+ #: includes/class-mla-settings-iptc-exif-tab.php:931
4133
+ #: includes/class-mla-settings-iptc-exif-tab.php:1637
4134
+ #: includes/class-mla-settings-iptc-exif-tab.php:1870
4135
+ #: includes/class-mla-settings-iptc-exif-tab.php:2463
4136
+ #: includes/class-mla-settings-upload-tab.php:197
4137
+ #: includes/class-mla-settings-upload-tab.php:541
4138
+ #: includes/class-mla-settings-upload-tab.php:1039
4139
  msgid "Inactive"
4140
  msgstr ""
4141
 
4142
+ #: includes/class-mla-settings-custom-fields-tab.php:552
4143
+ #: includes/class-mla-settings-iptc-exif-tab.php:654
4144
  #, php-format
4145
  msgid "Custom Field Rule \"%1$s\": %2$s"
4146
  msgstr ""
4147
 
4148
+ #: includes/class-mla-settings-custom-fields-tab.php:589
4149
  msgid "Edit Custom Field Rule cancelled."
4150
  msgstr ""
4151
 
4152
+ #: includes/class-mla-settings-custom-fields-tab.php:603
4153
+ #: includes/class-mla-settings-custom-fields-tab.php:631
4154
+ #: includes/class-mla-settings-documentation-tab.php:277
4155
+ #: includes/class-mla-settings-iptc-exif-tab.php:705
4156
+ #: includes/class-mla-settings-iptc-exif-tab.php:733
4157
+ #: includes/class-mla-settings-shortcodes-tab.php:576
4158
+ #: includes/class-mla-settings-upload-tab.php:410
4159
+ #: includes/class-mla-settings-view-tab.php:257
4160
  #, php-format
4161
  msgid "Unknown bulk action %1$s"
4162
  msgstr ""
4163
 
4164
+ #: includes/class-mla-settings-custom-fields-tab.php:675
4165
  msgid "Custom Field Mapping Support is disabled"
4166
  msgstr ""
4167
 
4168
+ #: includes/class-mla-settings-custom-fields-tab.php:746
4169
  msgid "Custom Field Mapping Progress"
4170
  msgstr ""
4171
 
4172
+ #: includes/class-mla-settings-custom-fields-tab.php:747
4173
+ #: includes/class-mla-settings-iptc-exif-tab.php:847
4174
  msgid "DO NOT DO THE FOLLOWING (they will cause mapping to fail)"
4175
  msgstr ""
4176
 
4177
+ #: includes/class-mla-settings-custom-fields-tab.php:748
4178
+ #: includes/class-mla-settings-iptc-exif-tab.php:848
4179
  msgid "Close the window"
4180
  msgstr ""
4181
 
4182
+ #: includes/class-mla-settings-custom-fields-tab.php:749
4183
+ #: includes/class-mla-settings-iptc-exif-tab.php:849
4184
  msgid "Reload the page"
4185
  msgstr ""
4186
 
4187
+ #: includes/class-mla-settings-custom-fields-tab.php:750
4188
+ #: includes/class-mla-settings-iptc-exif-tab.php:850
4189
  msgid "Click the browser&rsquo;s Stop, Back or forward buttons"
4190
  msgstr ""
4191
 
4192
+ #: includes/class-mla-settings-custom-fields-tab.php:751
4193
+ #: includes/class-mla-settings-iptc-exif-tab.php:851
4194
  msgid "Progress"
4195
  msgstr ""
4196
 
4197
+ #: includes/class-mla-settings-custom-fields-tab.php:752
4198
+ #: includes/class-mla-settings-iptc-exif-tab.php:852
4199
  msgid "Pause"
4200
  msgstr ""
4201
 
4202
+ #: includes/class-mla-settings-custom-fields-tab.php:754
4203
+ #: includes/class-mla-settings-iptc-exif-tab.php:854
4204
  msgid "Resume"
4205
  msgstr ""
4206
 
4207
+ #: includes/class-mla-settings-custom-fields-tab.php:755
4208
+ #: includes/class-mla-settings-documentation-tab.php:152
4209
+ #: includes/class-mla-settings-iptc-exif-tab.php:855
4210
+ #: includes/class-mla-settings-shortcodes-tab.php:499
4211
  #: includes/class-mla-template-support.php:160
4212
  #: includes/class-mla-template-support.php:166
4213
  #: includes/class-mla-template-support.php:208
4217
  msgid "Close"
4218
  msgstr ""
4219
 
4220
+ #: includes/class-mla-settings-custom-fields-tab.php:764
4221
  msgid "Custom Field and Attachment Metadata Processing Options"
4222
  msgstr ""
4223
 
4224
+ #: includes/class-mla-settings-custom-fields-tab.php:766
4225
  msgid ""
4226
  "In this tab you can define the rules for mapping several types of image "
4227
  "metadata to WordPress custom fields. You can also use this screen to define "
4230
  "field."
4231
  msgstr ""
4232
 
4233
+ #: includes/class-mla-settings-custom-fields-tab.php:768
4234
+ #: includes/class-mla-settings-iptc-exif-tab.php:868
4235
  msgid ""
4236
  "You can find more information about using the controls in this tab to define "
4237
  "mapping rules and apply them by clicking the \"Help\" control in the upper-"
4238
  "right corner of the screen."
4239
  msgstr ""
4240
 
4241
+ #: includes/class-mla-settings-custom-fields-tab.php:773
4242
+ #: includes/class-mla-settings-iptc-exif-tab.php:873
4243
+ #: includes/class-mla-settings-shortcodes-tab.php:733
4244
  msgid "Search results for"
4245
  msgstr ""
4246
 
4247
+ #: includes/class-mla-settings-custom-fields-tab.php:775
4248
+ #: includes/class-mla-settings-iptc-exif-tab.php:874
4249
  msgid "Search Rules Text"
4250
  msgstr ""
4251
 
4252
+ #: includes/class-mla-settings-custom-fields-tab.php:777
4253
+ #: includes/class-mla-settings-iptc-exif-tab.php:876
4254
  msgid "Search Rules"
4255
  msgstr ""
4256
 
4257
+ #: includes/class-mla-settings-custom-fields-tab.php:780
4258
+ #: includes/class-mla-settings-iptc-exif-tab.php:879
4259
  msgid "Execute All Rules"
4260
  msgstr ""
4261
 
4262
+ #: includes/class-mla-settings-custom-fields-tab.php:781
4263
+ #: includes/class-mla-settings-iptc-exif-tab.php:880
4264
  msgid "Add New Custom Field Rule"
4265
  msgstr ""
4266
 
4267
+ #: includes/class-mla-settings-custom-fields-tab.php:831
4268
+ #: includes/class-mla-settings-iptc-exif-tab.php:932
4269
  msgid "Add Rule"
4270
  msgstr ""
4271
 
4272
+ #: includes/class-mla-settings-custom-fields-tab.php:902
4273
+ #: includes/class-mla-settings-custom-fields-tab.php:924
4274
+ #: includes/class-mla-settings-iptc-exif-tab.php:1012
4275
  msgid "Nothing to execute"
4276
  msgstr ""
4277
 
4278
+ #: includes/class-mla-settings-custom-fields-tab.php:964
4279
+ #: includes/class-mla-settings-iptc-exif-tab.php:1053
4280
+ msgid "Rule not found"
4281
  msgstr ""
4282
 
4283
+ #: includes/class-mla-settings-custom-fields-tab.php:967
4284
+ #: includes/class-mla-settings-iptc-exif-tab.php:1049
4285
+ msgid "Rule ID not found"
4286
  msgstr ""
4287
 
4288
+ #: includes/class-mla-settings-custom-fields-tab.php:1241
4289
+ #: includes/class-mla-settings-iptc-exif-tab.php:1338
4290
  msgctxt "list_table_column"
4291
  msgid "Bad Name"
4292
  msgstr ""
4293
 
4294
+ #: includes/class-mla-settings-custom-fields-tab.php:1243
4295
  msgctxt "list_table_column"
4296
  msgid "Meta/Template"
4297
  msgstr ""
4298
 
4299
+ #: includes/class-mla-settings-custom-fields-tab.php:1244
4300
  msgctxt "list_table_column"
4301
  msgid "Visibility"
4302
  msgstr ""
4303
 
4304
+ #: includes/class-mla-settings-custom-fields-tab.php:1246
4305
+ #: includes/class-mla-settings-iptc-exif-tab.php:1342
4306
  msgctxt "list_table_column"
4307
  msgid "Existing Text"
4308
  msgstr ""
4309
 
4310
+ #: includes/class-mla-settings-custom-fields-tab.php:1247
4311
+ #: includes/class-mla-settings-iptc-exif-tab.php:1346
4312
  msgctxt "list_table_column"
4313
  msgid "Delete NULL"
4314
  msgstr ""
4315
 
4316
+ #: includes/class-mla-settings-custom-fields-tab.php:1248
4317
+ #: includes/class-mla-settings-iptc-exif-tab.php:1347
4318
  msgctxt "list_table_column"
4319
  msgid "Format"
4320
  msgstr ""
4321
 
4322
+ #: includes/class-mla-settings-custom-fields-tab.php:1249
4323
+ #: includes/class-mla-settings-iptc-exif-tab.php:1348
4324
  msgctxt "list_table_column"
4325
  msgid "Option"
4326
  msgstr ""
4327
 
4328
+ #: includes/class-mla-settings-custom-fields-tab.php:1387
4329
+ #: includes/class-mla-settings-iptc-exif-tab.php:1486
4330
  msgid "Map All Attachments"
4331
  msgstr ""
4332
 
4333
+ #: includes/class-mla-settings-custom-fields-tab.php:1387
4334
+ #: includes/class-mla-settings-custom-fields-tab.php:1718
4335
+ #: includes/class-mla-settings-iptc-exif-tab.php:1486
4336
+ #: includes/class-mla-settings-iptc-exif-tab.php:1846
4337
  msgid "Execute"
4338
  msgstr ""
4339
 
4340
+ #: includes/class-mla-settings-custom-fields-tab.php:1389
4341
  msgid "Purge custom field values"
4342
  msgstr ""
4343
 
4344
+ #: includes/class-mla-settings-custom-fields-tab.php:1389
4345
+ #: includes/class-mla-settings-custom-fields-tab.php:1719
4346
+ #: includes/class-mla-settings-iptc-exif-tab.php:1489
4347
+ #: includes/class-mla-settings-iptc-exif-tab.php:1847
4348
  msgid "Purge Values"
4349
  msgstr ""
4350
 
4351
+ #: includes/class-mla-settings-custom-fields-tab.php:1736
4352
+ #: includes/class-mla-settings-iptc-exif-tab.php:1864
4353
+ #: includes/class-mla-settings-shortcodes-tab.php:1319
4354
  msgid "Any Status"
4355
  msgstr ""
4356
 
4357
+ #: includes/class-mla-settings-custom-fields-tab.php:2474
4358
  msgctxt "table_view_singular"
4359
  msgid "MLA Column"
4360
  msgstr ""
4361
 
4362
+ #: includes/class-mla-settings-custom-fields-tab.php:2475
4363
  msgctxt "table_view_plural"
4364
  msgid "MLA Column"
4365
  msgstr ""
4366
 
4367
+ #: includes/class-mla-settings-custom-fields-tab.php:2478
4368
  msgctxt "table_view_singular"
4369
  msgid "Quick Edit"
4370
  msgstr ""
4371
 
4372
+ #: includes/class-mla-settings-custom-fields-tab.php:2479
4373
  msgctxt "table_view_plural"
4374
  msgid "Quick Edit"
4375
  msgstr ""
4376
 
4377
+ #: includes/class-mla-settings-custom-fields-tab.php:2482
4378
  msgctxt "table_view_singular"
4379
  msgid "Bulk Edit"
4380
  msgstr ""
4381
 
4382
+ #: includes/class-mla-settings-custom-fields-tab.php:2483
4383
  msgctxt "table_view_plural"
4384
  msgid "Bulk Edit"
4385
  msgstr ""
4386
 
4387
+ #: includes/class-mla-settings-custom-fields-tab.php:2486
4388
+ #: includes/class-mla-settings-iptc-exif-tab.php:2782
4389
  msgctxt "table_view_singular"
4390
  msgid "Read Only"
4391
  msgstr ""
4392
 
4393
+ #: includes/class-mla-settings-custom-fields-tab.php:2487
4394
+ #: includes/class-mla-settings-iptc-exif-tab.php:2783
4395
  msgctxt "table_view_plural"
4396
  msgid "Read Only"
4397
  msgstr ""
4398
 
4399
+ #: includes/class-mla-settings-documentation-tab.php:119
4400
+ #: includes/class-mla-settings-documentation-tab.php:951
4401
+ #: includes/class-mla-settings-documentation-tab.php:1038
4402
+ #: includes/class-mla-settings-documentation-tab.php:1068
4403
  #, php-format
4404
  msgid "Example plugin \"%1$s\" not found"
4405
  msgstr ""
4406
 
4407
+ #: includes/class-mla-settings-documentation-tab.php:142
4408
+ #: includes/class-mla-settings.php:1362
4409
  #, php-format
4410
  msgid "%1$s: Reading the %2$s file ( %3$s ) \"%4$s\"."
4411
  msgstr ""
4412
 
4413
+ #: includes/class-mla-settings-documentation-tab.php:142
4414
  msgid "plugin"
4415
  msgstr ""
4416
 
4417
+ #: includes/class-mla-settings-documentation-tab.php:149
4418
  msgid "View Plugin"
4419
  msgstr ""
4420
 
4421
+ #: includes/class-mla-settings-documentation-tab.php:197
4422
+ #: includes/class-mla-settings-upload-tab.php:267
4423
+ #: includes/class-mla-settings-upload-tab.php:556
4424
+ #: includes/class-mla-settings-view-tab.php:371
4425
  msgid "Displaying search results for"
4426
  msgstr ""
4427
 
4428
+ #: includes/class-mla-settings-documentation-tab.php:198
4429
  msgid ""
4430
  "In this tab you can browse the list of MLA example plugins, install or "
4431
  "update them in the Plugins/Installed Plugins area and see which examples you "
4433
  "the plugins you must go to the Plugins/Installed Plugins admin submenu."
4434
  msgstr ""
4435
 
4436
+ #: includes/class-mla-settings-documentation-tab.php:200
4437
  #, php-format
4438
  msgid ""
4439
  "You can find more information about using the example plugins in the %1$s "
4441
  "tab in the upper-right corner of this screen."
4442
  msgstr ""
4443
 
4444
+ #: includes/class-mla-settings-documentation-tab.php:200
4445
  msgid "Example plugin documentation"
4446
  msgstr ""
4447
 
4448
+ #: includes/class-mla-settings-documentation-tab.php:200
4449
  msgid "The Example Plugins"
4450
  msgstr ""
4451
 
4452
+ #: includes/class-mla-settings-documentation-tab.php:205
4453
  msgid "Example Plugins"
4454
  msgstr ""
4455
 
4456
+ #: includes/class-mla-settings-documentation-tab.php:206
4457
  msgid "Search Example Plugins"
4458
  msgstr ""
4459
 
4460
+ #: includes/class-mla-settings-documentation-tab.php:208
4461
  msgid "Search Plugins"
4462
  msgstr ""
4463
 
4464
+ #: includes/class-mla-settings-documentation-tab.php:209
4465
  msgid "Searches Name, Description, File Name and Tags"
4466
  msgstr ""
4467
 
4468
+ #: includes/class-mla-settings-documentation-tab.php:301
4469
  #, php-format
4470
  msgid "Empty mla_item_ID - \"%1$s\""
4471
  msgstr ""
4472
 
4473
+ #: includes/class-mla-settings-documentation-tab.php:537
4474
  msgctxt "list_table_column"
4475
  msgid "Current Version"
4476
  msgstr ""
4477
 
4478
+ #: includes/class-mla-settings-documentation-tab.php:538
4479
  msgctxt "list_table_column"
4480
  msgid "Installed Version"
4481
  msgstr ""
4482
 
4483
+ #: includes/class-mla-settings-documentation-tab.php:540
4484
  msgctxt "list_table_column"
4485
  msgid "File Name"
4486
  msgstr ""
4487
 
4488
+ #: includes/class-mla-settings-documentation-tab.php:541
4489
  msgctxt "list_table_column"
4490
  msgid "Tags"
4491
  msgstr ""
4492
 
4493
+ #: includes/class-mla-settings-documentation-tab.php:660
4494
  msgid "Install this plugin"
4495
  msgstr ""
4496
 
4497
+ #: includes/class-mla-settings-documentation-tab.php:660
4498
+ #: includes/class-mla-settings-documentation-tab.php:862
4499
  msgid "Install"
4500
  msgstr ""
4501
 
4502
+ #: includes/class-mla-settings-documentation-tab.php:664
4503
  msgid "Update this plugin"
4504
  msgstr ""
4505
 
4506
+ #: includes/class-mla-settings-documentation-tab.php:676
4507
+ #: includes/class-mla-settings-shortcodes-tab.php:1096
4508
  msgid "View this item"
4509
  msgstr ""
4510
 
4511
+ #: includes/class-mla-settings-documentation-tab.php:979
4512
  #, php-format
4513
  msgid "Example plugin \"%1$s\" fs_connect failed; no action taken. Error: %2$s"
4514
  msgstr ""
4515
 
4516
+ #: includes/class-mla-settings-documentation-tab.php:984
4517
  #, php-format
4518
  msgid "Example plugin \"%1$s\" fs_connect failed; no action taken"
4519
  msgstr ""
4520
 
4521
+ #: includes/class-mla-settings-documentation-tab.php:1007
4522
  #, php-format
4523
  msgid ""
4524
  "Example plugin \"%1$s\" install_package failed; no action taken. Error: %2$s"
4525
  msgstr ""
4526
 
4527
+ #: includes/class-mla-settings-documentation-tab.php:1018
4528
  #, php-format
4529
  msgid "Example plugin \"%1$s\" remove old single file failed."
4530
  msgstr ""
4531
 
4532
+ #: includes/class-mla-settings-documentation-tab.php:1043
4533
  #, php-format
4534
  msgid "Example plugin \"%1$s\" already installed; no action taken"
4535
  msgstr ""
4536
 
4537
+ #: includes/class-mla-settings-documentation-tab.php:1049
4538
  #, php-format
4539
  msgid "Example plugin \"%1$s\" installed"
4540
  msgstr ""
4541
 
4542
+ #: includes/class-mla-settings-documentation-tab.php:1073
4543
  #, php-format
4544
  msgid "Example plugin \"%1$s\" not installed; no action taken"
4545
  msgstr ""
4546
 
4547
+ #: includes/class-mla-settings-documentation-tab.php:1079
4548
  #, php-format
4549
  msgid "Example plugin \"%1$s\" updated"
4550
  msgstr ""
4551
 
4552
+ #: includes/class-mla-settings-documentation-tab.php:1224
4553
  msgid "Network"
4554
  msgstr ""
4555
 
4556
+ #: includes/class-mla-settings-documentation-tab.php:1549
4557
  msgctxt "table_view_singular"
4558
  msgid "Installed"
4559
  msgstr ""
4560
 
4561
+ #: includes/class-mla-settings-documentation-tab.php:1550
4562
  msgctxt "table_view_plural"
4563
  msgid "Installed"
4564
  msgstr ""
4565
 
4566
+ #: includes/class-mla-settings-documentation-tab.php:1561
4567
  msgctxt "table_view_singular"
4568
  msgid "Network"
4569
  msgstr ""
4570
 
4571
+ #: includes/class-mla-settings-documentation-tab.php:1562
4572
  msgctxt "table_view_plural"
4573
  msgid "Network"
4574
  msgstr ""
4575
 
4576
+ #: includes/class-mla-settings-documentation-tab.php:1565
4577
  msgctxt "table_view_singular"
4578
  msgid "Uninstalled"
4579
  msgstr ""
4580
 
4581
+ #: includes/class-mla-settings-documentation-tab.php:1566
4582
  msgctxt "table_view_plural"
4583
  msgid "Uninstalled"
4584
  msgstr ""
4595
  msgid "updated."
4596
  msgstr ""
4597
 
4598
+ #: includes/class-mla-settings-iptc-exif-tab.php:493
4599
+ #: includes/class-mla-settings-iptc-exif-tab.php:889
4600
  msgid "EXIF/Template Value"
4601
  msgstr ""
4602
 
4603
+ #: includes/class-mla-settings-iptc-exif-tab.php:496
4604
+ #: includes/class-mla-settings-iptc-exif-tab.php:892
4605
  msgid "EXIF element name or Content Template"
4606
  msgstr ""
4607
 
4608
+ #: includes/class-mla-settings-iptc-exif-tab.php:496
4609
  msgid " (starting with \"template:\")"
4610
  msgstr ""
4611
 
4612
+ #: includes/class-mla-settings-iptc-exif-tab.php:499
4613
+ #: includes/class-mla-settings-iptc-exif-tab.php:895
4614
+ #: includes/class-mla-settings-iptc-exif-tab.php:1603
4615
  msgid "IPTC"
4616
  msgstr ""
4617
 
4618
+ #: includes/class-mla-settings-iptc-exif-tab.php:501
4619
+ #: includes/class-mla-settings-iptc-exif-tab.php:897
4620
+ #: includes/class-mla-settings-iptc-exif-tab.php:1606
4621
  msgid "EXIF"
4622
  msgstr ""
4623
 
4624
+ #: includes/class-mla-settings-iptc-exif-tab.php:509
4625
+ #: includes/class-mla-settings-iptc-exif-tab.php:903
4626
  msgid "Delimiters"
4627
  msgstr ""
4628
 
4629
+ #: includes/class-mla-settings-iptc-exif-tab.php:564
4630
  msgid "Standard field mapping"
4631
  msgstr ""
4632
 
4633
+ #: includes/class-mla-settings-iptc-exif-tab.php:567
4634
  msgid "Taxonomy term mapping"
4635
  msgstr ""
4636
 
4637
+ #: includes/class-mla-settings-iptc-exif-tab.php:590
4638
  msgid "Custom field mapping"
4639
  msgstr ""
4640
 
4641
+ #: includes/class-mla-settings-iptc-exif-tab.php:691
4642
  msgid "Edit IPTC EXIF Rule cancelled."
4643
  msgstr ""
4644
 
4645
+ #: includes/class-mla-settings-iptc-exif-tab.php:777
4646
  msgid "IPTC/EXIF Mapping Support is disabled"
4647
  msgstr ""
4648
 
4649
+ #: includes/class-mla-settings-iptc-exif-tab.php:846
4650
  msgid "IPTC &amp; EXIF Mapping Progress"
4651
  msgstr ""
4652
 
4653
+ #: includes/class-mla-settings-iptc-exif-tab.php:864
4654
  msgid "IPTC &amp; EXIF Processing Options"
4655
  msgstr ""
4656
 
4657
+ #: includes/class-mla-settings-iptc-exif-tab.php:866
4658
  msgid ""
4659
  "In this tab you can define the rules for mapping IPTC (International Press "
4660
  "Telecommunications Council) and EXIF (EXchangeable Image File) metadata to "
4661
  "WordPress standard attachment fields, taxonomy terms and custom fields."
4662
  msgstr ""
4663
 
4664
+ #: includes/class-mla-settings-iptc-exif-tab.php:1339
4665
  msgctxt "list_table_column"
4666
  msgid "IPTC Value"
4667
  msgstr ""
4668
 
4669
+ #: includes/class-mla-settings-iptc-exif-tab.php:1340
4670
  msgctxt "list_table_column"
4671
  msgid "EXIF/Template Value"
4672
  msgstr ""
4673
 
4674
+ #: includes/class-mla-settings-iptc-exif-tab.php:1341
4675
  msgctxt "list_table_column"
4676
  msgid "Priority "
4677
  msgstr ""
4678
 
4679
+ #: includes/class-mla-settings-iptc-exif-tab.php:1344
4680
  msgctxt "list_table_column"
4681
  msgid "Delimiter(s)"
4682
  msgstr ""
4683
 
4684
+ #: includes/class-mla-settings-iptc-exif-tab.php:1345
4685
  msgctxt "list_table_column"
4686
  msgid "Parent"
4687
  msgstr ""
4688
 
4689
+ #: includes/class-mla-settings-iptc-exif-tab.php:1489
4690
  msgid "Purge IPTC EXIF values"
4691
  msgstr ""
4692
 
4693
+ #: includes/class-mla-settings-iptc-exif-tab.php:2770
4694
  msgctxt "table_view_singular"
4695
  msgid "Standard"
4696
  msgstr ""
4697
 
4698
+ #: includes/class-mla-settings-iptc-exif-tab.php:2771
4699
  msgctxt "table_view_plural"
4700
  msgid "Standard"
4701
  msgstr ""
4702
 
4703
+ #: includes/class-mla-settings-iptc-exif-tab.php:2774
4704
  msgctxt "table_view_singular"
4705
  msgid "Taxonomy"
4706
  msgstr ""
4707
 
4708
+ #: includes/class-mla-settings-iptc-exif-tab.php:2775
4709
  msgctxt "table_view_plural"
4710
  msgid "Taxonomy"
4711
  msgstr ""
4712
 
4713
+ #: includes/class-mla-settings-shortcodes-tab.php:102
4714
  #, php-format
4715
  msgid "%1$s: %2$s type or shortcode not specified."
4716
  msgstr ""
4717
 
4718
+ #: includes/class-mla-settings-shortcodes-tab.php:102
4719
+ #: includes/class-mla-settings-shortcodes-tab.php:167
4720
+ #: includes/class-mla-settings-shortcodes-tab.php:199
4721
+ #: includes/class-mla-settings-shortcodes-tab.php:265
4722
+ #: includes/class-mla-settings-shortcodes-tab.php:268
4723
+ #: includes/class-mla-settings-shortcodes-tab.php:287
4724
  msgid "Template"
4725
  msgstr ""
4726
 
4727
+ #: includes/class-mla-settings-shortcodes-tab.php:108
4728
  msgid "style template"
4729
  msgstr ""
4730
 
4731
+ #: includes/class-mla-settings-shortcodes-tab.php:113
4732
  #, php-format
4733
  msgid "%1$s: Blank %2$s name, reverting to \"%3$s\"."
4734
  msgstr ""
4735
 
4736
+ #: includes/class-mla-settings-shortcodes-tab.php:117
4737
  #, php-format
4738
  msgid "%1$s: Reserved %2$s name \"%3$s\", reverting to \"%4$s\"."
4739
  msgstr ""
4740
 
4741
+ #: includes/class-mla-settings-shortcodes-tab.php:135
4742
  #, php-format
4743
  msgid "%1$s: Duplicate new %2$s name \"%3$s\", reverting to \"%4$s\"."
4744
  msgstr ""
4745
 
4746
+ #: includes/class-mla-settings-shortcodes-tab.php:162
4747
  #, php-format
4748
  msgid "%1$s: New %2$s \"%3$s\" has no content; not added."
4749
  msgstr ""
4750
 
4751
+ #: includes/class-mla-settings-shortcodes-tab.php:167
4752
  #, php-format
4753
  msgid "%1$s \"%2$s\" added."
4754
  msgstr ""
4755
 
4756
+ #: includes/class-mla-settings-shortcodes-tab.php:199
4757
  #, php-format
4758
  msgid "%1$s \"%2$s\" copied to \"%3$s\"."
4759
  msgstr ""
4760
 
4761
+ #: includes/class-mla-settings-shortcodes-tab.php:222
4762
  msgid "style template name"
4763
  msgstr ""
4764
 
4765
+ #: includes/class-mla-settings-shortcodes-tab.php:222
4766
  msgid "markup template name"
4767
  msgstr ""
4768
 
4769
+ #: includes/class-mla-settings-shortcodes-tab.php:227
4770
  #, php-format
4771
  msgid "%1$s: Blank %2$s, reverting to \"%3$s\"."
4772
  msgstr ""
4773
 
4774
+ #: includes/class-mla-settings-shortcodes-tab.php:234
4775
  #, php-format
4776
  msgid "%1$s: Duplicate new %2$s \"%3$s\", reverting to \"%4$s\"."
4777
  msgstr ""
4778
 
4779
+ #: includes/class-mla-settings-shortcodes-tab.php:238
4780
  #, php-format
4781
  msgid "%1$s: Reserved %2$s \"%3$s\", reverting to \"%4$s\"."
4782
  msgstr ""
4783
 
4784
+ #: includes/class-mla-settings-shortcodes-tab.php:242
4785
  #, php-format
4786
  msgctxt "message_list"
4787
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\""
4788
  msgstr ""
4789
 
4790
+ #: includes/class-mla-settings-shortcodes-tab.php:265
4791
  #, php-format
4792
  msgid "%1$s \"%2$s\" updated."
4793
  msgstr ""
4794
 
4795
+ #: includes/class-mla-settings-shortcodes-tab.php:268
4796
  #, php-format
4797
  msgid "%1$s \"%2$s\" no changes detected."
4798
  msgstr ""
4799
 
4800
+ #: includes/class-mla-settings-shortcodes-tab.php:287
4801
  #, php-format
4802
  msgid "%1$s \"%2$s\" deleted."
4803
  msgstr ""
4804
 
4805
+ #: includes/class-mla-settings-shortcodes-tab.php:342
4806
  #, php-format
4807
  msgid "%1$s settings saved."
4808
  msgstr ""
4809
 
4810
+ #: includes/class-mla-settings-shortcodes-tab.php:342
4811
+ #: includes/class-mla-settings-shortcodes-tab.php:345
4812
+ #: includes/class-mla-settings.php:954
4813
  msgid "Shortcodes"
4814
  msgstr ""
4815
 
4816
+ #: includes/class-mla-settings-shortcodes-tab.php:345
4817
  #, php-format
4818
  msgid "%1$s no changes detected."
4819
  msgstr ""
4820
 
4821
+ #: includes/class-mla-settings-shortcodes-tab.php:377
4822
  msgid "select template type"
4823
  msgstr ""
4824
 
4825
+ #: includes/class-mla-settings-shortcodes-tab.php:378
4826
  msgid "select template shortcode"
4827
  msgstr ""
4828
 
4829
+ #: includes/class-mla-settings-shortcodes-tab.php:380
4830
  msgid "Select a template type and shortcode to generate the section areas."
4831
  msgstr ""
4832
 
4833
+ #: includes/class-mla-settings-shortcodes-tab.php:416
4834
+ #: includes/class-mla-settings-shortcodes-tab.php:430
4835
  msgid "Add Template"
4836
  msgstr ""
4837
 
4838
+ #: includes/class-mla-settings-shortcodes-tab.php:425
4839
+ #: includes/class-mla-settings-shortcodes-tab.php:496
4840
  msgid ""
4841
  "The name/&#8220;slug&#8221; is the URL-friendly, unique key for the "
4842
  "template. It must be all lowercase and contain only letters, numbers and "
4843
  "hyphens (-)."
4844
  msgstr ""
4845
 
4846
+ #: includes/class-mla-settings-shortcodes-tab.php:433
4847
+ #: includes/class-mla-settings-shortcodes-tab.php:505
4848
+ #: includes/class-mla-settings-shortcodes-tab.php:1101
4849
+ #: includes/class-mla-settings-shortcodes-tab.php:1303
4850
  msgid "Copy"
4851
  msgstr ""
4852
 
4853
+ #: includes/class-mla-settings-shortcodes-tab.php:486
4854
  msgid "View Template"
4855
  msgstr ""
4856
 
4857
+ #: includes/class-mla-settings-shortcodes-tab.php:486
4858
  msgid "Edit Template"
4859
  msgstr ""
4860
 
4861
+ #: includes/class-mla-settings-shortcodes-tab.php:547
4862
  msgid "Add Template cancelled."
4863
  msgstr ""
4864
 
4865
+ #: includes/class-mla-settings-shortcodes-tab.php:550
4866
  msgid "Edit Template cancelled."
4867
  msgstr ""
4868
 
4869
+ #: includes/class-mla-settings-shortcodes-tab.php:653
4870
  msgid "Theme"
4871
  msgstr ""
4872
 
4873
+ #: includes/class-mla-settings-shortcodes-tab.php:674
4874
  msgid "Imagick support is not installed."
4875
  msgstr ""
4876
 
4877
+ #: includes/class-mla-settings-shortcodes-tab.php:681
4878
  msgid "Ghostscript support is not installed."
4879
  msgstr ""
4880
 
4881
+ #: includes/class-mla-settings-shortcodes-tab.php:685
4882
+ #: includes/class-mla-wpml-support.php:1747
4883
+ #: includes/class-mla-wpml-support.php:1749
4884
  msgid "WARNING:"
4885
  msgstr ""
4886
 
4887
+ #: includes/class-mla-settings-shortcodes-tab.php:685
4888
  msgid " MLA Viewer support may not be available"
4889
  msgstr ""
4890
 
4891
+ #: includes/class-mla-settings-shortcodes-tab.php:721
4892
  msgid "MLA Shortcode Options"
4893
  msgstr ""
4894
 
4895
+ #: includes/class-mla-settings-shortcodes-tab.php:722
4896
  msgid ""
4897
  "In this tab you can view the default style and markup templates. You can "
4898
  "also define additional templates and use the <code>mla_style</code> and "
4900
  "shortcodes."
4901
  msgstr ""
4902
 
4903
+ #: includes/class-mla-settings-shortcodes-tab.php:724
4904
  #, php-format
4905
  msgid ""
4906
  "You can find more information about shortcode templates and how MLA and "
4908
  "the <strong>\"Help\"</strong> tab in the upper-right corner of this screen."
4909
  msgstr ""
4910
 
4911
+ #: includes/class-mla-settings-shortcodes-tab.php:724
4912
  msgid "Style and Markup Templates documentation"
4913
  msgstr ""
4914
 
4915
+ #: includes/class-mla-settings-shortcodes-tab.php:724
4916
  msgid "Style and Markup Templates"
4917
  msgstr ""
4918
 
4919
+ #: includes/class-mla-settings-shortcodes-tab.php:730
4920
  msgid "Add New Template"
4921
  msgstr ""
4922
 
4923
+ #: includes/class-mla-settings-shortcodes-tab.php:731
4924
  msgid "Search Templates"
4925
  msgstr ""
4926
 
4927
+ #: includes/class-mla-settings-shortcodes-tab.php:981
4928
  msgctxt "list_table_column"
4929
  msgid "Type"
4930
  msgstr ""
4931
 
4932
+ #: includes/class-mla-settings-shortcodes-tab.php:982
4933
  msgctxt "list_table_column"
4934
  msgid "Shortcode"
4935
  msgstr ""
4936
 
4937
+ #: includes/class-mla-settings-shortcodes-tab.php:1101
4938
  msgid "Make a copy"
4939
  msgstr ""
4940
 
4941
+ #: includes/class-mla-settings-shortcodes-tab.php:1121
4942
  msgid "default"
4943
  msgstr ""
4944
 
4945
+ #: includes/class-mla-settings-shortcodes-tab.php:1134
4946
+ #: includes/class-mla-settings-shortcodes-tab.php:1990
4947
  msgctxt "table_view_singular"
4948
  msgid "Style"
4949
  msgstr ""
4950
 
4951
+ #: includes/class-mla-settings-shortcodes-tab.php:1134
4952
+ #: includes/class-mla-settings-shortcodes-tab.php:1994
4953
  msgctxt "table_view_singular"
4954
  msgid "Markup"
4955
  msgstr ""
4956
 
4957
+ #: includes/class-mla-settings-shortcodes-tab.php:1302
4958
+ #: includes/class-mla-thumbnail-generation.php:670
4959
  msgid "Delete"
4960
  msgstr ""
4961
 
4962
+ #: includes/class-mla-settings-shortcodes-tab.php:1322
4963
  msgid "Default"
4964
  msgstr ""
4965
 
4966
+ #: includes/class-mla-settings-shortcodes-tab.php:1325
4967
  msgid "Custom"
4968
  msgstr ""
4969
 
4970
+ #: includes/class-mla-settings-shortcodes-tab.php:1991
4971
  msgctxt "table_view_plural"
4972
  msgid "Style"
4973
  msgstr ""
4974
 
4975
+ #: includes/class-mla-settings-shortcodes-tab.php:1995
4976
  msgctxt "table_view_plural"
4977
  msgid "Markup"
4978
  msgstr ""
4979
 
4980
+ #: includes/class-mla-settings-shortcodes-tab.php:1998
4981
  #: includes/class-mla-template-support.php:70
4982
  #: includes/class-mla-template-support.php:126
4983
  msgctxt "table_view_singular"
4984
  msgid "Gallery"
4985
  msgstr ""
4986
 
4987
+ #: includes/class-mla-settings-shortcodes-tab.php:1999
4988
  msgctxt "table_view_plural"
4989
  msgid "Gallery"
4990
  msgstr ""
4991
 
4992
+ #: includes/class-mla-settings-shortcodes-tab.php:2002
4993
  #: includes/class-mla-template-support.php:88
4994
  #: includes/class-mla-template-support.php:174
4995
  msgctxt "table_view_singular"
4996
  msgid "Tag Cloud"
4997
  msgstr ""
4998
 
4999
+ #: includes/class-mla-settings-shortcodes-tab.php:2003
5000
  msgctxt "table_view_plural"
5001
  msgid "Tag Cloud"
5002
  msgstr ""
5003
 
5004
+ #: includes/class-mla-settings-shortcodes-tab.php:2006
5005
  #: includes/class-mla-template-support.php:106
5006
  #: includes/class-mla-template-support.php:222
5007
  msgctxt "table_view_singular"
5008
  msgid "Term List"
5009
  msgstr ""
5010
 
5011
+ #: includes/class-mla-settings-shortcodes-tab.php:2007
5012
  msgctxt "table_view_plural"
5013
  msgid "Term List"
5014
  msgstr ""
5015
 
5016
+ #: includes/class-mla-settings-upload-tab.php:91
5017
  msgid "Upload MIME Type settings saved."
5018
  msgstr ""
5019
 
5020
+ #: includes/class-mla-settings-upload-tab.php:185
5021
  msgid "Edit Upload MIME Type"
5022
  msgstr ""
5023
 
5024
+ #: includes/class-mla-settings-upload-tab.php:191
5025
  msgid ""
5026
  "The &#8220;extension&#8221; is the file extension for this type, and a "
5027
  "unique key for the item. It must be all lowercase and contain only letters "
5028
  "and numbers."
5029
  msgstr ""
5030
 
5031
+ #: includes/class-mla-settings-upload-tab.php:193
5032
+ #: includes/class-mla-settings-upload-tab.php:538
5033
  msgid ""
5034
  "The MIME Type must be all lowercase and contain only letters, numbers, "
5035
  "periods (.), slashes (/) and hyphens (-). It <strong>must be a valid MIME</"
5036
  "strong> type, e.g., &#8220;image&#8221; or &#8220;image/jpeg&#8221;."
5037
  msgstr ""
5038
 
5039
+ #: includes/class-mla-settings-upload-tab.php:194
5040
+ #: includes/class-mla-settings-upload-tab.php:539
5041
  msgid "Icon Type"
5042
  msgstr ""
5043
 
5044
+ #: includes/class-mla-settings-upload-tab.php:196
5045
+ #: includes/class-mla-settings-upload-tab.php:540
5046
  msgid ""
5047
  "The Icon Type selects a thumbnail image displayed for non-image file types, "
5048
  "such as PDF documents."
5049
  msgstr ""
5050
 
5051
+ #: includes/class-mla-settings-upload-tab.php:198
5052
+ #: includes/class-mla-settings-upload-tab.php:542
5053
  msgid ""
5054
  "Check this box if you want to remove this entry from the list of Upload MIME "
5055
  "Types returned by get_allowed_mime_types()."
5056
  msgstr ""
5057
 
5058
+ #: includes/class-mla-settings-upload-tab.php:200
5059
+ #: includes/class-mla-settings-upload-tab.php:544
5060
+ #: includes/class-mla-settings-view-tab.php:129
5061
+ #: includes/class-mla-settings-view-tab.php:392
5062
  msgid ""
5063
  "The description can contain any documentation or notes you need to "
5064
  "understand or use the item."
5065
  msgstr ""
5066
 
5067
+ #: includes/class-mla-settings-upload-tab.php:266
5068
  msgid "Known File Extension/MIME Type Associations"
5069
  msgstr ""
5070
 
5071
+ #: includes/class-mla-settings-upload-tab.php:268
5072
  msgid "Search Known MIME Types"
5073
  msgstr ""
5074
 
5075
+ #: includes/class-mla-settings-upload-tab.php:270
5076
  msgid "Search Types"
5077
  msgstr ""
5078
 
5079
+ #: includes/class-mla-settings-upload-tab.php:271
5080
+ #: includes/class-mla-settings-upload-tab.php:527
5081
  msgid "To search by extension, use \".\", e.g., \".doc\""
5082
  msgstr ""
5083
 
5084
+ #: includes/class-mla-settings-upload-tab.php:451
5085
+ #: includes/class-mla-settings-view-tab.php:296
5086
  #, php-format
5087
  msgid "Edit view \"%1$s\" cancelled."
5088
  msgstr ""
5089
 
5090
+ #: includes/class-mla-settings-upload-tab.php:482
5091
  msgid "Upload MIME Type Support is disabled"
5092
  msgstr ""
5093
 
5094
+ #: includes/class-mla-settings-upload-tab.php:521
5095
+ #: includes/class-mla-settings-upload-tab.php:524
5096
  msgid "File Extension and MIME Type Processing"
5097
  msgstr ""
5098
 
5099
+ #: includes/class-mla-settings-upload-tab.php:522
5100
  msgid ""
5101
  "In this tab you can manage the list of file extension/MIME Type "
5102
  "associations, which are used by WordPress to decide what kind of files can "
5105
  "extension must be in this list and be active."
5106
  msgstr ""
5107
 
5108
+ #: includes/class-mla-settings-upload-tab.php:524
5109
  #, php-format
5110
  msgid ""
5111
  "You can find more information about file extensions, MIME types and how "
5113
  "the <strong>\"Help\"</strong> tab in the upper-right corner of this screen."
5114
  msgstr ""
5115
 
5116
+ #: includes/class-mla-settings-upload-tab.php:524
5117
  msgid "File Extension Processing documentation"
5118
  msgstr ""
5119
 
5120
+ #: includes/class-mla-settings-upload-tab.php:526
5121
  msgid "Search Uploads"
5122
  msgstr ""
5123
 
5124
+ #: includes/class-mla-settings-upload-tab.php:533
5125
  msgid "Upload MIME Type"
5126
  msgstr ""
5127
 
5128
+ #: includes/class-mla-settings-upload-tab.php:534
5129
  msgid ""
5130
  "To search the database of over 1,500 known extension/type associations, "
5131
  "click \"Search Known Types\" below the form."
5132
  msgstr ""
5133
 
5134
+ #: includes/class-mla-settings-upload-tab.php:536
5135
  msgid ""
5136
  "The &#8220;extension&#8221; is the file extension for this type, and unique "
5137
  "key for the item. It must be all lowercase and contain only letters and "
5138
  "numbers."
5139
  msgstr ""
5140
 
5141
+ #: includes/class-mla-settings-upload-tab.php:545
5142
  msgid "Add Upload MIME Type"
5143
  msgstr ""
5144
 
5145
+ #: includes/class-mla-settings-upload-tab.php:547
5146
  msgid "Search Known Types"
5147
  msgstr ""
5148
 
5149
+ #: includes/class-mla-settings-upload-tab.php:549
5150
+ #: includes/class-mla-settings-view-tab.php:395
5151
  msgid "<strong>Quick Edit</strong>"
5152
  msgstr ""
5153
 
5154
+ #: includes/class-mla-settings-upload-tab.php:597
5155
  msgid "No upload slug found"
5156
  msgstr ""
5157
 
5158
+ #: includes/class-mla-settings-upload-tab.php:936
5159
+ #: includes/class-mla-settings-view-tab.php:729
5160
  msgid "Revert to standard item"
5161
  msgstr ""
5162
 
5163
+ #: includes/class-mla-settings-upload-tab.php:936
5164
+ #: includes/class-mla-settings-view-tab.php:729
5165
  msgid "Revert to Standard"
5166
  msgstr ""
5167
 
5168
+ #: includes/class-mla-settings-upload-tab.php:1214
5169
  msgid "Delete/Revert Custom"
5170
  msgstr ""
5171
 
5172
+ #: includes/class-mla-settings-upload-tab.php:1469
5173
  msgid "Select this entry"
5174
  msgstr ""
5175
 
5176
+ #: includes/class-mla-settings-upload-tab.php:1589
5177
  msgid "Select these entries"
5178
  msgstr ""
5179
 
5180
+ #: includes/class-mla-settings-view-tab.php:88
5181
  msgid "View settings saved."
5182
  msgstr ""
5183
 
5184
+ #: includes/class-mla-settings-view-tab.php:110
5185
  msgid "Edit View"
5186
  msgstr ""
5187
 
5188
+ #: includes/class-mla-settings-view-tab.php:116
5189
+ #: includes/class-mla-settings-view-tab.php:379
5190
  msgid ""
5191
  "The &#8220;slug&#8221; is the URL-friendly, unique key for the view. It must "
5192
  "be all lowercase and contain only letters, numbers, periods (.), slashes (/) "
5195
  "MIME</strong> type, e.g., &#8220;image&#8221; or &#8220;image/jpeg&#8221;."
5196
  msgstr ""
5197
 
5198
+ #: includes/class-mla-settings-view-tab.php:117
5199
+ #: includes/class-mla-settings-view-tab.php:380
5200
  msgid "Singular Label"
5201
  msgstr ""
5202
 
5203
+ #: includes/class-mla-settings-view-tab.php:118
5204
+ #: includes/class-mla-settings-view-tab.php:381
5205
  msgid "Plural Label"
5206
  msgstr ""
5207
 
5208
+ #: includes/class-mla-settings-view-tab.php:119
5209
+ #: includes/class-mla-settings-view-tab.php:382
5210
  msgid ""
5211
  "The labels, e.g., &#8220;Image&#8221; and &#8220;Images&#8221; are used for "
5212
  "column headers and other display purposes."
5213
  msgstr ""
5214
 
5215
+ #: includes/class-mla-settings-view-tab.php:120
5216
+ #: includes/class-mla-settings-view-tab.php:383
5217
  msgid "Specification"
5218
  msgstr ""
5219
 
5220
+ #: includes/class-mla-settings-view-tab.php:121
5221
+ #: includes/class-mla-settings-view-tab.php:384
5222
  msgid ""
5223
  "If the MIME type specification differs from the slug, enter it here. You may "
5224
  "include multiple MIME types, e.g., &#8220;audio,video&#8221; and/or wildcard "
5226
  "MIME Type box is checked."
5227
  msgstr ""
5228
 
5229
+ #: includes/class-mla-settings-view-tab.php:122
5230
+ #: includes/class-mla-settings-view-tab.php:385
5231
  msgid "Post MIME Type"
5232
  msgstr ""
5233
 
5234
+ #: includes/class-mla-settings-view-tab.php:123
5235
+ #: includes/class-mla-settings-view-tab.php:386
5236
  msgid ""
5237
  "Check this box if you want to add this entry to the list of MIME types "
5238
  "returned by wp_get_mime_types()."
5239
  msgstr ""
5240
 
5241
+ #: includes/class-mla-settings-view-tab.php:124
5242
+ #: includes/class-mla-settings-view-tab.php:387
5243
  msgid "Table View"
5244
  msgstr ""
5245
 
5246
+ #: includes/class-mla-settings-view-tab.php:125
5247
+ #: includes/class-mla-settings-view-tab.php:388
5248
  msgid ""
5249
  "Check this box if you want to add this entry to the list of Media/Assistant "
5250
  "table views."
5251
  msgstr ""
5252
 
5253
+ #: includes/class-mla-settings-view-tab.php:127
5254
+ #: includes/class-mla-settings-view-tab.php:390
5255
  msgid ""
5256
  "You can choose your own table view order by entering a number (1 for first, "
5257
  "etc.) in this field."
5258
  msgstr ""
5259
 
5260
+ #: includes/class-mla-settings-view-tab.php:326
5261
  msgid "View and Post MIME Type Support is disabled"
5262
  msgstr ""
5263
 
 
5264
  #: includes/class-mla-settings-view-tab.php:364
5265
+ #: includes/class-mla-settings-view-tab.php:367
5266
  msgid "Library Views/Post MIME Type Processing"
5267
  msgstr ""
5268
 
5269
+ #: includes/class-mla-settings-view-tab.php:365
5270
  msgid ""
5271
  "In this tab you can manage the list of \"Post MIME Types\", which are used "
5272
  "by WordPress to define the views for the <em><strong>Media/Library</strong></"
5277
  "specifications (e.g. \"*/*ms*\")."
5278
  msgstr ""
5279
 
5280
+ #: includes/class-mla-settings-view-tab.php:367
5281
  #, php-format
5282
  msgid ""
5283
  "You can find more information about library views, Post MIME types and how "
5286
  "screen."
5287
  msgstr ""
5288
 
5289
+ #: includes/class-mla-settings-view-tab.php:367
5290
  msgid "Library View Processing documentation"
5291
  msgstr ""
5292
 
5293
+ #: includes/class-mla-settings-view-tab.php:372
5294
  msgid "Search Views"
5295
  msgstr ""
5296
 
5297
+ #: includes/class-mla-settings-view-tab.php:393
5298
  msgid "Add View"
5299
  msgstr ""
5300
 
5301
+ #: includes/class-mla-settings-view-tab.php:438
5302
  msgid "No view slug found"
5303
  msgstr ""
5304
 
5305
+ #: includes/class-mla-settings.php:426 includes/class-mla-settings.php:652
5306
+ #: includes/class-mla-settings.php:1467
5307
  msgid "Settings"
5308
  msgstr ""
5309
 
5310
+ #: includes/class-mla-settings.php:445
5311
  msgid "Views per page"
5312
  msgstr ""
5313
 
5314
+ #: includes/class-mla-settings.php:456
5315
  msgid "Types per page"
5316
  msgstr ""
5317
 
5318
+ #: includes/class-mla-settings.php:467
5319
  msgid "Upload types per page"
5320
  msgstr ""
5321
 
5322
+ #: includes/class-mla-settings.php:478
5323
  msgid "Shortcode templates per page"
5324
  msgstr ""
5325
 
5326
+ #: includes/class-mla-settings.php:489 includes/class-mla-settings.php:500
5327
  msgid "Rules per page"
5328
  msgstr ""
5329
 
5330
+ #: includes/class-mla-settings.php:512
5331
  msgid "Plugins per page"
5332
  msgstr ""
5333
 
5334
+ #: includes/class-mla-settings.php:650
5335
  msgid "Guide"
5336
  msgstr ""
5337
 
5338
+ #: includes/class-mla-settings.php:725 includes/class-mla-settings.php:762
5339
+ #: includes/class-mla-settings.php:902
5340
  #, php-format
5341
  msgctxt "error_log"
5342
  msgid "%1$s: %2$s unknown type = \"%3$s\""
5343
  msgstr ""
5344
 
5345
+ #: includes/class-mla-settings.php:800 includes/class-mla-settings.php:1067
5346
  msgid "Go to Bottom"
5347
  msgstr ""
5348
 
5349
+ #: includes/class-mla-settings.php:951
5350
  msgid "General"
5351
  msgstr ""
5352
 
5353
+ #: includes/class-mla-settings.php:952
5354
  msgid "Views"
5355
  msgstr ""
5356
 
5357
+ #: includes/class-mla-settings.php:953
5358
  msgid "Uploads"
5359
  msgstr ""
5360
 
5361
+ #: includes/class-mla-settings.php:955
5362
  msgid "Custom Fields"
5363
  msgstr ""
5364
 
5365
+ #: includes/class-mla-settings.php:956
5366
  msgid "IPTC/EXIF"
5367
  msgstr ""
5368
 
5369
+ #: includes/class-mla-settings.php:957
5370
  msgid "Documentation"
5371
  msgstr ""
5372
 
5373
+ #: includes/class-mla-settings.php:958
5374
  msgid "Debug"
5375
  msgstr ""
5376
 
5377
+ #: includes/class-mla-settings.php:1058
5378
  msgid "General Processing Options"
5379
  msgstr ""
5380
 
5381
+ #: includes/class-mla-settings.php:1060
5382
  #, php-format
5383
  msgid ""
5384
  "In this tab you can find a number of options for controlling the "
5387
  "any changes you make."
5388
  msgstr ""
5389
 
5390
+ #: includes/class-mla-settings.php:1060
5391
  msgid "Media/Assistant Table Defaults"
5392
  msgstr ""
5393
 
5394
+ #: includes/class-mla-settings.php:1060
5395
  msgid "Media Manager Enhancements"
5396
  msgstr ""
5397
 
5398
+ #: includes/class-mla-settings.php:1063
5399
  msgid "Delete General options and restore default settings"
5400
  msgstr ""
5401
 
5402
+ #: includes/class-mla-settings.php:1086
5403
  msgid "enhanced version of the WordPress [gallery] shortcode."
5404
  msgstr ""
5405
 
5406
+ #: includes/class-mla-settings.php:1087
5407
  msgid "enhanced version of the WordPress Tag Cloud."
5408
  msgstr ""
5409
 
5410
+ #: includes/class-mla-settings.php:1088
5411
  msgid ""
5412
  "provides flat or hierarchical lists, dropdown controls and checkbox lists of "
5413
  "taxonomy terms."
5414
  msgstr ""
5415
 
5416
+ #: includes/class-mla-settings.php:1100
5417
  msgid "Shortcodes made available by this plugin"
5418
  msgstr ""
5419
 
5420
+ #: includes/class-mla-settings.php:1215
5421
  msgid "Debug settings saved."
5422
  msgstr ""
5423
 
5424
+ #: includes/class-mla-settings.php:1311
5425
  #, php-format
5426
  msgid "%1$s: Reseting the %2$s file ( %3$s ) \"%4$s\"."
5427
  msgstr ""
5428
 
5429
+ #: includes/class-mla-settings.php:1311 includes/class-mla-settings.php:1362
5430
+ #: includes/class-mla-settings.php:1385 includes/class-mla-settings.php:1395
5431
+ #: includes/class-mla-settings.php:1421
5432
  msgid "Error Log"
5433
  msgstr ""
5434
 
5435
+ #: includes/class-mla-settings.php:1372
5436
  #, php-format
5437
  msgid "Error log file (%1$s) not found; click Reset to create it."
5438
  msgstr ""
5439
 
5440
+ #: includes/class-mla-settings.php:1416 includes/class-mla-settings.php:1432
5441
  msgid "Debug Options"
5442
  msgstr ""
5443
 
5444
+ #: includes/class-mla-settings.php:1419
5445
  msgid "Debug Settings"
5446
  msgstr ""
5447
 
5448
+ #: includes/class-mla-settings.php:1423
5449
  #, php-format
5450
  msgid ""
5451
  "You can find more information about the MLA Reporting/MLA_DEBUG_LEVEL values "
5452
  "in the %1$s section of the Documentation tab."
5453
  msgstr ""
5454
 
5455
+ #: includes/class-mla-settings.php:1423
5456
  msgid "MLA Debug Tab documentation"
5457
  msgstr ""
5458
 
5459
+ #: includes/class-mla-settings.php:1423
5460
  msgid "MLA Debug Tab"
5461
  msgstr ""
5462
 
5463
+ #: includes/class-mla-settings.php:1432
5464
  #, php-format
5465
  msgid "Click %1$s to update the %2$s."
5466
  msgstr ""
5467
 
5468
+ #: includes/class-mla-settings.php:1451
5469
  msgid "You do not have permission to manage plugin settings."
5470
  msgstr ""
5471
 
5472
+ #: includes/class-mla-settings.php:1477
5473
  msgid "Cannot render content tab"
5474
  msgstr ""
5475
 
5476
+ #: includes/class-mla-settings.php:1480
5477
  msgid "Unknown content tab"
5478
  msgstr ""
5479
 
5480
+ #: includes/class-mla-settings.php:1496
5481
  msgid "Dismiss this notice"
5482
  msgstr ""
5483
 
5484
+ #: includes/class-mla-settings.php:1523
5485
  #, php-format
5486
  msgid "%s attachment"
5487
  msgid_plural "%s attachments"
5488
  msgstr[0] ""
5489
  msgstr[1] ""
5490
 
5491
+ #: includes/class-mla-settings.php:1525
5492
  #, php-format
5493
  msgid "Deleted custom field value from %1$s."
5494
  msgstr ""
5495
 
5496
+ #: includes/class-mla-settings.php:1528
5497
  msgid "No attachments contained this custom field."
5498
  msgstr ""
5499
 
5500
+ #: includes/class-mla-settings.php:1559 includes/class-mla-settings.php:1569
5501
  #, php-format
5502
  msgctxt "message_list"
5503
  msgid "%1$s - references updated."
5504
  msgstr ""
5505
 
5506
+ #: includes/class-mla-settings.php:1612
5507
  msgid "General settings saved."
5508
  msgstr ""
5509
 
5510
+ #: includes/class-mla-settings.php:1651
5511
  msgid "General settings reset to default values."
5512
  msgstr ""
5513
 
5514
+ #: includes/class-mla-settings.php:1693
5515
  msgid "select settings"
5516
  msgstr ""
5517
 
5518
+ #: includes/class-mla-settings.php:1713
5519
  msgid "Import ALL Settings"
5520
  msgstr ""
5521
 
5522
+ #: includes/class-mla-settings.php:1742 includes/class-mla-settings.php:1758
5523
  msgctxt "message_list"
5524
  msgid "exported"
5525
  msgstr ""
5526
 
5527
+ #: includes/class-mla-settings.php:1744 includes/class-mla-settings.php:1760
5528
  msgctxt "message_list"
5529
  msgid "skipped"
5530
  msgstr ""
5531
 
5532
+ #: includes/class-mla-settings.php:1767
5533
  msgid "ALL settings exported."
5534
  msgstr ""
5535
 
5536
+ #: includes/class-mla-settings.php:1778
5537
  #, php-format
5538
  msgid "%1$s: The settings directory ( %2$s ) cannot be created."
5539
  msgstr ""
5540
 
5541
+ #: includes/class-mla-settings.php:1782
5542
  #, php-format
5543
  msgid "%1$s: The settings directory ( %2$s ) is not writable."
5544
  msgstr ""
5545
 
5546
+ #: includes/class-mla-settings.php:1793
5547
  #, php-format
5548
  msgid "%1$s: The settings file ( %2$s ) could not be opened."
5549
  msgstr ""
5550
 
5551
+ #: includes/class-mla-settings.php:1800
5552
  #, php-format
5553
  msgctxt "error_log"
5554
  msgid "%1$s: _export_settings $error_info = \"%2$s\"."
5555
  msgstr ""
5556
 
5557
+ #: includes/class-mla-settings.php:1809
5558
  #, php-format
5559
  msgid "%1$s: Writing the settings file ( %2$s ) \"%3$s\"."
5560
  msgstr ""
5561
 
5562
+ #: includes/class-mla-settings.php:1815
5563
  #, php-format
5564
  msgid "Settings exported; %1$s settings recorded."
5565
  msgstr ""
5566
 
5567
+ #: includes/class-mla-settings.php:1833
5568
  msgid "No settings imported."
5569
  msgstr ""
5570
 
5571
+ #: includes/class-mla-settings.php:1842
5572
  msgid "Please select an import settings file from the dropdown list."
5573
  msgstr ""
5574
 
5575
+ #: includes/class-mla-settings.php:1846
5576
  msgid "The import settings dropdown selection is missing."
5577
  msgstr ""
5578
 
5579
+ #: includes/class-mla-settings.php:1854
5580
  #, php-format
5581
  msgctxt "error_log"
5582
  msgid "%1$s: _import_settings $error_info = \"%2$s\"."
5583
  msgstr ""
5584
 
5585
+ #: includes/class-mla-settings.php:1863
5586
  #, php-format
5587
  msgid "%1$s: Reading the settings file ( %2$s ) \"%3$s\"."
5588
  msgstr ""
5589
 
5590
+ #: includes/class-mla-settings.php:1882 includes/class-mla-settings.php:1898
5591
  msgctxt "message_list"
5592
  msgid "updated"
5593
  msgstr ""
5594
 
5595
+ #: includes/class-mla-settings.php:1885 includes/class-mla-settings.php:1901
5596
  msgctxt "message_list"
5597
  msgid "unchanged"
5598
  msgstr ""
5599
 
5600
+ #: includes/class-mla-settings.php:1906
5601
  #, php-format
5602
  msgid "Settings imported; %1$s updated, %2$s unchanged."
5603
  msgstr ""
5604
 
5605
+ #: includes/class-mla-shortcode-support.php:508
5606
+ #: includes/class-mla-shortcode-support.php:1941
5607
+ #: includes/class-mla-shortcode-support.php:4027
5608
+ #: includes/class-mla-shortcode-support.php:4327
5609
  msgid "Previous"
5610
  msgstr ""
5611
 
5612
+ #: includes/class-mla-shortcode-support.php:509
5613
+ #: includes/class-mla-shortcode-support.php:1942
5614
+ #: includes/class-mla-shortcode-support.php:4074
5615
+ #: includes/class-mla-shortcode-support.php:4333
5616
  msgid "Next"
5617
  msgstr ""
5618
 
5619
+ #: includes/class-mla-shortcode-support.php:581
5620
+ #: includes/class-mla-shortcode-support.php:587
5621
+ #: includes/class-mla-shortcode-support.php:2080
5622
+ #: includes/class-mla-shortcode-support.php:2087
5623
+ #: includes/class-mla-shortcode-support.php:3400
5624
+ #: includes/class-mla-shortcode-support.php:3407
5625
  #: includes/class-mla-template-support.php:598
5626
  msgid "not found"
5627
  msgstr ""
5628
 
5629
+ #: includes/class-mla-shortcode-support.php:611
5630
+ #: includes/class-mla-shortcode-support.php:2072
5631
+ #: includes/class-mla-shortcode-support.php:3392
5632
  msgid "mla_debug REQUEST"
5633
  msgstr ""
5634
 
5635
+ #: includes/class-mla-shortcode-support.php:615
5636
+ #: includes/class-mla-shortcode-support.php:617
5637
  msgid "mla_debug attributes_errors"
5638
  msgstr ""
5639
 
5640
+ #: includes/class-mla-shortcode-support.php:623
5641
+ #: includes/class-mla-shortcode-support.php:2073
5642
+ #: includes/class-mla-shortcode-support.php:3393
5643
  msgid "mla_debug attributes"
5644
  msgstr ""
5645
 
5646
+ #: includes/class-mla-shortcode-support.php:624
5647
+ #: includes/class-mla-shortcode-support.php:2074
5648
+ #: includes/class-mla-shortcode-support.php:3394
5649
  msgid "mla_debug arguments"
5650
  msgstr ""
5651
 
5652
+ #: includes/class-mla-shortcode-support.php:716
5653
  msgid "mla_debug empty gallery"
5654
  msgstr ""
5655
 
5656
+ #: includes/class-mla-shortcode-support.php:747
5657
  msgid ""
5658
  "<strong>Photonic-enhanced [mla_gallery]</strong> type must be "
5659
  "<strong>default</strong>, query = "
5660
  msgstr ""
5661
 
5662
+ #: includes/class-mla-shortcode-support.php:1207
5663
  msgid "unknown"
5664
  msgstr ""
5665
 
5666
+ #: includes/class-mla-shortcode-support.php:2205
5667
  msgid "mla_debug empty cloud"
5668
  msgstr ""
5669
 
5670
+ #: includes/class-mla-shortcode-support.php:3528
5671
  msgid "mla_debug empty list"
5672
  msgstr ""
5673
 
5674
+ #: includes/class-mla-shortcode-support.php:3551
5675
  msgid "no-terms"
5676
  msgstr ""
5677
 
5678
+ #: includes/class-mla-shortcode-support.php:4864
5679
+ #: includes/class-mla-shortcode-support.php:5276
5680
+ #: includes/class-mla-shortcode-support.php:5307
5681
  msgid "Invalid mla_gallery"
5682
  msgstr ""
5683
 
5684
+ #: includes/class-mla-shortcode-support.php:5598
5685
  msgid "mla_debug query"
5686
  msgstr ""
5687
 
5688
+ #: includes/class-mla-shortcode-support.php:5599
5689
  msgid "mla_debug request"
5690
  msgstr ""
5691
 
5692
+ #: includes/class-mla-shortcode-support.php:5600
5693
  msgid "mla_debug query_vars"
5694
  msgstr ""
5695
 
5696
+ #: includes/class-mla-shortcode-support.php:5601
5697
  msgid "mla_debug post_count"
5698
  msgstr ""
5699
 
5700
+ #: includes/class-mla-shortcode-support.php:5625
5701
  msgid "mla_debug JOIN filter"
5702
  msgstr ""
5703
 
5704
+ #: includes/class-mla-shortcode-support.php:5665
5705
  msgid "mla_debug modified JOIN filter"
5706
  msgstr ""
5707
 
5708
+ #: includes/class-mla-shortcode-support.php:5690
5709
  msgid "mla_debug WHERE filter"
5710
  msgstr ""
5711
 
5712
+ #: includes/class-mla-shortcode-support.php:5719
5713
  msgid "mla_debug modified WHERE filter"
5714
  msgstr ""
5715
 
5716
+ #: includes/class-mla-shortcode-support.php:5742
5717
  msgid "mla_debug ORDER BY filter, incoming"
5718
  msgstr ""
5719
 
5720
+ #: includes/class-mla-shortcode-support.php:5742
5721
  msgid "Replacement ORDER BY clause"
5722
  msgstr ""
5723
 
5724
+ #: includes/class-mla-shortcode-support.php:5765
5725
  msgid "mla_debug posts_clauses filter"
5726
  msgstr ""
5727
 
5728
+ #: includes/class-mla-shortcode-support.php:5783
5729
  msgid "mla_debug posts_clauses_request filter"
5730
  msgstr ""
5731
 
5732
+ #: includes/class-mla-shortcode-support.php:6015
5733
  msgid "Invalid taxonomy"
5734
  msgstr ""
5735
 
5736
+ #: includes/class-mla-shortcode-support.php:6206
5737
  msgid "mla_debug query arguments"
5738
  msgstr ""
5739
 
5740
+ #: includes/class-mla-shortcode-support.php:6207
5741
  msgid "mla_debug last_query"
5742
  msgstr ""
5743
 
5744
+ #: includes/class-mla-shortcode-support.php:6208
5745
  msgid "mla_debug last_error"
5746
  msgstr ""
5747
 
5748
+ #: includes/class-mla-shortcode-support.php:6209
5749
  msgid "mla_debug num_rows"
5750
  msgstr ""
5751
 
5752
+ #: includes/class-mla-shortcode-support.php:6210
5753
  msgid "mla_debug found_rows"
5754
  msgstr ""
5755
 
5911
 
5912
  #: includes/class-mla-thumbnail-generation.php:96
5913
  #: includes/class-mla-thumbnail-generation.php:98
5914
+ #: includes/class-mla-thumbnail-generation.php:653
5915
  msgid "Generate Thumbnails"
5916
  msgstr ""
5917
 
5918
+ #: includes/class-mla-thumbnail-generation.php:407
5919
  #, php-format
5920
  msgid "Item %1$d"
5921
  msgstr ""
5922
 
5923
+ #: includes/class-mla-thumbnail-generation.php:425
5924
  msgid "has native thumbnail."
5925
  msgstr ""
5926
 
5927
+ #: includes/class-mla-thumbnail-generation.php:446
5928
  msgid "Featured Image retained."
5929
  msgstr ""
5930
 
5931
+ #: includes/class-mla-thumbnail-generation.php:454
5932
  #, php-format
5933
  msgid "%1$s: %2$sno attached file."
5934
  msgstr ""
5935
 
5936
+ #: includes/class-mla-thumbnail-generation.php:458
5937
  msgid "unsupported file type."
5938
  msgstr ""
5939
 
5940
+ #: includes/class-mla-thumbnail-generation.php:466
5941
+ #: includes/class-mla-thumbnail-generation.php:478
5942
  #, php-format
5943
  msgid "%1$s: %2$sthumbnail generation failed"
5944
  msgstr ""
5945
 
5946
+ #: includes/class-mla-thumbnail-generation.php:474
5947
  #, php-format
5948
  msgid "%1$sWordPress-style thumbnail generated."
5949
  msgstr ""
5950
 
5951
+ #: includes/class-mla-thumbnail-generation.php:522
5952
  #, php-format
5953
  msgid "%1$s: %2$swp_insert_attachment failed."
5954
  msgstr ""
5955
 
5956
+ #: includes/class-mla-thumbnail-generation.php:539
5957
  #, php-format
5958
  msgid "%1$sthumbnail generated as new item %2$s."
5959
  msgstr ""
5960
 
5961
+ #: includes/class-mla-thumbnail-generation.php:588
5962
+ #: includes/class-mla-thumbnail-generation.php:697
5963
  msgid "Generated Thumbnails"
5964
  msgstr ""
5965
 
5966
+ #: includes/class-mla-thumbnail-generation.php:643
5967
  msgid ""
5968
  "Type &ldquo;WP&rdquo; generates native WordPress thumbnails without creating "
5969
  "a separate image item."
5970
  msgstr ""
5971
 
5972
+ #: includes/class-mla-thumbnail-generation.php:654
5973
  msgid ""
5974
  "Pull down the Help menu and select Thumbnail Generation for setting details"
5975
  msgstr ""
5976
 
5977
+ #: includes/class-mla-thumbnail-generation.php:655
5978
  msgid "Width"
5979
  msgstr ""
5980
 
5981
+ #: includes/class-mla-thumbnail-generation.php:656
5982
  msgid "Height"
5983
  msgstr ""
5984
 
5985
+ #: includes/class-mla-thumbnail-generation.php:657
5986
  msgid "Best Fit"
5987
  msgstr ""
5988
 
5989
+ #: includes/class-mla-thumbnail-generation.php:658
5990
  msgid "Page"
5991
  msgstr ""
5992
 
5993
+ #: includes/class-mla-thumbnail-generation.php:659
5994
  msgid "Resolution"
5995
  msgstr ""
5996
 
5997
+ #: includes/class-mla-thumbnail-generation.php:660
5998
  msgid "Quality"
5999
  msgstr ""
6000
 
6001
+ #: includes/class-mla-thumbnail-generation.php:666
6002
  msgid "Existing Items"
6003
  msgstr ""
6004
 
6005
+ #: includes/class-mla-thumbnail-generation.php:668
6006
  msgid "Ignore"
6007
  msgstr ""
6008
 
6009
+ #: includes/class-mla-thumbnail-generation.php:671
6010
  msgid "Suffix"
6011
  msgstr ""
6012
 
6013
+ #: includes/class-mla-wpml-support.php:445
6014
  msgid "Duplicate translation created; update as desired."
6015
  msgstr ""
6016
 
6017
+ #: includes/class-mla-wpml-support.php:1597
6018
  msgid "Make media available in all languages"
6019
  msgstr ""
6020
 
6021
+ #: includes/class-mla-wpml-support.php:1747
6022
  msgid " WPML Media is not installed."
6023
  msgstr ""
6024
 
6025
+ #: includes/class-mla-wpml-support.php:1749
6026
  msgid " WPML Media is not active."
6027
  msgstr ""
6028
 
6029
+ #: includes/class-mla-wpml-support.php:1755
6030
  #, php-format
6031
  msgid ""
6032
  "In this tab you can find a number of options for controlling WPML-specific "
6034
  "\"Save Changes\" at the bottom of the tab to save any changes you make."
6035
  msgstr ""
6036
 
6037
+ #: includes/class-mla-wpml-support.php:2306
6038
+ #: includes/class-mla-wpml-support.php:2312
6039
  #, php-format
6040
  msgid "Edit the %s translation"
6041
  msgstr ""
6042
 
6043
+ #: includes/class-mla-wpml-support.php:2318
6044
  #, php-format
6045
  msgid "Add translation to %s"
6046
  msgstr ""
languages/media-library-assistant-en_US.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Media Library Assistant\n"
4
- "POT-Creation-Date: 2020-08-13 16:21-0700\n"
5
- "PO-Revision-Date: 2020-08-13 16:21-0700\n"
6
- "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
@@ -11,7 +11,8 @@ msgstr ""
11
  "X-Poedit-Basepath: ..\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
14
- "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c\n"
 
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "Last-Translator: David Lingren <dlingren@comcast.net>\n"
17
  "Language: en_US\n"
@@ -1709,6 +1710,10 @@ msgstr ""
1709
  msgid "You do not have permission to manage attachments."
1710
  msgstr ""
1711
 
 
 
 
 
1712
  #, php-format
1713
  msgctxt "deleted items"
1714
  msgid "%s item deleted."
@@ -2655,10 +2660,10 @@ msgstr ""
2655
  msgid "Nothing to execute"
2656
  msgstr ""
2657
 
2658
- msgid "Rule ID not found"
2659
  msgstr ""
2660
 
2661
- msgid "Rule not found"
2662
  msgstr ""
2663
 
2664
  msgctxt "list_table_column"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Media Library Assistant\n"
4
+ "POT-Creation-Date: 2020-11-20 16:53-0800\n"
5
+ "PO-Revision-Date: 2020-11-20 16:53-0800\n"
6
+ "Language-Team: David Lingren <david@davidlingren.com>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
11
  "X-Poedit-Basepath: ..\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
14
+ "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
15
+ "esc_html__;esc_html_e;esc_html_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Last-Translator: David Lingren <dlingren@comcast.net>\n"
18
  "Language: en_US\n"
1710
  msgid "You do not have permission to manage attachments."
1711
  msgstr ""
1712
 
1713
+ msgctxt "file"
1714
+ msgid "Add New"
1715
+ msgstr ""
1716
+
1717
  #, php-format
1718
  msgctxt "deleted items"
1719
  msgid "%s item deleted."
2660
  msgid "Nothing to execute"
2661
  msgstr ""
2662
 
2663
+ msgid "Rule not found"
2664
  msgstr ""
2665
 
2666
+ msgid "Rule ID not found"
2667
  msgstr ""
2668
 
2669
  msgctxt "list_table_column"
languages/media-library-assistant-en_US.pot CHANGED
@@ -2,10 +2,10 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Media Library Assistant\n"
5
- "POT-Creation-Date: 2020-08-13 16:20-0700\n"
6
  "PO-Revision-Date: 2015-08-21 21:38-0800\n"
7
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
8
- "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
9
  "Language: en_US\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -14,7 +14,8 @@ msgstr ""
14
  "X-Poedit-Basepath: ..\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
- "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c\n"
 
18
  "X-Poedit-SourceCharset: UTF-8\n"
19
  "X-Poedit-SearchPath-0: includes\n"
20
  "X-Poedit-SearchPath-1: tests\n"
@@ -1710,6 +1711,10 @@ msgstr ""
1710
  msgid "You do not have permission to manage attachments."
1711
  msgstr ""
1712
 
 
 
 
 
1713
  #, php-format
1714
  msgctxt "deleted items"
1715
  msgid "%s item deleted."
@@ -2656,10 +2661,10 @@ msgstr ""
2656
  msgid "Nothing to execute"
2657
  msgstr ""
2658
 
2659
- msgid "Rule ID not found"
2660
  msgstr ""
2661
 
2662
- msgid "Rule not found"
2663
  msgstr ""
2664
 
2665
  msgctxt "list_table_column"
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Media Library Assistant\n"
5
+ "POT-Creation-Date: 2020-11-20 16:52-0800\n"
6
  "PO-Revision-Date: 2015-08-21 21:38-0800\n"
7
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
8
+ "Language-Team: David Lingren <david@davidlingren.com>\n"
9
  "Language: en_US\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
+ "_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
18
+ "esc_html__;esc_html_e;esc_html_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c\n"
19
  "X-Poedit-SourceCharset: UTF-8\n"
20
  "X-Poedit-SearchPath-0: includes\n"
21
  "X-Poedit-SearchPath-1: tests\n"
1711
  msgid "You do not have permission to manage attachments."
1712
  msgstr ""
1713
 
1714
+ msgctxt "file"
1715
+ msgid "Add New"
1716
+ msgstr ""
1717
+
1718
  #, php-format
1719
  msgctxt "deleted items"
1720
  msgid "%s item deleted."
2661
  msgid "Nothing to execute"
2662
  msgstr ""
2663
 
2664
+ msgid "Rule not found"
2665
  msgstr ""
2666
 
2667
+ msgid "Rule ID not found"
2668
  msgstr ""
2669
 
2670
  msgctxt "list_table_column"
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: dglingren
3
  Donate link: http://davidlingren.com/#two
4
  Tags: media, media library, gallery, images, categories, tags, attachments, IPTC, EXIF, XMP, GPS, PDF, metadata, photos, photographs, photo albums, MIME, mime-type, icon, upload, file extensions, WPML, Polylang
5
  Requires at least: 3.5.0
6
- Tested up to: 5.5
7
  Requires PHP: 5.3
8
- Stable tag: 2.84
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -181,34 +181,24 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
181
 
182
  == Changelog ==
183
 
184
- = 2.84 =
185
- * New: For the "MLA Substitution Parameter Hooks Example" plugin, a new "ucwords" custom format value lets you uppercase the first letter in each word of a string.
186
- * New: For the Media/Assistant submenu table, if a non-image item has a Featured Image, it will be displayed as the item thumbnail instead of the MIME Type icon.
187
- * New: A new option, "Always Use MLA MIME Type", has been added to the Settings/Media Library Assistant Uploads tab. When checked, this option overrides WordPress validation logic that fails some uploads for "security purposes". For example, a CSV file that contains HTML tags on one or more cells. More information in the "Help" dropdown menu for the tab.
188
- * New: Support for the PaidMembershipsPro plugin has been added. MLA will restrict access to attachments assigned to "members-only categories" in the `[mla_gallery]` shortcode.
189
- * New: The "MLA Gallery Download Archive" example plugin implements a shortcode that lets you download the files attached to a "gallery" of Media library items as a ZIP archive file. Documentation is provided in comments at the start of the source code.
190
- * New: The "MLA CSV Data Source Example" plugin allows you to access values in a CSV file as a custom Data Source for MLA Bulk Edit templates, mapping rules and shortcode parameters. Detailed instructions are provided in a Documentation tab.
191
- * New: For the `[mla_tag_cloud]` and `[mla_term_list]` shortcodes, the `orderby=term_order` parameter supports the "drag and drop" ordering of taxonomy terms created by the <a href="https://wordpress.org/plugins/simple-custom-post-order/" target="_blank" rel="noopener noreferrer nofollow">Simple Custom Post Order</a> plugin.
192
- * New: For the `[mla_tag_cloud]` and `[mla_term_list]` shortcodes, the `orderby=tax_position` parameter supports the "drag and drop" ordering of taxonomy terms created by the <a href="https://wordpress.org/plugins/simple-taxonomy-ordering/" target="_blank" rel="noopener noreferrer nofollow">Simple Taxonomy Ordering</a> plugin.
193
- * New: For the Media/Assistant admin submenu and `[mla_gallery]` shortcode, support is added for the "Media Library" filter used in the <a href="https://wordpress.org/plugins/featured-image-from-url/" target="_blank" rel="noopener noreferrer nofollow">Featured Image from URL</a> plugin.
194
- * New: For the "MLA Advanced Custom Fields Example" plugin, add "where used" information for the ACF "image" field type. See the first page of the plugin source code for details.
195
- * New: A new `MLA_DEBUG_LEVEL` category allows logging of "query-attachments" requests and results for the Media Manager Modal Window.
196
- * New: For IPTC/EXIF taxonomy mapping rules, the "text" option supports composing a term name from a Content Template with multiple data sources.
197
- * New: Allow ALT Taxt values to be assigned to `application\*` MIME types, such as PDF documents, in the Media/Assistant Bulk Edit and Quick Edit areas. These will populate the `alt=` attributes of `<img>` tags in `[mla_gallery]` displays.
198
- * Fix: Deprecated Jquery functions have been replaced for compatibility with WP 5.5+.
199
- * Fix: Cross site scripting (reflected) and HTTP parameter pollution problems in `[mla_gallery]` pagination controls have been resolved.
200
- * Fix: Some problems parsing Content Templates with nested "test" delimiters have been resolved.
201
- * Fix: References to the `WP_Query` class documentation in the WordPress Code Reference have been updated.
202
- * Fix: Accommodate WordPress 5.4.2 bug that prevents changing "items per screen",e.g., on the Media/Assistant submenu table.
203
- * Fix: Correct parsing problems with embedded delimiter characters in Content Template choice elements.
204
- * Fix: Allow mapping rule taxonomy term assignment for "not logged in" applications such as WP/LR Sync.
205
- * Fix: Avoid PHP Notice messages for attempts to extract non-existent metadata from, for example, SVG images.
206
- * Fix: For the `[mla_gallery]` shortcode, empty `tax_query` parameters are now accepted and ignored, matching the behavior of simple taxonomy parameters.
207
- * Fix: For the Bulk Edit Area in the Media/Add New (Upload New Media) screen, content templates with backslash characters are now parsed and processed correctly.
208
- * Fix: For Admin Columns v4.1+ and Pro v5.0+, correct "Deprecated: AC\AdminColumns::register_list_screen..." problem.
209
- * Fix: For the "MLA Custom Feed Example" plugin, correct the handling of values containing quotes and special characters in the "Edit Feed" page.
210
-
211
- = 2.80 - 2.83 =
212
  * 2.83 - Avoid "Fatal error:" with Admin Columns Pro version 5.1+. Fix Attachments area positioning in the Media Manager Modal (popup) Window. Two fixes in all.
213
  * 2.82 - Compatibility updates for WordPress 5.4. Security fixes to prevent three categories of attacks. New tools for "MLA Insert Fixit" and “WooCommerce Fixit Tools" example plugins. Fixes for `[mla_gallery]` and Media Manager Modal Window. Seven enhancements in all, eleven fixes.
214
  * 2.81 - Compatibility updates for WordPress 5.3. New "mso:" prefix gives access to the Document Properties embedded in Office Open XML file formats (e.g., docx, xlsx, pptx). Three enhancements, eight fixes.
@@ -317,8 +307,8 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
317
 
318
  == Upgrade Notice ==
319
 
320
- = 2.84 =
321
- WP 5.5 support, new Always Use MLA MIME Type option, CSV Data Source example plugin, Support for PaidMembershipsPro, Simple Taxonomy Ordering, Simple Custom Post Order, Featured Image from URL plugins. Thirteen enhancements in all, twelve fixes.
322
 
323
  == Other Notes ==
324
 
3
  Donate link: http://davidlingren.com/#two
4
  Tags: media, media library, gallery, images, categories, tags, attachments, IPTC, EXIF, XMP, GPS, PDF, metadata, photos, photographs, photo albums, MIME, mime-type, icon, upload, file extensions, WPML, Polylang
5
  Requires at least: 3.5.0
6
+ Tested up to: 5.6
7
  Requires PHP: 5.3
8
+ Stable tag: 2.90
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
181
 
182
  == Changelog ==
183
 
184
+ = 2.90 =
185
+ * New: <strong>A new example plugin, "MLA Parent Custom Field Mapping"</strong>, allows IPTC/EXIF and Custom Field mapping rules to update custom fields in the item's parent post/page rather than the items's own fields. Support for Advanced Custom Fields and WP/LR Sync is included.
186
+ * New: <strong>The "MLA Randon Galleries Example" plugin has been greatly enhanced</strong>. The new version has many more parameters and a new plugin options page. A Documentation tab on the settings page contains all the information you need to understand and use the new version.
187
+ * New: Three new field level data sources have been added for use in mapping rules, etc. They are `site_url`, `base_url` and `base_dir`. The last two give the location of the uploads directory.
188
+ * New: For the `[mla_gallery]` shortcode, a new `size=icon_feature` parameter value will display item icons or the "Featured Image" associated with an item. This can be used to suppress the thumbnails and "PDF Thumbnails" that appear when `size=icon` is specified, but retain the explicitly assigned Featured Images.
189
+ * New: For Advanced Custom Fields Pro "Gallery" Fields, restrictions such as minimum/maximum dimensions and sizes are now respected when adding items to the gallery.
190
+ * New: For Custom Field or IPTC/EXIF mapping rules, a new "mla_purge_custom_field_values" filter lets you override the default "Purge Values" processing, and a new "mla_mapping_old_custom_value" filter lets you replace the current target value for "Existing Text" processing.
191
+ * New: Added support for applying mapping rules to attachments created by "Postie" cron jobs.
192
+ * Fix: Systematic review and update of all files for validating, sanitizing and escaping user data to reduce the risk of security exploits.
193
+ * Fix: Allow IPTC and XMP metadata extraction from images that fail the WordPress `getimagesize( $path, $info )` logic.
194
+ * Fix: For the `[mla_gallery]` shortcode, the default style and markup templates have been adjusted for greater compatibility with the styles and markup used in the WordPress `[gallery]` shortcode.
195
+ * Fix: For the Media Manager Modal (popup) Window, changing term assignment(s) for Media Library items no longer changes the corresponding checkbox(s) in the underlying post/page.
196
+ * Fix: For Media/Assistant submenu table filtering by a custom field value, dropdown setting is now retained and pagination controls have been repaired.
197
+ * Fix: Deprecated reference to `postL10n.dateFormat` has been replaced with `wp.i18n.__`.
198
+ * Fix: Handling of `[mla_gallery]` shortcodes with a blank but non-empty parameter string has been corrected.
199
+
200
+ = 2.80 - 2.84 =
201
+ * 2.84 - WP 5.5 support, new Always Use MLA MIME Type option, CSV Data Source example plugin, Support for PaidMembershipsPro, Simple Taxonomy Ordering, Simple Custom Post Order, Featured Image from URL plugins. Thirteen enhancements in all, twelve fixes.
 
 
 
 
 
 
 
 
 
 
202
  * 2.83 - Avoid "Fatal error:" with Admin Columns Pro version 5.1+. Fix Attachments area positioning in the Media Manager Modal (popup) Window. Two fixes in all.
203
  * 2.82 - Compatibility updates for WordPress 5.4. Security fixes to prevent three categories of attacks. New tools for "MLA Insert Fixit" and “WooCommerce Fixit Tools" example plugins. Fixes for `[mla_gallery]` and Media Manager Modal Window. Seven enhancements in all, eleven fixes.
204
  * 2.81 - Compatibility updates for WordPress 5.3. New "mso:" prefix gives access to the Document Properties embedded in Office Open XML file formats (e.g., docx, xlsx, pptx). Three enhancements, eight fixes.
307
 
308
  == Upgrade Notice ==
309
 
310
+ = 2.90 =
311
+ WP 5.6 support, thorough review and update of all files for validating, sanitizing and escaping user data to reduce the risk of security exploits, two new example plugins. Seven enhancements in all, seven fixes.
312
 
313
  == Other Notes ==
314
 
tpls/admin-display-settings-iptc-exif-tab.tpl CHANGED
@@ -352,7 +352,7 @@ href="#mla-new-iptc-exif"> [+Cancel new field+] </a></td>
352
  <option value="">[+Replace+]</option>
353
  </select>
354
  </span> </label>
355
- <label class="alignleft"> <span class="dropdown-title">[+Option+]</span> <span class="input-dropdown-wrap">
356
  <select name="tax_option">
357
  <option value="array">[+Array+]</option>
358
  <option value="text">[+Text+]</option>
352
  <option value="">[+Replace+]</option>
353
  </select>
354
  </span> </label>
355
+ <label class="alignleft inline-taxonomy-group"> <span class="dropdown-title">[+Option+]</span> <span class="input-dropdown-wrap">
356
  <select name="tax_option">
357
  <option value="array">[+Array+]</option>
358
  <option value="text">[+Text+]</option>
tpls/documentation-settings-tab.tpl CHANGED
@@ -631,6 +631,10 @@ The Size parameter specifies the image size to use for the thumbnail display; "t
631
  <td>Display an appropriate 60x60 (or 64x64) pixel thumbnail for image items and an appropriate icon for non-image items such as PDF or text files.</td>
632
  </tr>
633
  <tr>
 
 
 
 
634
  <td class="mla-doc-table-label">icon_only</td>
635
  <td>Display an appropriate 60x60 (or 64x64) pixel icon for <strong>ALL</strong> items, image and non-image.</td>
636
  </tr>
@@ -4578,6 +4582,18 @@ Each Media Library attachment item has a row in the "posts" database table that
4578
  <td style="padding-bottom: 2em;">ALT text, for image types. If there are multiple values (unlikely) they will be returned as a comma-separated list. You can use the ",single" or ",export" option values to change that.</td>
4579
  </tr>
4580
  <tr>
 
 
 
 
 
 
 
 
 
 
 
 
4581
  <td class="mla-doc-table-label">absolute_path</td>
4582
  <td>complete path portion of the attachment file, e.g., C:/site/wordpress/wp-content/uploads/2012/11/</td>
4583
  </tr>
@@ -6908,6 +6924,10 @@ The current mapping hooks are:
6908
  <td class="mla-doc-hook-definition">called once for each custom field mapping rule, after the rule is evaluated. You can change the new value produced by the rule.</td>
6909
  </tr>
6910
  <tr>
 
 
 
 
6911
  <td class="mla-doc-table-label">mla_mapping_iptc_value</td>
6912
  <td class="mla-doc-hook-definition">called once for each IPTC/EXIF mapping rule, after the IPTC portion of the rule is evaluated. You can change the new value produced by the rule.</td>
6913
  </tr>
@@ -6927,6 +6947,10 @@ The current mapping hooks are:
6927
  <td class="mla-doc-table-label">mla_end_mapping</td>
6928
  <td class="mla-doc-hook-definition">called once, after mapping rules for any/all attachment(s) are executed. This is a good place to close files, perform cleanup, etc.</td>
6929
  </tr>
 
 
 
 
6930
  </table>
6931
  <p>
6932
  A second example plugin, <a title="Find the Metadata Mapping Hooks Example" href="[+example_url+]&amp;mla-example-search=Search+Plugins&amp;s=%22MLA+Metadata+Mapping+Hooks+Example%22" class="mla-doc-bold-link">MLA Metadata Mapping Hooks Example</a>, illustrates the metadata hooks. The current insert attachment/update attachment metadata hooks are:
631
  <td>Display an appropriate 60x60 (or 64x64) pixel thumbnail for image items and an appropriate icon for non-image items such as PDF or text files.</td>
632
  </tr>
633
  <tr>
634
+ <td class="mla-doc-table-label">icon_feature</td>
635
+ <td>Display an appropriate 60x60 (or 64x64) pixel icon for <strong>ALL</strong> items, image and non-image. If, however, an item has a "Featured Image" it will replace the icon.</td>
636
+ </tr>
637
+ <tr>
638
  <td class="mla-doc-table-label">icon_only</td>
639
  <td>Display an appropriate 60x60 (or 64x64) pixel icon for <strong>ALL</strong> items, image and non-image.</td>
640
  </tr>
4582
  <td style="padding-bottom: 2em;">ALT text, for image types. If there are multiple values (unlikely) they will be returned as a comma-separated list. You can use the ",single" or ",export" option values to change that.</td>
4583
  </tr>
4584
  <tr>
4585
+ <td class="mla-doc-table-label">site_url</td>
4586
+ <td style="vertical-align: top">absolute URL to the site directory, without trailing slash.</td>
4587
+ </tr>
4588
+ <tr>
4589
+ <td class="mla-doc-table-label">base_url</td>
4590
+ <td>absolute URL to the upload directory, without trailing slash.</td>
4591
+ </tr>
4592
+ <tr>
4593
+ <td class="mla-doc-table-label">base_dir</td>
4594
+ <td style="padding-bottom: 2em;">absolute (full) path to the upload directory, without trailing slash.</td>
4595
+ </tr>
4596
+ <tr>
4597
  <td class="mla-doc-table-label">absolute_path</td>
4598
  <td>complete path portion of the attachment file, e.g., C:/site/wordpress/wp-content/uploads/2012/11/</td>
4599
  </tr>
6924
  <td class="mla-doc-hook-definition">called once for each custom field mapping rule, after the rule is evaluated. You can change the new value produced by the rule.</td>
6925
  </tr>
6926
  <tr>
6927
+ <td class="mla-doc-table-label">mla_mapping_old_custom_value</td>
6928
+ <td class="mla-doc-hook-definition">called once for each Custom Field mapping rule, after the "old text" portion of the rule is evaluated. You can change the old value produced by the rule.</td>
6929
+ </tr>
6930
+ <tr>
6931
  <td class="mla-doc-table-label">mla_mapping_iptc_value</td>
6932
  <td class="mla-doc-hook-definition">called once for each IPTC/EXIF mapping rule, after the IPTC portion of the rule is evaluated. You can change the new value produced by the rule.</td>
6933
  </tr>
6947
  <td class="mla-doc-table-label">mla_end_mapping</td>
6948
  <td class="mla-doc-hook-definition">called once, after mapping rules for any/all attachment(s) are executed. This is a good place to close files, perform cleanup, etc.</td>
6949
  </tr>
6950
+ <tr>
6951
+ <td class="mla-doc-table-label">mla_purge_custom_field_values</td>
6952
+ <td class="mla-doc-hook-definition">called once for each custom field mapping rule, when the "Purge Values" rollover or Bulk action is executed. This is a good place to apply your own purge logic or prevent the purge from taking place.</td>
6953
+ </tr>
6954
  </table>
6955
  <p>
6956
  A second example plugin, <a title="Find the Metadata Mapping Hooks Example" href="[+example_url+]&amp;mla-example-search=Search+Plugins&amp;s=%22MLA+Metadata+Mapping+Hooks+Example%22" class="mla-doc-bold-link">MLA Metadata Mapping Hooks Example</a>, illustrates the metadata hooks. The current insert attachment/update attachment metadata hooks are:
tpls/help-for-thumbnail_generation.tpl CHANGED
@@ -48,10 +48,6 @@ You can select "Delete" to replace WordPress-style thumbnails (Type "WP") like t
48
  <td class="mla-doc-table-label">Suffix</td>
49
  <td>the suffix added to the source item's Title to create the thumbnail's Title. Suffix is ignored when generating WordPress-style thumbnails.</td>
50
  </tr>
51
- <tr>
52
- <td class="mla-doc-table-label">Clear Filter-by</td>
53
- <td>remove the "Filter-by" criteria when refreshing the display. Leaving criteria such as year/month or Search Media values in place can prevent the display of the new, generated items.</td>
54
- </tr>
55
  </table>
56
  <p>After you click Generate Thumbnails, the Media/Assistant submenu table will be refreshed to display all the new items generated and added to the Media Library. You can use Quick Edit and Bulk Edit to make additional changes to the new items.</p>
57
  <!-- template="sidebar" -->
48
  <td class="mla-doc-table-label">Suffix</td>
49
  <td>the suffix added to the source item's Title to create the thumbnail's Title. Suffix is ignored when generating WordPress-style thumbnails.</td>
50
  </tr>
 
 
 
 
51
  </table>
52
  <p>After you click Generate Thumbnails, the Media/Assistant submenu table will be refreshed to display all the new items generated and added to the Media Library. You can use Quick Edit and Bulk Edit to make additional changes to the new items.</p>
53
  <!-- template="sidebar" -->
tpls/mla-custom-templates.tpl CHANGED
@@ -9,6 +9,7 @@
9
  #[+selector+] .gallery-item {
10
  float: [+float+];
11
  margin: [+margin+];
 
12
  text-align: center;
13
  width: [+itemwidth+];
14
  }
@@ -37,9 +38,7 @@ mla_shortcode_slug="gallery"
37
  <[+icontag+] class='gallery-icon [+orientation+]'>
38
  [+link+]
39
  </[+icontag+]>
40
- [+captiontag_content+]
41
- </[+itemtag+]>
42
-
43
  <!-- template="default-row-close-markup" -->
44
  <br style="clear: both" />
45
 
9
  #[+selector+] .gallery-item {
10
  float: [+float+];
11
  margin: [+margin+];
12
+ display: inline-block;
13
  text-align: center;
14
  width: [+itemwidth+];
15
  }
38
  <[+icontag+] class='gallery-icon [+orientation+]'>
39
  [+link+]
40
  </[+icontag+]>
41
+ [+captiontag_content+]</[+itemtag+]>
 
 
42
  <!-- template="default-row-close-markup" -->
43
  <br style="clear: both" />
44
 
tpls/mla-option-templates.tpl CHANGED
@@ -74,7 +74,7 @@
74
 
75
  <!-- template="taxonomy-metakey-row" -->
76
  <tr valign="top">
77
- <td colspan="5" style="text-align:right;">
78
  <input type="radio" name="tax_metakey_sort" id="tax_metakey_asc" [+asc_checked+] value="ASC" /> ASC&nbsp;&nbsp;
79
  <input type="radio" name="tax_metakey_sort" id="tax_metakey_desc" [+desc_checked+] value="DESC" /> DESC&nbsp;&nbsp;
80
  <select name="tax_metakey" id="tax_metakey">
74
 
75
  <!-- template="taxonomy-metakey-row" -->
76
  <tr valign="top">
77
+ <td colspan="6" style="text-align:right;">
78
  <input type="radio" name="tax_metakey_sort" id="tax_metakey_asc" [+asc_checked+] value="ASC" /> ASC&nbsp;&nbsp;
79
  <input type="radio" name="tax_metakey_sort" id="tax_metakey_desc" [+desc_checked+] value="DESC" /> DESC&nbsp;&nbsp;
80
  <select name="tax_metakey" id="tax_metakey">
tpls/mla-thumbnail-generation.tpl CHANGED
@@ -56,7 +56,7 @@
56
  </select>
57
  </label></td>
58
  <td><label> <span class="title">[+Suffix+]</span>
59
- <input name="mla_thumbnail_options[suffix]" id="mla-thumbnail-options-quality" type="text" size="15" value="[+default_suffix+]" />
60
  </label></td>
61
  </tr></table>
62
  <p>&nbsp;&nbsp;[+WP Help+]</p>
56
  </select>
57
  </label></td>
58
  <td><label> <span class="title">[+Suffix+]</span>
59
+ <input name="mla_thumbnail_options[suffix]" id="mla-thumbnail-options-suffix" type="text" size="15" value="[+default_suffix+]" />
60
  </label></td>
61
  </tr></table>
62
  <p>&nbsp;&nbsp;[+WP Help+]</p>