More settings (implicit)
Hidden options (from v.2.0.6/1.0.6) due to the complexity of their understanding, rare use, technical requirements, more flexibility are created by code which you should place in the file functions.php of the current WordPress theme:
- Values to set products count per page. By hook ‘woobe_set_per_page_values‘: (premium version)
add_filter('woobe_set_per_page_values', function($add) { return '10,30,100,150,200'; });
Be care with big values (memory overflow)!
- Exclude tabs for specific users/roles. By hook ‘woobe_show_tabs‘:
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);
- 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. By hook ‘woobe_filter_include_children‘:
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);
- Control the ability of editing fields depending of the user/role. By hook ‘woobe_user_can_edit‘:
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);
- Ability to make any custom operations with field new value before its updating. By hook ‘woobe_before_update_product_field‘:
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);
- Hook woobe_storage_type (from v.2.0.8/1.0.8) help in cases when troubles with session on the server and filtering of products doesn work, allows to set transient as filtering storage
add_filter('woobe_storage_type', function($type) { return 'session';//session, transient });
- Hook ‘woobe_product_statuses‘ – allows to add more products statuses (from v.2.0.8.1/1.0.8.1)
add_filter('woobe_product_statuses', function($statuses) { $statuses['archive'] = 'Archive'; return $statuses; });
- Hook ‘woobe_users_args‘ allows to get users by custom roles, for example ‘vendors’. By default is ‘authors’ (from v.2.0.9/1.0.9)
add_filter('woobe_users_args', function ($args) { return array('fields' => array('ID', 'display_name'), 'who' => 'vendors'); });
- Hook ‘woobe_new_product_status‘ which allows to define what status new products created by BEAR will has: (from v.2.0.9/1.0.9)
add_filter('woobe_new_product_status', function ($status) { return 'publish'; });
- Hook ‘woobe_stock_quantity_dependency‘. If to set FALSE then with changing of stock quantity to positive value field ‘manage_stock’ will not be changed automatically. By default is TRUE.
add_filter('woobe_stock_quantity_dependency', function ($status) { return false; });
- Hook ‘woobe_bulkedit_taxonomies‘. It is useful when the shop has thousands of taxonomies to avoid long time loading in tab Bulk Edit. Example, lets not display products categories: (from v.2.0.9/1.0.9)
add_filter('woobe_bulkedit_taxonomies', function ($taxonomy_objects) { if (isset($taxonomy_objects['product_cat'])) { unset($taxonomy_objects['product_cat']); } return $taxonomy_objects; });
- Hook ‘woobe_filter_taxonomies‘ . It is useful when the shop has thousands of taxonomies to avoid long time loading in tab Filters. Example, lets not display products categories: (from v.2.0.9/1.0.9)
add_filter('woobe_filter_taxonomies', function ($taxonomy_objects) { if (isset($taxonomy_objects['product_cat'])) { unset($taxonomy_objects['product_cat']); } return $taxonomy_objects; });
- Hook ‘woobe_wpml_sync_prices‘ allows to copy the same sale and regular prices for all WPML languages
add_filter('woobe_wpml_sync_prices', function ($do) { return true; });
- “weight“, “length“, “width“, “height” – this now works for variants as well. Hook (from v.2.1.3) to make it works is: woobe_filter_consider_variation_dimensions ,is true by default. If you pass false then these filters will not take into account the values in the options:
add_filter('woobe_filter_consider_variation_dimensions', function ($do) { return false; });
- Hook (from v.2.1.3) woobe_new_variation_product_status – set default product variant status:
add_filter('woobe_new_variation_product_status', function ($status) { return 'private'; });
- Hook ‘woobe_use_kses_for_page_field‘ – avoid to “updates character in stead of the symbol” suggested by omc123 https://wordpress.org/support/topic/it-updates-in-stead-of-the-symbol-in-wordpress-editor/
- Hook ‘woobe_on_sale_from_set_day‘ and ‘woobe_on_sale_to_set_day‘ suggested by krixxsw https://share.pluginus.net/image/i20230922153100.png allows to moderate when by time sale start/end: false – 00:00:00, true – 23:59:59
- Hook ‘woobe_settings_key_options‘ – suggested by carlosdm https://pluginus.net/support/topic/same-configuration-for-all-users/ and allows make same configuration for all users
add_filter('woobe_settings_key_options', function ($id) { return "for_all"; });
- Hook ‘woobe_wrap_field_val‘ suggested by Luigi Pulcini https://pluginus.net/support/topic/add-filter-to-wrap_field_val-method/ allows to customize the content of a column for custom fields
- Hook (from v.2.1.4.6) ‘woobe_export_cut_empty_variations‘ – allows to to exclude out-of-stock product variations
add_filter('woobe_export_cut_empty_variations', function ($type) { return true; });
- Hook (from v.2.1.4.6) ‘woobe_export_product_fields_answer‘ – for export data manipulation
- Feature: you can now create woobe.css file in your current WordPress theme folder to fully customize the BEAR admin panel appearance. Example:
/* sticky position of chekbox, preview img, title */ #advanced-table { overflow: auto; } #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=__checker], #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=_thumbnail_id], #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=post_title] { position: sticky; top: 0; left: 0; z-index: 1; background: #fff; } #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=__checker] { left: -1px; } #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=_thumbnail_id]{ left:26px; } #advanced-table_wrapper .dataTables_scroll .scroll-wrapper .dataTables_scrollBody table tbody tr td[data-field=post_title]{ left:90px; }
- …