woof_after_draw_filter
Works after print of each filter element in WOOF filter form.
1 2 3 4 5 | add_action('woof_after_draw_filter', function($key, $shortcode_atts) { //do smth here }, 99, 2); |
From v.2.2.5/1.2.5
Works after print of each filter element in WOOF filter form.
1 2 3 4 5 | add_action('woof_after_draw_filter', function($key, $shortcode_atts) { //do smth here }, 99, 2); |
From v.2.2.5/1.2.5
Works before print of each filter element in WOOF filter form.
1 2 3 4 5 | add_action('woof_before_draw_filter', function($key, $shortcode_atts) { //do here }, 99, 2); |
From v.2.2.5/1.2.5
Using in extensions to add additional options in tab Design if its necessary. Example:
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 | 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['checked_color_img'])) { $woof_settings['checked_color_img'] = ''; } ?> <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[checked_color_img]" value="<?php //echo $woof_settings['checked_color_img'] ?>" /> <a href="#" class="woof-button woof_select_image"><?php _e('Select Image', 'woocommerce-products-filter') ?></a> </div> <div class="woof-description"> <p class="description"><?php _e('Image for color checkboxes when its checked. Better use png. Size is: 25x25 px.', 'woocommerce-products-filter') ?></p> </div> </div> </div> <?php } |
Using in extension for printing additional options under ‘additional options’ button like in color: Example:
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 | 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) { $color = '#000000'; if (isset($woof_settings['color'][$key][$t['slug']])) { $color = $woof_settings['color'][$key][$t['slug']]; } $color_img = ''; if (isset($woof_settings['color_img'][$key][$t['slug']])) { $color_img = $woof_settings['color_img'][$key][$t['slug']]; } ?> <li> <table> <tr> <td valign="top"> <input type="text" name="woof_settings[color][<?php echo $key ?>][<?php echo $t['slug'] ?>]" value="<?php echo $color ?>" id="woof_color_picker_<?php echo $t['slug'] ?>" class="woof-color-picker" > </td> <td> <input type="text" name="woof_settings[color_img][<?php echo $key ?>][<?php echo $t['slug'] ?>]" value="<?php echo $color_img ?>" placeholder="<?php _e('background image url 25x25', 'woocommerce-products-filter') ?>" class="text" style="width: 600px;" /> <a href="#" class="woof-button woof_select_image"><?php _e('Select Image', 'woocommerce-products-filter') ?></a> </td> <td valign="top" style="padding: 4px 0 0 0;"> <p class="description"> [ <?php echo strtolower($t['name']) ?> ]</p> </td> </tr> </table> </li> <?php } echo '</ul>'; } } |
Using by all extensions for drawing settings block in tab Settings of the plugin settings page Example:
1 2 3 4 5 6 7 8 9 10 11 12 | 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; 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:
1 | add_action('woof_print_html_type_' . $this->html_type, array($this, 'print_html_type'), 10, 1); |
Look code of by_author for example