If you by any reason want to remade native woo price slider in the WOOF search form.
- classes/helper.php
- public static function price_filter
apply_filters('woof_price_slider_html', $price_slider_html, $price_slider_data);
[...]
Uses for any term with child’s terms when its necessary hide that child’s terms at all in: checkboxes, radio,select,mselect,labels.
add_filter('woof_terms_where_hidden_childs', function($term_id)
{
$hide_array=array(11,22,33,44,55,66,77);
if (in_array($term_id, $hide_array))
{
return true;
}
return false;
}, 1, 1);
[...]
Uses for ordering terms in the search form.
- classes/helper.php
- public static function get_terms
Used in pair with woof_get_terms_orderby
add_filter('woof_get_terms_order', function($taxonomy)
{
if ($taxonomy == 'pa_size')
{
return 'DESC';//ASC
}
}, 1, 1);
[...]
Uses for ordering terms in the search form.
- classes/helper.php
- public static function get_terms
Used in pair with woof_get_terms_order
add_filter('woof_get_terms_orderby', function($taxonomy)
{
if ($taxonomy == 'pa_size')
{
return 'term_id';
}
}, 1, 1);
[...]
Useful for taxonomies relations manipulation, for example changing relation from OR to AND. Doesn’t work with dynamic recount together.
- index.php
- private function get_tax_query
add_filter('woof_get_tax_query', 'my_woof_get_tax_query');
function my_woof_get_tax_query($tax_args){
//do smth here
return $tax_args;
}
[...]
Using in extensions to add additional options in tab Design if its necessary.
Example:
add_action('woof_print_design_additional_options', array($this, 'my_design_additional_options'), 10, 1);
public function my_design_additional_options()
{
global $WOOF;
$woof_settings = $WOOF->settings;
if (!isset($woof_settings))
{
$woof_settings = '';
}
?>
<div class="woof-control-section">
<h4><?php _e('Image for checked color type checkbox', 'woocommerce-products-filter') ?></h4>
<div class="woof-control-container">
<div class="woof-control woof-upload-style-wrap">
<input type="text" name="woof_settings" value="<?php //echo $woof_settings ?>" />
<a href="#" class="woof-button woo [...]
Using in extension for printing additional options under ‘additional options’ button like in color:
Example:
add_action('woof_print_tax_additional_options_color', array($this, 'print_additional_options'), 10, 1);
public function print_additional_options($key)
{
global $WOOF;
$woof_settings = $WOOF->settings;
$terms = WOOF_HELPER::get_terms($key, 0, 0, 0, 0);
if (!empty($terms))
{
echo '<ul class="woof_color_list">';
foreach ($terms as $t)
{
$col [...]
Using by all extensions for drawing settings block in tab Settings of the plugin settings page
Example:
add_action('woof_print_html_type_options_' . $this->html_type, array($this, 'woof_print_html_type_options'), 10, 1);
//settings page hook
public function woof_print_html_type_options()
{
global $WOOF;
if($WOOF){
echo woof()->render_html($this->get_ext_path() . 'views/options.php', array(
'key' => $this->html_type,
"woof_settings" => get_option('woof_settings', array())
)
[...]
Using by extensions to draw self on the front
Its enough just in init of an extension write next code:
add_action('woof_print_html_type_' . $this->html_type, array($this, 'print_html_type'), 10, 1);
Look code of by_author for example
[...]
Uses in html types as: radio, checkbox, select, mselect for printing any symbols or icons before its label
wp-content\plugins\woocommerce-products-filter\views\html_types\checkbox.php
[...]