diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 05ada1c19..c3d6e44b1 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -30,7 +30,6 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue'; import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue'; import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue'; -import FilterTaxonomySelectbox from '../../classes/filter-types/taxonomy/Selectbox.vue'; import TainacanFormItem from '../../classes/metadata-types/tainacan-form-item.vue'; import TainacanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue'; @@ -82,7 +81,6 @@ Vue.component('tainacan-filter-checkbox', FilterCheckbox); Vue.component('tainacan-filter-taginput', FilterTaginput); Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox); Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput); -Vue.component('tainacan-filter-taxonomy-selectbox', FilterTaxonomySelectbox); /* Others */ Vue.component('help-button', HelpButton); diff --git a/src/admin/js/theme-main.js b/src/admin/js/theme-main.js index f10919575..71ec5d8ea 100644 --- a/src/admin/js/theme-main.js +++ b/src/admin/js/theme-main.js @@ -26,7 +26,6 @@ import FilterTaginput from '../../classes/filter-types/taginput/Taginput.vue'; import FilterTaxonomyCheckbox from '../../classes/filter-types/taxonomy/Checkbox.vue'; import FilterTaxonomyTaginput from '../../classes/filter-types/taxonomy/Taginput.vue'; -import FilterTaxonomySelectbox from '../../classes/filter-types/taxonomy/Selectbox.vue'; import TaincanFormItem from '../../classes/metadata-types/tainacan-form-item.vue'; import TaincanFiltersList from '../../classes/filter-types/tainacan-filter-item.vue'; @@ -78,7 +77,6 @@ Vue.component('tainacan-filter-checkbox', FilterCheckbox); Vue.component('tainacan-filter-taginput', FilterTaginput); Vue.component('tainacan-filter-taxonomy-checkbox', FilterTaxonomyCheckbox); Vue.component('tainacan-filter-taxonomy-taginput', FilterTaxonomyTaginput); -Vue.component('tainacan-filter-taxonomy-selectbox', FilterTaxonomySelectbox); /* Others */ Vue.component('help-button', HelpButton); diff --git a/src/classes/filter-types/taxonomy/Selectbox.vue b/src/classes/filter-types/taxonomy/Selectbox.vue deleted file mode 100644 index 8de73fdf2..000000000 --- a/src/classes/filter-types/taxonomy/Selectbox.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - diff --git a/src/classes/filter-types/taxonomy/class-tainacan-taxonomycheckbox.php b/src/classes/filter-types/taxonomy/class-tainacan-taxonomycheckbox.php index 7e9d08780..9d0b4b651 100644 --- a/src/classes/filter-types/taxonomy/class-tainacan-taxonomycheckbox.php +++ b/src/classes/filter-types/taxonomy/class-tainacan-taxonomycheckbox.php @@ -22,6 +22,6 @@ class TaxonomyCheckbox extends Filter_Type { return ''; + metadatum_id="'.$filter->get_metadatum()->get_id().'">'; } } \ No newline at end of file diff --git a/src/classes/filter-types/taxonomy/class-tainacan-taxonomyselectbox.php b/src/classes/filter-types/taxonomy/class-tainacan-taxonomyselectbox.php deleted file mode 100644 index ff8a067c1..000000000 --- a/src/classes/filter-types/taxonomy/class-tainacan-taxonomyselectbox.php +++ /dev/null @@ -1,27 +0,0 @@ -set_supported_types(['term']); - $this->set_component('tainacan-filter-taxonomy-selectbox'); - } - - /** - * @param $filter - * @return string - */ - - public function render( $filter ){ - return ''; - } -} \ No newline at end of file diff --git a/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php b/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php index e933a7b4b..a7cb6fe04 100644 --- a/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php +++ b/src/classes/filter-types/taxonomy/class-tainacan-taxonomytaginput.php @@ -22,6 +22,6 @@ class TaxonomyTaginput extends Filter_Type { return ''; + metadatum_id="'.$filter->get_metadatum()->get_id().'">'; } } \ No newline at end of file diff --git a/src/classes/metadata-types/taxonomy/FormTaxonomy.vue b/src/classes/metadata-types/taxonomy/FormTaxonomy.vue index b7a33b118..9355ab170 100644 --- a/src/classes/metadata-types/taxonomy/FormTaxonomy.vue +++ b/src/classes/metadata-types/taxonomy/FormTaxonomy.vue @@ -107,7 +107,6 @@ } this.single_types['tainacan-taxonomy-radio'] = 'Radio'; - this.single_types['tainacan-taxonomy-selectbox'] = 'Selectbox'; this.multiple_types['tainacan-taxonomy-tag-input'] = 'Tag Input'; this.multiple_types['tainacan-taxonomy-checkbox'] = 'Checkbox'; diff --git a/src/classes/metadata-types/taxonomy/Taxonomy.vue b/src/classes/metadata-types/taxonomy/Taxonomy.vue index b92a4ac8e..739cd5781 100644 --- a/src/classes/metadata-types/taxonomy/Taxonomy.vue +++ b/src/classes/metadata-types/taxonomy/Taxonomy.vue @@ -34,7 +34,6 @@ import TainacanTaxonomyRadio from './TaxonomyRadio.vue' import TainacanTaxonomyCheckbox from './TaxonomyCheckbox.vue' import TainacanTaxonomyTagInput from './TaxonomyTaginput.vue' - import TainacanTaxonomySelectbox from './TaxonomySelectbox.vue' import AddNewTerm from './AddNewTerm.vue' import HierarchicalCheckboxModal from '../../../admin/components/other/checkbox-filter-modal.vue' @@ -63,7 +62,6 @@ TainacanTaxonomyRadio, TainacanTaxonomyCheckbox, TainacanTaxonomyTagInput, - TainacanTaxonomySelectbox, AddNewTerm }, data(){ diff --git a/src/classes/metadata-types/taxonomy/TaxonomySelectbox.vue b/src/classes/metadata-types/taxonomy/TaxonomySelectbox.vue deleted file mode 100644 index f985e2d2b..000000000 --- a/src/classes/metadata-types/taxonomy/TaxonomySelectbox.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - \ No newline at end of file diff --git a/src/classes/tainacan-creator.php b/src/classes/tainacan-creator.php index a71ff9208..979a93221 100644 --- a/src/classes/tainacan-creator.php +++ b/src/classes/tainacan-creator.php @@ -73,7 +73,7 @@ function tainacan_autoload($class_name){ } if( in_array('Metadata_Types', $class_path) || in_array('Filter_Types', $class_path) ){ - $exceptions = ['taxonomytaginput','taxonomycheckbox','taxonomyselectbox']; + $exceptions = ['taxonomytaginput','taxonomycheckbox']; if( in_array( strtolower( $class_name ), $exceptions) ){ $dir.= 'taxonomy/'; }else{ @@ -115,7 +115,6 @@ $Tainacan_Filters->register_filter_type('Tainacan\Filter_Types\Taginput'); $Tainacan_Filters->register_filter_type('Tainacan\Filter_Types\Checkbox'); $Tainacan_Filters->register_filter_type('Tainacan\Filter_Types\TaxonomyTaginput'); $Tainacan_Filters->register_filter_type('Tainacan\Filter_Types\TaxonomyCheckbox'); -$Tainacan_Filters->register_filter_type('Tainacan\Filter_Types\TaxonomySelectbox'); $Tainacan_Taxonomies = \Tainacan\Repositories\Taxonomies::get_instance(); diff --git a/src/migrations.php b/src/migrations.php index 181add03e..8fe8628fc 100644 --- a/src/migrations.php +++ b/src/migrations.php @@ -239,7 +239,16 @@ class Migrations { ['meta_value' => 'Tainacan\Filter_Types\TaxonomySelectbox'], ['meta_value' => 'Tainacan\Filter_Types\CategorySelectbox'], '%s', '%s'); - + + $wpdb->update($wpdb->postmeta, + ['meta_value' => 'Tainacan\Filter_Types\TaxonomyTaginput'], + ['meta_value' => 'Tainacan\Filter_Types\TaxonomySelectbox'], + '%s', '%s'); + + $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->postmeta SET meta_value = REPLACE(meta_value, 'tainacan-taxonomy-selectbox', 'tainacan-taxonomy-radio')" + )); } static function update_core_metadata() {