Changeset 2758024
- Timestamp:
- 07/18/2022 03:04:30 PM (4 years ago)
- Location:
- media-library-organizer
- Files:
-
- 60 edited
- 1 copied
-
tags/1.4.6 (copied) (copied from media-library-organizer/trunk)
-
tags/1.4.6/_modules/dashboard/class-wpzincdashboardwidget.php (modified) (26 diffs)
-
tags/1.4.6/_modules/dashboard/views/deactivation-modal.php (modified) (3 diffs)
-
tags/1.4.6/_modules/dashboard/views/footer-upgrade-embedded.php (modified) (1 diff)
-
tags/1.4.6/_modules/dashboard/views/footer-upgrade.php (modified) (2 diffs)
-
tags/1.4.6/_modules/dashboard/views/import-export.php (modified) (10 diffs)
-
tags/1.4.6/_modules/dashboard/views/review-notice.php (modified) (3 diffs)
-
tags/1.4.6/_modules/dashboard/views/sidebar-upgrade.php (modified) (2 diffs)
-
tags/1.4.6/addons/tree-view/class-media-library-organizer-tree-view.php (modified) (2 diffs)
-
tags/1.4.6/addons/tree-view/includes/global/class-media-library-organizer-tree-view-media.php (modified) (2 diffs)
-
tags/1.4.6/addons/tree-view/includes/global/class-media-library-organizer-tree-view-taxonomy-walker.php (modified) (1 diff)
-
tags/1.4.6/addons/tree-view/views/admin/media.php (modified) (1 diff)
-
tags/1.4.6/assets/css/media.css (modified) (1 diff)
-
tags/1.4.6/assets/js/media.js (modified) (6 diffs)
-
tags/1.4.6/assets/js/min/media-min.js (modified) (1 diff)
-
tags/1.4.6/assets/scss/media.scss (modified) (3 diffs)
-
tags/1.4.6/includes/admin/class-media-library-organizer-admin.php (modified) (6 diffs)
-
tags/1.4.6/includes/admin/class-media-library-organizer-api.php (modified) (1 diff)
-
tags/1.4.6/includes/admin/class-media-library-organizer-import.php (modified) (4 diffs)
-
tags/1.4.6/includes/admin/class-media-library-organizer-notices.php (modified) (2 diffs)
-
tags/1.4.6/includes/class-media-library-organizer.php (modified) (3 diffs)
-
tags/1.4.6/includes/global/class-media-library-organizer-ajax.php (modified) (2 diffs)
-
tags/1.4.6/includes/global/class-media-library-organizer-common.php (modified) (2 diffs)
-
tags/1.4.6/includes/global/class-media-library-organizer-media.php (modified) (11 diffs)
-
tags/1.4.6/includes/global/class-media-library-organizer-taxonomy-walker.php (modified) (4 diffs)
-
tags/1.4.6/includes/global/class-media-library-organizer-upload.php (modified) (1 diff)
-
tags/1.4.6/media-library-organizer.php (modified) (3 diffs)
-
tags/1.4.6/readme.txt (modified) (2 diffs)
-
tags/1.4.6/views/admin/import-enhanced-media-library.php (modified) (2 diffs)
-
tags/1.4.6/views/admin/settings-general.php (modified) (2 diffs)
-
tags/1.4.6/views/admin/settings.php (modified) (1 diff)
-
trunk/_modules/dashboard/class-wpzincdashboardwidget.php (modified) (26 diffs)
-
trunk/_modules/dashboard/views/deactivation-modal.php (modified) (3 diffs)
-
trunk/_modules/dashboard/views/footer-upgrade-embedded.php (modified) (1 diff)
-
trunk/_modules/dashboard/views/footer-upgrade.php (modified) (2 diffs)
-
trunk/_modules/dashboard/views/import-export.php (modified) (10 diffs)
-
trunk/_modules/dashboard/views/review-notice.php (modified) (3 diffs)
-
trunk/_modules/dashboard/views/sidebar-upgrade.php (modified) (2 diffs)
-
trunk/addons/tree-view/class-media-library-organizer-tree-view.php (modified) (2 diffs)
-
trunk/addons/tree-view/includes/global/class-media-library-organizer-tree-view-media.php (modified) (2 diffs)
-
trunk/addons/tree-view/includes/global/class-media-library-organizer-tree-view-taxonomy-walker.php (modified) (1 diff)
-
trunk/addons/tree-view/views/admin/media.php (modified) (1 diff)
-
trunk/assets/css/media.css (modified) (1 diff)
-
trunk/assets/js/media.js (modified) (6 diffs)
-
trunk/assets/js/min/media-min.js (modified) (1 diff)
-
trunk/assets/scss/media.scss (modified) (3 diffs)
-
trunk/includes/admin/class-media-library-organizer-admin.php (modified) (6 diffs)
-
trunk/includes/admin/class-media-library-organizer-api.php (modified) (1 diff)
-
trunk/includes/admin/class-media-library-organizer-import.php (modified) (4 diffs)
-
trunk/includes/admin/class-media-library-organizer-notices.php (modified) (2 diffs)
-
trunk/includes/class-media-library-organizer.php (modified) (3 diffs)
-
trunk/includes/global/class-media-library-organizer-ajax.php (modified) (2 diffs)
-
trunk/includes/global/class-media-library-organizer-common.php (modified) (2 diffs)
-
trunk/includes/global/class-media-library-organizer-media.php (modified) (11 diffs)
-
trunk/includes/global/class-media-library-organizer-taxonomy-walker.php (modified) (4 diffs)
-
trunk/includes/global/class-media-library-organizer-upload.php (modified) (1 diff)
-
trunk/media-library-organizer.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/admin/import-enhanced-media-library.php (modified) (2 diffs)
-
trunk/views/admin/settings-general.php (modified) (2 diffs)
-
trunk/views/admin/settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
media-library-organizer/tags/1.4.6/_modules/dashboard/class-wpzincdashboardwidget.php
r2747124 r2758024 438 438 439 439 // Define minimum capability for accessing Import and Export Sub Menu. 440 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */441 442 add_submenu_page( $slug, __( 'Import & Export', $this->plugin->name ), __( 'Import & Export', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-import-export', array( $this, 'import_export_screen' ) ); / * phpcs:ignore */440 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 441 442 add_submenu_page( $slug, __( 'Import & Export', $this->plugin->name ), __( 'Import & Export', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-import-export', array( $this, 'import_export_screen' ) ); // phpcs:ignore WordPress.WP.I18n 443 443 444 444 } … … 463 463 464 464 // Define minimum capability for accessing Support Menu. 465 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */466 467 add_submenu_page( $slug, __( 'Support', $this->plugin->name ), __( 'Support', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-support', array( $this, 'support_screen' ) ); / * phpcs:ignore */465 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 466 467 add_submenu_page( $slug, __( 'Support', $this->plugin->name ), __( 'Support', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-support', array( $this, 'support_screen' ) ); // phpcs:ignore WordPress.WP.I18n 468 468 469 469 } … … 488 488 489 489 // Define minimum capability for accessing Upgrade Menu. 490 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */491 492 add_submenu_page( $slug, __( 'Upgrade', $this->plugin->name ), __( 'Upgrade', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-upgrade', array( $this, 'upgrade_screen' ) ); / * phpcs:ignore */490 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 491 492 add_submenu_page( $slug, __( 'Upgrade', $this->plugin->name ), __( 'Upgrade', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-upgrade', array( $this, 'upgrade_screen' ) ); // phpcs:ignore WordPress.WP.I18n 493 493 494 494 } … … 531 531 * @return array Action Links 532 532 */ 533 public function add_action_link( $links, $file ) { / * phpcs:ignore */533 public function add_action_link( $links, $file ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 534 534 535 535 // Bail if the licensing class exists,as this means we're on a Pro version. … … 558 558 // Add Links. 559 559 if ( $this->get_upgrade_url( 'plugins' ) ) { 560 $links[] = '<a href="' . $this->get_upgrade_url( 'plugins' ) . '" rel="noopener" target="_blank">' . __( 'Upgrade', $this->plugin->name ) . '</a>'; /* phpcs:ignore */560 $links[] = '<a href="' . esc_attr( $this->get_upgrade_url( 'plugins' ) ) . '" rel="noopener" target="_blank">' . __( 'Upgrade', $this->plugin->name ) . '</a>'; //phpcs:ignore WordPress.WP.I18n 561 561 } 562 562 … … 586 586 // Define the deactivation reasons. 587 587 $reasons = array( 588 'not_working' => __( 'The Plugin didn\'t work', $this->plugin->name ), / * phpcs:ignore */589 'better_alternative' => __( 'I found a better Plugin', $this->plugin->name ), / * phpcs:ignore */590 'other' => __( 'Other', $this->plugin->name ), / * phpcs:ignore */588 'not_working' => __( 'The Plugin didn\'t work', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 589 'better_alternative' => __( 'I found a better Plugin', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 590 'other' => __( 'Other', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 591 591 ); 592 592 … … 620 620 621 621 // Build args. 622 // phpcs:disable WordPress.Security.NonceVerification 622 623 $args = array( 623 'product' => sanitize_text_field( $_REQUEST['product'] ), /* phpcs:ignore */624 'version' => sanitize_text_field( $_REQUEST['version'] ), /* phpcs:ignore */625 'reason' => sanitize_text_field( $_REQUEST['reason'] ), /* phpcs:ignore */626 'reason_text' => sanitize_text_field( $_REQUEST['reason_text'] ), /* phpcs:ignore */627 'reason_email' => sanitize_text_field( $_REQUEST['reason_email'] ), /* phpcs:ignore */624 'product' => sanitize_text_field( $_REQUEST['product'] ), 625 'version' => sanitize_text_field( $_REQUEST['version'] ), 626 'reason' => sanitize_text_field( $_REQUEST['reason'] ), 627 'reason_text' => sanitize_text_field( $_REQUEST['reason_text'] ), 628 'reason_email' => sanitize_text_field( $_REQUEST['reason_email'] ), 628 629 'site_url' => str_replace( wp_parse_url( get_bloginfo( 'url' ), PHP_URL_SCHEME ) . '://', '', get_bloginfo( 'url' ) ), 629 630 ); 631 // phpcs:enable 630 632 631 633 // Send deactivation reason. … … 693 695 694 696 // Bail if we're not on a Plugin screen. 695 if ( ! isset( $_REQUEST['page'] ) ) { / * phpcs:ignore */697 if ( ! isset( $_REQUEST['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 696 698 return $text; 697 699 } 698 $page = sanitize_text_field( $_REQUEST['page'] ); / * phpcs:ignore */700 $page = sanitize_text_field( $_REQUEST['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 699 701 if ( strpos( $page, $this->plugin->name ) === false ) { 700 702 return $text; … … 704 706 return sprintf( 705 707 /* translators: %1$s: Plugin Name, %2$s: Five Star Link to Review URL, %3$s: Link to Review URL, %4$s: Plugin Name */ 706 __( 'Please rate %1$s %2$s on %3$s to help us grow %4$s. Thanks!', $this->plugin->name ), / * phpcs:ignore */708 __( 'Please rate %1$s %2$s on %3$s to help us grow %4$s. Thanks!', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 707 709 '<strong>' . $this->plugin->displayName . '</strong>', 708 710 '<a href="' . $this->get_review_url() . '" target="_blank">★★★★★</a>', … … 842 844 public function import_export_screen() { 843 845 844 if ( ! empty( $_POST ) ) { / * phpcs:ignore */846 if ( ! empty( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 845 847 // Check nonce. 846 848 $result = $this->import_export_security_check(); … … 850 852 } else { 851 853 // Import JSON. 852 if ( isset( $_POST['import'] ) ) { / * phpcs:ignore */854 if ( isset( $_POST['import'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 853 855 $this->import(); 854 856 } else { 855 857 // Import from Third Party. 856 858 $result = true; 857 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_third_party', $result, $_POST ); / * phpcs:ignore */859 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_third_party', $result, $_POST ); // phpcs:ignore WordPress.NamingConventions.ValidHookName,WordPress.Security.NonceVerification 858 860 859 861 if ( is_wp_error( $result ) ) { 860 862 $this->error_message = $result->get_error_message(); 861 863 } else { 862 $this->message = __( 'Settings imported.', $this->plugin->name ); / * phpcs:ignore */864 $this->message = __( 'Settings imported.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 863 865 } 864 866 } … … 867 869 868 870 // Allow Plugin to define additional import routines. 869 $import_sources = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_sources', array() ); / * phpcs:ignore */871 $import_sources = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_sources', array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 870 872 871 873 // Output view. … … 886 888 if ( ! isset( $_POST[ $this->plugin->name . '_nonce' ] ) ) { 887 889 // Missing nonce. 888 return new WP_Error( 'import_export_nonce_missing', __( 'nonce field is missing. Settings NOT saved.', $this->plugin->name ) ); / * phpcs:ignore */890 return new WP_Error( 'import_export_nonce_missing', __( 'nonce field is missing. Settings NOT saved.', $this->plugin->name ) ); // phpcs:ignore WordPress.WP.I18n 889 891 } 890 892 891 893 if ( ! wp_verify_nonce( $_POST[ $this->plugin->name . '_nonce' ], $this->plugin->name ) ) { 892 894 // Invalid nonce. 893 return new WP_Error( 'import_export_nonce_invalid', __( 'Invalid nonce specified. Settings NOT saved.', $this->plugin->name ) ); / * phpcs:ignore */895 return new WP_Error( 'import_export_nonce_invalid', __( 'Invalid nonce specified. Settings NOT saved.', $this->plugin->name ) ); // phpcs:ignore WordPress.WP.I18n 894 896 } 895 897 … … 906 908 907 909 if ( ! is_array( $_FILES ) ) { 908 $this->error_message = __( 'No file was uploaded', $this->plugin->name ); / * phpcs:ignore */910 $this->error_message = __( 'No file was uploaded', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 909 911 return; 910 912 } 911 913 912 914 if ( $_FILES['import']['error'] !== 0 ) { 913 $this->error_message = __( 'Error when uploading file.', $this->plugin->name ); / * phpcs:ignore */915 $this->error_message = __( 'Error when uploading file.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 914 916 return; 915 917 } … … 924 926 $zip = new ZipArchive(); 925 927 if ( $zip->open( $_FILES['import']['tmp_name'] ) !== true ) { 926 $this->error_message = __( 'Could not extract the supplied ZIP file.', $this->plugin->name ); / * phpcs:ignore */928 $this->error_message = __( 'Could not extract the supplied ZIP file.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 927 929 return; 928 930 } … … 933 935 934 936 // Read JSON file. 935 $handle = fopen( sys_get_temp_dir() . '/export.json', 'r' ); /* phpcs:ignore */ 936 $json = fread( $handle, filesize( sys_get_temp_dir() . '/export.json' ) ); /* phpcs:ignore */ 937 fclose( $handle ); /* phpcs:ignore */ 937 // phpcs:disable WordPress.WP.AlternativeFunctions 938 $handle = fopen( sys_get_temp_dir() . '/export.json', 'r' ); 939 $json = fread( $handle, filesize( sys_get_temp_dir() . '/export.json' ) ); 940 fclose( $handle ); 941 // phpcs:enable 938 942 break; 939 943 940 944 default: 941 945 // Read file. 942 $handle = fopen( $_FILES['import']['tmp_name'], 'r' ); /* phpcs:ignore */ 943 $json = fread( $handle, $_FILES['import']['size'] ); /* phpcs:ignore */ 944 fclose( $handle ); /* phpcs:ignore */ 946 // phpcs:disable WordPress.WP.AlternativeFunctions 947 $handle = fopen( $_FILES['import']['tmp_name'], 'r' ); 948 $json = fread( $handle, $_FILES['import']['size'] ); 949 fclose( $handle ); 950 // phpcs:enable 945 951 946 952 } … … 951 957 952 958 // Decode. 953 $import = json_decode( $json, true ); /* phpcs:ignore */959 $import = json_decode( $json, true ); 954 960 955 961 // Check data is an array. 956 962 if ( ! is_array( $import ) ) { 957 $this->error_message = __( 'Supplied file is not a valid JSON settings file, or has become corrupt.', $this->plugin->name ); / * phpcs:ignore */963 $this->error_message = __( 'Supplied file is not a valid JSON settings file, or has become corrupt.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 958 964 return; 959 965 } … … 961 967 // Allow Plugin to run its Import Routine using the supplied data now. 962 968 $result = true; 963 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import', $result, $import ); /* phpcs:ignore */969 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import', $result, $import ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 964 970 965 971 // Bail if an error occured. … … 969 975 } 970 976 971 $this->message = __( 'Settings imported.', $this->plugin->name ); / * phpcs:ignore */977 $this->message = __( 'Settings imported.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 972 978 973 979 } … … 999 1005 1000 1006 // Bail if no POST data. 1001 if ( empty( $_POST ) ) { / * phpcs:ignore */1007 if ( empty( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1002 1008 return; 1003 1009 } 1004 1010 1005 1011 // Bail if not exporting. 1006 if ( ! isset( $_POST['export'] ) ) { / * phpcs:ignore */1012 if ( ! isset( $_POST['export'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1007 1013 return; 1008 1014 } … … 1027 1033 * @param array $_POST POST Data. 1028 1034 */ 1029 $data = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_export', $data, $_POST ); / * phpcs:ignore */1035 $data = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_export', $data, $_POST ); // phpcs:ignore WordPress.NamingConventions.ValidHookName,WordPress.Security.NonceVerification 1030 1036 1031 1037 // Force a file download, depending on the export format. 1032 switch ( sanitize_text_field( $_POST['format'] ) ) { / * phpcs:ignore */1038 switch ( sanitize_text_field( $_POST['format'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1033 1039 /** 1034 1040 * JSON, Zipped. … … 1089 1095 header( 'Pragma: no-cache' ); 1090 1096 header( 'Expires: 0' ); 1091 readfile( $filename ); / * phpcs:ignore */1097 readfile( $filename ); // phpcs:ignore WordPress.WP.AlternativeFunctions 1092 1098 unlink( $filename ); 1093 1099 exit(); … … 1110 1116 header( 'Pragma: no-cache' ); 1111 1117 header( 'Expires: 0' ); 1112 echo $json; / * phpcs:ignore */1118 echo $json; // phpcs:ignore WordPress.Security.EscapeOutput 1113 1119 exit(); 1114 1120 … … 1130 1136 header( 'Pragma: no-cache' ); 1131 1137 header( 'Expires: 0' ); 1132 echo $csv; / * phpcs:ignore */1138 echo $csv; // phpcs:ignore WordPress.Security.EscapeOutput 1133 1139 exit(); 1134 1140 … … 1143 1149 1144 1150 // Check we requested the support page. 1145 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */1151 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1146 1152 return; 1147 1153 } 1148 1154 1149 1155 // Sanitize page. 1150 $page = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */1156 $page = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 1151 1157 1152 1158 // Redirect to Support. 1153 1159 if ( $page === $this->plugin->name . '-support' ) { 1154 wp_redirect( $this->plugin->support_url ); // phpcs:ignore 1160 wp_redirect( $this->plugin->support_url ); // phpcs:ignore WordPress.Security.SafeRedirect 1155 1161 die(); 1156 1162 } … … 1158 1164 // Redirect to Upgrade. 1159 1165 if ( $page === $this->plugin->name . '-upgrade' ) { 1160 wp_redirect( $this->get_upgrade_url( 'menu' ) ); // phpcs:ignore 1166 wp_redirect( $this->get_upgrade_url( 'menu' ) ); // phpcs:ignore WordPress.Security.SafeRedirect 1161 1167 die(); 1162 1168 } -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/deactivation-modal.php
r2688245 r2758024 18 18 echo sprintf( 19 19 /* Translators: Plugin Name */ 20 esc_html__( 'Optional: We\'d be super grateful if you could take a moment to let us know why you\'re deactivating %s', $this->plugin->name ), / * phpcs:ignore */20 esc_html__( 'Optional: We\'d be super grateful if you could take a moment to let us know why you\'re deactivating %s', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 21 21 esc_html( $this->plugin->displayName ) 22 22 ); … … 45 45 <p> 46 46 <label for="reason_text"> 47 <?php esc_html_e( 'Optional: Was there a problem, any feedback or something we could do better?', $this->plugin->name ); / * phpcs:ignore */?>47 <?php esc_html_e( 'Optional: Was there a problem, any feedback or something we could do better?', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 48 48 </label> 49 <input type="text" id="reason_text" name="reason_text" value="" placeholder="<?php esc_attr_e( 'e.g. XYZ Plugin because it has this feature...', $this->plugin->name ); / * phpcs:ignore */?>" class="widefat" />49 <input type="text" id="reason_text" name="reason_text" value="" placeholder="<?php esc_attr_e( 'e.g. XYZ Plugin because it has this feature...', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="widefat" /> 50 50 </p> 51 51 52 52 <p> 53 <label for="reason_email"><?php esc_html_e( 'Optional: Email Address', $this->plugin->name ); / * phpcs:ignore */?></label>53 <label for="reason_email"><?php esc_html_e( 'Optional: Email Address', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 54 54 <input type="email" id="reason_email" name="reason_email" value="" class="widefat" /> 55 55 <small> 56 56 <?php 57 esc_html_e( 'If you\'d like further discuss the problem / feature, enter your email address above and we\'ll be in touch. This will *never* be used for any marketing.', $this->plugin->name ); / * phpcs:ignore */57 esc_html_e( 'If you\'d like further discuss the problem / feature, enter your email address above and we\'ll be in touch. This will *never* be used for any marketing.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 58 58 ?> 59 59 </small> … … 61 61 </div> 62 62 63 <input type="submit" name="submit" value="<?php esc_attr_e( 'Deactivate', $this->plugin->name ); /* phpcs:ignore */?>" class="button button-primary" />63 <input type="submit" name="submit" value="<?php esc_attr_e( 'Deactivate', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="button button-primary" /> 64 64 </form> 65 65 </div> -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/footer-upgrade-embedded.php
r2688245 r2758024 18 18 19 19 <div class="wpzinc-option ignore-nth-child"> 20 <strong><?php esc_html_e( 'Support', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Access to one on one email support', $this->base->plugin->name ); /* phpcs:ignore */?>20 <strong><?php esc_html_e( 'Support', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Access to one on one email support', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 21 21 </div> 22 22 23 23 <div class="wpzinc-option ignore-nth-child"> 24 <strong><?php esc_html_e( 'Documentation', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Detailed documentation on how to install and configure the plugin', $this->base->plugin->name ); /* phpcs:ignore */?>24 <strong><?php esc_html_e( 'Documentation', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Detailed documentation on how to install and configure the plugin', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 25 25 </div> 26 26 27 27 <div class="wpzinc-option ignore-nth-child"> 28 <strong><?php esc_html_e( 'Updates', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Receive one click update notifications, right within your WordPress Adminstration panel', $this->base->plugin->name ); /* phpcs:ignore */?>28 <strong><?php esc_html_e( 'Updates', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Receive one click update notifications, right within your WordPress Adminstration panel', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 29 29 </div> 30 30 31 31 <div class="wpzinc-option ignore-nth-child"> 32 <strong><?php esc_html_e( 'Seamless Upgrade', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Retain all current settings when upgrading to Pro', $this->base->plugin->name ); /* phpcs:ignore */?>32 <strong><?php esc_html_e( 'Seamless Upgrade', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Retain all current settings when upgrading to Pro', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 33 33 </div> 34 34 35 35 <div class="wpzinc-option"> 36 36 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary" rel="noopener" target="_blank"> 37 <?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); / * phpcs:ignore */?>37 <?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 38 38 </a> 39 39 </div> -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/footer-upgrade.php
r2688245 r2758024 12 12 <div class="wpzinc-upgrade"> 13 13 <h3> 14 <?php esc_html_e( 'Upgrade to Pro', $this->base->plugin->name ); / * phpcs:ignore */?>14 <?php esc_html_e( 'Upgrade to Pro', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 15 15 </h3> 16 16 … … 27 27 ?> 28 28 <li> 29 <strong><?php esc_html_e( 'Support, Documentation and Updates', $this->base->plugin->name ); / * phpcs:ignore */?></strong>30 <?php esc_html_e( 'Access to one on one email support, plus detailed documentation on how to install and configure the plugin and one click update notifications, right within the WordPress Administration panel.', $this->base->plugin->name ); / * phpcs:ignore */?>29 <strong><?php esc_html_e( 'Support, Documentation and Updates', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></strong> 30 <?php esc_html_e( 'Access to one on one email support, plus detailed documentation on how to install and configure the plugin and one click update notifications, right within the WordPress Administration panel.', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 31 31 </li> 32 32 </ul> 33 33 34 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary button-large" target="_blank"><?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); / * phpcs:ignore */?></a>35 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-large" target="_blank"><?php esc_html_e( 'See all Features', $this->base->plugin->name ); / * phpcs:ignore */?></a>34 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary button-large" target="_blank"><?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></a> 35 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-large" target="_blank"><?php esc_html_e( 'See all Features', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></a> 36 36 </div> 37 37 <?php -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/import-export.php
r2688245 r2758024 13 13 14 14 <span> 15 <?php esc_html_e( 'Import & Export', $this->plugin->name ); / * phpcs:ignore */?>15 <?php esc_html_e( 'Import & Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 16 16 </span> 17 17 </h1> … … 37 37 <h2 class="nav-tab-wrapper wpzinc-horizontal-tabbed-ui"> 38 38 <a href="<?php echo esc_url( $this->plugin->documentation_url ); ?>" class="nav-tab last documentation" rel="noopener" target="_blank"> 39 <?php esc_html_e( 'Documentation', $this->plugin->name ); / * phpcs:ignore */?>39 <?php esc_html_e( 'Documentation', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 40 40 <span class="dashicons dashicons-admin-page"></span> 41 41 </a> … … 53 53 <li class="wpzinc-nav-tab download"> 54 54 <a href="#import" class="wpzinc-nav-tab-vertical-active"> 55 <?php esc_html_e( 'Import', $this->plugin->name ); /* phpcs:ignore */?>55 <?php esc_html_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 56 56 </a> 57 57 </li> … … 71 71 <li class="wpzinc-nav-tab upload"> 72 72 <a href="#export"> 73 <?php esc_html_e( 'Export', $this->plugin->name ); /* phpcs:ignore */?>73 <?php esc_html_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 74 74 </a> 75 75 </li> … … 82 82 <div class="postbox"> 83 83 <header> 84 <h3><?php esc_html_e( 'Import', $this->plugin->name ); / * phpcs:ignore */?></h3>84 <h3><?php esc_html_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></h3> 85 85 <p class="description"> 86 <?php esc_html_e( 'Upload a file generated by this Plugin\'s export functionality (JSON or zipped JSON). This will overwrite any existing settings stored on this installation.', $this->plugin->name ); /* phpcs:ignore */?>86 <?php esc_html_e( 'Upload a file generated by this Plugin\'s export functionality (JSON or zipped JSON). This will overwrite any existing settings stored on this installation.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 87 87 </p> 88 88 </header> … … 90 90 <div class="wpzinc-option"> 91 91 <div class="left"> 92 <label for="file"><?php esc_html_e( 'JSON File', $this->plugin->name ); / * phpcs:ignore */?></label>92 <label for="file"><?php esc_html_e( 'JSON File', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 93 93 </div> 94 94 <div class="right"> … … 98 98 99 99 <div class="wpzinc-option"> 100 <input name="import" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import', $this->plugin->name ); / * phpcs:ignore */?>" />100 <input name="import" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" /> 101 101 </div> 102 102 </div> … … 115 115 <div class="postbox"> 116 116 <header> 117 <h3><?php esc_html_e( 'Export', $this->plugin->name ); / * phpcs:ignore */?></h3>117 <h3><?php esc_html_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></h3> 118 118 <p class="description"> 119 <?php esc_html_e( 'To export this Plugin\'s settings, choose which item(s) to export, and click the Export button below.', $this->plugin->name ); / * phpcs:ignore */?>119 <?php esc_html_e( 'To export this Plugin\'s settings, choose which item(s) to export, and click the Export button below.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 120 120 <br /> 121 <?php esc_html_e( 'You can then import the generated file into another Plugin installation.', $this->plugin->name ); / * phpcs:ignore */?>121 <?php esc_html_e( 'You can then import the generated file into another Plugin installation.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 122 122 <br /> 123 <?php esc_html_e( 'Including this file in a support request? We recommend setting the Format option to "Export as JSON, Zipped".', $this->plugin->name ); / * phpcs:ignore */?>123 <?php esc_html_e( 'Including this file in a support request? We recommend setting the Format option to "Export as JSON, Zipped".', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 124 124 </p> 125 125 </header> … … 131 131 * @since 1.0.0 132 132 */ 133 do_action( str_replace( '-', '_', $this->plugin->name ) . '_export_view' ); / * phpcs:ignore */133 do_action( str_replace( '-', '_', $this->plugin->name ) . '_export_view' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 134 134 ?> 135 135 136 136 <div class="wpzinc-option"> 137 137 <div class="left"> 138 <label for="format"><?php esc_html_e( 'Format', $this->plugin->name ); / * phpcs:ignore */?></label>138 <label for="format"><?php esc_html_e( 'Format', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 139 139 </div> 140 140 <div class="right"> 141 141 <select name="format" id="format" size="1"> 142 <option value="json"><?php esc_html_e( 'JSON', $this->plugin->name ); / * phpcs:ignore */?></option>143 <option value="zip"><?php esc_html_e( 'JSON, Zipped', $this->plugin->name ); / * phpcs:ignore */?></option>142 <option value="json"><?php esc_html_e( 'JSON', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></option> 143 <option value="zip"><?php esc_html_e( 'JSON, Zipped', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></option> 144 144 </select> 145 145 </div> … … 147 147 148 148 <div class="wpzinc-option"> 149 <input name="export" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Export', $this->plugin->name ); / * phpcs:ignore */?>" />149 <input name="export" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" /> 150 150 </div> 151 151 </div> -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/review-notice.php
r2688245 r2758024 22 22 echo sprintf( 23 23 /* translators: Plugin Name */ 24 esc_html__( 'We\'d be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?', $this->plugin->name ), /* phpcs:ignore */24 esc_html__( 'We\'d be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 25 25 esc_html( $this->plugin->displayName ) 26 26 ); … … 29 29 <p> 30 30 <a href="<?php echo esc_url( $this->get_review_url() ); ?>" class="button button-primary" target="_blank"> 31 <?php esc_html_e( 'Yes, Leave Review', $this->plugin->name ); / * phpcs:ignore */?>31 <?php esc_html_e( 'Yes, Leave Review', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 32 32 </a> 33 33 <a href="<?php echo esc_url( $this->plugin->support_url ); ?>" class="button" rel="noopener" target="_blank"> … … 35 35 echo sprintf( 36 36 /* translators: Plugin Name */ 37 esc_html__( 'No, I\'m having issues with %s', $this->plugin->name ), / * phpcs:ignore */37 esc_html__( 'No, I\'m having issues with %s', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 38 38 esc_html( $this->plugin->displayName ) 39 39 ); -
media-library-organizer/tags/1.4.6/_modules/dashboard/views/sidebar-upgrade.php
r2688245 r2758024 16 16 <div class="postbox"> 17 17 <h3 class="hndle"> 18 <?php esc_html_e( 'Keep Updated', $this->base->plugin->name ); / * phpcs:ignore */?>18 <?php esc_html_e( 'Keep Updated', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 19 19 </h3> 20 20 21 21 <div class="wpzinc-option"> 22 22 <p class="description"> 23 <?php esc_html_e( 'Subscribe to the newsletter and receive updates on our WordPress Plugins.', $this->base->plugin->name ); / * phpcs:ignore */?>23 <?php esc_html_e( 'Subscribe to the newsletter and receive updates on our WordPress Plugins.', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 24 24 </p> 25 25 </div> … … 28 28 <div class="wpzinc-option"> 29 29 <div class="full"> 30 <input id="fieldEmail" name="cm-jdutdyj-jdutdyj" type="email" class="widefat" placeholder="<?php esc_attr_e( 'Your Email Address', $this->base->plugin->name ); / * phpcs:ignore */?>" class="widefat" required />30 <input id="fieldEmail" name="cm-jdutdyj-jdutdyj" type="email" class="widefat" placeholder="<?php esc_attr_e( 'Your Email Address', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="widefat" required /> 31 31 </div> 32 32 </div> 33 33 <div class="wpzinc-option"> 34 34 <div class="full"> 35 <input type="submit" name="submit" value="<?php esc_attr_e( 'Subscribe', $this->base->plugin->name ); / * phpcs:ignore */?>" class="button button-primary" />35 <input type="submit" name="submit" value="<?php esc_attr_e( 'Subscribe', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="button button-primary" /> 36 36 </div> 37 37 </div> -
media-library-organizer/tags/1.4.6/addons/tree-view/class-media-library-organizer-tree-view.php
r2688245 r2758024 177 177 if ( is_admin() ) { 178 178 wp_die( 179 $error, /* phpcs:ignore */179 esc_html( $error->get_error_message() ), 180 180 esc_html__( 'Media Library Organizer: Tree View: Error', 'media-library-organizer' ), 181 181 array( … … 273 273 * @since 1.1.1 274 274 */ 275 function Media_Library_Organizer_Tree_View() { / * phpcs:ignore */275 function Media_Library_Organizer_Tree_View() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName 276 276 277 277 return Media_Library_Organizer_Tree_View::get_instance(); -
media-library-organizer/tags/1.4.6/addons/tree-view/includes/global/class-media-library-organizer-tree-view-media.php
r2688245 r2758024 58 58 * @param string $ext If defined, loads minified JS. 59 59 */ 60 public function enqueue_js( $screen, $screens, $mode, $ext ) { / * phpcs:ignore */60 public function enqueue_js( $screen, $screens, $mode, $ext ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 61 61 62 62 // Bail if Tree View isn't enabled. … … 420 420 ); 421 421 foreach ( $conditions as $condition ) { 422 if ( ! isset( $_REQUEST[ $condition ] ) ) { / * phpcs:ignore */422 if ( ! isset( $_REQUEST[ $condition ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 423 423 continue; 424 424 } 425 425 426 if ( empty( $_REQUEST[ $condition ] ) ) { / * phpcs:ignore */426 if ( empty( $_REQUEST[ $condition ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 427 427 continue; 428 428 } 429 429 430 $args[ $condition ] = sanitize_text_field( $_REQUEST[ $condition ] ); / * phpcs:ignore */430 $args[ $condition ] = sanitize_text_field( $_REQUEST[ $condition ] ); // phpcs:ignore WordPress.Security.NonceVerification 431 431 } 432 432 -
media-library-organizer/tags/1.4.6/addons/tree-view/includes/global/class-media-library-organizer-tree-view-taxonomy-walker.php
r2688245 r2758024 102 102 103 103 // Sanitize request. 104 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */104 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 105 105 106 106 foreach ( $conditions as $condition ) { -
media-library-organizer/tags/1.4.6/addons/tree-view/views/admin/media.php
r2688245 r2758024 27 27 28 28 <div id="media-library-organizer-tree-view-list"<?php echo ( $jstree_enabled ? ' class="media-library-organizer-tree-view-enabled"' : '' ); ?>> 29 <?php echo $output; / * phpcs:ignore */?>29 <?php echo $output; // phpcs:ignore WordPress.Security.EscapeOutput ?> 30 30 </div> 31 31 </form> -
media-library-organizer/tags/1.4.6/assets/css/media.css
r2493585 r2758024 1 .media-library-organizer-feather-image{background:url(../../_modules/dashboard/assets/feather/image.svg) transparent no-repeat scroll 0 0;background-size:16px 16px;width:16px;height:16px;display:inline-block;vertical-align:text-top}div.selectize-control{display:inline-block;min-width:160px;vertical-align:middle;line-height:1}form.compat-item table.compat-attachment-fields p.help{margin:0}form.compat-item table.compat-attachment-fields tr th{display:block;width:100%;margin:5px 0 0 0;padding:5px 0 0 0;border:none;border-top:1px solid #ddd}form.compat-item table.compat-attachment-fields tr th label span{text-align:left;font-weight:600}form.compat-item table.compat-attachment-fields tr td.field{clear:both;float:left;width:100%;margin:0;border:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel{margin-top:-2px;min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist{list-style:none;margin:15px 0;padding:0}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist li{line-height:1.7}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist ul{margin-left:18px}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields{display:grid;grid-gap:10px;grid-template-columns:4fr 1fr}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields.hidden{display:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv input[type=checkbox]{margin:0 3px 0 0}table.media .column-title .has-media-icon~.row-actions{clear:both;margin-left:0}#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{display:grid;column-gap:10px;row-gap:10px;box-sizing:border-box;margin:10px 0;max-width:33%;width:33%;grid-template-columns:1fr 4fr;grid-template-rows:32px;grid-template-areas:"searchlabel search"}#posts-filter .search-form label.media-search-input-label,.media-frame-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label,.media-modal-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label{position:static !important;line-height:32px;text-align:right;grid-area:searchlabel}#posts-filter .search-form input#media-search-input,.media-frame-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input,.media-modal-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input{grid-area:search;width:100% !important;margin:0;height:32px;line-height:32px}.media-modal-content .media-frame-title h1:before{content:"";margin:0}.media-modal-content .media-attachments-filter-heading:before{content:"";margin:0}.media-modal-content .media-frame .media-toolbar select.attachment-filters{width:auto !important}.media-modal-content .attachments-browser .media-toolbar{height:50px;background-color:#f3f3f3;border-bottom:1px solid #ddd}.media-modal-content .attachments-browser .attachments{top:50px}.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:66%;width:66%}.media-modal-content .attachments-browser .media-toolbar-secondary h2{display:none}.media-modal-content .attachments-browser .media-toolbar-secondary select{margin-top:10px}.media-modal-content .media-content{position:absolute;left:0;padding:20px}.media-modal-content .media-content.has-sidebar{right:300px}.media-modal-content .media-content .media-library-organizer-modal-content-field{padding:0 0 20px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns{display:grid;grid-gap:10px}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-2{grid-template-columns:repeat(2, 50%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-3{grid-template-columns:repeat(3, 33%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-4{grid-template-columns:repeat(4, 25%)}.media-modal-content .media-content .media-library-organizer-modal-content-field label{display:block;font-size:15px;margin:0 0 5px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field input,.media-modal-content .media-content .media-library-organizer-modal-content-field select{font-size:15px}@media only screen and (max-width: 1840px){.media-modal-content .attachments-browser .media-toolbar{height:90px}.media-modal-content .attachments-browser .attachments{top:90px}}@media only screen and (max-width: 1330px){.media-modal-content .attachments-browser .media-toolbar{height:130px}.media-modal-content .attachments-browser .attachments{top:130px}}@media only screen and (max-width: 1000px){.media-modal-content .attachments-browser .media-toolbar{height:170px}.media-modal-content .attachments-browser .attachments{top:170px}}@media only screen and (max-width: 900px){.media-modal-content .attachments-browser .media-toolbar{height:210px}.media-modal-content .attachments-browser .attachments{top:210px}}@media only screen and (max-width: 640px){.media-modal-content .attachments-browser .media-toolbar{height:160px}.media-modal-content .attachments-browser .attachments{top:160px}}@media only screen and (max-width: 1000px){#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{max-width:100%;width:100%;grid-template-columns:50px auto;grid-template-rows:32px;grid-template-areas:"searchlabel search"}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:100%;width:100%;height:auto}}@media only screen and (max-width: 782px){div.media-library-organizer-selectize,div.media-library-organizer-selectize-search{width:200px}div.media-library-organizer-selectize .selectize-input,div.media-library-organizer-selectize-search .selectize-input{min-height:40px;font-size:16px;line-height:1.625;padding:5px 24px 5px 8px}}1 .media-library-organizer-feather-image{background:url(../../_modules/dashboard/assets/feather/image.svg) rgba(0,0,0,0) no-repeat scroll 0 0;background-size:16px 16px;width:16px;height:16px;display:inline-block;vertical-align:text-top}div.selectize-control{display:inline-block;min-width:160px;vertical-align:middle;line-height:1}form.compat-item table.compat-attachment-fields p.help{margin:0}form.compat-item table.compat-attachment-fields tr th{display:block;width:100%;margin:5px 0 0 0;padding:5px 0 0 0;border:none;border-top:1px solid #ddd}form.compat-item table.compat-attachment-fields tr th label span{text-align:left;font-weight:600}form.compat-item table.compat-attachment-fields tr td.field{clear:both;float:left;width:100%;margin:0;border:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel{margin-top:-2px;min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist{list-style:none;margin:15px 0;padding:0}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist li{line-height:1.7}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist ul{margin-left:18px}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields{display:grid;grid-gap:10px;grid-template-columns:4fr 1fr}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields.hidden{display:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv input[type=checkbox]{margin:0 3px 0 0}table.media .column-title .has-media-icon~.row-actions{clear:both;margin-left:0}#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{display:grid;column-gap:10px;row-gap:10px;box-sizing:border-box;margin:10px 0;max-width:33%;width:33%;grid-template-columns:1fr 4fr;grid-template-rows:32px;grid-template-areas:"searchlabel search"}#posts-filter .search-form label.media-search-input-label,.media-frame-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label,.media-modal-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label{position:static !important;line-height:32px;text-align:right;grid-area:searchlabel}#posts-filter .search-form input#media-search-input,.media-frame-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input,.media-modal-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input{grid-area:search;width:100% !important;margin:0;height:32px;line-height:32px}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{padding-bottom:10px}.media-modal-content .media-frame-title h1:before{content:"";margin:0}.media-modal-content .media-attachments-filter-heading:before{content:"";margin:0}.media-modal-content .media-frame .media-toolbar select.attachment-filters{width:auto !important}.media-modal-content .attachments-browser .media-toolbar{height:auto;background-color:#f3f3f3;border-bottom:1px solid #ddd}.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:66%;width:66%}.media-modal-content .attachments-browser .media-toolbar-secondary h2{display:none}.media-modal-content .attachments-browser .media-toolbar-secondary select{margin-top:10px}.media-modal-content .media-content{position:absolute;left:0;padding:20px}.media-modal-content .media-content.has-sidebar{right:300px}.media-modal-content .media-content .media-library-organizer-modal-content-field{padding:0 0 20px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns{display:grid;grid-gap:10px}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-2{grid-template-columns:repeat(2, 50%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-3{grid-template-columns:repeat(3, 33%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-4{grid-template-columns:repeat(4, 25%)}.media-modal-content .media-content .media-library-organizer-modal-content-field label{display:block;font-size:15px;margin:0 0 5px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field input,.media-modal-content .media-content .media-library-organizer-modal-content-field select{font-size:15px}@media only screen and (max-width: 1000px){#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{max-width:100%;width:100%;grid-template-columns:50px auto;grid-template-rows:32px;grid-template-areas:"searchlabel search"}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:100%;width:100%;height:auto}}@media only screen and (max-width: 782px){div.media-library-organizer-selectize,div.media-library-organizer-selectize-search{width:200px}div.media-library-organizer-selectize .selectize-input,div.media-library-organizer-selectize-search .selectize-input{min-height:40px;font-size:16px;line-height:1.625;padding:5px 24px 5px 8px}} -
media-library-organizer/tags/1.4.6/assets/js/media.js
r2692053 r2758024 573 573 wp.media.view.AttachmentsBrowser = wp.media.view.AttachmentsBrowser.extend( 574 574 { 575 576 /** 577 * When the toolbar is created, add our custom filters to it, which 578 * are rendered as select dropdowns. 579 * 580 * @since 1.0.0 581 */ 575 /** 576 * When the toolbar is created, add our custom filters to it, which 577 * are rendered as select dropdowns. 578 * 579 * @since 1.0.0 580 */ 582 581 createToolbar: function() { 583 582 584 583 // Make sure to load the original toolbar. 585 584 AttachmentsBrowser.prototype.createToolbar.call( this ); 585 586 // Bail if search is not included in the toolbar, as this means we're on a grid view 587 // that doesn't display filters, such as Edit Gallery. 588 if ( ! this.options.search ) { 589 return; 590 } 586 591 587 592 // Define the priority order at which these filters should begin output in the Grid View Toolbar. … … 603 608 ); 604 609 605 // Increment priority so the order of filters remains the same606 // if they're subsequently updated by calling mediaLibraryOrganizerGridViewInitializeTaxonomyFilter().607 priority++;608 } 609 610 // Add the orderby filter to the toolbar.610 // Increment priority so the order of filters remains the same 611 // if they're subsequently updated by calling mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(). 612 priority++; 613 } 614 615 // Add the orderby filter to the toolbar. 611 616 if ( media_library_organizer_media.settings.orderby_enabled == 1 ) { 612 617 this.toolbar.set( … … 626 631 } 627 632 628 // Add the order filter to the toolbar.633 // Add the order filter to the toolbar. 629 634 if ( media_library_organizer_media.settings.order_enabled == 1 ) { 630 635 this.toolbar.set( … … 644 649 } 645 650 646 // Fire the mlo:grid:filters:add event that Addons can hook into and add their own Filters now. 647 wp.media.events.trigger( 648 'mlo:grid:filters:add', 649 { 650 attachments_browser: this, 651 priority: priority 652 } 651 // Fire the mlo:grid:filters:add event that Addons can hook into and add their own Filters now. 652 wp.media.events.trigger( 653 'mlo:grid:filters:add', 654 { 655 attachments_browser: this, 656 priority: priority 657 } 658 ); 659 660 // Fire the mlo:grid:bulk_select:enabled event that Addons can hook into and listen 661 // when Bulk select is enabled by clicking the Bulk Select button. 662 this.controller.on( 663 'select:activate', 664 function() { 665 wp.media.events.trigger( 'mlo:grid:bulk_select:enabled' ); 666 } 667 ); 668 669 // Fire the mlo:grid:bulk_select:disabled event that Addons can hook into and listen 670 // when Bulk select is disabled by clicking the Cancel button. 671 this.controller.on( 672 'select:deactivate', 673 function() { 674 wp.media.events.trigger( 'mlo:grid:bulk_select:disabled' ); 675 } 676 ); 677 678 // Fire the mlo:grid:attachments:bulk_actions:done event that Addons can hook into and listen 679 // when a Bulk select action (e.g. Delete) completes. 680 this.controller.on( 681 'selection:action:done', 682 function() { 683 wp.media.events.trigger( 'mlo:grid:attachments:bulk_actions:done' ); 684 } 685 ); 686 687 // Store the toolbar in a var so we can interact with it later. 688 MediaLibraryOrganizerAttachmentsBrowser = this; 689 690 }, 691 692 createAttachmentsHeading: function() { 693 694 // Make sure to load the original attachments heading. Check if we still need this function. 695 AttachmentsBrowser.prototype.createAttachmentsHeading.call( this ); 696 697 }, 698 699 /** 700 * Set attachment wrapper view top to match the height of the toolbar, so attachments 701 * are not cut off. 702 */ 703 createAttachmentsWrapperView: function() { 704 705 // Make sure to load the original attachments wrapper view. 706 AttachmentsBrowser.prototype.createAttachmentsWrapperView.call( this ); 707 708 // Set wrapper offset on load. 709 setTimeout( 710 function() { 711 MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top = ( MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight + 10 ) + 'px'; 712 }, 713 500 653 714 ); 654 715 655 // Fire the mlo:grid:bulk_select:enabled event that Addons can hook into and listen 656 // when Bulk select is enabled by clicking the Bulk Select button. 657 this.controller.on( 658 'select:activate', 659 function() { 660 wp.media.events.trigger( 'mlo:grid:bulk_select:enabled' ); 661 } 662 ); 663 664 // Fire the mlo:grid:bulk_select:disabled event that Addons can hook into and listen 665 // when Bulk select is disabled by clicking the Cancel button. 666 this.controller.on( 667 'select:deactivate', 668 function() { 669 wp.media.events.trigger( 'mlo:grid:bulk_select:disabled' ); 670 } 671 ); 672 673 // Fire the mlo:grid:attachments:bulk_actions:done event that Addons can hook into and listen 674 // when a Bulk select action (e.g. Delete) completes. 675 this.controller.on( 676 'selection:action:done', 677 function() { 678 wp.media.events.trigger( 'mlo:grid:attachments:bulk_actions:done' ); 679 } 680 ); 681 682 // Store the toolbar in a var so we can interact with it later. 683 MediaLibraryOrganizerAttachmentsBrowser = this; 716 // Update wrapper offset on window resize. 717 window.onresize = function() { 718 MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top = ( MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight + 10 ) + 'px'; 719 } 684 720 685 721 }, 686 687 createAttachmentsHeading: function() {688 689 // Make sure to load the original attachments heading.690 AttachmentsBrowser.prototype.createAttachmentsHeading.call( this );691 692 }693 722 694 723 } … … 1132 1161 } 1133 1162 1134 if ( mediaLibraryOrganizerUploader ) {1163 if ( mediaLibraryOrganizerUploader && typeof mediaLibraryOrganizerUploader.uploader !== 'undefined' ) { 1135 1164 var selected_terms = {}; 1136 1165 for ( let taxonomy_name in media_library_organizer_media.taxonomies ) { … … 1158 1187 function( atts ) { 1159 1188 1160 if ( mediaLibraryOrganizerUploader ) {1189 if ( mediaLibraryOrganizerUploader && typeof mediaLibraryOrganizerUploader.uploader !== 'undefined' ) { 1161 1190 mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[ atts.taxonomy_name ] = atts.slug; 1162 1191 } -
media-library-organizer/tags/1.4.6/assets/js/min/media-min.js
r2692053 r2758024 1 function mediaLibraryOrganizerQueryInitialize(){!function(){wp.media.query=function(e){return new wp.media.model.Attachments(null,{props:_.extend(_.defaults(e||{},{orderby:media_library_organizer_media.defaults.orderby,order:media_library_organizer_media.defaults.order}),{query:!0})})};var e=wp.media.model.Query,r;_.extend(e,{get:(r=[],function(i,a){var t={},n=e.orderby,o=e.defaultProps,d,m=!1;return delete i.query,delete i.cache,_.defaults(i,o),i.order=i.order.toUpperCase(),"DESC"!==i.order&&"ASC"!==i.order&&(i.order=o.order.toUpperCase()),_.contains(n.allowed,i.orderby)||(i.orderby=o.orderby),_.each(["include","exclude"],(function(e){i[e]&&!_.isArray(i[e])&&(i[e]=[i[e]])})),_.each(i,(function(r,i){_.isNull(r)||(t[e.propmap[i]||i]=r)})),_.defaults(t,e.defaultArgs),t.orderby=n.valuemap[i.orderby]||i.orderby,m=!1,r=[],d||(d=new e([],_.extend(a||{},{props:i,args:t})),r.push(d)),wp.media.events.trigger("mlo:grid:query",{query:d}),d})})}(jQuery,_)}function mediaLibraryOrganizerUploaderInitializeEvents(){!function($,e){void 0!==wp.Uploader&&e.extend(wp.Uploader.prototype,{init:function(){wp.media.events.trigger("mlo:grid:attachment:upload:init")},added:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:added",e)},progress:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:progress",e)},success:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:success",e)},error:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:error",e)},complete:function(){wp.media.events.trigger("mlo:grid:attachment:upload:complete")},refresh:function(){wp.media.events.trigger("mlo:grid:attachment:upload:refresh")}})}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(){!function(){for(let e in media_library_organizer_media.taxonomies)mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,media_library_organizer_media.taxonomies[e].terms,media_library_organizer_media.taxonomies[e].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned,media_library_organizer_media.show_attachment_count)}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t){jQuery,_,"0"!=media_library_organizer_media.settings[e+"_enabled"]&&media_library_organizer_media.settings[e+"_enabled"]&&(MediaLibraryOrganizerTaxonomyFilter[e]=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter-"+e,createFilters:function(){var n={},o,o;_.each(r||{},(function(r,i){var a={};a[e]=r.slug;var o=r.name+("1"===t?" ("+r.count+")":"");n[i]={text:o,props:a}})),(o={})[e]="",n.all={text:i,props:o,priority:10},(o={})[e]="-1",n.unassigned={text:a,props:o,priority:10},this.filters=n},change:function(){var r=this.filters[this.el.value];r&&(this.model.set(r.props),wp.media.events.trigger("mlo:grid:filter:change:term",{taxonomy_name:e,slug:r.props[e]}))},select:function(){var e=this.model,r="all",i=e.toJSON();wp.media.events.trigger("mlo:grid:filter:select",{props:i}),_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderByFilter(){jQuery,_,1==media_library_organizer_media.settings.orderby_enabled&&(MediaLibraryOrganizerTaxonomyOrderBy=wp.media.view.AttachmentFilters.extend({id:"media-attachment-orderby",createFilters:function(){var e={};_.each(media_library_organizer_media.orderby||{},(function(r,i){e[i]={text:r,props:{orderby:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderFilter(){jQuery,_,1==media_library_organizer_media.settings.order_enabled&&(MediaLibraryOrganizerTaxonomyOrder=wp.media.view.AttachmentFilters.extend({id:"media-attachment-order",createFilters:function(){var e={};_.each(media_library_organizer_media.order||{},(function(r,i){e[i]={text:r,props:{order:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewAddFiltersToToolbar(){var e;jQuery,_,e=wp.media.view.AttachmentsBrowser,wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){ e.prototype.createToolbar.call(this);var r=-75;for(let e in MediaLibraryOrganizerTaxonomyFilter)this.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:this.controller,model:this.collection.props,priority:r}).render()),r++;1==media_library_organizer_media.settings.orderby_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrderBy",new MediaLibraryOrganizerTaxonomyOrderBy({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),1==media_library_organizer_media.settings.order_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrder",new MediaLibraryOrganizerTaxonomyOrder({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),wp.media.events.trigger("mlo:grid:filters:add",{attachments_browser:this,priority:r}),this.controller.on("select:activate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:enabled")})),this.controller.on("select:deactivate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:disabled")})),this.controller.on("selection:action:done",(function(){wp.media.events.trigger("mlo:grid:attachments:bulk_actions:done")})),MediaLibraryOrganizerAttachmentsBrowser=this},createAttachmentsHeading:function(){e.prototype.createAttachmentsHeading.call(this)}})}function mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(){!function($,e){var r;$("body").on("click","table.compat-attachment-fields a.taxonomy-add-new",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm($(this).data("taxonomy"))})),$("body").on("click","table.compat-attachment-fields div.mlo-taxonomy-term-add-fields input[type=button]",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentAddTerm($(this).data("taxonomy"),$("input[type=text]",$(this).parent()).val())})),e.extend(wp.media.view.Attachment.prototype,{updateSave:function(e){var i=this._save=this._save||{status:"ready"};return e&&e!==i.status&&(this.$el.removeClass("save-"+i.status),i.status=e),this.$el.addClass("save-"+i.status),"waiting"!=r||"ready"!=i.status&&"complete"!=i.status||wp.media.events.trigger("mlo:grid:edit-attachment:edited",{attachment_id:this.model.id,attachment:this.model.attributes,changed:this.model.changed,taxonomy_term_changed:void 0!==this.model.changed.compat}),r=i.status,this}}),e.extend(wp.media.view.Attachment.Details.prototype,{moveFocus:function(){wp.media.events.trigger("mlo:grid:edit-attachment:deleted"),this.previousAttachment.length?this.previousAttachment.focus():this.nextAttachment.length?this.nextAttachment.focus():this.controller.uploader&&this.controller.uploader.$browser?this.controller.uploader.$browser.focus():this.moveFocusToLastFallback()}})}(jQuery,_)}function mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e,r,i,a,t){var $;$=jQuery,MediaLibraryOrganizerTaxonomyFilter.hasOwnProperty(e)&&(mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t),MediaLibraryOrganizerAttachmentsBrowser.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:MediaLibraryOrganizerAttachmentsBrowser.controller,model:MediaLibraryOrganizerAttachmentsBrowser.collection.props,priority:-75}).render()))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomies_terms.action,nonce:media_library_organizer_media.get_taxonomies_terms.nonce},(function(e){if(e.success)for(let r in e.data)mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data[r].taxonomy.name,e.data[r].terms,e.data[r].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned);else alert(e.data)}))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilter(e){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomy_terms.action,nonce:media_library_organizer_media.get_taxonomy_terms.nonce,taxonomy_name:e},(function(e){e.success?mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data.taxonomy.name,e.data.terms,e.data.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned):alert(e.data)}))}function mediaLibraryOrganizerListViewReplaceTaxonomyFilter(e,r,i){var $;($=jQuery)("select#"+e).replaceWith(r),i.length>0&&$("select#"+e).val(i)}function mediaLibraryOrganizerListViewUpdateAttachmentTerms(e,r,i){var $;($=jQuery)("td.taxonomy-"+e+" a").each((function(){$(this).text()==r.name&&(i?($(this).text(i.name),$(this).attr("href","upload.php?taxonomy="+e+"&term="+i.slug)):$(this).remove())})),$("td.taxonomy-"+e).each((function(){$(this).html($(this).html().replace(/(^\s*,)|(,\s*$)/g,""))}))}function mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e).hasClass("hidden")?$(".mlo-taxonomy-term-add-fields."+e).removeClass("hidden"):$(".mlo-taxonomy-term-add-fields."+e).addClass("hidden")}function mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e+"input[type=text]").val("")}function mediaLibraryOrganizerEditAttachmentAddTerm(e,r,i){var $,a;$=jQuery,a={action:media_library_organizer_media.create_term.action,nonce:media_library_organizer_media.create_term.nonce,taxonomy_name:e,term_name:r,term_parent_id:i},$.post(media_library_organizer_media.ajaxurl,a,(function(r){r.success?(wp.media.events.trigger("mlo:grid:edit-attachment:added:term",r.data),$("ul#"+r.data.term.taxonomy+"checklist").prepend(r.data.checkbox),mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e),$("ul#"+r.data.term.taxonomy+'checklist li:first input[type="checkbox"]').trigger("change")):alert(r.data)}))}function mediaLibraryOrganizerGridViewRefresh(){void 0!==wp.media.frame.library?wp.media.frame.library.props.set({ignore:+new Date}):wp.media.frame.content.get().collection.props.set({ignore:+new Date})}function mediaLibraryOrganizerInitialize(){mediaLibraryOrganizerQueryInitialize(),mediaLibraryOrganizerUploaderInitializeEvents(),mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(),mediaLibraryOrganizerGridViewInitializeOrderByFilter(),mediaLibraryOrganizerGridViewInitializeOrderFilter(),mediaLibraryOrganizerGridViewAddFiltersToToolbar(),mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(),jQuery(document).ready((function($){"undefined"!=typeof mediaLibraryOrganizerSelectizeInit&&mediaLibraryOrganizerSelectizeInit()}))}var mediaLibraryOrganizerUploader=!1,MediaLibraryOrganizerTaxonomyFilter={},MediaLibraryOrganizerTaxonomyOrderBy,MediaLibraryOrganizerTaxonomyOrder,MediaLibraryOrganizerAttachmentsBrowser;wp.media.events.on("mlo:grid:attachment:upload:init",(function(){if(mediaLibraryOrganizerUploader||void 0===wp.media.frame.uploader||(mediaLibraryOrganizerUploader=wp.media.frame.uploader),mediaLibraryOrganizerUploader){var e={};for(let r in media_library_organizer_media.taxonomies)e[r]=media_library_organizer_media.taxonomies[r].selected_term;mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer=e}})),wp.media.events.on("mlo:grid:filter:change:term",(function(e){mediaLibraryOrganizerUploader&&(mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[e.taxonomy_name]=e.slug)})),wp.media.events.on("mlo:grid:attachment:upload:success",(function(e){mediaLibraryOrganizerGridViewRefresh()})),wp.media.events.on("mlo:grid:edit-attachment:added:term",(function(e){mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.taxonomy.name,e.terms,e.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned)})),wp.media.events.on("mlo:grid:edit-attachment:edited",(function(e){var $;$=jQuery,e.taxonomy_term_changed&&(mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(),mediaLibraryOrganizerGridViewRefresh())})),wp.media.events.on("mlo:grid:edit-attachment:deleted",(function(e){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),wp.media.events.on("mlo:grid:bulk_select:disabled",(function(){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),mediaLibraryOrganizerInitialize();1 function mediaLibraryOrganizerQueryInitialize(){!function(){wp.media.query=function(e){return new wp.media.model.Attachments(null,{props:_.extend(_.defaults(e||{},{orderby:media_library_organizer_media.defaults.orderby,order:media_library_organizer_media.defaults.order}),{query:!0})})};var e=wp.media.model.Query,r;_.extend(e,{get:(r=[],function(i,a){var t={},n=e.orderby,o=e.defaultProps,d,m=!1;return delete i.query,delete i.cache,_.defaults(i,o),i.order=i.order.toUpperCase(),"DESC"!==i.order&&"ASC"!==i.order&&(i.order=o.order.toUpperCase()),_.contains(n.allowed,i.orderby)||(i.orderby=o.orderby),_.each(["include","exclude"],(function(e){i[e]&&!_.isArray(i[e])&&(i[e]=[i[e]])})),_.each(i,(function(r,i){_.isNull(r)||(t[e.propmap[i]||i]=r)})),_.defaults(t,e.defaultArgs),t.orderby=n.valuemap[i.orderby]||i.orderby,m=!1,r=[],d||(d=new e([],_.extend(a||{},{props:i,args:t})),r.push(d)),wp.media.events.trigger("mlo:grid:query",{query:d}),d})})}(jQuery,_)}function mediaLibraryOrganizerUploaderInitializeEvents(){!function($,e){void 0!==wp.Uploader&&e.extend(wp.Uploader.prototype,{init:function(){wp.media.events.trigger("mlo:grid:attachment:upload:init")},added:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:added",e)},progress:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:progress",e)},success:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:success",e)},error:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:error",e)},complete:function(){wp.media.events.trigger("mlo:grid:attachment:upload:complete")},refresh:function(){wp.media.events.trigger("mlo:grid:attachment:upload:refresh")}})}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(){!function(){for(let e in media_library_organizer_media.taxonomies)mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,media_library_organizer_media.taxonomies[e].terms,media_library_organizer_media.taxonomies[e].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned,media_library_organizer_media.show_attachment_count)}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t){jQuery,_,"0"!=media_library_organizer_media.settings[e+"_enabled"]&&media_library_organizer_media.settings[e+"_enabled"]&&(MediaLibraryOrganizerTaxonomyFilter[e]=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter-"+e,createFilters:function(){var n={},o,o;_.each(r||{},(function(r,i){var a={};a[e]=r.slug;var o=r.name+("1"===t?" ("+r.count+")":"");n[i]={text:o,props:a}})),(o={})[e]="",n.all={text:i,props:o,priority:10},(o={})[e]="-1",n.unassigned={text:a,props:o,priority:10},this.filters=n},change:function(){var r=this.filters[this.el.value];r&&(this.model.set(r.props),wp.media.events.trigger("mlo:grid:filter:change:term",{taxonomy_name:e,slug:r.props[e]}))},select:function(){var e=this.model,r="all",i=e.toJSON();wp.media.events.trigger("mlo:grid:filter:select",{props:i}),_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderByFilter(){jQuery,_,1==media_library_organizer_media.settings.orderby_enabled&&(MediaLibraryOrganizerTaxonomyOrderBy=wp.media.view.AttachmentFilters.extend({id:"media-attachment-orderby",createFilters:function(){var e={};_.each(media_library_organizer_media.orderby||{},(function(r,i){e[i]={text:r,props:{orderby:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderFilter(){jQuery,_,1==media_library_organizer_media.settings.order_enabled&&(MediaLibraryOrganizerTaxonomyOrder=wp.media.view.AttachmentFilters.extend({id:"media-attachment-order",createFilters:function(){var e={};_.each(media_library_organizer_media.order||{},(function(r,i){e[i]={text:r,props:{order:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewAddFiltersToToolbar(){var e;jQuery,_,e=wp.media.view.AttachmentsBrowser,wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){if(e.prototype.createToolbar.call(this),this.options.search){var r=-75;for(let e in MediaLibraryOrganizerTaxonomyFilter)this.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:this.controller,model:this.collection.props,priority:r}).render()),r++;1==media_library_organizer_media.settings.orderby_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrderBy",new MediaLibraryOrganizerTaxonomyOrderBy({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),1==media_library_organizer_media.settings.order_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrder",new MediaLibraryOrganizerTaxonomyOrder({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),wp.media.events.trigger("mlo:grid:filters:add",{attachments_browser:this,priority:r}),this.controller.on("select:activate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:enabled")})),this.controller.on("select:deactivate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:disabled")})),this.controller.on("selection:action:done",(function(){wp.media.events.trigger("mlo:grid:attachments:bulk_actions:done")})),MediaLibraryOrganizerAttachmentsBrowser=this}},createAttachmentsHeading:function(){e.prototype.createAttachmentsHeading.call(this)},createAttachmentsWrapperView:function(){e.prototype.createAttachmentsWrapperView.call(this),setTimeout((function(){MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top=MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight+10+"px"}),500),window.onresize=function(){MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top=MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight+10+"px"}}})}function mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(){!function($,e){var r;$("body").on("click","table.compat-attachment-fields a.taxonomy-add-new",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm($(this).data("taxonomy"))})),$("body").on("click","table.compat-attachment-fields div.mlo-taxonomy-term-add-fields input[type=button]",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentAddTerm($(this).data("taxonomy"),$("input[type=text]",$(this).parent()).val())})),e.extend(wp.media.view.Attachment.prototype,{updateSave:function(e){var i=this._save=this._save||{status:"ready"};return e&&e!==i.status&&(this.$el.removeClass("save-"+i.status),i.status=e),this.$el.addClass("save-"+i.status),"waiting"!=r||"ready"!=i.status&&"complete"!=i.status||wp.media.events.trigger("mlo:grid:edit-attachment:edited",{attachment_id:this.model.id,attachment:this.model.attributes,changed:this.model.changed,taxonomy_term_changed:void 0!==this.model.changed.compat}),r=i.status,this}}),e.extend(wp.media.view.Attachment.Details.prototype,{moveFocus:function(){wp.media.events.trigger("mlo:grid:edit-attachment:deleted"),this.previousAttachment.length?this.previousAttachment.focus():this.nextAttachment.length?this.nextAttachment.focus():this.controller.uploader&&this.controller.uploader.$browser?this.controller.uploader.$browser.focus():this.moveFocusToLastFallback()}})}(jQuery,_)}function mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e,r,i,a,t){var $;$=jQuery,MediaLibraryOrganizerTaxonomyFilter.hasOwnProperty(e)&&(mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t),MediaLibraryOrganizerAttachmentsBrowser.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:MediaLibraryOrganizerAttachmentsBrowser.controller,model:MediaLibraryOrganizerAttachmentsBrowser.collection.props,priority:-75}).render()))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomies_terms.action,nonce:media_library_organizer_media.get_taxonomies_terms.nonce},(function(e){if(e.success)for(let r in e.data)mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data[r].taxonomy.name,e.data[r].terms,e.data[r].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned);else alert(e.data)}))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilter(e){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomy_terms.action,nonce:media_library_organizer_media.get_taxonomy_terms.nonce,taxonomy_name:e},(function(e){e.success?mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data.taxonomy.name,e.data.terms,e.data.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned):alert(e.data)}))}function mediaLibraryOrganizerListViewReplaceTaxonomyFilter(e,r,i){var $;($=jQuery)("select#"+e).replaceWith(r),i.length>0&&$("select#"+e).val(i)}function mediaLibraryOrganizerListViewUpdateAttachmentTerms(e,r,i){var $;($=jQuery)("td.taxonomy-"+e+" a").each((function(){$(this).text()==r.name&&(i?($(this).text(i.name),$(this).attr("href","upload.php?taxonomy="+e+"&term="+i.slug)):$(this).remove())})),$("td.taxonomy-"+e).each((function(){$(this).html($(this).html().replace(/(^\s*,)|(,\s*$)/g,""))}))}function mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e).hasClass("hidden")?$(".mlo-taxonomy-term-add-fields."+e).removeClass("hidden"):$(".mlo-taxonomy-term-add-fields."+e).addClass("hidden")}function mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e+"input[type=text]").val("")}function mediaLibraryOrganizerEditAttachmentAddTerm(e,r,i){var $,a;$=jQuery,a={action:media_library_organizer_media.create_term.action,nonce:media_library_organizer_media.create_term.nonce,taxonomy_name:e,term_name:r,term_parent_id:i},$.post(media_library_organizer_media.ajaxurl,a,(function(r){r.success?(wp.media.events.trigger("mlo:grid:edit-attachment:added:term",r.data),$("ul#"+r.data.term.taxonomy+"checklist").prepend(r.data.checkbox),mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e),$("ul#"+r.data.term.taxonomy+'checklist li:first input[type="checkbox"]').trigger("change")):alert(r.data)}))}function mediaLibraryOrganizerGridViewRefresh(){void 0!==wp.media.frame.library?wp.media.frame.library.props.set({ignore:+new Date}):wp.media.frame.content.get().collection.props.set({ignore:+new Date})}function mediaLibraryOrganizerInitialize(){mediaLibraryOrganizerQueryInitialize(),mediaLibraryOrganizerUploaderInitializeEvents(),mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(),mediaLibraryOrganizerGridViewInitializeOrderByFilter(),mediaLibraryOrganizerGridViewInitializeOrderFilter(),mediaLibraryOrganizerGridViewAddFiltersToToolbar(),mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(),jQuery(document).ready((function($){"undefined"!=typeof mediaLibraryOrganizerSelectizeInit&&mediaLibraryOrganizerSelectizeInit()}))}var mediaLibraryOrganizerUploader=!1,MediaLibraryOrganizerTaxonomyFilter={},MediaLibraryOrganizerTaxonomyOrderBy,MediaLibraryOrganizerTaxonomyOrder,MediaLibraryOrganizerAttachmentsBrowser;wp.media.events.on("mlo:grid:attachment:upload:init",(function(){if(mediaLibraryOrganizerUploader||void 0===wp.media.frame.uploader||(mediaLibraryOrganizerUploader=wp.media.frame.uploader),mediaLibraryOrganizerUploader&&void 0!==mediaLibraryOrganizerUploader.uploader){var e={};for(let r in media_library_organizer_media.taxonomies)e[r]=media_library_organizer_media.taxonomies[r].selected_term;mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer=e}})),wp.media.events.on("mlo:grid:filter:change:term",(function(e){mediaLibraryOrganizerUploader&&void 0!==mediaLibraryOrganizerUploader.uploader&&(mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[e.taxonomy_name]=e.slug)})),wp.media.events.on("mlo:grid:attachment:upload:success",(function(e){mediaLibraryOrganizerGridViewRefresh()})),wp.media.events.on("mlo:grid:edit-attachment:added:term",(function(e){mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.taxonomy.name,e.terms,e.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned)})),wp.media.events.on("mlo:grid:edit-attachment:edited",(function(e){var $;$=jQuery,e.taxonomy_term_changed&&(mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(),mediaLibraryOrganizerGridViewRefresh())})),wp.media.events.on("mlo:grid:edit-attachment:deleted",(function(e){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),wp.media.events.on("mlo:grid:bulk_select:disabled",(function(){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),mediaLibraryOrganizerInitialize(); -
media-library-organizer/tags/1.4.6/assets/scss/media.scss
r2688245 r2758024 163 163 164 164 /** 165 * Grid View: Add padding below filters 166 */ 167 .media-frame-content .attachments-browser .media-toolbar-secondary, 168 .media-modal-content .attachments-browser .media-toolbar-secondary { 169 padding-bottom: 10px; 170 } 171 172 /** 165 173 * Grid View: Modal 166 174 * - Adjust widths of items so that all filters display … … 204 212 .attachments-browser { 205 213 .media-toolbar { 206 height: 50px;214 height: auto; 207 215 background-color: #f3f3f3; 208 216 border-bottom: 1px solid #ddd; 209 }210 211 .attachments {212 top: 50px;213 217 } 214 218 … … 272 276 } 273 277 } 274 }275 @media only screen and (max-width: 1840px) {276 .media-modal-content {277 .attachments-browser {278 .media-toolbar {279 height: 90px;280 }281 282 .attachments {283 top: 90px;284 }285 }286 }287 }288 @media only screen and (max-width: 1330px) {289 .media-modal-content {290 .attachments-browser {291 .media-toolbar {292 height: 130px;293 }294 295 .attachments {296 top: 130px;297 }298 }299 }300 }301 @media only screen and (max-width: 1000px) {302 .media-modal-content {303 .attachments-browser {304 .media-toolbar {305 height: 170px;306 307 }308 309 .attachments {310 top: 170px;311 }312 }313 }314 }315 @media only screen and (max-width: 900px) {316 .media-modal-content {317 .attachments-browser {318 .media-toolbar {319 height: 210px;320 321 }322 323 .attachments {324 top: 210px;325 }326 }327 }328 }329 @media only screen and (max-width: 640px) {330 .media-modal-content {331 .attachments-browser {332 .media-toolbar {333 height: 160px;334 335 }336 337 .attachments {338 top: 160px;339 }340 }341 }342 278 } 343 279 -
media-library-organizer/tags/1.4.6/includes/admin/class-media-library-organizer-admin.php
r2688245 r2758024 259 259 * @param string $ext If defined, loads minified JS. 260 260 */ 261 public function enqueue_js_settings( $screen, $screens, $mode, $ext ) { / * phpcs:ignore */261 public function enqueue_js_settings( $screen, $screens, $mode, $ext ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 262 262 263 263 // JS. … … 409 409 410 410 // Bail if no page given. 411 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */411 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 412 412 return; 413 413 } 414 414 415 415 // Get current screen name. 416 $screen = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */416 $screen = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 417 417 418 418 // Get registered screens. … … 457 457 458 458 // If no page name was given, we're not on a plugin screen. 459 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */459 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 460 460 return false; 461 461 } 462 462 463 463 // Get screen name. 464 $screen = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */464 $screen = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 465 465 466 466 // Return. … … 485 485 486 486 // If no tab defined, get the first tab name from the tabs array. 487 if ( ! isset( $_REQUEST['tab'] ) ) { / * phpcs:ignore */487 if ( ! isset( $_REQUEST['tab'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 488 488 foreach ( $tabs as $tab ) { 489 489 return $tab; … … 492 492 493 493 // Return the requested tab, if it exists. 494 if ( isset( $tabs[ $_REQUEST['tab'] ] ) ) { / * phpcs:ignore */495 $tab = $tabs[ sanitize_text_field( $_REQUEST['tab'] ) ]; / * phpcs:ignore */494 if ( isset( $tabs[ $_REQUEST['tab'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 495 $tab = $tabs[ sanitize_text_field( $_REQUEST['tab'] ) ]; // phpcs:ignore WordPress.Security.NonceVerification 496 496 return $tab; 497 497 } else { … … 862 862 */ 863 863 $result = apply_filters( 'media_library_organizer_admin_save_settings', true, $_POST ); 864 break; /* phpcs:ignore */864 break; 865 865 866 866 /** -
media-library-organizer/tags/1.4.6/includes/admin/class-media-library-organizer-api.php
r2688245 r2758024 238 238 ) 239 239 ); 240 break; /* phpcs:ignore */241 240 } 242 241 243 242 // Decode JSON. 244 $body = json_decode( $body ); /* phpcs:ignore */243 $body = json_decode( $body ); 245 244 246 245 // Bail if an error occured. -
media-library-organizer/tags/1.4.6/includes/admin/class-media-library-organizer-import.php
r2688245 r2758024 144 144 * @return mixed WP_Error | bool 145 145 */ 146 public function import( $success, $import ) { / * phpcs:ignore */146 public function import( $success, $import ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 147 147 148 148 // Bail if no data. … … 171 171 * @return mixed WP_Error | bool 172 172 */ 173 public function import_third_party( $success, $import ) { / * phpcs:ignore */173 public function import_third_party( $success, $import ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 174 174 175 175 // Check which importer we need to run. … … 446 446 $terms = $wpdb->get_results( 447 447 $wpdb->prepare( 448 'SELECT ' . $wpdb->term_taxonomy . '.term_taxonomy_id,449 ' . $wpdb->term_taxonomy . '.description,450 ' . $wpdb->term_taxonomy . '.parent,451 ' . $wpdb->terms . '.name452 FROM ' . $wpdb->term_taxonomy . '453 LEFT JOIN ' . $wpdb->terms . '454 ON ' . $wpdb->term_taxonomy . '.term_id = ' . $wpdb->terms . '.term_id455 WHERE ' . $wpdb->term_taxonomy . ".taxonomy = '%s'", /* phpcs:ignore */448 "SELECT {$wpdb->term_taxonomy}.term_taxonomy_id, 449 {$wpdb->term_taxonomy}.description, 450 {$wpdb->term_taxonomy}.parent, 451 {$wpdb->terms}.name 452 FROM {$wpdb->term_taxonomy} 453 LEFT JOIN {$wpdb->terms} 454 ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id 455 WHERE {$wpdb->term_taxonomy}.taxonomy = %s", 456 456 $taxonomy 457 457 ) … … 491 491 // Get Attachment IDs that have any of the given Term IDs assigned to them. 492 492 $attachments = $wpdb->get_results( 493 'SELECT ' . $wpdb->term_relationships . '.object_id, 494 ' . $wpdb->term_relationships . '.term_taxonomy_id 495 FROM ' . $wpdb->term_relationships . ' 496 WHERE ' . $wpdb->term_relationships . '.term_taxonomy_id IN (' . implode( ',', $term_ids ) . ')' /* phpcs:ignore */ 493 "SELECT {$wpdb->term_relationships}.object_id, {$wpdb->term_relationships}.term_taxonomy_id 494 FROM {$wpdb->term_relationships} 495 WHERE {$wpdb->term_relationships}.term_taxonomy_id IN (" . implode( ',', $term_ids ) . ')' // phpcs:ignore WordPress.DB.PreparedSQL 497 496 ); 498 497 -
media-library-organizer/tags/1.4.6/includes/admin/class-media-library-organizer-notices.php
r2688245 r2758024 350 350 <div class="notice notice-success is-dismissible"> 351 351 <p> 352 <?php echo implode( '<br />', $this->notices['success'] ); /* phpcs:ignore */ ?> 352 <?php 353 foreach ( $this->notices['success'] as $notice ) { 354 echo esc_html( $notice ) . '<br />'; 355 } 356 ?> 353 357 </p> 354 358 </div> … … 361 365 <div class="notice notice-error is-dismissible"> 362 366 <p> 363 <?php echo implode( '<br />', $this->notices['error'] ); /* phpcs:ignore */ ?> 367 <?php 368 foreach ( $this->notices['error'] as $notice ) { 369 echo esc_html( $notice ) . '<br />'; 370 } 371 ?> 364 372 </p> 365 373 </div> -
media-library-organizer/tags/1.4.6/includes/class-media-library-organizer.php
r2722863 r2758024 281 281 // If the request global exists, check for specific request keys which tell us 282 282 // that we're using a frontend editor. 283 if ( isset( $_REQUEST ) && ! empty( $_REQUEST ) ) { / * phpcs:ignore */283 if ( isset( $_REQUEST ) && ! empty( $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 284 284 // Sanitize request. 285 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */285 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 286 286 287 287 // Beaver Builder. … … 405 405 /* translators: %1$s: Plugin Name, %2$s: PHP class name */ 406 406 __( '%1$s: Error: Could not load Plugin class %2$s', 'media-library-organizer' ), 407 $this->plugin->displayName, /* phpcs:ignore */407 $this->plugin->displayName, 408 408 $name 409 409 ) … … 414 414 if ( is_admin() ) { 415 415 wp_die( 416 $error, /* phpcs:ignore */416 esc_html( $error->get_error_message() ), 417 417 sprintf( 418 418 /* translators: Plugin Name */ 419 419 esc_html__( '%s: Error', 'media-library-organizer' ), 420 $this->plugin->displayName /* phpcs:ignore */420 esc_html( $this->plugin->displayName ) 421 421 ), 422 422 array( -
media-library-organizer/tags/1.4.6/includes/global/class-media-library-organizer-ajax.php
r2688245 r2758024 260 260 public function search_authors() { 261 261 262 // Get vars. 263 $query = sanitize_text_field( $_REQUEST['query'] ); /* phpcs:ignore */ 262 // Check nonce. 263 check_ajax_referer( 'media_library_organizer_search_authors', 'nonce' ); 264 265 // Get vars. 266 $query = sanitize_text_field( $_REQUEST['query'] ); 264 267 265 268 // Get results. … … 299 302 public function search_taxonomy_terms() { 300 303 304 // Check nonce. 305 check_ajax_referer( 'media_library_organizer_search_taxonomy_terms', 'nonce' ); 306 301 307 // Get vars. 302 308 $taxonomy_name = false; 303 if ( isset( $_REQUEST['taxonomy_name'] ) ) { /* phpcs:ignore */304 $taxonomy_name = sanitize_text_field( $_REQUEST['taxonomy_name'] ); /* phpcs:ignore */305 } elseif ( isset( $_REQUEST['args'] ) && isset( $_REQUEST['args']['taxonomy_name'] ) ) { /* phpcs:ignore */306 $taxonomy_name = sanitize_text_field( $_REQUEST['args']['taxonomy_name'] ); /* phpcs:ignore */307 } 308 $query = sanitize_text_field( $_REQUEST['query'] ); /* phpcs:ignore */309 if ( isset( $_REQUEST['taxonomy_name'] ) ) { 310 $taxonomy_name = sanitize_text_field( $_REQUEST['taxonomy_name'] ); 311 } elseif ( isset( $_REQUEST['args'] ) && isset( $_REQUEST['args']['taxonomy_name'] ) ) { 312 $taxonomy_name = sanitize_text_field( $_REQUEST['args']['taxonomy_name'] ); 313 } 314 $query = sanitize_text_field( $_REQUEST['query'] ); 309 315 310 316 // Bail if no Taxonomy Name specified. -
media-library-organizer/tags/1.4.6/includes/global/class-media-library-organizer-common.php
r2747124 r2758024 418 418 'image_size_names_choose', 419 419 array( 420 'thumbnail' => __( 'Thumbnail' ), /* phpcs:ignore */421 'medium' => __( 'Medium' ), /* phpcs:ignore */422 'large' => __( 'Large' ), /* phpcs:ignore */423 'full' => __( 'Full Size' ), /* phpcs:ignore */420 'thumbnail' => __( 'Thumbnail', 'media-library-organizer' ), 421 'medium' => __( 'Medium', 'media-library-organizer' ), 422 'large' => __( 'Large', 'media-library-organizer' ), 423 'full' => __( 'Full Size', 'media-library-organizer' ), 424 424 ) 425 425 ); … … 605 605 606 606 $keys = array_keys( $array ); 607 $index = array_search( $key, $keys ); /* phpcs:ignore */608 $pos = false === $index ? count( $array ) : $index + 1; /* phpcs:ignore */607 $index = array_search( $key, $keys, true ); 608 $pos = false === $index ? count( $array ) : $index + 1; 609 609 return array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) ); 610 610 -
media-library-organizer/tags/1.4.6/includes/global/class-media-library-organizer-media.php
r2747124 r2758024 126 126 127 127 // Determine the current orderby. 128 if ( isset( $_REQUEST['orderby'] ) ) { / * phpcs:ignore */128 if ( isset( $_REQUEST['orderby'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 129 129 // Get from the <select> dropdown. 130 $current_orderby = sanitize_text_field( $_REQUEST['orderby'] ); / * phpcs:ignore */130 $current_orderby = sanitize_text_field( $_REQUEST['orderby'] ); // phpcs:ignore WordPress.Security.NonceVerification 131 131 } else { 132 132 // Get orderby default from the User's Options, if set to persist. … … 140 140 141 141 // Determine the current order. 142 if ( isset( $_REQUEST['order'] ) ) { / * phpcs:ignore */142 if ( isset( $_REQUEST['order'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 143 143 // Get from the <select> dropdown. 144 $current_order = sanitize_text_field( $_REQUEST['order'] ); / * phpcs:ignore */144 $current_order = sanitize_text_field( $_REQUEST['order'] ); // phpcs:ignore WordPress.Security.NonceVerification 145 145 } else { 146 146 // Get orderby default from the User's Options, if set to persist. … … 160 160 } 161 161 162 echo $this->get_list_table_category_filter( $taxonomy_name, sanitize_text_field( $taxonomy['plural_name'] ) ); / * phpcs:ignore */162 echo $this->get_list_table_category_filter( $taxonomy_name, sanitize_text_field( $taxonomy['plural_name'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput 163 163 } 164 164 … … 489 489 490 490 // Output. 491 echo $output; / * phpcs:ignore */491 echo $output; // phpcs:ignore WordPress.Security.EscapeOutput 492 492 493 493 } … … 545 545 // wp_ajax_query_attachments() doesn't attribute $_REQUEST['query'] attributes to $args that aren't Post or Taxonomy Related. 546 546 // Include these in the below filter so they're accessible to Addons which might need to read the request input to modify $args. 547 $query = array_map( 'sanitize_text_field', $_REQUEST['query'] ); / * phpcs:ignore */547 $query = array_map( 'sanitize_text_field', $_REQUEST['query'] ); // phpcs:ignore WordPress.Security.NonceVerification 548 548 549 549 /** … … 620 620 621 621 // Sanitize request. 622 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */622 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 623 623 624 624 // File Type. … … 932 932 <a href="#" class="taxonomy-add-new" data-taxonomy="' . $taxonomy_name . '">' . 933 933 /* translators: %s: Add New taxonomy label. */ 934 sprintf( __( '+ %s' ), $taxonomy->labels->add_new_item ) /* phpcs:ignore */. '934 sprintf( __( '+ %s', 'media-library-organizer' ), $taxonomy->labels->add_new_item ) . ' 935 935 </a> 936 936 <div class="mlo-taxonomy-term-add-fields hidden ' . $taxonomy_name . '"> … … 966 966 $taxonomy = $this->base->get_class( 'taxonomies' )->get_taxonomy( $taxonomy_name ); 967 967 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); 968 $comma = _x( ',', 'tag delimiter' ); /* phpcs:ignore */968 $comma = _x( ',', 'tag delimiter', 'media-library-organizer' ); 969 969 $terms = get_the_terms( $post_id, $taxonomy_name ); 970 970 … … 1022 1022 * @return string Taxonomy HTML Checkboxes 1023 1023 */ 1024 public function terms_checkbox( $taxonomy_name, $field_name, $selected_term_ids = array() ) { / * phpcs:ignore */1024 public function terms_checkbox( $taxonomy_name, $field_name, $selected_term_ids = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 1025 1025 1026 1026 // Get Taxonomy Terms. … … 1080 1080 } 1081 1081 1082 // Getrequest.1083 $request = $_REQUEST; /* phpcs:ignore */1082 // Sanitize request. 1083 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 1084 1084 1085 1085 // Iterate through Registered Taxonomies. … … 1257 1257 1258 1258 // Sanitize request. 1259 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */1259 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 1260 1260 1261 1261 // Check some request variables. -
media-library-organizer/tags/1.4.6/includes/global/class-media-library-organizer-taxonomy-walker.php
r2688245 r2758024 48 48 * @param array $args An array of arguments. @see wp_terms_checklist(). 49 49 */ 50 public function start_lvl( &$output, $depth = 0, $args = array() ) { / * phpcs:ignore */50 public function start_lvl( &$output, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 51 51 52 52 $indent = str_repeat( "\t", $depth ); … … 66 66 * @param array $args An array of arguments. @see wp_terms_checklist(). 67 67 */ 68 public function end_lvl( &$output, $depth = 0, $args = array() ) { / * phpcs:ignore */68 public function end_lvl( &$output, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 69 69 70 70 $indent = str_repeat( "\t", $depth ); … … 90 90 * @param int $id ID of the current term. 91 91 */ 92 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { / * phpcs:ignore */92 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 93 93 94 94 $taxonomy = $args['taxonomy']; … … 137 137 * @param array $args An array of arguments. @see wp_terms_checklist(). 138 138 */ 139 public function end_el( &$output, $category, $depth = 0, $args = array() ) { / * phpcs:ignore */139 public function end_el( &$output, $category, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 140 140 141 141 $output .= "</li>\n"; -
media-library-organizer/tags/1.4.6/includes/global/class-media-library-organizer-upload.php
r2688245 r2758024 164 164 foreach ( $this->base->get_class( 'taxonomies' )->get_taxonomies() as $taxonomy_name => $taxonomy ) { 165 165 // Conditionally set Media Categories, as they won't be included in the request if no checkboxes were selected. 166 if ( ! isset( $_REQUEST['media_library_organizer'] ) ) { / * phpcs:ignore */166 if ( ! isset( $_REQUEST['media_library_organizer'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 167 167 continue; 168 168 } 169 169 170 170 // Fetch request. 171 $request = $_REQUEST['media_library_organizer']; /* phpcs:ignore */171 $request = stripslashes_deep( $_REQUEST['media_library_organizer'] ); // phpcs:ignore WordPress.Security.NonceVerification 172 172 173 173 // Skip if the Taxonomy isn't specified. -
media-library-organizer/tags/1.4.6/media-library-organizer.php
r2747124 r2758024 9 9 * Plugin Name: Media Library Organizer 10 10 * Plugin URI: https://wpmedialibrary.com 11 * Version: 1.4. 511 * Version: 1.4.6 12 12 * Author: WP Media Library 13 13 * Author URI: https://wpmedialibrary.com … … 22 22 23 23 // Define Plugin version and build date. 24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4. 5' );25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-0 6-2318:00:00' );24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4.6' ); 25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-07-18 18:00:00' ); 26 26 27 27 // Define Plugin paths. … … 101 101 * @since 1.0.5 102 102 */ 103 function Media_Library_Organizer() { / * phpcs:ignore */103 function Media_Library_Organizer() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 104 104 105 105 return Media_Library_Organizer::get_instance(); -
media-library-organizer/tags/1.4.6/readme.txt
r2747124 r2758024 4 4 Tags: media categories, media library, media tags, images, organizer 5 5 Requires at least: 5.0 6 Tested up to: 6.0 6 Tested up to: 6.0.1 7 7 Requires PHP: 5.6 8 8 Stable tag: trunk … … 173 173 == Changelog == 174 174 175 = 1.4.6 (2022-07-18) = 176 * Added: Grid View: Modal: Better method for defining toolbar height and attachments grid 177 * Updated: French translations 178 * Fix: Grid View: Modal: Edit Gallery: Don't display Dropdown Filters, as they have no effect on the selected images 179 * Fix: Code improvements for WordPress Coding Standards 180 175 181 = 1.4.5 (2022-06-23) = 176 182 * Added: French translations -
media-library-organizer/tags/1.4.6/views/admin/import-enhanced-media-library.php
r2688245 r2758024 24 24 <div class="right"> 25 25 <?php 26 foreach ( $import_source['data']['taxonomies'] as $taxonomy_name => $ taxonomy ) { /* phpcs:ignore */26 foreach ( $import_source['data']['taxonomies'] as $taxonomy_name => $eml_taxonomy ) { 27 27 // Skip non-EML categories. 28 if ( ! $ taxonomy['eml_media'] ) {28 if ( ! $eml_taxonomy['eml_media'] ) { 29 29 continue; 30 30 } … … 32 32 <label for="taxonomies_<?php echo esc_attr( $taxonomy_name ); ?>"> 33 33 <input type="checkbox" name="taxonomies[]" id="taxonomies_<?php echo esc_attr( $taxonomy_name ); ?>" value="<?php echo esc_attr( $taxonomy_name ); ?>" /> 34 <?php echo esc_html( $ taxonomy['labels']['name'] ); ?>34 <?php echo esc_html( $eml_taxonomy['labels']['name'] ); ?> 35 35 </label><br /> 36 36 <?php -
media-library-organizer/tags/1.4.6/views/admin/settings-general.php
r2688245 r2758024 64 64 65 65 <?php 66 foreach ( $taxonomies as $taxonomy_name => $ taxonomy ) { /* phpcs:ignore */66 foreach ( $taxonomies as $taxonomy_name => $mlo_taxonomy ) { 67 67 ?> 68 68 <div class="wpzinc-option"> 69 69 <div class="left"> 70 <label for="general_<?php echo esc_attr( $taxonomy_name ); ?>_enabled"><?php echo esc_html( $ taxonomy['plural_name'] ); ?></label>70 <label for="general_<?php echo esc_attr( $taxonomy_name ); ?>_enabled"><?php echo esc_html( $mlo_taxonomy['plural_name'] ); ?></label> 71 71 </div> 72 72 <div class="right"> … … 82 82 /* translators: Taxonomy Label, Singular */ 83 83 __( 'If enabled, displays a dropdown option to filter Media Library items by %s', 'media-library-organizer' ), 84 $ taxonomy['singular_name']84 $mlo_taxonomy['singular_name'] 85 85 ) 86 86 ); -
media-library-organizer/tags/1.4.6/views/admin/settings.php
r2688245 r2758024 22 22 <?php 23 23 // Output notices. 24 echo $this->base->get_class( 'notices' )->output_notices(); / * phpcs:ignore */24 echo $this->base->get_class( 'notices' )->output_notices(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 25 25 ?> 26 26 -
media-library-organizer/trunk/_modules/dashboard/class-wpzincdashboardwidget.php
r2747124 r2758024 438 438 439 439 // Define minimum capability for accessing Import and Export Sub Menu. 440 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */441 442 add_submenu_page( $slug, __( 'Import & Export', $this->plugin->name ), __( 'Import & Export', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-import-export', array( $this, 'import_export_screen' ) ); / * phpcs:ignore */440 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 441 442 add_submenu_page( $slug, __( 'Import & Export', $this->plugin->name ), __( 'Import & Export', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-import-export', array( $this, 'import_export_screen' ) ); // phpcs:ignore WordPress.WP.I18n 443 443 444 444 } … … 463 463 464 464 // Define minimum capability for accessing Support Menu. 465 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */466 467 add_submenu_page( $slug, __( 'Support', $this->plugin->name ), __( 'Support', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-support', array( $this, 'support_screen' ) ); / * phpcs:ignore */465 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 466 467 add_submenu_page( $slug, __( 'Support', $this->plugin->name ), __( 'Support', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-support', array( $this, 'support_screen' ) ); // phpcs:ignore WordPress.WP.I18n 468 468 469 469 } … … 488 488 489 489 // Define minimum capability for accessing Upgrade Menu. 490 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); / * phpcs:ignore */491 492 add_submenu_page( $slug, __( 'Upgrade', $this->plugin->name ), __( 'Upgrade', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-upgrade', array( $this, 'upgrade_screen' ) ); / * phpcs:ignore */490 $minimum_capability = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 491 492 add_submenu_page( $slug, __( 'Upgrade', $this->plugin->name ), __( 'Upgrade', $this->plugin->name ), $minimum_capability, $this->plugin->name . '-upgrade', array( $this, 'upgrade_screen' ) ); // phpcs:ignore WordPress.WP.I18n 493 493 494 494 } … … 531 531 * @return array Action Links 532 532 */ 533 public function add_action_link( $links, $file ) { / * phpcs:ignore */533 public function add_action_link( $links, $file ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 534 534 535 535 // Bail if the licensing class exists,as this means we're on a Pro version. … … 558 558 // Add Links. 559 559 if ( $this->get_upgrade_url( 'plugins' ) ) { 560 $links[] = '<a href="' . $this->get_upgrade_url( 'plugins' ) . '" rel="noopener" target="_blank">' . __( 'Upgrade', $this->plugin->name ) . '</a>'; /* phpcs:ignore */560 $links[] = '<a href="' . esc_attr( $this->get_upgrade_url( 'plugins' ) ) . '" rel="noopener" target="_blank">' . __( 'Upgrade', $this->plugin->name ) . '</a>'; //phpcs:ignore WordPress.WP.I18n 561 561 } 562 562 … … 586 586 // Define the deactivation reasons. 587 587 $reasons = array( 588 'not_working' => __( 'The Plugin didn\'t work', $this->plugin->name ), / * phpcs:ignore */589 'better_alternative' => __( 'I found a better Plugin', $this->plugin->name ), / * phpcs:ignore */590 'other' => __( 'Other', $this->plugin->name ), / * phpcs:ignore */588 'not_working' => __( 'The Plugin didn\'t work', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 589 'better_alternative' => __( 'I found a better Plugin', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 590 'other' => __( 'Other', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 591 591 ); 592 592 … … 620 620 621 621 // Build args. 622 // phpcs:disable WordPress.Security.NonceVerification 622 623 $args = array( 623 'product' => sanitize_text_field( $_REQUEST['product'] ), /* phpcs:ignore */624 'version' => sanitize_text_field( $_REQUEST['version'] ), /* phpcs:ignore */625 'reason' => sanitize_text_field( $_REQUEST['reason'] ), /* phpcs:ignore */626 'reason_text' => sanitize_text_field( $_REQUEST['reason_text'] ), /* phpcs:ignore */627 'reason_email' => sanitize_text_field( $_REQUEST['reason_email'] ), /* phpcs:ignore */624 'product' => sanitize_text_field( $_REQUEST['product'] ), 625 'version' => sanitize_text_field( $_REQUEST['version'] ), 626 'reason' => sanitize_text_field( $_REQUEST['reason'] ), 627 'reason_text' => sanitize_text_field( $_REQUEST['reason_text'] ), 628 'reason_email' => sanitize_text_field( $_REQUEST['reason_email'] ), 628 629 'site_url' => str_replace( wp_parse_url( get_bloginfo( 'url' ), PHP_URL_SCHEME ) . '://', '', get_bloginfo( 'url' ) ), 629 630 ); 631 // phpcs:enable 630 632 631 633 // Send deactivation reason. … … 693 695 694 696 // Bail if we're not on a Plugin screen. 695 if ( ! isset( $_REQUEST['page'] ) ) { / * phpcs:ignore */697 if ( ! isset( $_REQUEST['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 696 698 return $text; 697 699 } 698 $page = sanitize_text_field( $_REQUEST['page'] ); / * phpcs:ignore */700 $page = sanitize_text_field( $_REQUEST['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 699 701 if ( strpos( $page, $this->plugin->name ) === false ) { 700 702 return $text; … … 704 706 return sprintf( 705 707 /* translators: %1$s: Plugin Name, %2$s: Five Star Link to Review URL, %3$s: Link to Review URL, %4$s: Plugin Name */ 706 __( 'Please rate %1$s %2$s on %3$s to help us grow %4$s. Thanks!', $this->plugin->name ), / * phpcs:ignore */708 __( 'Please rate %1$s %2$s on %3$s to help us grow %4$s. Thanks!', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 707 709 '<strong>' . $this->plugin->displayName . '</strong>', 708 710 '<a href="' . $this->get_review_url() . '" target="_blank">★★★★★</a>', … … 842 844 public function import_export_screen() { 843 845 844 if ( ! empty( $_POST ) ) { / * phpcs:ignore */846 if ( ! empty( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 845 847 // Check nonce. 846 848 $result = $this->import_export_security_check(); … … 850 852 } else { 851 853 // Import JSON. 852 if ( isset( $_POST['import'] ) ) { / * phpcs:ignore */854 if ( isset( $_POST['import'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 853 855 $this->import(); 854 856 } else { 855 857 // Import from Third Party. 856 858 $result = true; 857 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_third_party', $result, $_POST ); / * phpcs:ignore */859 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_third_party', $result, $_POST ); // phpcs:ignore WordPress.NamingConventions.ValidHookName,WordPress.Security.NonceVerification 858 860 859 861 if ( is_wp_error( $result ) ) { 860 862 $this->error_message = $result->get_error_message(); 861 863 } else { 862 $this->message = __( 'Settings imported.', $this->plugin->name ); / * phpcs:ignore */864 $this->message = __( 'Settings imported.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 863 865 } 864 866 } … … 867 869 868 870 // Allow Plugin to define additional import routines. 869 $import_sources = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_sources', array() ); / * phpcs:ignore */871 $import_sources = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import_sources', array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 870 872 871 873 // Output view. … … 886 888 if ( ! isset( $_POST[ $this->plugin->name . '_nonce' ] ) ) { 887 889 // Missing nonce. 888 return new WP_Error( 'import_export_nonce_missing', __( 'nonce field is missing. Settings NOT saved.', $this->plugin->name ) ); / * phpcs:ignore */890 return new WP_Error( 'import_export_nonce_missing', __( 'nonce field is missing. Settings NOT saved.', $this->plugin->name ) ); // phpcs:ignore WordPress.WP.I18n 889 891 } 890 892 891 893 if ( ! wp_verify_nonce( $_POST[ $this->plugin->name . '_nonce' ], $this->plugin->name ) ) { 892 894 // Invalid nonce. 893 return new WP_Error( 'import_export_nonce_invalid', __( 'Invalid nonce specified. Settings NOT saved.', $this->plugin->name ) ); / * phpcs:ignore */895 return new WP_Error( 'import_export_nonce_invalid', __( 'Invalid nonce specified. Settings NOT saved.', $this->plugin->name ) ); // phpcs:ignore WordPress.WP.I18n 894 896 } 895 897 … … 906 908 907 909 if ( ! is_array( $_FILES ) ) { 908 $this->error_message = __( 'No file was uploaded', $this->plugin->name ); / * phpcs:ignore */910 $this->error_message = __( 'No file was uploaded', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 909 911 return; 910 912 } 911 913 912 914 if ( $_FILES['import']['error'] !== 0 ) { 913 $this->error_message = __( 'Error when uploading file.', $this->plugin->name ); / * phpcs:ignore */915 $this->error_message = __( 'Error when uploading file.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 914 916 return; 915 917 } … … 924 926 $zip = new ZipArchive(); 925 927 if ( $zip->open( $_FILES['import']['tmp_name'] ) !== true ) { 926 $this->error_message = __( 'Could not extract the supplied ZIP file.', $this->plugin->name ); / * phpcs:ignore */928 $this->error_message = __( 'Could not extract the supplied ZIP file.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 927 929 return; 928 930 } … … 933 935 934 936 // Read JSON file. 935 $handle = fopen( sys_get_temp_dir() . '/export.json', 'r' ); /* phpcs:ignore */ 936 $json = fread( $handle, filesize( sys_get_temp_dir() . '/export.json' ) ); /* phpcs:ignore */ 937 fclose( $handle ); /* phpcs:ignore */ 937 // phpcs:disable WordPress.WP.AlternativeFunctions 938 $handle = fopen( sys_get_temp_dir() . '/export.json', 'r' ); 939 $json = fread( $handle, filesize( sys_get_temp_dir() . '/export.json' ) ); 940 fclose( $handle ); 941 // phpcs:enable 938 942 break; 939 943 940 944 default: 941 945 // Read file. 942 $handle = fopen( $_FILES['import']['tmp_name'], 'r' ); /* phpcs:ignore */ 943 $json = fread( $handle, $_FILES['import']['size'] ); /* phpcs:ignore */ 944 fclose( $handle ); /* phpcs:ignore */ 946 // phpcs:disable WordPress.WP.AlternativeFunctions 947 $handle = fopen( $_FILES['import']['tmp_name'], 'r' ); 948 $json = fread( $handle, $_FILES['import']['size'] ); 949 fclose( $handle ); 950 // phpcs:enable 945 951 946 952 } … … 951 957 952 958 // Decode. 953 $import = json_decode( $json, true ); /* phpcs:ignore */959 $import = json_decode( $json, true ); 954 960 955 961 // Check data is an array. 956 962 if ( ! is_array( $import ) ) { 957 $this->error_message = __( 'Supplied file is not a valid JSON settings file, or has become corrupt.', $this->plugin->name ); / * phpcs:ignore */963 $this->error_message = __( 'Supplied file is not a valid JSON settings file, or has become corrupt.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 958 964 return; 959 965 } … … 961 967 // Allow Plugin to run its Import Routine using the supplied data now. 962 968 $result = true; 963 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import', $result, $import ); /* phpcs:ignore */969 $result = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_import', $result, $import ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 964 970 965 971 // Bail if an error occured. … … 969 975 } 970 976 971 $this->message = __( 'Settings imported.', $this->plugin->name ); / * phpcs:ignore */977 $this->message = __( 'Settings imported.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 972 978 973 979 } … … 999 1005 1000 1006 // Bail if no POST data. 1001 if ( empty( $_POST ) ) { / * phpcs:ignore */1007 if ( empty( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1002 1008 return; 1003 1009 } 1004 1010 1005 1011 // Bail if not exporting. 1006 if ( ! isset( $_POST['export'] ) ) { / * phpcs:ignore */1012 if ( ! isset( $_POST['export'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1007 1013 return; 1008 1014 } … … 1027 1033 * @param array $_POST POST Data. 1028 1034 */ 1029 $data = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_export', $data, $_POST ); / * phpcs:ignore */1035 $data = apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_export', $data, $_POST ); // phpcs:ignore WordPress.NamingConventions.ValidHookName,WordPress.Security.NonceVerification 1030 1036 1031 1037 // Force a file download, depending on the export format. 1032 switch ( sanitize_text_field( $_POST['format'] ) ) { / * phpcs:ignore */1038 switch ( sanitize_text_field( $_POST['format'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1033 1039 /** 1034 1040 * JSON, Zipped. … … 1089 1095 header( 'Pragma: no-cache' ); 1090 1096 header( 'Expires: 0' ); 1091 readfile( $filename ); / * phpcs:ignore */1097 readfile( $filename ); // phpcs:ignore WordPress.WP.AlternativeFunctions 1092 1098 unlink( $filename ); 1093 1099 exit(); … … 1110 1116 header( 'Pragma: no-cache' ); 1111 1117 header( 'Expires: 0' ); 1112 echo $json; / * phpcs:ignore */1118 echo $json; // phpcs:ignore WordPress.Security.EscapeOutput 1113 1119 exit(); 1114 1120 … … 1130 1136 header( 'Pragma: no-cache' ); 1131 1137 header( 'Expires: 0' ); 1132 echo $csv; / * phpcs:ignore */1138 echo $csv; // phpcs:ignore WordPress.Security.EscapeOutput 1133 1139 exit(); 1134 1140 … … 1143 1149 1144 1150 // Check we requested the support page. 1145 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */1151 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 1146 1152 return; 1147 1153 } 1148 1154 1149 1155 // Sanitize page. 1150 $page = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */1156 $page = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 1151 1157 1152 1158 // Redirect to Support. 1153 1159 if ( $page === $this->plugin->name . '-support' ) { 1154 wp_redirect( $this->plugin->support_url ); // phpcs:ignore 1160 wp_redirect( $this->plugin->support_url ); // phpcs:ignore WordPress.Security.SafeRedirect 1155 1161 die(); 1156 1162 } … … 1158 1164 // Redirect to Upgrade. 1159 1165 if ( $page === $this->plugin->name . '-upgrade' ) { 1160 wp_redirect( $this->get_upgrade_url( 'menu' ) ); // phpcs:ignore 1166 wp_redirect( $this->get_upgrade_url( 'menu' ) ); // phpcs:ignore WordPress.Security.SafeRedirect 1161 1167 die(); 1162 1168 } -
media-library-organizer/trunk/_modules/dashboard/views/deactivation-modal.php
r2688245 r2758024 18 18 echo sprintf( 19 19 /* Translators: Plugin Name */ 20 esc_html__( 'Optional: We\'d be super grateful if you could take a moment to let us know why you\'re deactivating %s', $this->plugin->name ), / * phpcs:ignore */20 esc_html__( 'Optional: We\'d be super grateful if you could take a moment to let us know why you\'re deactivating %s', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 21 21 esc_html( $this->plugin->displayName ) 22 22 ); … … 45 45 <p> 46 46 <label for="reason_text"> 47 <?php esc_html_e( 'Optional: Was there a problem, any feedback or something we could do better?', $this->plugin->name ); / * phpcs:ignore */?>47 <?php esc_html_e( 'Optional: Was there a problem, any feedback or something we could do better?', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 48 48 </label> 49 <input type="text" id="reason_text" name="reason_text" value="" placeholder="<?php esc_attr_e( 'e.g. XYZ Plugin because it has this feature...', $this->plugin->name ); / * phpcs:ignore */?>" class="widefat" />49 <input type="text" id="reason_text" name="reason_text" value="" placeholder="<?php esc_attr_e( 'e.g. XYZ Plugin because it has this feature...', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="widefat" /> 50 50 </p> 51 51 52 52 <p> 53 <label for="reason_email"><?php esc_html_e( 'Optional: Email Address', $this->plugin->name ); / * phpcs:ignore */?></label>53 <label for="reason_email"><?php esc_html_e( 'Optional: Email Address', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 54 54 <input type="email" id="reason_email" name="reason_email" value="" class="widefat" /> 55 55 <small> 56 56 <?php 57 esc_html_e( 'If you\'d like further discuss the problem / feature, enter your email address above and we\'ll be in touch. This will *never* be used for any marketing.', $this->plugin->name ); / * phpcs:ignore */57 esc_html_e( 'If you\'d like further discuss the problem / feature, enter your email address above and we\'ll be in touch. This will *never* be used for any marketing.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n 58 58 ?> 59 59 </small> … … 61 61 </div> 62 62 63 <input type="submit" name="submit" value="<?php esc_attr_e( 'Deactivate', $this->plugin->name ); /* phpcs:ignore */?>" class="button button-primary" />63 <input type="submit" name="submit" value="<?php esc_attr_e( 'Deactivate', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="button button-primary" /> 64 64 </form> 65 65 </div> -
media-library-organizer/trunk/_modules/dashboard/views/footer-upgrade-embedded.php
r2688245 r2758024 18 18 19 19 <div class="wpzinc-option ignore-nth-child"> 20 <strong><?php esc_html_e( 'Support', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Access to one on one email support', $this->base->plugin->name ); /* phpcs:ignore */?>20 <strong><?php esc_html_e( 'Support', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Access to one on one email support', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 21 21 </div> 22 22 23 23 <div class="wpzinc-option ignore-nth-child"> 24 <strong><?php esc_html_e( 'Documentation', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Detailed documentation on how to install and configure the plugin', $this->base->plugin->name ); /* phpcs:ignore */?>24 <strong><?php esc_html_e( 'Documentation', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Detailed documentation on how to install and configure the plugin', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 25 25 </div> 26 26 27 27 <div class="wpzinc-option ignore-nth-child"> 28 <strong><?php esc_html_e( 'Updates', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Receive one click update notifications, right within your WordPress Adminstration panel', $this->base->plugin->name ); /* phpcs:ignore */?>28 <strong><?php esc_html_e( 'Updates', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Receive one click update notifications, right within your WordPress Adminstration panel', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 29 29 </div> 30 30 31 31 <div class="wpzinc-option ignore-nth-child"> 32 <strong><?php esc_html_e( 'Seamless Upgrade', $this->base->plugin->name ); / * phpcs:ignore */ ?>:</strong> <?php esc_html_e( 'Retain all current settings when upgrading to Pro', $this->base->plugin->name ); /* phpcs:ignore */?>32 <strong><?php esc_html_e( 'Seamless Upgrade', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>:</strong> <?php esc_html_e( 'Retain all current settings when upgrading to Pro', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 33 33 </div> 34 34 35 35 <div class="wpzinc-option"> 36 36 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary" rel="noopener" target="_blank"> 37 <?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); / * phpcs:ignore */?>37 <?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 38 38 </a> 39 39 </div> -
media-library-organizer/trunk/_modules/dashboard/views/footer-upgrade.php
r2688245 r2758024 12 12 <div class="wpzinc-upgrade"> 13 13 <h3> 14 <?php esc_html_e( 'Upgrade to Pro', $this->base->plugin->name ); / * phpcs:ignore */?>14 <?php esc_html_e( 'Upgrade to Pro', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 15 15 </h3> 16 16 … … 27 27 ?> 28 28 <li> 29 <strong><?php esc_html_e( 'Support, Documentation and Updates', $this->base->plugin->name ); / * phpcs:ignore */?></strong>30 <?php esc_html_e( 'Access to one on one email support, plus detailed documentation on how to install and configure the plugin and one click update notifications, right within the WordPress Administration panel.', $this->base->plugin->name ); / * phpcs:ignore */?>29 <strong><?php esc_html_e( 'Support, Documentation and Updates', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></strong> 30 <?php esc_html_e( 'Access to one on one email support, plus detailed documentation on how to install and configure the plugin and one click update notifications, right within the WordPress Administration panel.', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 31 31 </li> 32 32 </ul> 33 33 34 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary button-large" target="_blank"><?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); / * phpcs:ignore */?></a>35 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-large" target="_blank"><?php esc_html_e( 'See all Features', $this->base->plugin->name ); / * phpcs:ignore */?></a>34 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-primary button-large" target="_blank"><?php esc_html_e( 'Upgrade Now', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></a> 35 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_footer_upgrade' ) ); ?>" class="button button-large" target="_blank"><?php esc_html_e( 'See all Features', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></a> 36 36 </div> 37 37 <?php -
media-library-organizer/trunk/_modules/dashboard/views/import-export.php
r2688245 r2758024 13 13 14 14 <span> 15 <?php esc_html_e( 'Import & Export', $this->plugin->name ); / * phpcs:ignore */?>15 <?php esc_html_e( 'Import & Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 16 16 </span> 17 17 </h1> … … 37 37 <h2 class="nav-tab-wrapper wpzinc-horizontal-tabbed-ui"> 38 38 <a href="<?php echo esc_url( $this->plugin->documentation_url ); ?>" class="nav-tab last documentation" rel="noopener" target="_blank"> 39 <?php esc_html_e( 'Documentation', $this->plugin->name ); / * phpcs:ignore */?>39 <?php esc_html_e( 'Documentation', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 40 40 <span class="dashicons dashicons-admin-page"></span> 41 41 </a> … … 53 53 <li class="wpzinc-nav-tab download"> 54 54 <a href="#import" class="wpzinc-nav-tab-vertical-active"> 55 <?php esc_html_e( 'Import', $this->plugin->name ); /* phpcs:ignore */?>55 <?php esc_html_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 56 56 </a> 57 57 </li> … … 71 71 <li class="wpzinc-nav-tab upload"> 72 72 <a href="#export"> 73 <?php esc_html_e( 'Export', $this->plugin->name ); /* phpcs:ignore */?>73 <?php esc_html_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 74 74 </a> 75 75 </li> … … 82 82 <div class="postbox"> 83 83 <header> 84 <h3><?php esc_html_e( 'Import', $this->plugin->name ); / * phpcs:ignore */?></h3>84 <h3><?php esc_html_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></h3> 85 85 <p class="description"> 86 <?php esc_html_e( 'Upload a file generated by this Plugin\'s export functionality (JSON or zipped JSON). This will overwrite any existing settings stored on this installation.', $this->plugin->name ); /* phpcs:ignore */?>86 <?php esc_html_e( 'Upload a file generated by this Plugin\'s export functionality (JSON or zipped JSON). This will overwrite any existing settings stored on this installation.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 87 87 </p> 88 88 </header> … … 90 90 <div class="wpzinc-option"> 91 91 <div class="left"> 92 <label for="file"><?php esc_html_e( 'JSON File', $this->plugin->name ); / * phpcs:ignore */?></label>92 <label for="file"><?php esc_html_e( 'JSON File', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 93 93 </div> 94 94 <div class="right"> … … 98 98 99 99 <div class="wpzinc-option"> 100 <input name="import" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import', $this->plugin->name ); / * phpcs:ignore */?>" />100 <input name="import" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Import', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" /> 101 101 </div> 102 102 </div> … … 115 115 <div class="postbox"> 116 116 <header> 117 <h3><?php esc_html_e( 'Export', $this->plugin->name ); / * phpcs:ignore */?></h3>117 <h3><?php esc_html_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></h3> 118 118 <p class="description"> 119 <?php esc_html_e( 'To export this Plugin\'s settings, choose which item(s) to export, and click the Export button below.', $this->plugin->name ); / * phpcs:ignore */?>119 <?php esc_html_e( 'To export this Plugin\'s settings, choose which item(s) to export, and click the Export button below.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 120 120 <br /> 121 <?php esc_html_e( 'You can then import the generated file into another Plugin installation.', $this->plugin->name ); / * phpcs:ignore */?>121 <?php esc_html_e( 'You can then import the generated file into another Plugin installation.', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 122 122 <br /> 123 <?php esc_html_e( 'Including this file in a support request? We recommend setting the Format option to "Export as JSON, Zipped".', $this->plugin->name ); / * phpcs:ignore */?>123 <?php esc_html_e( 'Including this file in a support request? We recommend setting the Format option to "Export as JSON, Zipped".', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 124 124 </p> 125 125 </header> … … 131 131 * @since 1.0.0 132 132 */ 133 do_action( str_replace( '-', '_', $this->plugin->name ) . '_export_view' ); / * phpcs:ignore */133 do_action( str_replace( '-', '_', $this->plugin->name ) . '_export_view' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName 134 134 ?> 135 135 136 136 <div class="wpzinc-option"> 137 137 <div class="left"> 138 <label for="format"><?php esc_html_e( 'Format', $this->plugin->name ); / * phpcs:ignore */?></label>138 <label for="format"><?php esc_html_e( 'Format', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></label> 139 139 </div> 140 140 <div class="right"> 141 141 <select name="format" id="format" size="1"> 142 <option value="json"><?php esc_html_e( 'JSON', $this->plugin->name ); / * phpcs:ignore */?></option>143 <option value="zip"><?php esc_html_e( 'JSON, Zipped', $this->plugin->name ); / * phpcs:ignore */?></option>142 <option value="json"><?php esc_html_e( 'JSON', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></option> 143 <option value="zip"><?php esc_html_e( 'JSON, Zipped', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?></option> 144 144 </select> 145 145 </div> … … 147 147 148 148 <div class="wpzinc-option"> 149 <input name="export" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Export', $this->plugin->name ); / * phpcs:ignore */?>" />149 <input name="export" type="submit" class="button button-primary" value="<?php esc_attr_e( 'Export', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" /> 150 150 </div> 151 151 </div> -
media-library-organizer/trunk/_modules/dashboard/views/review-notice.php
r2688245 r2758024 22 22 echo sprintf( 23 23 /* translators: Plugin Name */ 24 esc_html__( 'We\'d be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?', $this->plugin->name ), /* phpcs:ignore */24 esc_html__( 'We\'d be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 25 25 esc_html( $this->plugin->displayName ) 26 26 ); … … 29 29 <p> 30 30 <a href="<?php echo esc_url( $this->get_review_url() ); ?>" class="button button-primary" target="_blank"> 31 <?php esc_html_e( 'Yes, Leave Review', $this->plugin->name ); / * phpcs:ignore */?>31 <?php esc_html_e( 'Yes, Leave Review', $this->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 32 32 </a> 33 33 <a href="<?php echo esc_url( $this->plugin->support_url ); ?>" class="button" rel="noopener" target="_blank"> … … 35 35 echo sprintf( 36 36 /* translators: Plugin Name */ 37 esc_html__( 'No, I\'m having issues with %s', $this->plugin->name ), / * phpcs:ignore */37 esc_html__( 'No, I\'m having issues with %s', $this->plugin->name ), // phpcs:ignore WordPress.WP.I18n 38 38 esc_html( $this->plugin->displayName ) 39 39 ); -
media-library-organizer/trunk/_modules/dashboard/views/sidebar-upgrade.php
r2688245 r2758024 16 16 <div class="postbox"> 17 17 <h3 class="hndle"> 18 <?php esc_html_e( 'Keep Updated', $this->base->plugin->name ); / * phpcs:ignore */?>18 <?php esc_html_e( 'Keep Updated', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 19 19 </h3> 20 20 21 21 <div class="wpzinc-option"> 22 22 <p class="description"> 23 <?php esc_html_e( 'Subscribe to the newsletter and receive updates on our WordPress Plugins.', $this->base->plugin->name ); / * phpcs:ignore */?>23 <?php esc_html_e( 'Subscribe to the newsletter and receive updates on our WordPress Plugins.', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?> 24 24 </p> 25 25 </div> … … 28 28 <div class="wpzinc-option"> 29 29 <div class="full"> 30 <input id="fieldEmail" name="cm-jdutdyj-jdutdyj" type="email" class="widefat" placeholder="<?php esc_attr_e( 'Your Email Address', $this->base->plugin->name ); / * phpcs:ignore */?>" class="widefat" required />30 <input id="fieldEmail" name="cm-jdutdyj-jdutdyj" type="email" class="widefat" placeholder="<?php esc_attr_e( 'Your Email Address', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="widefat" required /> 31 31 </div> 32 32 </div> 33 33 <div class="wpzinc-option"> 34 34 <div class="full"> 35 <input type="submit" name="submit" value="<?php esc_attr_e( 'Subscribe', $this->base->plugin->name ); / * phpcs:ignore */?>" class="button button-primary" />35 <input type="submit" name="submit" value="<?php esc_attr_e( 'Subscribe', $this->base->plugin->name ); // phpcs:ignore WordPress.WP.I18n ?>" class="button button-primary" /> 36 36 </div> 37 37 </div> -
media-library-organizer/trunk/addons/tree-view/class-media-library-organizer-tree-view.php
r2688245 r2758024 177 177 if ( is_admin() ) { 178 178 wp_die( 179 $error, /* phpcs:ignore */179 esc_html( $error->get_error_message() ), 180 180 esc_html__( 'Media Library Organizer: Tree View: Error', 'media-library-organizer' ), 181 181 array( … … 273 273 * @since 1.1.1 274 274 */ 275 function Media_Library_Organizer_Tree_View() { / * phpcs:ignore */275 function Media_Library_Organizer_Tree_View() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName 276 276 277 277 return Media_Library_Organizer_Tree_View::get_instance(); -
media-library-organizer/trunk/addons/tree-view/includes/global/class-media-library-organizer-tree-view-media.php
r2688245 r2758024 58 58 * @param string $ext If defined, loads minified JS. 59 59 */ 60 public function enqueue_js( $screen, $screens, $mode, $ext ) { / * phpcs:ignore */60 public function enqueue_js( $screen, $screens, $mode, $ext ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 61 61 62 62 // Bail if Tree View isn't enabled. … … 420 420 ); 421 421 foreach ( $conditions as $condition ) { 422 if ( ! isset( $_REQUEST[ $condition ] ) ) { / * phpcs:ignore */422 if ( ! isset( $_REQUEST[ $condition ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 423 423 continue; 424 424 } 425 425 426 if ( empty( $_REQUEST[ $condition ] ) ) { / * phpcs:ignore */426 if ( empty( $_REQUEST[ $condition ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 427 427 continue; 428 428 } 429 429 430 $args[ $condition ] = sanitize_text_field( $_REQUEST[ $condition ] ); / * phpcs:ignore */430 $args[ $condition ] = sanitize_text_field( $_REQUEST[ $condition ] ); // phpcs:ignore WordPress.Security.NonceVerification 431 431 } 432 432 -
media-library-organizer/trunk/addons/tree-view/includes/global/class-media-library-organizer-tree-view-taxonomy-walker.php
r2688245 r2758024 102 102 103 103 // Sanitize request. 104 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */104 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 105 105 106 106 foreach ( $conditions as $condition ) { -
media-library-organizer/trunk/addons/tree-view/views/admin/media.php
r2688245 r2758024 27 27 28 28 <div id="media-library-organizer-tree-view-list"<?php echo ( $jstree_enabled ? ' class="media-library-organizer-tree-view-enabled"' : '' ); ?>> 29 <?php echo $output; / * phpcs:ignore */?>29 <?php echo $output; // phpcs:ignore WordPress.Security.EscapeOutput ?> 30 30 </div> 31 31 </form> -
media-library-organizer/trunk/assets/css/media.css
r2493585 r2758024 1 .media-library-organizer-feather-image{background:url(../../_modules/dashboard/assets/feather/image.svg) transparent no-repeat scroll 0 0;background-size:16px 16px;width:16px;height:16px;display:inline-block;vertical-align:text-top}div.selectize-control{display:inline-block;min-width:160px;vertical-align:middle;line-height:1}form.compat-item table.compat-attachment-fields p.help{margin:0}form.compat-item table.compat-attachment-fields tr th{display:block;width:100%;margin:5px 0 0 0;padding:5px 0 0 0;border:none;border-top:1px solid #ddd}form.compat-item table.compat-attachment-fields tr th label span{text-align:left;font-weight:600}form.compat-item table.compat-attachment-fields tr td.field{clear:both;float:left;width:100%;margin:0;border:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel{margin-top:-2px;min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist{list-style:none;margin:15px 0;padding:0}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist li{line-height:1.7}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist ul{margin-left:18px}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields{display:grid;grid-gap:10px;grid-template-columns:4fr 1fr}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields.hidden{display:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv input[type=checkbox]{margin:0 3px 0 0}table.media .column-title .has-media-icon~.row-actions{clear:both;margin-left:0}#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{display:grid;column-gap:10px;row-gap:10px;box-sizing:border-box;margin:10px 0;max-width:33%;width:33%;grid-template-columns:1fr 4fr;grid-template-rows:32px;grid-template-areas:"searchlabel search"}#posts-filter .search-form label.media-search-input-label,.media-frame-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label,.media-modal-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label{position:static !important;line-height:32px;text-align:right;grid-area:searchlabel}#posts-filter .search-form input#media-search-input,.media-frame-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input,.media-modal-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input{grid-area:search;width:100% !important;margin:0;height:32px;line-height:32px}.media-modal-content .media-frame-title h1:before{content:"";margin:0}.media-modal-content .media-attachments-filter-heading:before{content:"";margin:0}.media-modal-content .media-frame .media-toolbar select.attachment-filters{width:auto !important}.media-modal-content .attachments-browser .media-toolbar{height:50px;background-color:#f3f3f3;border-bottom:1px solid #ddd}.media-modal-content .attachments-browser .attachments{top:50px}.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:66%;width:66%}.media-modal-content .attachments-browser .media-toolbar-secondary h2{display:none}.media-modal-content .attachments-browser .media-toolbar-secondary select{margin-top:10px}.media-modal-content .media-content{position:absolute;left:0;padding:20px}.media-modal-content .media-content.has-sidebar{right:300px}.media-modal-content .media-content .media-library-organizer-modal-content-field{padding:0 0 20px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns{display:grid;grid-gap:10px}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-2{grid-template-columns:repeat(2, 50%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-3{grid-template-columns:repeat(3, 33%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-4{grid-template-columns:repeat(4, 25%)}.media-modal-content .media-content .media-library-organizer-modal-content-field label{display:block;font-size:15px;margin:0 0 5px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field input,.media-modal-content .media-content .media-library-organizer-modal-content-field select{font-size:15px}@media only screen and (max-width: 1840px){.media-modal-content .attachments-browser .media-toolbar{height:90px}.media-modal-content .attachments-browser .attachments{top:90px}}@media only screen and (max-width: 1330px){.media-modal-content .attachments-browser .media-toolbar{height:130px}.media-modal-content .attachments-browser .attachments{top:130px}}@media only screen and (max-width: 1000px){.media-modal-content .attachments-browser .media-toolbar{height:170px}.media-modal-content .attachments-browser .attachments{top:170px}}@media only screen and (max-width: 900px){.media-modal-content .attachments-browser .media-toolbar{height:210px}.media-modal-content .attachments-browser .attachments{top:210px}}@media only screen and (max-width: 640px){.media-modal-content .attachments-browser .media-toolbar{height:160px}.media-modal-content .attachments-browser .attachments{top:160px}}@media only screen and (max-width: 1000px){#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{max-width:100%;width:100%;grid-template-columns:50px auto;grid-template-rows:32px;grid-template-areas:"searchlabel search"}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:100%;width:100%;height:auto}}@media only screen and (max-width: 782px){div.media-library-organizer-selectize,div.media-library-organizer-selectize-search{width:200px}div.media-library-organizer-selectize .selectize-input,div.media-library-organizer-selectize-search .selectize-input{min-height:40px;font-size:16px;line-height:1.625;padding:5px 24px 5px 8px}}1 .media-library-organizer-feather-image{background:url(../../_modules/dashboard/assets/feather/image.svg) rgba(0,0,0,0) no-repeat scroll 0 0;background-size:16px 16px;width:16px;height:16px;display:inline-block;vertical-align:text-top}div.selectize-control{display:inline-block;min-width:160px;vertical-align:middle;line-height:1}form.compat-item table.compat-attachment-fields p.help{margin:0}form.compat-item table.compat-attachment-fields tr th{display:block;width:100%;margin:5px 0 0 0;padding:5px 0 0 0;border:none;border-top:1px solid #ddd}form.compat-item table.compat-attachment-fields tr th label span{text-align:left;font-weight:600}form.compat-item table.compat-attachment-fields tr td.field{clear:both;float:left;width:100%;margin:0;border:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel{margin-top:-2px;min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:solid 1px #ddd;background-color:#fdfdfd}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist{list-style:none;margin:15px 0;padding:0}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist li{line-height:1.7}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv div.tabs-panel ul.categorychecklist ul{margin-left:18px}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields{display:grid;grid-gap:10px;grid-template-columns:4fr 1fr}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv #mlo-taxonomy-term-add .mlo-taxonomy-term-add-fields.hidden{display:none}form.compat-item table.compat-attachment-fields tr td.field div.categorydiv input[type=checkbox]{margin:0 3px 0 0}table.media .column-title .has-media-icon~.row-actions{clear:both;margin-left:0}#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{display:grid;column-gap:10px;row-gap:10px;box-sizing:border-box;margin:10px 0;max-width:33%;width:33%;grid-template-columns:1fr 4fr;grid-template-rows:32px;grid-template-areas:"searchlabel search"}#posts-filter .search-form label.media-search-input-label,.media-frame-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label,.media-modal-content .attachments-browser .media-toolbar-primary.search-form label.media-search-input-label{position:static !important;line-height:32px;text-align:right;grid-area:searchlabel}#posts-filter .search-form input#media-search-input,.media-frame-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input,.media-modal-content .attachments-browser .media-toolbar-primary.search-form input#media-search-input{grid-area:search;width:100% !important;margin:0;height:32px;line-height:32px}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{padding-bottom:10px}.media-modal-content .media-frame-title h1:before{content:"";margin:0}.media-modal-content .media-attachments-filter-heading:before{content:"";margin:0}.media-modal-content .media-frame .media-toolbar select.attachment-filters{width:auto !important}.media-modal-content .attachments-browser .media-toolbar{height:auto;background-color:#f3f3f3;border-bottom:1px solid #ddd}.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:66%;width:66%}.media-modal-content .attachments-browser .media-toolbar-secondary h2{display:none}.media-modal-content .attachments-browser .media-toolbar-secondary select{margin-top:10px}.media-modal-content .media-content{position:absolute;left:0;padding:20px}.media-modal-content .media-content.has-sidebar{right:300px}.media-modal-content .media-content .media-library-organizer-modal-content-field{padding:0 0 20px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns{display:grid;grid-gap:10px}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-2{grid-template-columns:repeat(2, 50%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-3{grid-template-columns:repeat(3, 33%)}.media-modal-content .media-content .media-library-organizer-modal-content-field.columns-4{grid-template-columns:repeat(4, 25%)}.media-modal-content .media-content .media-library-organizer-modal-content-field label{display:block;font-size:15px;margin:0 0 5px 0}.media-modal-content .media-content .media-library-organizer-modal-content-field input,.media-modal-content .media-content .media-library-organizer-modal-content-field select{font-size:15px}@media only screen and (max-width: 1000px){#posts-filter .search-form,.media-frame-content .attachments-browser .media-toolbar-primary.search-form,.media-modal-content .attachments-browser .media-toolbar-primary.search-form{max-width:100%;width:100%;grid-template-columns:50px auto;grid-template-rows:32px;grid-template-areas:"searchlabel search"}.media-frame-content .attachments-browser .media-toolbar-secondary,.media-modal-content .attachments-browser .media-toolbar-secondary{max-width:100%;width:100%;height:auto}}@media only screen and (max-width: 782px){div.media-library-organizer-selectize,div.media-library-organizer-selectize-search{width:200px}div.media-library-organizer-selectize .selectize-input,div.media-library-organizer-selectize-search .selectize-input{min-height:40px;font-size:16px;line-height:1.625;padding:5px 24px 5px 8px}} -
media-library-organizer/trunk/assets/js/media.js
r2692053 r2758024 573 573 wp.media.view.AttachmentsBrowser = wp.media.view.AttachmentsBrowser.extend( 574 574 { 575 576 /** 577 * When the toolbar is created, add our custom filters to it, which 578 * are rendered as select dropdowns. 579 * 580 * @since 1.0.0 581 */ 575 /** 576 * When the toolbar is created, add our custom filters to it, which 577 * are rendered as select dropdowns. 578 * 579 * @since 1.0.0 580 */ 582 581 createToolbar: function() { 583 582 584 583 // Make sure to load the original toolbar. 585 584 AttachmentsBrowser.prototype.createToolbar.call( this ); 585 586 // Bail if search is not included in the toolbar, as this means we're on a grid view 587 // that doesn't display filters, such as Edit Gallery. 588 if ( ! this.options.search ) { 589 return; 590 } 586 591 587 592 // Define the priority order at which these filters should begin output in the Grid View Toolbar. … … 603 608 ); 604 609 605 // Increment priority so the order of filters remains the same606 // if they're subsequently updated by calling mediaLibraryOrganizerGridViewInitializeTaxonomyFilter().607 priority++;608 } 609 610 // Add the orderby filter to the toolbar.610 // Increment priority so the order of filters remains the same 611 // if they're subsequently updated by calling mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(). 612 priority++; 613 } 614 615 // Add the orderby filter to the toolbar. 611 616 if ( media_library_organizer_media.settings.orderby_enabled == 1 ) { 612 617 this.toolbar.set( … … 626 631 } 627 632 628 // Add the order filter to the toolbar.633 // Add the order filter to the toolbar. 629 634 if ( media_library_organizer_media.settings.order_enabled == 1 ) { 630 635 this.toolbar.set( … … 644 649 } 645 650 646 // Fire the mlo:grid:filters:add event that Addons can hook into and add their own Filters now. 647 wp.media.events.trigger( 648 'mlo:grid:filters:add', 649 { 650 attachments_browser: this, 651 priority: priority 652 } 651 // Fire the mlo:grid:filters:add event that Addons can hook into and add their own Filters now. 652 wp.media.events.trigger( 653 'mlo:grid:filters:add', 654 { 655 attachments_browser: this, 656 priority: priority 657 } 658 ); 659 660 // Fire the mlo:grid:bulk_select:enabled event that Addons can hook into and listen 661 // when Bulk select is enabled by clicking the Bulk Select button. 662 this.controller.on( 663 'select:activate', 664 function() { 665 wp.media.events.trigger( 'mlo:grid:bulk_select:enabled' ); 666 } 667 ); 668 669 // Fire the mlo:grid:bulk_select:disabled event that Addons can hook into and listen 670 // when Bulk select is disabled by clicking the Cancel button. 671 this.controller.on( 672 'select:deactivate', 673 function() { 674 wp.media.events.trigger( 'mlo:grid:bulk_select:disabled' ); 675 } 676 ); 677 678 // Fire the mlo:grid:attachments:bulk_actions:done event that Addons can hook into and listen 679 // when a Bulk select action (e.g. Delete) completes. 680 this.controller.on( 681 'selection:action:done', 682 function() { 683 wp.media.events.trigger( 'mlo:grid:attachments:bulk_actions:done' ); 684 } 685 ); 686 687 // Store the toolbar in a var so we can interact with it later. 688 MediaLibraryOrganizerAttachmentsBrowser = this; 689 690 }, 691 692 createAttachmentsHeading: function() { 693 694 // Make sure to load the original attachments heading. Check if we still need this function. 695 AttachmentsBrowser.prototype.createAttachmentsHeading.call( this ); 696 697 }, 698 699 /** 700 * Set attachment wrapper view top to match the height of the toolbar, so attachments 701 * are not cut off. 702 */ 703 createAttachmentsWrapperView: function() { 704 705 // Make sure to load the original attachments wrapper view. 706 AttachmentsBrowser.prototype.createAttachmentsWrapperView.call( this ); 707 708 // Set wrapper offset on load. 709 setTimeout( 710 function() { 711 MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top = ( MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight + 10 ) + 'px'; 712 }, 713 500 653 714 ); 654 715 655 // Fire the mlo:grid:bulk_select:enabled event that Addons can hook into and listen 656 // when Bulk select is enabled by clicking the Bulk Select button. 657 this.controller.on( 658 'select:activate', 659 function() { 660 wp.media.events.trigger( 'mlo:grid:bulk_select:enabled' ); 661 } 662 ); 663 664 // Fire the mlo:grid:bulk_select:disabled event that Addons can hook into and listen 665 // when Bulk select is disabled by clicking the Cancel button. 666 this.controller.on( 667 'select:deactivate', 668 function() { 669 wp.media.events.trigger( 'mlo:grid:bulk_select:disabled' ); 670 } 671 ); 672 673 // Fire the mlo:grid:attachments:bulk_actions:done event that Addons can hook into and listen 674 // when a Bulk select action (e.g. Delete) completes. 675 this.controller.on( 676 'selection:action:done', 677 function() { 678 wp.media.events.trigger( 'mlo:grid:attachments:bulk_actions:done' ); 679 } 680 ); 681 682 // Store the toolbar in a var so we can interact with it later. 683 MediaLibraryOrganizerAttachmentsBrowser = this; 716 // Update wrapper offset on window resize. 717 window.onresize = function() { 718 MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top = ( MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight + 10 ) + 'px'; 719 } 684 720 685 721 }, 686 687 createAttachmentsHeading: function() {688 689 // Make sure to load the original attachments heading.690 AttachmentsBrowser.prototype.createAttachmentsHeading.call( this );691 692 }693 722 694 723 } … … 1132 1161 } 1133 1162 1134 if ( mediaLibraryOrganizerUploader ) {1163 if ( mediaLibraryOrganizerUploader && typeof mediaLibraryOrganizerUploader.uploader !== 'undefined' ) { 1135 1164 var selected_terms = {}; 1136 1165 for ( let taxonomy_name in media_library_organizer_media.taxonomies ) { … … 1158 1187 function( atts ) { 1159 1188 1160 if ( mediaLibraryOrganizerUploader ) {1189 if ( mediaLibraryOrganizerUploader && typeof mediaLibraryOrganizerUploader.uploader !== 'undefined' ) { 1161 1190 mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[ atts.taxonomy_name ] = atts.slug; 1162 1191 } -
media-library-organizer/trunk/assets/js/min/media-min.js
r2692053 r2758024 1 function mediaLibraryOrganizerQueryInitialize(){!function(){wp.media.query=function(e){return new wp.media.model.Attachments(null,{props:_.extend(_.defaults(e||{},{orderby:media_library_organizer_media.defaults.orderby,order:media_library_organizer_media.defaults.order}),{query:!0})})};var e=wp.media.model.Query,r;_.extend(e,{get:(r=[],function(i,a){var t={},n=e.orderby,o=e.defaultProps,d,m=!1;return delete i.query,delete i.cache,_.defaults(i,o),i.order=i.order.toUpperCase(),"DESC"!==i.order&&"ASC"!==i.order&&(i.order=o.order.toUpperCase()),_.contains(n.allowed,i.orderby)||(i.orderby=o.orderby),_.each(["include","exclude"],(function(e){i[e]&&!_.isArray(i[e])&&(i[e]=[i[e]])})),_.each(i,(function(r,i){_.isNull(r)||(t[e.propmap[i]||i]=r)})),_.defaults(t,e.defaultArgs),t.orderby=n.valuemap[i.orderby]||i.orderby,m=!1,r=[],d||(d=new e([],_.extend(a||{},{props:i,args:t})),r.push(d)),wp.media.events.trigger("mlo:grid:query",{query:d}),d})})}(jQuery,_)}function mediaLibraryOrganizerUploaderInitializeEvents(){!function($,e){void 0!==wp.Uploader&&e.extend(wp.Uploader.prototype,{init:function(){wp.media.events.trigger("mlo:grid:attachment:upload:init")},added:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:added",e)},progress:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:progress",e)},success:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:success",e)},error:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:error",e)},complete:function(){wp.media.events.trigger("mlo:grid:attachment:upload:complete")},refresh:function(){wp.media.events.trigger("mlo:grid:attachment:upload:refresh")}})}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(){!function(){for(let e in media_library_organizer_media.taxonomies)mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,media_library_organizer_media.taxonomies[e].terms,media_library_organizer_media.taxonomies[e].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned,media_library_organizer_media.show_attachment_count)}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t){jQuery,_,"0"!=media_library_organizer_media.settings[e+"_enabled"]&&media_library_organizer_media.settings[e+"_enabled"]&&(MediaLibraryOrganizerTaxonomyFilter[e]=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter-"+e,createFilters:function(){var n={},o,o;_.each(r||{},(function(r,i){var a={};a[e]=r.slug;var o=r.name+("1"===t?" ("+r.count+")":"");n[i]={text:o,props:a}})),(o={})[e]="",n.all={text:i,props:o,priority:10},(o={})[e]="-1",n.unassigned={text:a,props:o,priority:10},this.filters=n},change:function(){var r=this.filters[this.el.value];r&&(this.model.set(r.props),wp.media.events.trigger("mlo:grid:filter:change:term",{taxonomy_name:e,slug:r.props[e]}))},select:function(){var e=this.model,r="all",i=e.toJSON();wp.media.events.trigger("mlo:grid:filter:select",{props:i}),_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderByFilter(){jQuery,_,1==media_library_organizer_media.settings.orderby_enabled&&(MediaLibraryOrganizerTaxonomyOrderBy=wp.media.view.AttachmentFilters.extend({id:"media-attachment-orderby",createFilters:function(){var e={};_.each(media_library_organizer_media.orderby||{},(function(r,i){e[i]={text:r,props:{orderby:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderFilter(){jQuery,_,1==media_library_organizer_media.settings.order_enabled&&(MediaLibraryOrganizerTaxonomyOrder=wp.media.view.AttachmentFilters.extend({id:"media-attachment-order",createFilters:function(){var e={};_.each(media_library_organizer_media.order||{},(function(r,i){e[i]={text:r,props:{order:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewAddFiltersToToolbar(){var e;jQuery,_,e=wp.media.view.AttachmentsBrowser,wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){ e.prototype.createToolbar.call(this);var r=-75;for(let e in MediaLibraryOrganizerTaxonomyFilter)this.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:this.controller,model:this.collection.props,priority:r}).render()),r++;1==media_library_organizer_media.settings.orderby_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrderBy",new MediaLibraryOrganizerTaxonomyOrderBy({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),1==media_library_organizer_media.settings.order_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrder",new MediaLibraryOrganizerTaxonomyOrder({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),wp.media.events.trigger("mlo:grid:filters:add",{attachments_browser:this,priority:r}),this.controller.on("select:activate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:enabled")})),this.controller.on("select:deactivate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:disabled")})),this.controller.on("selection:action:done",(function(){wp.media.events.trigger("mlo:grid:attachments:bulk_actions:done")})),MediaLibraryOrganizerAttachmentsBrowser=this},createAttachmentsHeading:function(){e.prototype.createAttachmentsHeading.call(this)}})}function mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(){!function($,e){var r;$("body").on("click","table.compat-attachment-fields a.taxonomy-add-new",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm($(this).data("taxonomy"))})),$("body").on("click","table.compat-attachment-fields div.mlo-taxonomy-term-add-fields input[type=button]",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentAddTerm($(this).data("taxonomy"),$("input[type=text]",$(this).parent()).val())})),e.extend(wp.media.view.Attachment.prototype,{updateSave:function(e){var i=this._save=this._save||{status:"ready"};return e&&e!==i.status&&(this.$el.removeClass("save-"+i.status),i.status=e),this.$el.addClass("save-"+i.status),"waiting"!=r||"ready"!=i.status&&"complete"!=i.status||wp.media.events.trigger("mlo:grid:edit-attachment:edited",{attachment_id:this.model.id,attachment:this.model.attributes,changed:this.model.changed,taxonomy_term_changed:void 0!==this.model.changed.compat}),r=i.status,this}}),e.extend(wp.media.view.Attachment.Details.prototype,{moveFocus:function(){wp.media.events.trigger("mlo:grid:edit-attachment:deleted"),this.previousAttachment.length?this.previousAttachment.focus():this.nextAttachment.length?this.nextAttachment.focus():this.controller.uploader&&this.controller.uploader.$browser?this.controller.uploader.$browser.focus():this.moveFocusToLastFallback()}})}(jQuery,_)}function mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e,r,i,a,t){var $;$=jQuery,MediaLibraryOrganizerTaxonomyFilter.hasOwnProperty(e)&&(mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t),MediaLibraryOrganizerAttachmentsBrowser.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:MediaLibraryOrganizerAttachmentsBrowser.controller,model:MediaLibraryOrganizerAttachmentsBrowser.collection.props,priority:-75}).render()))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomies_terms.action,nonce:media_library_organizer_media.get_taxonomies_terms.nonce},(function(e){if(e.success)for(let r in e.data)mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data[r].taxonomy.name,e.data[r].terms,e.data[r].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned);else alert(e.data)}))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilter(e){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomy_terms.action,nonce:media_library_organizer_media.get_taxonomy_terms.nonce,taxonomy_name:e},(function(e){e.success?mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data.taxonomy.name,e.data.terms,e.data.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned):alert(e.data)}))}function mediaLibraryOrganizerListViewReplaceTaxonomyFilter(e,r,i){var $;($=jQuery)("select#"+e).replaceWith(r),i.length>0&&$("select#"+e).val(i)}function mediaLibraryOrganizerListViewUpdateAttachmentTerms(e,r,i){var $;($=jQuery)("td.taxonomy-"+e+" a").each((function(){$(this).text()==r.name&&(i?($(this).text(i.name),$(this).attr("href","upload.php?taxonomy="+e+"&term="+i.slug)):$(this).remove())})),$("td.taxonomy-"+e).each((function(){$(this).html($(this).html().replace(/(^\s*,)|(,\s*$)/g,""))}))}function mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e).hasClass("hidden")?$(".mlo-taxonomy-term-add-fields."+e).removeClass("hidden"):$(".mlo-taxonomy-term-add-fields."+e).addClass("hidden")}function mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e+"input[type=text]").val("")}function mediaLibraryOrganizerEditAttachmentAddTerm(e,r,i){var $,a;$=jQuery,a={action:media_library_organizer_media.create_term.action,nonce:media_library_organizer_media.create_term.nonce,taxonomy_name:e,term_name:r,term_parent_id:i},$.post(media_library_organizer_media.ajaxurl,a,(function(r){r.success?(wp.media.events.trigger("mlo:grid:edit-attachment:added:term",r.data),$("ul#"+r.data.term.taxonomy+"checklist").prepend(r.data.checkbox),mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e),$("ul#"+r.data.term.taxonomy+'checklist li:first input[type="checkbox"]').trigger("change")):alert(r.data)}))}function mediaLibraryOrganizerGridViewRefresh(){void 0!==wp.media.frame.library?wp.media.frame.library.props.set({ignore:+new Date}):wp.media.frame.content.get().collection.props.set({ignore:+new Date})}function mediaLibraryOrganizerInitialize(){mediaLibraryOrganizerQueryInitialize(),mediaLibraryOrganizerUploaderInitializeEvents(),mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(),mediaLibraryOrganizerGridViewInitializeOrderByFilter(),mediaLibraryOrganizerGridViewInitializeOrderFilter(),mediaLibraryOrganizerGridViewAddFiltersToToolbar(),mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(),jQuery(document).ready((function($){"undefined"!=typeof mediaLibraryOrganizerSelectizeInit&&mediaLibraryOrganizerSelectizeInit()}))}var mediaLibraryOrganizerUploader=!1,MediaLibraryOrganizerTaxonomyFilter={},MediaLibraryOrganizerTaxonomyOrderBy,MediaLibraryOrganizerTaxonomyOrder,MediaLibraryOrganizerAttachmentsBrowser;wp.media.events.on("mlo:grid:attachment:upload:init",(function(){if(mediaLibraryOrganizerUploader||void 0===wp.media.frame.uploader||(mediaLibraryOrganizerUploader=wp.media.frame.uploader),mediaLibraryOrganizerUploader){var e={};for(let r in media_library_organizer_media.taxonomies)e[r]=media_library_organizer_media.taxonomies[r].selected_term;mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer=e}})),wp.media.events.on("mlo:grid:filter:change:term",(function(e){mediaLibraryOrganizerUploader&&(mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[e.taxonomy_name]=e.slug)})),wp.media.events.on("mlo:grid:attachment:upload:success",(function(e){mediaLibraryOrganizerGridViewRefresh()})),wp.media.events.on("mlo:grid:edit-attachment:added:term",(function(e){mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.taxonomy.name,e.terms,e.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned)})),wp.media.events.on("mlo:grid:edit-attachment:edited",(function(e){var $;$=jQuery,e.taxonomy_term_changed&&(mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(),mediaLibraryOrganizerGridViewRefresh())})),wp.media.events.on("mlo:grid:edit-attachment:deleted",(function(e){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),wp.media.events.on("mlo:grid:bulk_select:disabled",(function(){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),mediaLibraryOrganizerInitialize();1 function mediaLibraryOrganizerQueryInitialize(){!function(){wp.media.query=function(e){return new wp.media.model.Attachments(null,{props:_.extend(_.defaults(e||{},{orderby:media_library_organizer_media.defaults.orderby,order:media_library_organizer_media.defaults.order}),{query:!0})})};var e=wp.media.model.Query,r;_.extend(e,{get:(r=[],function(i,a){var t={},n=e.orderby,o=e.defaultProps,d,m=!1;return delete i.query,delete i.cache,_.defaults(i,o),i.order=i.order.toUpperCase(),"DESC"!==i.order&&"ASC"!==i.order&&(i.order=o.order.toUpperCase()),_.contains(n.allowed,i.orderby)||(i.orderby=o.orderby),_.each(["include","exclude"],(function(e){i[e]&&!_.isArray(i[e])&&(i[e]=[i[e]])})),_.each(i,(function(r,i){_.isNull(r)||(t[e.propmap[i]||i]=r)})),_.defaults(t,e.defaultArgs),t.orderby=n.valuemap[i.orderby]||i.orderby,m=!1,r=[],d||(d=new e([],_.extend(a||{},{props:i,args:t})),r.push(d)),wp.media.events.trigger("mlo:grid:query",{query:d}),d})})}(jQuery,_)}function mediaLibraryOrganizerUploaderInitializeEvents(){!function($,e){void 0!==wp.Uploader&&e.extend(wp.Uploader.prototype,{init:function(){wp.media.events.trigger("mlo:grid:attachment:upload:init")},added:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:added",e)},progress:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:progress",e)},success:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:success",e)},error:function(e){wp.media.events.trigger("mlo:grid:attachment:upload:error",e)},complete:function(){wp.media.events.trigger("mlo:grid:attachment:upload:complete")},refresh:function(){wp.media.events.trigger("mlo:grid:attachment:upload:refresh")}})}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(){!function(){for(let e in media_library_organizer_media.taxonomies)mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,media_library_organizer_media.taxonomies[e].terms,media_library_organizer_media.taxonomies[e].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned,media_library_organizer_media.show_attachment_count)}(jQuery,_)}function mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t){jQuery,_,"0"!=media_library_organizer_media.settings[e+"_enabled"]&&media_library_organizer_media.settings[e+"_enabled"]&&(MediaLibraryOrganizerTaxonomyFilter[e]=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter-"+e,createFilters:function(){var n={},o,o;_.each(r||{},(function(r,i){var a={};a[e]=r.slug;var o=r.name+("1"===t?" ("+r.count+")":"");n[i]={text:o,props:a}})),(o={})[e]="",n.all={text:i,props:o,priority:10},(o={})[e]="-1",n.unassigned={text:a,props:o,priority:10},this.filters=n},change:function(){var r=this.filters[this.el.value];r&&(this.model.set(r.props),wp.media.events.trigger("mlo:grid:filter:change:term",{taxonomy_name:e,slug:r.props[e]}))},select:function(){var e=this.model,r="all",i=e.toJSON();wp.media.events.trigger("mlo:grid:filter:select",{props:i}),_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderByFilter(){jQuery,_,1==media_library_organizer_media.settings.orderby_enabled&&(MediaLibraryOrganizerTaxonomyOrderBy=wp.media.view.AttachmentFilters.extend({id:"media-attachment-orderby",createFilters:function(){var e={};_.each(media_library_organizer_media.orderby||{},(function(r,i){e[i]={text:r,props:{orderby:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewInitializeOrderFilter(){jQuery,_,1==media_library_organizer_media.settings.order_enabled&&(MediaLibraryOrganizerTaxonomyOrder=wp.media.view.AttachmentFilters.extend({id:"media-attachment-order",createFilters:function(){var e={};_.each(media_library_organizer_media.order||{},(function(r,i){e[i]={text:r,props:{order:i}}})),this.filters=e},select:function(){var e=this.model,r="all",i=e.toJSON();_.find(this.filters,(function(e,a){var t;if(_.all(e.props,(function(e,r){return e===(_.isUndefined(i[r])?null:i[r])})))return r=a})),this.$el.val(r)}}))}function mediaLibraryOrganizerGridViewAddFiltersToToolbar(){var e;jQuery,_,e=wp.media.view.AttachmentsBrowser,wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){if(e.prototype.createToolbar.call(this),this.options.search){var r=-75;for(let e in MediaLibraryOrganizerTaxonomyFilter)this.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:this.controller,model:this.collection.props,priority:r}).render()),r++;1==media_library_organizer_media.settings.orderby_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrderBy",new MediaLibraryOrganizerTaxonomyOrderBy({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),1==media_library_organizer_media.settings.order_enabled&&(this.toolbar.set("MediaLibraryOrganizerTaxonomyOrder",new MediaLibraryOrganizerTaxonomyOrder({controller:this.controller,model:this.collection.props,priority:r}).render()),r++),wp.media.events.trigger("mlo:grid:filters:add",{attachments_browser:this,priority:r}),this.controller.on("select:activate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:enabled")})),this.controller.on("select:deactivate",(function(){wp.media.events.trigger("mlo:grid:bulk_select:disabled")})),this.controller.on("selection:action:done",(function(){wp.media.events.trigger("mlo:grid:attachments:bulk_actions:done")})),MediaLibraryOrganizerAttachmentsBrowser=this}},createAttachmentsHeading:function(){e.prototype.createAttachmentsHeading.call(this)},createAttachmentsWrapperView:function(){e.prototype.createAttachmentsWrapperView.call(this),setTimeout((function(){MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top=MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight+10+"px"}),500),window.onresize=function(){MediaLibraryOrganizerAttachmentsBrowser.attachmentsWrapper.el.style.top=MediaLibraryOrganizerAttachmentsBrowser.toolbar.el.clientHeight+10+"px"}}})}function mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(){!function($,e){var r;$("body").on("click","table.compat-attachment-fields a.taxonomy-add-new",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm($(this).data("taxonomy"))})),$("body").on("click","table.compat-attachment-fields div.mlo-taxonomy-term-add-fields input[type=button]",(function(e){e.preventDefault(),mediaLibraryOrganizerEditAttachmentAddTerm($(this).data("taxonomy"),$("input[type=text]",$(this).parent()).val())})),e.extend(wp.media.view.Attachment.prototype,{updateSave:function(e){var i=this._save=this._save||{status:"ready"};return e&&e!==i.status&&(this.$el.removeClass("save-"+i.status),i.status=e),this.$el.addClass("save-"+i.status),"waiting"!=r||"ready"!=i.status&&"complete"!=i.status||wp.media.events.trigger("mlo:grid:edit-attachment:edited",{attachment_id:this.model.id,attachment:this.model.attributes,changed:this.model.changed,taxonomy_term_changed:void 0!==this.model.changed.compat}),r=i.status,this}}),e.extend(wp.media.view.Attachment.Details.prototype,{moveFocus:function(){wp.media.events.trigger("mlo:grid:edit-attachment:deleted"),this.previousAttachment.length?this.previousAttachment.focus():this.nextAttachment.length?this.nextAttachment.focus():this.controller.uploader&&this.controller.uploader.$browser?this.controller.uploader.$browser.focus():this.moveFocusToLastFallback()}})}(jQuery,_)}function mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e,r,i,a,t){var $;$=jQuery,MediaLibraryOrganizerTaxonomyFilter.hasOwnProperty(e)&&(mediaLibraryOrganizerGridViewInitializeTaxonomyFilter(e,r,i,a,t),MediaLibraryOrganizerAttachmentsBrowser.toolbar.set(e,new MediaLibraryOrganizerTaxonomyFilter[e]({controller:MediaLibraryOrganizerAttachmentsBrowser.controller,model:MediaLibraryOrganizerAttachmentsBrowser.collection.props,priority:-75}).render()))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomies_terms.action,nonce:media_library_organizer_media.get_taxonomies_terms.nonce},(function(e){if(e.success)for(let r in e.data)mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data[r].taxonomy.name,e.data[r].terms,e.data[r].taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned);else alert(e.data)}))}function mediaLibraryOrganizerGridViewUpdateTaxonomyFilter(e){var $;($=jQuery).post(media_library_organizer_media.ajaxurl,{action:media_library_organizer_media.get_taxonomy_terms.action,nonce:media_library_organizer_media.get_taxonomy_terms.nonce,taxonomy_name:e},(function(e){e.success?mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.data.taxonomy.name,e.data.terms,e.data.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned):alert(e.data)}))}function mediaLibraryOrganizerListViewReplaceTaxonomyFilter(e,r,i){var $;($=jQuery)("select#"+e).replaceWith(r),i.length>0&&$("select#"+e).val(i)}function mediaLibraryOrganizerListViewUpdateAttachmentTerms(e,r,i){var $;($=jQuery)("td.taxonomy-"+e+" a").each((function(){$(this).text()==r.name&&(i?($(this).text(i.name),$(this).attr("href","upload.php?taxonomy="+e+"&term="+i.slug)):$(this).remove())})),$("td.taxonomy-"+e).each((function(){$(this).html($(this).html().replace(/(^\s*,)|(,\s*$)/g,""))}))}function mediaLibraryOrganizerEditAttachmentToggleTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e).hasClass("hidden")?$(".mlo-taxonomy-term-add-fields."+e).removeClass("hidden"):$(".mlo-taxonomy-term-add-fields."+e).addClass("hidden")}function mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e){var $;($=jQuery)(".mlo-taxonomy-term-add-fields."+e+"input[type=text]").val("")}function mediaLibraryOrganizerEditAttachmentAddTerm(e,r,i){var $,a;$=jQuery,a={action:media_library_organizer_media.create_term.action,nonce:media_library_organizer_media.create_term.nonce,taxonomy_name:e,term_name:r,term_parent_id:i},$.post(media_library_organizer_media.ajaxurl,a,(function(r){r.success?(wp.media.events.trigger("mlo:grid:edit-attachment:added:term",r.data),$("ul#"+r.data.term.taxonomy+"checklist").prepend(r.data.checkbox),mediaLibraryOrganizerEditAttachmentResetTaxonomyTermForm(e),$("ul#"+r.data.term.taxonomy+'checklist li:first input[type="checkbox"]').trigger("change")):alert(r.data)}))}function mediaLibraryOrganizerGridViewRefresh(){void 0!==wp.media.frame.library?wp.media.frame.library.props.set({ignore:+new Date}):wp.media.frame.content.get().collection.props.set({ignore:+new Date})}function mediaLibraryOrganizerInitialize(){mediaLibraryOrganizerQueryInitialize(),mediaLibraryOrganizerUploaderInitializeEvents(),mediaLibraryOrganizerGridViewInitializeTaxonomyFilters(),mediaLibraryOrganizerGridViewInitializeOrderByFilter(),mediaLibraryOrganizerGridViewInitializeOrderFilter(),mediaLibraryOrganizerGridViewAddFiltersToToolbar(),mediaLibraryOrganizerGridViewInitializeEditAttachmentListeners(),jQuery(document).ready((function($){"undefined"!=typeof mediaLibraryOrganizerSelectizeInit&&mediaLibraryOrganizerSelectizeInit()}))}var mediaLibraryOrganizerUploader=!1,MediaLibraryOrganizerTaxonomyFilter={},MediaLibraryOrganizerTaxonomyOrderBy,MediaLibraryOrganizerTaxonomyOrder,MediaLibraryOrganizerAttachmentsBrowser;wp.media.events.on("mlo:grid:attachment:upload:init",(function(){if(mediaLibraryOrganizerUploader||void 0===wp.media.frame.uploader||(mediaLibraryOrganizerUploader=wp.media.frame.uploader),mediaLibraryOrganizerUploader&&void 0!==mediaLibraryOrganizerUploader.uploader){var e={};for(let r in media_library_organizer_media.taxonomies)e[r]=media_library_organizer_media.taxonomies[r].selected_term;mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer=e}})),wp.media.events.on("mlo:grid:filter:change:term",(function(e){mediaLibraryOrganizerUploader&&void 0!==mediaLibraryOrganizerUploader.uploader&&(mediaLibraryOrganizerUploader.uploader.uploader.settings.multipart_params.media_library_organizer[e.taxonomy_name]=e.slug)})),wp.media.events.on("mlo:grid:attachment:upload:success",(function(e){mediaLibraryOrganizerGridViewRefresh()})),wp.media.events.on("mlo:grid:edit-attachment:added:term",(function(e){mediaLibraryOrganizerGridViewReplaceTaxonomyFilter(e.taxonomy.name,e.terms,e.taxonomy.labels.all_items,media_library_organizer_media.labels.unassigned)})),wp.media.events.on("mlo:grid:edit-attachment:edited",(function(e){var $;$=jQuery,e.taxonomy_term_changed&&(mediaLibraryOrganizerGridViewUpdateTaxonomyFilters(),mediaLibraryOrganizerGridViewRefresh())})),wp.media.events.on("mlo:grid:edit-attachment:deleted",(function(e){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),wp.media.events.on("mlo:grid:bulk_select:disabled",(function(){mediaLibraryOrganizerGridViewUpdateTaxonomyFilters()})),mediaLibraryOrganizerInitialize(); -
media-library-organizer/trunk/assets/scss/media.scss
r2688245 r2758024 163 163 164 164 /** 165 * Grid View: Add padding below filters 166 */ 167 .media-frame-content .attachments-browser .media-toolbar-secondary, 168 .media-modal-content .attachments-browser .media-toolbar-secondary { 169 padding-bottom: 10px; 170 } 171 172 /** 165 173 * Grid View: Modal 166 174 * - Adjust widths of items so that all filters display … … 204 212 .attachments-browser { 205 213 .media-toolbar { 206 height: 50px;214 height: auto; 207 215 background-color: #f3f3f3; 208 216 border-bottom: 1px solid #ddd; 209 }210 211 .attachments {212 top: 50px;213 217 } 214 218 … … 272 276 } 273 277 } 274 }275 @media only screen and (max-width: 1840px) {276 .media-modal-content {277 .attachments-browser {278 .media-toolbar {279 height: 90px;280 }281 282 .attachments {283 top: 90px;284 }285 }286 }287 }288 @media only screen and (max-width: 1330px) {289 .media-modal-content {290 .attachments-browser {291 .media-toolbar {292 height: 130px;293 }294 295 .attachments {296 top: 130px;297 }298 }299 }300 }301 @media only screen and (max-width: 1000px) {302 .media-modal-content {303 .attachments-browser {304 .media-toolbar {305 height: 170px;306 307 }308 309 .attachments {310 top: 170px;311 }312 }313 }314 }315 @media only screen and (max-width: 900px) {316 .media-modal-content {317 .attachments-browser {318 .media-toolbar {319 height: 210px;320 321 }322 323 .attachments {324 top: 210px;325 }326 }327 }328 }329 @media only screen and (max-width: 640px) {330 .media-modal-content {331 .attachments-browser {332 .media-toolbar {333 height: 160px;334 335 }336 337 .attachments {338 top: 160px;339 }340 }341 }342 278 } 343 279 -
media-library-organizer/trunk/includes/admin/class-media-library-organizer-admin.php
r2688245 r2758024 259 259 * @param string $ext If defined, loads minified JS. 260 260 */ 261 public function enqueue_js_settings( $screen, $screens, $mode, $ext ) { / * phpcs:ignore */261 public function enqueue_js_settings( $screen, $screens, $mode, $ext ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 262 262 263 263 // JS. … … 409 409 410 410 // Bail if no page given. 411 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */411 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 412 412 return; 413 413 } 414 414 415 415 // Get current screen name. 416 $screen = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */416 $screen = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 417 417 418 418 // Get registered screens. … … 457 457 458 458 // If no page name was given, we're not on a plugin screen. 459 if ( ! isset( $_GET['page'] ) ) { / * phpcs:ignore */459 if ( ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 460 460 return false; 461 461 } 462 462 463 463 // Get screen name. 464 $screen = sanitize_text_field( $_GET['page'] ); / * phpcs:ignore */464 $screen = sanitize_text_field( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification 465 465 466 466 // Return. … … 485 485 486 486 // If no tab defined, get the first tab name from the tabs array. 487 if ( ! isset( $_REQUEST['tab'] ) ) { / * phpcs:ignore */487 if ( ! isset( $_REQUEST['tab'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 488 488 foreach ( $tabs as $tab ) { 489 489 return $tab; … … 492 492 493 493 // Return the requested tab, if it exists. 494 if ( isset( $tabs[ $_REQUEST['tab'] ] ) ) { / * phpcs:ignore */495 $tab = $tabs[ sanitize_text_field( $_REQUEST['tab'] ) ]; / * phpcs:ignore */494 if ( isset( $tabs[ $_REQUEST['tab'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 495 $tab = $tabs[ sanitize_text_field( $_REQUEST['tab'] ) ]; // phpcs:ignore WordPress.Security.NonceVerification 496 496 return $tab; 497 497 } else { … … 862 862 */ 863 863 $result = apply_filters( 'media_library_organizer_admin_save_settings', true, $_POST ); 864 break; /* phpcs:ignore */864 break; 865 865 866 866 /** -
media-library-organizer/trunk/includes/admin/class-media-library-organizer-api.php
r2688245 r2758024 238 238 ) 239 239 ); 240 break; /* phpcs:ignore */241 240 } 242 241 243 242 // Decode JSON. 244 $body = json_decode( $body ); /* phpcs:ignore */243 $body = json_decode( $body ); 245 244 246 245 // Bail if an error occured. -
media-library-organizer/trunk/includes/admin/class-media-library-organizer-import.php
r2688245 r2758024 144 144 * @return mixed WP_Error | bool 145 145 */ 146 public function import( $success, $import ) { / * phpcs:ignore */146 public function import( $success, $import ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 147 147 148 148 // Bail if no data. … … 171 171 * @return mixed WP_Error | bool 172 172 */ 173 public function import_third_party( $success, $import ) { / * phpcs:ignore */173 public function import_third_party( $success, $import ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 174 174 175 175 // Check which importer we need to run. … … 446 446 $terms = $wpdb->get_results( 447 447 $wpdb->prepare( 448 'SELECT ' . $wpdb->term_taxonomy . '.term_taxonomy_id,449 ' . $wpdb->term_taxonomy . '.description,450 ' . $wpdb->term_taxonomy . '.parent,451 ' . $wpdb->terms . '.name452 FROM ' . $wpdb->term_taxonomy . '453 LEFT JOIN ' . $wpdb->terms . '454 ON ' . $wpdb->term_taxonomy . '.term_id = ' . $wpdb->terms . '.term_id455 WHERE ' . $wpdb->term_taxonomy . ".taxonomy = '%s'", /* phpcs:ignore */448 "SELECT {$wpdb->term_taxonomy}.term_taxonomy_id, 449 {$wpdb->term_taxonomy}.description, 450 {$wpdb->term_taxonomy}.parent, 451 {$wpdb->terms}.name 452 FROM {$wpdb->term_taxonomy} 453 LEFT JOIN {$wpdb->terms} 454 ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id 455 WHERE {$wpdb->term_taxonomy}.taxonomy = %s", 456 456 $taxonomy 457 457 ) … … 491 491 // Get Attachment IDs that have any of the given Term IDs assigned to them. 492 492 $attachments = $wpdb->get_results( 493 'SELECT ' . $wpdb->term_relationships . '.object_id, 494 ' . $wpdb->term_relationships . '.term_taxonomy_id 495 FROM ' . $wpdb->term_relationships . ' 496 WHERE ' . $wpdb->term_relationships . '.term_taxonomy_id IN (' . implode( ',', $term_ids ) . ')' /* phpcs:ignore */ 493 "SELECT {$wpdb->term_relationships}.object_id, {$wpdb->term_relationships}.term_taxonomy_id 494 FROM {$wpdb->term_relationships} 495 WHERE {$wpdb->term_relationships}.term_taxonomy_id IN (" . implode( ',', $term_ids ) . ')' // phpcs:ignore WordPress.DB.PreparedSQL 497 496 ); 498 497 -
media-library-organizer/trunk/includes/admin/class-media-library-organizer-notices.php
r2688245 r2758024 350 350 <div class="notice notice-success is-dismissible"> 351 351 <p> 352 <?php echo implode( '<br />', $this->notices['success'] ); /* phpcs:ignore */ ?> 352 <?php 353 foreach ( $this->notices['success'] as $notice ) { 354 echo esc_html( $notice ) . '<br />'; 355 } 356 ?> 353 357 </p> 354 358 </div> … … 361 365 <div class="notice notice-error is-dismissible"> 362 366 <p> 363 <?php echo implode( '<br />', $this->notices['error'] ); /* phpcs:ignore */ ?> 367 <?php 368 foreach ( $this->notices['error'] as $notice ) { 369 echo esc_html( $notice ) . '<br />'; 370 } 371 ?> 364 372 </p> 365 373 </div> -
media-library-organizer/trunk/includes/class-media-library-organizer.php
r2722863 r2758024 281 281 // If the request global exists, check for specific request keys which tell us 282 282 // that we're using a frontend editor. 283 if ( isset( $_REQUEST ) && ! empty( $_REQUEST ) ) { / * phpcs:ignore */283 if ( isset( $_REQUEST ) && ! empty( $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 284 284 // Sanitize request. 285 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */285 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 286 286 287 287 // Beaver Builder. … … 405 405 /* translators: %1$s: Plugin Name, %2$s: PHP class name */ 406 406 __( '%1$s: Error: Could not load Plugin class %2$s', 'media-library-organizer' ), 407 $this->plugin->displayName, /* phpcs:ignore */407 $this->plugin->displayName, 408 408 $name 409 409 ) … … 414 414 if ( is_admin() ) { 415 415 wp_die( 416 $error, /* phpcs:ignore */416 esc_html( $error->get_error_message() ), 417 417 sprintf( 418 418 /* translators: Plugin Name */ 419 419 esc_html__( '%s: Error', 'media-library-organizer' ), 420 $this->plugin->displayName /* phpcs:ignore */420 esc_html( $this->plugin->displayName ) 421 421 ), 422 422 array( -
media-library-organizer/trunk/includes/global/class-media-library-organizer-ajax.php
r2688245 r2758024 260 260 public function search_authors() { 261 261 262 // Get vars. 263 $query = sanitize_text_field( $_REQUEST['query'] ); /* phpcs:ignore */ 262 // Check nonce. 263 check_ajax_referer( 'media_library_organizer_search_authors', 'nonce' ); 264 265 // Get vars. 266 $query = sanitize_text_field( $_REQUEST['query'] ); 264 267 265 268 // Get results. … … 299 302 public function search_taxonomy_terms() { 300 303 304 // Check nonce. 305 check_ajax_referer( 'media_library_organizer_search_taxonomy_terms', 'nonce' ); 306 301 307 // Get vars. 302 308 $taxonomy_name = false; 303 if ( isset( $_REQUEST['taxonomy_name'] ) ) { /* phpcs:ignore */304 $taxonomy_name = sanitize_text_field( $_REQUEST['taxonomy_name'] ); /* phpcs:ignore */305 } elseif ( isset( $_REQUEST['args'] ) && isset( $_REQUEST['args']['taxonomy_name'] ) ) { /* phpcs:ignore */306 $taxonomy_name = sanitize_text_field( $_REQUEST['args']['taxonomy_name'] ); /* phpcs:ignore */307 } 308 $query = sanitize_text_field( $_REQUEST['query'] ); /* phpcs:ignore */309 if ( isset( $_REQUEST['taxonomy_name'] ) ) { 310 $taxonomy_name = sanitize_text_field( $_REQUEST['taxonomy_name'] ); 311 } elseif ( isset( $_REQUEST['args'] ) && isset( $_REQUEST['args']['taxonomy_name'] ) ) { 312 $taxonomy_name = sanitize_text_field( $_REQUEST['args']['taxonomy_name'] ); 313 } 314 $query = sanitize_text_field( $_REQUEST['query'] ); 309 315 310 316 // Bail if no Taxonomy Name specified. -
media-library-organizer/trunk/includes/global/class-media-library-organizer-common.php
r2747124 r2758024 418 418 'image_size_names_choose', 419 419 array( 420 'thumbnail' => __( 'Thumbnail' ), /* phpcs:ignore */421 'medium' => __( 'Medium' ), /* phpcs:ignore */422 'large' => __( 'Large' ), /* phpcs:ignore */423 'full' => __( 'Full Size' ), /* phpcs:ignore */420 'thumbnail' => __( 'Thumbnail', 'media-library-organizer' ), 421 'medium' => __( 'Medium', 'media-library-organizer' ), 422 'large' => __( 'Large', 'media-library-organizer' ), 423 'full' => __( 'Full Size', 'media-library-organizer' ), 424 424 ) 425 425 ); … … 605 605 606 606 $keys = array_keys( $array ); 607 $index = array_search( $key, $keys ); /* phpcs:ignore */608 $pos = false === $index ? count( $array ) : $index + 1; /* phpcs:ignore */607 $index = array_search( $key, $keys, true ); 608 $pos = false === $index ? count( $array ) : $index + 1; 609 609 return array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) ); 610 610 -
media-library-organizer/trunk/includes/global/class-media-library-organizer-media.php
r2747124 r2758024 126 126 127 127 // Determine the current orderby. 128 if ( isset( $_REQUEST['orderby'] ) ) { / * phpcs:ignore */128 if ( isset( $_REQUEST['orderby'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 129 129 // Get from the <select> dropdown. 130 $current_orderby = sanitize_text_field( $_REQUEST['orderby'] ); / * phpcs:ignore */130 $current_orderby = sanitize_text_field( $_REQUEST['orderby'] ); // phpcs:ignore WordPress.Security.NonceVerification 131 131 } else { 132 132 // Get orderby default from the User's Options, if set to persist. … … 140 140 141 141 // Determine the current order. 142 if ( isset( $_REQUEST['order'] ) ) { / * phpcs:ignore */142 if ( isset( $_REQUEST['order'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 143 143 // Get from the <select> dropdown. 144 $current_order = sanitize_text_field( $_REQUEST['order'] ); / * phpcs:ignore */144 $current_order = sanitize_text_field( $_REQUEST['order'] ); // phpcs:ignore WordPress.Security.NonceVerification 145 145 } else { 146 146 // Get orderby default from the User's Options, if set to persist. … … 160 160 } 161 161 162 echo $this->get_list_table_category_filter( $taxonomy_name, sanitize_text_field( $taxonomy['plural_name'] ) ); / * phpcs:ignore */162 echo $this->get_list_table_category_filter( $taxonomy_name, sanitize_text_field( $taxonomy['plural_name'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput 163 163 } 164 164 … … 489 489 490 490 // Output. 491 echo $output; / * phpcs:ignore */491 echo $output; // phpcs:ignore WordPress.Security.EscapeOutput 492 492 493 493 } … … 545 545 // wp_ajax_query_attachments() doesn't attribute $_REQUEST['query'] attributes to $args that aren't Post or Taxonomy Related. 546 546 // Include these in the below filter so they're accessible to Addons which might need to read the request input to modify $args. 547 $query = array_map( 'sanitize_text_field', $_REQUEST['query'] ); / * phpcs:ignore */547 $query = array_map( 'sanitize_text_field', $_REQUEST['query'] ); // phpcs:ignore WordPress.Security.NonceVerification 548 548 549 549 /** … … 620 620 621 621 // Sanitize request. 622 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */622 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 623 623 624 624 // File Type. … … 932 932 <a href="#" class="taxonomy-add-new" data-taxonomy="' . $taxonomy_name . '">' . 933 933 /* translators: %s: Add New taxonomy label. */ 934 sprintf( __( '+ %s' ), $taxonomy->labels->add_new_item ) /* phpcs:ignore */. '934 sprintf( __( '+ %s', 'media-library-organizer' ), $taxonomy->labels->add_new_item ) . ' 935 935 </a> 936 936 <div class="mlo-taxonomy-term-add-fields hidden ' . $taxonomy_name . '"> … … 966 966 $taxonomy = $this->base->get_class( 'taxonomies' )->get_taxonomy( $taxonomy_name ); 967 967 $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); 968 $comma = _x( ',', 'tag delimiter' ); /* phpcs:ignore */968 $comma = _x( ',', 'tag delimiter', 'media-library-organizer' ); 969 969 $terms = get_the_terms( $post_id, $taxonomy_name ); 970 970 … … 1022 1022 * @return string Taxonomy HTML Checkboxes 1023 1023 */ 1024 public function terms_checkbox( $taxonomy_name, $field_name, $selected_term_ids = array() ) { / * phpcs:ignore */1024 public function terms_checkbox( $taxonomy_name, $field_name, $selected_term_ids = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 1025 1025 1026 1026 // Get Taxonomy Terms. … … 1080 1080 } 1081 1081 1082 // Getrequest.1083 $request = $_REQUEST; /* phpcs:ignore */1082 // Sanitize request. 1083 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 1084 1084 1085 1085 // Iterate through Registered Taxonomies. … … 1257 1257 1258 1258 // Sanitize request. 1259 $request = array_map( 'sanitize_text_field', $_REQUEST ); / * phpcs:ignore */1259 $request = array_map( 'sanitize_text_field', $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification 1260 1260 1261 1261 // Check some request variables. -
media-library-organizer/trunk/includes/global/class-media-library-organizer-taxonomy-walker.php
r2688245 r2758024 48 48 * @param array $args An array of arguments. @see wp_terms_checklist(). 49 49 */ 50 public function start_lvl( &$output, $depth = 0, $args = array() ) { / * phpcs:ignore */50 public function start_lvl( &$output, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 51 51 52 52 $indent = str_repeat( "\t", $depth ); … … 66 66 * @param array $args An array of arguments. @see wp_terms_checklist(). 67 67 */ 68 public function end_lvl( &$output, $depth = 0, $args = array() ) { / * phpcs:ignore */68 public function end_lvl( &$output, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 69 69 70 70 $indent = str_repeat( "\t", $depth ); … … 90 90 * @param int $id ID of the current term. 91 91 */ 92 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { / * phpcs:ignore */92 public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 93 93 94 94 $taxonomy = $args['taxonomy']; … … 137 137 * @param array $args An array of arguments. @see wp_terms_checklist(). 138 138 */ 139 public function end_el( &$output, $category, $depth = 0, $args = array() ) { / * phpcs:ignore */139 public function end_el( &$output, $category, $depth = 0, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter 140 140 141 141 $output .= "</li>\n"; -
media-library-organizer/trunk/includes/global/class-media-library-organizer-upload.php
r2688245 r2758024 164 164 foreach ( $this->base->get_class( 'taxonomies' )->get_taxonomies() as $taxonomy_name => $taxonomy ) { 165 165 // Conditionally set Media Categories, as they won't be included in the request if no checkboxes were selected. 166 if ( ! isset( $_REQUEST['media_library_organizer'] ) ) { / * phpcs:ignore */166 if ( ! isset( $_REQUEST['media_library_organizer'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification 167 167 continue; 168 168 } 169 169 170 170 // Fetch request. 171 $request = $_REQUEST['media_library_organizer']; /* phpcs:ignore */171 $request = stripslashes_deep( $_REQUEST['media_library_organizer'] ); // phpcs:ignore WordPress.Security.NonceVerification 172 172 173 173 // Skip if the Taxonomy isn't specified. -
media-library-organizer/trunk/media-library-organizer.php
r2747124 r2758024 9 9 * Plugin Name: Media Library Organizer 10 10 * Plugin URI: https://wpmedialibrary.com 11 * Version: 1.4. 511 * Version: 1.4.6 12 12 * Author: WP Media Library 13 13 * Author URI: https://wpmedialibrary.com … … 22 22 23 23 // Define Plugin version and build date. 24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4. 5' );25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-0 6-2318:00:00' );24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4.6' ); 25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-07-18 18:00:00' ); 26 26 27 27 // Define Plugin paths. … … 101 101 * @since 1.0.5 102 102 */ 103 function Media_Library_Organizer() { / * phpcs:ignore */103 function Media_Library_Organizer() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 104 104 105 105 return Media_Library_Organizer::get_instance(); -
media-library-organizer/trunk/readme.txt
r2747124 r2758024 4 4 Tags: media categories, media library, media tags, images, organizer 5 5 Requires at least: 5.0 6 Tested up to: 6.0 6 Tested up to: 6.0.1 7 7 Requires PHP: 5.6 8 8 Stable tag: trunk … … 173 173 == Changelog == 174 174 175 = 1.4.6 (2022-07-18) = 176 * Added: Grid View: Modal: Better method for defining toolbar height and attachments grid 177 * Updated: French translations 178 * Fix: Grid View: Modal: Edit Gallery: Don't display Dropdown Filters, as they have no effect on the selected images 179 * Fix: Code improvements for WordPress Coding Standards 180 175 181 = 1.4.5 (2022-06-23) = 176 182 * Added: French translations -
media-library-organizer/trunk/views/admin/import-enhanced-media-library.php
r2688245 r2758024 24 24 <div class="right"> 25 25 <?php 26 foreach ( $import_source['data']['taxonomies'] as $taxonomy_name => $ taxonomy ) { /* phpcs:ignore */26 foreach ( $import_source['data']['taxonomies'] as $taxonomy_name => $eml_taxonomy ) { 27 27 // Skip non-EML categories. 28 if ( ! $ taxonomy['eml_media'] ) {28 if ( ! $eml_taxonomy['eml_media'] ) { 29 29 continue; 30 30 } … … 32 32 <label for="taxonomies_<?php echo esc_attr( $taxonomy_name ); ?>"> 33 33 <input type="checkbox" name="taxonomies[]" id="taxonomies_<?php echo esc_attr( $taxonomy_name ); ?>" value="<?php echo esc_attr( $taxonomy_name ); ?>" /> 34 <?php echo esc_html( $ taxonomy['labels']['name'] ); ?>34 <?php echo esc_html( $eml_taxonomy['labels']['name'] ); ?> 35 35 </label><br /> 36 36 <?php -
media-library-organizer/trunk/views/admin/settings-general.php
r2688245 r2758024 64 64 65 65 <?php 66 foreach ( $taxonomies as $taxonomy_name => $ taxonomy ) { /* phpcs:ignore */66 foreach ( $taxonomies as $taxonomy_name => $mlo_taxonomy ) { 67 67 ?> 68 68 <div class="wpzinc-option"> 69 69 <div class="left"> 70 <label for="general_<?php echo esc_attr( $taxonomy_name ); ?>_enabled"><?php echo esc_html( $ taxonomy['plural_name'] ); ?></label>70 <label for="general_<?php echo esc_attr( $taxonomy_name ); ?>_enabled"><?php echo esc_html( $mlo_taxonomy['plural_name'] ); ?></label> 71 71 </div> 72 72 <div class="right"> … … 82 82 /* translators: Taxonomy Label, Singular */ 83 83 __( 'If enabled, displays a dropdown option to filter Media Library items by %s', 'media-library-organizer' ), 84 $ taxonomy['singular_name']84 $mlo_taxonomy['singular_name'] 85 85 ) 86 86 ); -
media-library-organizer/trunk/views/admin/settings.php
r2688245 r2758024 22 22 <?php 23 23 // Output notices. 24 echo $this->base->get_class( 'notices' )->output_notices(); / * phpcs:ignore */24 echo $this->base->get_class( 'notices' )->output_notices(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 25 25 ?> 26 26
Note: See TracChangeset
for help on using the changeset viewer.