add_filter for price slider html
-
i’d like to modify the html of the default price slider but it’s not possible to access it without hacking the plugin or other nasty tricks.
suggestion:
implement add_filter for price slider html.
example implementation:
add_filter('woof_price_slider_html', array(this, 'woof_price_slider_html')); function woof_price_slider_html($args) { return '<form method="get" action="' . esc_url($args['form_action']) . '"> <div class="price_slider_wrapper"> <div class="price_slider" style="display:none;"></div> <div class="price_slider_amount"> <input type="text" id="min_price" name="min_price" value="' . esc_attr($args['min_price']) . '" data-min="' . esc_attr(apply_filters('woocommerce_price_filter_widget_amount', $args['min'])) . '" placeholder="' . __('Min price', 'woocommerce') . '" /> <input type="text" id="max_price" name="max_price" value="' . esc_attr($args['max_price']) . '" data-max="' . esc_attr(apply_filters('woocommerce_price_filter_widget_amount', $args['max'])) . '" placeholder="' . __('Max price', 'woocommerce') . '" /> <button type="submit" class="button">' . __('Filter', 'woocommerce') . '</button> <div class="price_label" style="display:none;"> ' . __('Price:', 'woocommerce') . ' <span class="from"></span> — <span class="to"></span> </div> ' . $args['fields'] . ' <div class="clear"></div> </div> </div> </form>'; }
Edit: I guess I mean implement apply_filters. i’m not a plugin developer. Just make it hookable ??
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘add_filter for price slider html’ is closed to new replies.