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( 'gettext', function( $translated_text, $text, $domain ) { | |
if ( 'fwp' == $domain ) { | |
if ( 'Start typing...' == $translated_text ) { | |
$translated_text = 'The new placeholder'; | |
} | |
} | |
return $translated_text; | |
}, 10, 3 ); |
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 | |
function change_proximity_label( $translated_text ) { | |
if ( 'Enter location' == $translated_text ) { | |
return 'My new placeholder text'; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'change_proximity_label' ); |
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 | |
function index_EDD_FES_multiselect( $params, $class ) { | |
if ( 'product_style' == $params['facet_name'] ) { | |
$choices = explode( '| ', $params['facet_display_value'] ); | |
foreach ( $choices as $choice ) { | |
$params['facet_value'] = $choice; | |
$params['facet_display_value'] = $choice; | |
$class->insert( $params ); | |
} |
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
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
var cookie_data = JSON.stringify(FWP.settings.post_ids); | |
setCookie("fwp_posts", cookie_data, 7); | |
}); | |
})(jQuery); | |
function setCookie(cname, cvalue, exdays) { | |
var d = new Date(); |
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 | |
/* | |
CSS-template approach | |
*/ | |
?> | |
<button class="fwp-load-more" onclick="fwp_load_more()">Load more</button> | |
<script> | |
(function($) { |
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
<div class="nav-wrapper"><!-- placeholder --></div> | |
<script> | |
(function($) { | |
$(function() { | |
var post_id = <?php echo $post->ID; ?>; // grab the current post ID | |
var data = getCookie('fwp_posts'); // get the cookie | |
if ('' != data) { | |
data = JSON.parse(data); | |
var pos = data.indexOf(post_id); |
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
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.product_boxes .box').addClass('fadeIn animated'); | |
}); | |
})(jQuery); | |
</script> |
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 | |
function custom_slider_logic( $response, $params ) { | |
$facet = $params['facet']; | |
// Change the facet name | |
if ( 'YOUR_FACET_NAME' == $facet['name'] ) { | |
global $wpdb; | |
$values = $params['selected_values']; |
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 | |
function my_facetwp_is_main_query( $is_main_query, $query ) { | |
if ( isset( $query->query_vars['post_type'] ) ) { | |
if ( 'edd_wish_list' == $query->query_vars['post_type'] ) { | |
$is_main_query = false; | |
} | |
} | |
return $is_main_query; | |
} |
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 | |
function index_attachment_terms( $object_id ) { | |
if ( 0 < (int) $object_id ) { | |
FWP()->indexer->index( $object_id ); | |
} | |
} | |
add_action( 'set_object_terms', 'index_attachment_terms' ); |