This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* THIS CODE IS NO LONGER WORKS | |
* PLEASE USE THE FILTER EVERYTHING PRO VERSION 1.7.15.6 OR ABOVE | |
*/ | |
/** | |
* Makes only In stock products visible in filtering process | |
* You can put this code in the end of the functions.php file | |
* of your active theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If prices include taxes | |
add_filter( 'wpc_set_num_shift', 'flrt_set_num_shift', 10, 2 ); | |
function flrt_set_num_shift( $value, $entity_name ) { | |
if ( $entity_name === '_price' ) { | |
// Let's imagine that tax is 10% | |
// The final price will be | |
// $price_with_tax = $price + $price*0.1; | |
$value = $value + $value * 0.1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace FilterEverything\Filter; | |
if ( ! defined('WPINC') ) { | |
wp_die(); | |
} | |
class PostMetaNumEntity implements Entity | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace FilterEverything\Filter; | |
if ( ! defined('WPINC') ) { | |
wp_die(); | |
} | |
class RequestParser | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined('WPINC') ) { | |
wp_die(); | |
} | |
use \FilterEverything\Filter\Container; | |
use \FilterEverything\Filter\FilterSet; | |
use \FilterEverything\Filter\FilterFields; | |
use \FilterEverything\Filter\PostMetaNumEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_head', 'wpc_add_filters_seo_description'); | |
function wpc_add_filters_seo_description(){ | |
if( class_exists( 'FilterEverything\Filter\Container' ) ){ | |
$seoFrontEnd = FilterEverything\Filter\Container::instance()->getSeoFrontendService(); | |
$your_new_hook = 'woocommerce_archive_description'; | |
remove_action('woocommerce_after_shop_loop', [ $seoFrontEnd, 'showSeoDescription' ], 5); | |
add_action( $your_new_hook, [ $seoFrontEnd, 'showSeoDescription' ] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wpc_filter_post_meta_term_name', 'wpc_acf_tax_term_name', 10, 2); | |
function wpc_acf_tax_term_name($term_name, $e_name) | |
{ // tax_object - is a filter meta key name. | |
if( $e_name === 'tax_object' ){ | |
$term = get_term( $term_name, 'product_cat' ); // product_cat is related taxonomy | |
$term_name = $term->name; | |
} | |
return $term_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_head', 'wpc_inline_filters'); | |
function wpc_inline_filters(){ | |
// Page IDs where this CSS should be displayed | |
if( is_page( array(2006, 2049) ) ): | |
?> | |
<style type="text/css"> | |
@media screen and (min-width: 768px) { | |
.wpc-filter-set-2058 .wpc-filters-widget-wrapper, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Checkbox filters brand images | |
add_filter( 'wpc_filters_checkbox_term_html', 'wpc_term_brand_custom_logo', 10, 4 ); | |
// Radio filters brand images | |
add_filter( 'wpc_filters_radio_term_html', 'wpc_term_brand_custom_logo', 10, 4 ); | |
function wpc_term_brand_custom_logo($html, $link_attributes, $term, $filter) | |
{ | |
$img = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'pre_get_posts', 'stepasyuk_custom_wp_query' ); | |
function stepasyuk_custom_wp_query( $wp_query ){ | |
if( $wp_query->is_main_query() && $wp_query->is_tax('categories-formations') ){ | |
$wp_query->set('posts_per_page', -1); | |
$wp_query->set('orderby', 'date'); | |
$wp_query->set('order', 'DESC'); | |
} | |
} |