How to make auto-update for WordPress plugins and themes bought on Envato
Read info about it here: https://pluginus.net/make-auto-update-wordpress-plugins-themes-bought-envato/
Read info about it here: https://pluginus.net/make-auto-update-wordpress-plugins-themes-bought-envato/
The plugin has hidden area: wp-admin/edit.php?post_type=meta_data_filter&page=mdf_utilities To display it: open index.php of the plugin (near row #33) find:
1 | //require plugin_dir_path(__FILE__) . 'ext/utilities.php'; |
and uncomment it (remove ‘//’ on the beginning of the string) save the file you will find useful utility there ‘Terms to meta’ which allows convert any taxonomy terms slugs or names into meta data p.s. this… read more
When searching works in the redirect mode (not ajax) in tag <body> appears CSS class ‘mdf_search_is_going ‘. This fact can help you with any manipulations with site layout while MDTF search request is going on current page. For example hide smth:
1 2 3 | body.mdf_search_is_going .any_container_class{ display: none; } |
Some times there is troubles with version of MySQL versions on your server, and its generates next error: “WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OPTION SQL_BIG_SELECTS = 1 /* From [XXX’ at line… read more
Open functions.php of the current wp theme On the same bottom of the file drop next code:
1 2 3 4 5 6 7 8 | add_filter('mdf_terms_order',function($default){ return 'DESC';//ASC }); //id,name,slug,count,term_group add_filter('mdf_terms_orderby',function($default){ return 'count'; }); |
It is possible order terms by: id,name,slug,count,term_group
Sometimes when MDTF works (searching going), some plugins have conflicts with it. Lets consider an example – one customer wrote me that his ‘membership plugin’ doesn work normally when MDTF making searching, there was some issues. So I suggested simple and quick decision: open index.php of that membership plugin for example (the same for another… read more
open enfold functions.php file drop on the same bottom of the file next code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | add_filter('avf_magazine_entries_query', 'my_avf_magazine_entries_query', 10, 2); function my_avf_magazine_entries_query($query, $params) { if (class_exists('MetaDataFilter') AND MetaDataFilter::is_page_mdf_data()) { $_REQUEST['mdf_do_not_render_shortcode_tpl'] = true; $_REQUEST['mdf_get_query_args_only'] = true; do_shortcode('[meta_data_filter_results]'); $query = $_REQUEST['meta_data_filter_args']; } return $query; } |
Save the file
This works for shortcode [mdf_custom custom_id=777] with attribute ‘custom_id’ (777 is in the code below) + doesn work with dynamic recount (you can hide count by CSS) Example: http://general.wp-filter.com/category/flowers-posts/ open your current wp theme functions.php file drop there next code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | //*** add_filter('mdf_custom_shortcode_query_args', 'mdf_custom_shortcode_query_args', 10, 2); function mdf_custom_shortcode_query_args($args, $custom_id) { $and_tax_relation = array('post_tag'); //https://codex.wordpress.org/WordPress_Taxonomy if ($custom_id == '777') { $args['tax_query'] = mdf_modify_tax_query($args['tax_query'], $and_tax_relation); //add_filter('mdf_dyn_tax_recount_args', 'mdf_dyn_tax_recount_args', 10, 1); } return $args; } //*** for dynamic recount add_filter('mdf_dyn_tax_recount_args', 'mdf_dyn_tax_recount_args', 10, 1); function mdf_dyn_tax_recount_args($tax_query_array) { $and_tax_relation = array('post_tag'); return mdf_modify_tax_query($tax_query_array, $and_tax_relation); } //logic of AND relations in taxonomies function mdf_modify_tax_query($tax_query_array, $and_tax_relation) { if (!empty($tax_query_array)) { foreach ($tax_query_array as $key => $value) { if (isset($value['taxonomy'])) { if (in_array($value['taxonomy'], $and_tax_relation)) { $tag_terms = $tax_query_array[$key]['terms']; if (!empty($tag_terms)) { $tag_terms_tpl = $tax_query_array[$key]; $tag_terms_tpl['terms'] = array(); unset($tax_query_array[$key]); foreach ($tag_terms as $term_id) { $tag_terms_tpl['terms'] = array($term_id); $tax_query_array[] = $tag_terms_tpl; } } } } } } return $tax_query_array; } |
In the function mdf_dyn_tax_recount_args in array $and_tax_relation write your taxonomy instead ‘post_tag’ OR using comma add more another… read more
Assigning of filter-category automatically (by code in your site) to any post type is necessary when for example a lot of posts should be added by users for example, or by any another reason. For this should be used WordPress hook save_post https://codex.wordpress.org/Plugin_API/Action_Reference/save_post Here is an example how to realize it: open functions.php file of your… read more