When the phrase is divided into several words condition ‘AND’ mandatory matching with all the words, condition ‘OR’ – matching at least one word This hook is addition to hook: mdf_txtsearch_some_words_behavior Example:
| add_filter('mdf_txtsearch_some_words_condition', function($default) { return 'OR'; }); |
From v.2.2.2/1.2.2
This functions doing the same as shortcode [mdf_value] – getting data from any post meta field by its meta key created by in-built meta data constructor.
| public static function get_field($key, $post_id = 0, $look_for_reflection = false) |
Example:
| $val=MetaDataFilter::get_field('medafi_fashion', 777, false); |
This function give the answer to the question (returns true or false): is MDTF searching going now?
| if(class_exists('MetaDataFilter') AND MetaDataFilter::is_page_mdf_data()){ //do smth here } |
Examples of using: https://wp-filter.com/howto/get-search-arguments-action-page-hack-portfolio-shortcode/ https://wp-filter.com/howto/how-to-make-searchable-enfold-magazine-entries/ https://wp-filter.com/document/developers/
Returns one setting of the plugin by its key.
| <?php $val=MetaDataFilter::get_setting('exclude_out_stock_products'); ?> |
Read also: https://wp-filter.com/features/metadatafilter-get_settings/
Returns array of the plugin settings.
| <?php $settings=MetaDataFilter::get_settings(); print_r($settings); ?> |
Use this function to output any image of the site (added trough media library) using its link:
| <img src="<?php echo MDTF_HELPER::get_image('http://mysite.com/wp-content/uploads/2016/08/my_home_1.png', '500x300'); ?>" alt="" /> |
You can set any size you want by alias for the result image, for example: ‘800×600’, but this should be always less or equal to the size of the original image, + be attentive with image proportions.
| <?php public static function get_image($img_src, $alias) ?> |
Useful for… read more
Use this function to output any post featured image using its ID:
| <img src="<?php echo MDTF_HELPER::get_post_featured_image(777, '500x300'); ?>" alt="" /> |
In the loop use $post->ID:
| <img src="<?php echo MDTF_HELPER::get_post_featured_image($post->ID, '500x300'); ?>" alt="" /> |
You can set any size you want by alias for the result image, for example: ‘800×600’, but this should be always less or equal to the size of the original image, + be attentive with image proportions…. read more
This function doing the same as shortcode [mdf_select_title] – getting Title text from the drop-down by its meta_key created in the meta data constructor.
| <?php public static function get_val_as_select_title($post_id, $meta_key) ?> |
Example:
| <?php $val=MetaDataFilter::get_val_as_select_title(139,'medafi_fashion'); ?> |
This functions generates sort-panel and doing the same as shortcode [mdf_sort_panel] Examples: Without panel_id:
| <?php MDTF_SORT_PANEL::mdtf_catalog_ordering(); ?> |
With panel_id:
| <?php MDTF_SORT_PANEL::mdtf_catalog_ordering(array('panel_id'=>186)); ?> |
If you will not set panel_id attribute in the widget (or [mdf_search_form] shortcode), default panel ID will be applied for current sort-panel, which you can set in the plugins settings (tab ‘Miscellaneous’).