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/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" />