Update 2.0.6
- Small fixes
- Some customers ideas
- In filter added ability to filter products by its empty fields
- Added Filter by range of the products count in stock: stock quantity from – stock quantity to
- New option ‘Add fields to the quick search‘ – Adds more fields to quick search fields drop-down on the tools panel. Works only for text fields. Syntax: post_name:Product slug,post_content: Content. The same is possible to realize with hook: woobe_quick_search_options
add_filter('woobe_quick_search_options', function($filters) { $filters['post_name'] = 'Post slug'; $filters['post_content'] = 'Content'; return $filters; });
- New hook ‘woobe_before_update_product_field‘ which adds ability to make any custom operations with field new value before its updating:
add_filter('woobe_before_update_product_field', function($value, $product_id, $field_key) { //$condition= your code here //example if ($field_key === 'post_title' AND $condition) { $value .= " Some text"; } return $value; }, 10, 3);
- New hook ‘woobe_user_can_edit‘ – for control the ability of editing fields depending of the user/role.
add_filter('woobe_user_can_edit', function($is_forbidden, $field_key, $shop_manager_visibility_array) { $user = wp_get_current_user(); //print_r($shop_manager_visibility_array); if (in_array('author', (array) $user->roles)) { if ($field_key == 'sku') { $is_forbidden = 1; } } return $is_forbidden; }, 10, 3);
- New hook ‘woobe_filter_include_children‘ – Include child terms in filter results. By default if to filter by any term will be found products with this selected term and will be not found another products even if they has any child of this selected parent term.
add_filter('woobe_filter_include_children', function($include, $tax) { $alow = ['product_cat', 'pa_color']; if (in_array($tax, $alow)) { $include = true; } return $include; }, 10, 2);
- New hook ‘woobe_show_tabs‘ – to exclude tabs for specific users/roles
add_filter('woobe_show_tabs', function ($show, $slug) { $rules = array('settings', 'meta', 'info'); if (!current_user_can('administrator') AND in_array($slug, $rules)) { $show = false; } return $show; }, 99, 2);
- New hook ‘woobe_set_per_page_values‘ allows to set values to set products count per page. Be care with big values (memory overflow)
add_filter('woobe_set_per_page_values', function($add) { return '10,30,100,150,200'; });
- Export to XML