diff --git a/src/classes/api/endpoints/class-tainacan-rest-background-processes-controller.php b/src/classes/api/endpoints/class-tainacan-rest-background-processes-controller.php index e127bb439..7f237fa78 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-background-processes-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-background-processes-controller.php @@ -192,8 +192,8 @@ class REST_Background_Processes_Controller extends REST_Controller { $process_type = ''; if (isset($request['search'])) { $name = $request['search']; - $process_type = "AND name LIKE '%$name%'"; - $process_type = $wpdb->prepare($process_type); + $search_term_like = '%' . $wpdb->esc_like($name) . '%'; + $process_type = $wpdb->prepare("AND name LIKE %s", $search_term_like); } $recent_q = ''; diff --git a/src/classes/entities/class-tainacan-item.php b/src/classes/entities/class-tainacan-item.php index 2c9b58f5d..a8fb33fdb 100644 --- a/src/classes/entities/class-tainacan-item.php +++ b/src/classes/entities/class-tainacan-item.php @@ -587,6 +587,7 @@ class Item extends Entity { 'metadatum_index' => null ); $args = wp_parse_args($args, $defaults); + $item_metadata = array(); // If a single metadata is passed, we use it instead of fetching more @@ -749,6 +750,13 @@ class Item extends Entity { ); $args = wp_parse_args($args, $defaults); + /** + * Filter the arguments passed to the get_item_metadatum_as_html function + * @param array $args The arguments passed to the function + * @param object $metadata_section The Item Metadatum object + */ + $args = apply_filters( 'tainacan-get-item-metadatum-as-html-filter-args', $args, $item_metadatum ); + if ($item_metadatum->has_value() || !$args['hide_empty']) { // Gets the metadata type object to use it if we need the slug @@ -1230,6 +1238,13 @@ class Item extends Entity { ); $args = wp_parse_args($args, $defaults); + /** + * Filter the arguments passed to the get_metadata_section_as_html function + * @param array $args The arguments passed to the function + * @param object $metadata_section The Metadata Section object + */ + $args = apply_filters( 'tainacan-get-metadata-section-as-html-filter-args', $args, $metadata_section ); + // Gets the metadata section inner metadata list $metadata_section_metadata_list = $metadata_section->get_metadata_object_list(); $has_metadata_list = (is_array($metadata_section_metadata_list) && count($metadata_section_metadata_list) > 0 ); diff --git a/src/classes/repositories/class-tainacan-filters.php b/src/classes/repositories/class-tainacan-filters.php index 68415bf13..3212b3411 100644 --- a/src/classes/repositories/class-tainacan-filters.php +++ b/src/classes/repositories/class-tainacan-filters.php @@ -107,7 +107,7 @@ class Filters extends Repository { 'map' => 'meta', 'title' => __( 'Max of options', 'tainacan' ), 'type' => ['integer', 'string'], - 'description' => __( 'The max number of options to be showed in filter sidebar.', 'tainacan' ), + 'description' => __( 'The maximum number of options to be loaded by default on the filter.', 'tainacan' ), 'validation' => '', 'default' => 4 ], diff --git a/src/classes/tainacan-creator.php b/src/classes/tainacan-creator.php index b022b5f4e..e3d32d68f 100644 --- a/src/classes/tainacan-creator.php +++ b/src/classes/tainacan-creator.php @@ -111,7 +111,7 @@ function tainacan_autoload($class_name) { } if( in_array('Metadata_Types', $class_path) || in_array('Filter_Types', $class_path) ){ - $exceptions = ['taxonomytaginput','taxonomycheckbox']; + $exceptions = ['taxonomytaginput','taxonomycheckbox','taxonomyselectbox']; if( in_array( strtolower( $class_name ), $exceptions) ){ $dir.= 'taxonomy/'; }else{ diff --git a/src/readme.txt b/src/readme.txt index d3853b026..091600898 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -4,7 +4,7 @@ Tags: museums, archives, GLAM, collections, repository Requires at least: 5.9 Tested up to: 6.6 Requires PHP: 7.0 -Stable tag: 0.21.8 +Stable tag: 0.21.9 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/tainacan.php b/src/tainacan.php index 069afad32..acbde7645 100644 --- a/src/tainacan.php +++ b/src/tainacan.php @@ -5,17 +5,17 @@ Plugin URI: https://tainacan.org/ Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform. Author: Tainacan.org Author URI: https://tainacan.org/ -Version: 0.21.8 +Version: 0.21.9 Requires at least: 5.9 Tested up to: 6.6 Requires PHP: 7.0 -Stable tag: 0.21.8 +Stable tag: 0.21.9 Text Domain: tainacan License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html */ -const TAINACAN_VERSION = '0.21.8'; +const TAINACAN_VERSION = '0.21.9'; defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); $TAINACAN_BASE_URL = plugins_url('', __FILE__); diff --git a/src/views/admin/components/edition/filter-edition-form.vue b/src/views/admin/components/edition/filter-edition-form.vue index 1486caba1..d8ec40059 100644 --- a/src/views/admin/components/edition/filter-edition-form.vue +++ b/src/views/admin/components/edition/filter-edition-form.vue @@ -179,7 +179,8 @@ v-model="form.max_options" name="max_options" type="number" - step="1" /> + step="1" + :max="maxOptionsLimit" />