Changeset 2747124
- Timestamp:
- 06/23/2022 01:48:54 PM (4 years ago)
- Location:
- media-library-organizer
- Files:
-
- 4 added
- 4 deleted
- 16 edited
- 1 copied
-
tags/1.4.5 (copied) (copied from media-library-organizer/trunk)
-
tags/1.4.5/_modules/dashboard/class-wpzincdashboardwidget.php (modified) (1 diff)
-
tags/1.4.5/_modules/dashboard/js/clipboard.js (deleted)
-
tags/1.4.5/_modules/dashboard/js/min/clipboard-min.js (deleted)
-
tags/1.4.5/includes/global/class-media-library-organizer-common.php (modified) (2 diffs)
-
tags/1.4.5/includes/global/class-media-library-organizer-media.php (modified) (5 diffs)
-
tags/1.4.5/includes/global/class-media-library-organizer-settings.php (modified) (1 diff)
-
tags/1.4.5/includes/global/class-media-library-organizer-user-option.php (modified) (1 diff)
-
tags/1.4.5/languages/media-library-organizer-fr_FR.mo (added)
-
tags/1.4.5/languages/media-library-organizer-fr_FR.po (added)
-
tags/1.4.5/languages/media-library-organizer.pot (modified) (2 diffs)
-
tags/1.4.5/media-library-organizer.php (modified) (2 diffs)
-
tags/1.4.5/readme.txt (modified) (1 diff)
-
trunk/_modules/dashboard/class-wpzincdashboardwidget.php (modified) (1 diff)
-
trunk/_modules/dashboard/js/clipboard.js (deleted)
-
trunk/_modules/dashboard/js/min/clipboard-min.js (deleted)
-
trunk/includes/global/class-media-library-organizer-common.php (modified) (2 diffs)
-
trunk/includes/global/class-media-library-organizer-media.php (modified) (5 diffs)
-
trunk/includes/global/class-media-library-organizer-settings.php (modified) (1 diff)
-
trunk/includes/global/class-media-library-organizer-user-option.php (modified) (1 diff)
-
trunk/languages/media-library-organizer-fr_FR.mo (added)
-
trunk/languages/media-library-organizer-fr_FR.po (added)
-
trunk/languages/media-library-organizer.pot (modified) (2 diffs)
-
trunk/media-library-organizer.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
media-library-organizer/tags/1.4.5/_modules/dashboard/class-wpzincdashboardwidget.php
r2722863 r2747124 374 374 wp_register_script( 'wpzinc-admin-autosize', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'autosize' . ( $minified ? '-min' : '' ) . '.js', false, $this->plugin->version, true ); 375 375 wp_register_script( 'wpzinc-admin-conditional', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'jquery.form-conditionals' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); 376 wp_register_script( 'wpzinc-admin-clipboard', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'clipboard' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true );377 376 wp_register_script( 'wpzinc-admin-deactivation', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'deactivation' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); 378 377 wp_register_script( 'wpzinc-admin-inline-search', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'inline-search' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); -
media-library-organizer/tags/1.4.5/includes/global/class-media-library-organizer-common.php
r2688245 r2747124 469 469 470 470 // Get hierarchy of Terms. 471 $hierarchy = _get_term_hierarchy( $taxonomy ); 471 // We don't use _get_term_hierarchy(), as this is a private WordPress function that returns child term IDs ordered by ID, not name. 472 $hierarchy = $this->get_term_hierarchy( $taxonomy ); 472 473 473 474 // Build final term array, comprising of top level terms and all children. … … 489 490 // Return filtered results. 490 491 return $hierarchical_terms; 492 493 } 494 495 /** 496 * Modified version of _get_term_hierarchy(), which returns Term IDs ordered by Term Name. 497 * 498 * @since 1.4.5 499 * 500 * @param string $taxonomy Taxonomy. 501 * @return array Child Terms 502 */ 503 private function get_term_hierarchy( $taxonomy ) { 504 505 // Bail if the taxonomy is not hierarchical. 506 if ( ! is_taxonomy_hierarchical( $taxonomy ) ) { 507 return array(); 508 } 509 510 $children = array(); 511 $terms = get_terms( 512 array( 513 'taxonomy' => $taxonomy, 514 'get' => 'all', 515 'orderby' => 'name', 516 'fields' => 'id=>parent', 517 'update_term_meta_cache' => false, 518 ) 519 ); 520 foreach ( $terms as $term_id => $parent ) { 521 if ( $parent > 0 ) { 522 $children[ $parent ][] = $term_id; 523 } 524 } 525 526 return $children; 491 527 492 528 } -
media-library-organizer/tags/1.4.5/includes/global/class-media-library-organizer-media.php
r2722863 r2747124 132 132 // Get orderby default from the User's Options, if set to persist. 133 133 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ) { 134 $current_orderby = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby');134 $current_orderby = $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ); 135 135 } else { 136 136 // Get from Plugin Defaults. … … 146 146 // Get orderby default from the User's Options, if set to persist. 147 147 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ) { 148 $current_order = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order');148 $current_order = $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ); 149 149 } else { 150 150 // Get from Plugin Defaults. … … 307 307 'orderby' => ( 308 308 $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ? 309 $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby') :309 $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ) : 310 310 $this->base->get_class( 'common' )->get_orderby_default() 311 311 ), 312 312 'order' => ( 313 313 $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ? 314 $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order') :314 $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ) : 315 315 $this->base->get_class( 'common' )->get_order_default() 316 316 ), … … 671 671 // Get orderby default from the User's Options, if set to persist. 672 672 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ) { 673 $orderby = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby');673 $orderby = $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ); 674 674 } else { 675 675 // Get from Plugin Defaults. 676 $orderby = $this->base->get_class( 'common' )->get_order _default();676 $orderby = $this->base->get_class( 'common' )->get_orderby_default(); 677 677 } 678 678 … … 691 691 // Get orderby default from the User's Options, if set to persist. 692 692 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ) { 693 $order = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order');693 $order = $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ); 694 694 } else { 695 695 // Get from Plugin Defaults. -
media-library-organizer/tags/1.4.5/includes/global/class-media-library-organizer-settings.php
r2688245 r2747124 302 302 // User Options. 303 303 'user-options' => array( 304 'orderby_enabled' => 1,305 'order_enabled' => 1,304 'orderby_enabled' => 0, 305 'order_enabled' => 0, 306 306 ), 307 307 ); -
media-library-organizer/tags/1.4.5/includes/global/class-media-library-organizer-user-option.php
r2688245 r2747124 47 47 48 48 /** 49 * Returns a User's order by option. 50 * 51 * @since 1.4.5 52 * 53 * @param int $user_id User ID. 54 * @return string Value 55 */ 56 public function get_orderby( $user_id ) { 57 58 // Get user option. 59 $value = $this->get_option( $user_id, 'orderby' ); 60 61 // If the value isn't a permitted order by option, return the default. 62 if ( ! in_array( $value, array_keys( $this->base->get_class( 'common' )->get_orderby_options() ), true ) ) { 63 return $this->get_default_option( 'orderby' ); 64 } 65 66 // Return user's order by option. 67 return $value; 68 69 } 70 71 /** 72 * Returns a User's order option. 73 * 74 * @since 1.4.5 75 * 76 * @param int $user_id User ID. 77 * @return string Value 78 */ 79 public function get_order( $user_id ) { 80 81 // Get user option. 82 $value = $this->get_option( $user_id, 'order' ); 83 84 // If the value isn't a permitted order by option, return the default. 85 if ( ! in_array( $value, array_keys( $this->base->get_class( 'common' )->get_order_options() ), true ) ) { 86 return $this->get_default_option( 'order' ); 87 } 88 89 // Return user's order by option. 90 return $value; 91 92 } 93 94 /** 49 95 * Returns a User option. 50 96 * -
media-library-organizer/tags/1.4.5/languages/media-library-organizer.pot
r2739899 r2747124 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Media Library Organizer 1.4. 3\n"5 "Project-Id-Version: Media Library Organizer 1.4.5\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/media-library-organizer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2022-0 5-12T15:14:03+00:00\n"12 "POT-Creation-Date: 2022-06-23T13:43:11+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" -
media-library-organizer/tags/1.4.5/media-library-organizer.php
r2739899 r2747124 9 9 * Plugin Name: Media Library Organizer 10 10 * Plugin URI: https://wpmedialibrary.com 11 * Version: 1.4. 411 * Version: 1.4.5 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. 4' );25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-06- 0918:00:00' );24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4.5' ); 25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-06-23 18:00:00' ); 26 26 27 27 // Define Plugin paths. -
media-library-organizer/tags/1.4.5/readme.txt
r2739899 r2747124 173 173 == Changelog == 174 174 175 = 1.4.5 (2022-06-23) = 176 * Added: French translations 177 * Fix: Grid View: Category Dropdown Filter: Order child terms by name, not ID 178 * Fix: User Options: Fallback to order by default when User Options > Sort Order is enabled and either the user has no sort order preference defined, or a non-valid sort order was specified 179 175 180 = 1.4.4 (2022-06-09) = 176 181 * Added: Support for WordPress 6.0 -
media-library-organizer/trunk/_modules/dashboard/class-wpzincdashboardwidget.php
r2722863 r2747124 374 374 wp_register_script( 'wpzinc-admin-autosize', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'autosize' . ( $minified ? '-min' : '' ) . '.js', false, $this->plugin->version, true ); 375 375 wp_register_script( 'wpzinc-admin-conditional', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'jquery.form-conditionals' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); 376 wp_register_script( 'wpzinc-admin-clipboard', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'clipboard' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true );377 376 wp_register_script( 'wpzinc-admin-deactivation', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'deactivation' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); 378 377 wp_register_script( 'wpzinc-admin-inline-search', $this->dashboard_url . 'js/' . ( $minified ? 'min/' : '' ) . 'inline-search' . ( $minified ? '-min' : '' ) . '.js', array( 'jquery' ), $this->plugin->version, true ); -
media-library-organizer/trunk/includes/global/class-media-library-organizer-common.php
r2688245 r2747124 469 469 470 470 // Get hierarchy of Terms. 471 $hierarchy = _get_term_hierarchy( $taxonomy ); 471 // We don't use _get_term_hierarchy(), as this is a private WordPress function that returns child term IDs ordered by ID, not name. 472 $hierarchy = $this->get_term_hierarchy( $taxonomy ); 472 473 473 474 // Build final term array, comprising of top level terms and all children. … … 489 490 // Return filtered results. 490 491 return $hierarchical_terms; 492 493 } 494 495 /** 496 * Modified version of _get_term_hierarchy(), which returns Term IDs ordered by Term Name. 497 * 498 * @since 1.4.5 499 * 500 * @param string $taxonomy Taxonomy. 501 * @return array Child Terms 502 */ 503 private function get_term_hierarchy( $taxonomy ) { 504 505 // Bail if the taxonomy is not hierarchical. 506 if ( ! is_taxonomy_hierarchical( $taxonomy ) ) { 507 return array(); 508 } 509 510 $children = array(); 511 $terms = get_terms( 512 array( 513 'taxonomy' => $taxonomy, 514 'get' => 'all', 515 'orderby' => 'name', 516 'fields' => 'id=>parent', 517 'update_term_meta_cache' => false, 518 ) 519 ); 520 foreach ( $terms as $term_id => $parent ) { 521 if ( $parent > 0 ) { 522 $children[ $parent ][] = $term_id; 523 } 524 } 525 526 return $children; 491 527 492 528 } -
media-library-organizer/trunk/includes/global/class-media-library-organizer-media.php
r2722863 r2747124 132 132 // Get orderby default from the User's Options, if set to persist. 133 133 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ) { 134 $current_orderby = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby');134 $current_orderby = $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ); 135 135 } else { 136 136 // Get from Plugin Defaults. … … 146 146 // Get orderby default from the User's Options, if set to persist. 147 147 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ) { 148 $current_order = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order');148 $current_order = $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ); 149 149 } else { 150 150 // Get from Plugin Defaults. … … 307 307 'orderby' => ( 308 308 $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ? 309 $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby') :309 $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ) : 310 310 $this->base->get_class( 'common' )->get_orderby_default() 311 311 ), 312 312 'order' => ( 313 313 $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ? 314 $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order') :314 $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ) : 315 315 $this->base->get_class( 'common' )->get_order_default() 316 316 ), … … 671 671 // Get orderby default from the User's Options, if set to persist. 672 672 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'orderby_enabled' ) ) { 673 $orderby = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'orderby');673 $orderby = $this->base->get_class( 'user_option' )->get_orderby( get_current_user_id() ); 674 674 } else { 675 675 // Get from Plugin Defaults. 676 $orderby = $this->base->get_class( 'common' )->get_order _default();676 $orderby = $this->base->get_class( 'common' )->get_orderby_default(); 677 677 } 678 678 … … 691 691 // Get orderby default from the User's Options, if set to persist. 692 692 if ( $this->base->get_class( 'settings' )->get_setting( 'user-options', 'order_enabled' ) ) { 693 $order = $this->base->get_class( 'user_option' )->get_o ption( get_current_user_id(), 'order');693 $order = $this->base->get_class( 'user_option' )->get_order( get_current_user_id() ); 694 694 } else { 695 695 // Get from Plugin Defaults. -
media-library-organizer/trunk/includes/global/class-media-library-organizer-settings.php
r2688245 r2747124 302 302 // User Options. 303 303 'user-options' => array( 304 'orderby_enabled' => 1,305 'order_enabled' => 1,304 'orderby_enabled' => 0, 305 'order_enabled' => 0, 306 306 ), 307 307 ); -
media-library-organizer/trunk/includes/global/class-media-library-organizer-user-option.php
r2688245 r2747124 47 47 48 48 /** 49 * Returns a User's order by option. 50 * 51 * @since 1.4.5 52 * 53 * @param int $user_id User ID. 54 * @return string Value 55 */ 56 public function get_orderby( $user_id ) { 57 58 // Get user option. 59 $value = $this->get_option( $user_id, 'orderby' ); 60 61 // If the value isn't a permitted order by option, return the default. 62 if ( ! in_array( $value, array_keys( $this->base->get_class( 'common' )->get_orderby_options() ), true ) ) { 63 return $this->get_default_option( 'orderby' ); 64 } 65 66 // Return user's order by option. 67 return $value; 68 69 } 70 71 /** 72 * Returns a User's order option. 73 * 74 * @since 1.4.5 75 * 76 * @param int $user_id User ID. 77 * @return string Value 78 */ 79 public function get_order( $user_id ) { 80 81 // Get user option. 82 $value = $this->get_option( $user_id, 'order' ); 83 84 // If the value isn't a permitted order by option, return the default. 85 if ( ! in_array( $value, array_keys( $this->base->get_class( 'common' )->get_order_options() ), true ) ) { 86 return $this->get_default_option( 'order' ); 87 } 88 89 // Return user's order by option. 90 return $value; 91 92 } 93 94 /** 49 95 * Returns a User option. 50 96 * -
media-library-organizer/trunk/languages/media-library-organizer.pot
r2739899 r2747124 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Media Library Organizer 1.4. 3\n"5 "Project-Id-Version: Media Library Organizer 1.4.5\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/media-library-organizer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2022-0 5-12T15:14:03+00:00\n"12 "POT-Creation-Date: 2022-06-23T13:43:11+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" -
media-library-organizer/trunk/media-library-organizer.php
r2739899 r2747124 9 9 * Plugin Name: Media Library Organizer 10 10 * Plugin URI: https://wpmedialibrary.com 11 * Version: 1.4. 411 * Version: 1.4.5 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. 4' );25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-06- 0918:00:00' );24 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_VERSION', '1.4.5' ); 25 define( 'MEDIA_LIBRARY_ORGANIZER_PLUGIN_BUILD_DATE', '2022-06-23 18:00:00' ); 26 26 27 27 // Define Plugin paths. -
media-library-organizer/trunk/readme.txt
r2739899 r2747124 173 173 == Changelog == 174 174 175 = 1.4.5 (2022-06-23) = 176 * Added: French translations 177 * Fix: Grid View: Category Dropdown Filter: Order child terms by name, not ID 178 * Fix: User Options: Fallback to order by default when User Options > Sort Order is enabled and either the user has no sort order preference defined, or a non-valid sort order was specified 179 175 180 = 1.4.4 (2022-06-09) = 176 181 * Added: Support for WordPress 6.0
Note: See TracChangeset
for help on using the changeset viewer.