Works with woocommerce price-range slider. Allows make range in the process of the seacrhing like flexible. Example: range of the price is from 20 to 50 USD. If user will set max price to 40 USD – new displayed maximum will came as 40 USD. If to apply this hook: Before filtering by MDTF: After filtering by… read more
If on the plugin settings page set ‘Show terms childs’ – all child terms on all taxonomies elements will be shown. To disallow it for multi-select this hook will help if return FALSE (by default is TRUE):
| add_filter('mdf_multy_select_show_all_childs', function($default) { return 0; }); |
From v.2.2.2/1.2.2
Separates the phrase into search words that allows to perform a search regardless of the location of these words in the phrase. By default is TRUE. Examples: If to set FALSE will be found posts with ONLY exact phrase, for example ‘Hello World’ – all posts with exact phrase only will be found.
| add_filter('mdf_txtsearch_some_words_behavior', function($default) { return 0; }); |
If… read more
By default empty sections of the MDTF filter sections are hidden, but for any case its can be cancelled.
| add_filter('mdf_hide_title_empty_section', function($default) { return 0; }); |
From v.2.2.2/1.2.2
Hook which allows to set in the plugin search form tag for the section title for any SEO optimizations. H4 is by default.
| add_filter('mdf_tag_title_sections', function($default) { return 'h5'; }); |
From v.2.2.2/1.2.2
Search data in array, useful when its necessary to get seacrh data for any purposes. Its generates by “do_shortcode(‘[meta_data_filter_results]’);” or by basic MDTF search request in the file: wp-content\plugins\meta-data-filter\views\shortcode\meta_data_filter.php Example of using: https://wp-filter.com/howto/how-to-make-searchable-enfold-magazine-entries/
Use it if you want to get MDTF search parameters while searching is going:
| if(class_exists('MetaDataFilter') AND MetaDataFilter::is_page_mdf_data()){ $args=MetaDataFilter::get_page_mdf_data(); print_r($args); } |
This hook-filter works only in the premium version of the plugin for shortcode [mdf_custom] to manipulate by its search request if its necessary using the shortcode attribute ‘custom_id’. Location: wp-content\plugins\meta-data-filter\classes\shortcodes.php -> public static function mdf_custom($atts)
This hook-filter applies for any taxonomies terms in MDTF search forms. Using this hook you can order taxonomies terms in your custom order by: id, name, slug, count, term_group. Read more here: https://developer.wordpress.org/reference/functions/get_terms/#parameters Example:
| add_filter('mdf_terms_orderby', function($default) { return 'count'; }); |
Read also: https://wp-filter.com/features/mdf_terms_order/
This hook-filter applies for any taxonomies terms in MDTF search forms. Use this hook in pair with https://wp-filter.com/features/mdf_terms_orderby/. Its callback can return 2 values only: ‘ASC’ or ‘DESC’. Example:
| add_filter('mdf_terms_order', function($default) { return 'DESC'; }); |
Read also: https://wp-filter.com/features/mdf_terms_orderby/