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 | |
/** | |
* Search & Filter Pro | |
* | |
* Sample Results Template | |
* | |
* @package Search_Filter | |
* @author Ross Morsali | |
* @link https://searchandfilter.com | |
* @copyright 2018 Search & Filter |
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 | |
/** | |
* Adds helpers to Handlebars to support the following expressions: | |
* | |
* If truthy - `{{#if_truthy varName}}...{{/if_truthy}}` | |
* If falsy - `{{#if_falsy varName}}...{{/if_falsy}}` | |
* If equal - `{{#if_equal varName anotherVar}}...{{/if_equal}}` | |
* If not equal - `{{#if_not_equal varName anotherVar}}...{{/if_not_equal}}` | |
* | |
* Supports the PHP implementation of Handlebars found here: https://github.com/salesforce/handlebars-php |
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
// re init layout after ajax request | |
$( document ).on( "sf:ajaxfinish", ".searchandfilter", function( e, data ) { | |
if ( window.elementorFrontend && window.elementorFrontend.elementsHandler && window.elementorFrontend.elementsHandler.runReadyTrigger) { | |
var runReadyTrigger = window.elementorFrontend.elementsHandler.runReadyTrigger; | |
runReadyTrigger( data.targetSelector ); | |
// NEW - re-init elementor widgets inside the new results: | |
var ajaxTarget = $( data.targetSelector ); | |
if ( ajaxTarget.length > 0 ) { | |
ajaxTarget.find( '.elementor-widget' ).each( 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
<?php | |
//Get an array of objects containing data for the current search/filter | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
echo $sf_current_query->is_filtered(); | |
?> |
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 | |
// Warning: There is nothing safe about this script - don't use in production - make a backup. Always delete when finished. | |
/* | |
* Use this script to change the table prefix (renames the tables) in your WordPress install. | |
* Instructions: | |
* - Put this in a subdirectory from the root of your install - ie, create a new directory in the same folder as `wp-config.php` | |
and put this in it | |
* - Change the values `$old_prefix` and `$new_prefix` below, to match your requirements | |
* - Change the `$table_prefix` var in `wp-config.php` to your new prefix |
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
.search-filter-result-item{ | |
overflow: auto; | |
} | |
.search-filter-results-image{ | |
display: block; | |
width: 30%; | |
vertical-align: top; | |
float: left; | |
} |
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
var el = wp.element.createElement; | |
const { __ } = wp.i18n; // Import __() from wp.i18n | |
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks | |
const { RichText, BlockControls, BlockFormatControls, AlignmentToolbar } = wp.editor; | |
const { Button, Dashicon, Tooltip, IconButton, Toolbar } = wp.components; | |
const { Component, Fragment } = wp.element; | |
//standard registerBlockType init | |
registerBlockType( 'my-block-plugin/block-w-insert-shortcode', { | |
title: 'Block w Shortcode Button', //any title you like |
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 | |
//Get a multiple fields values by passing an array of field names | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
/* | |
* EXAMPLE 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
(function ( $ ) { | |
"use strict"; | |
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ | |
var grid; | |
$(el).find($('.edd_download.content-grid-download')).attr('style', ''); | |
grid = document.querySelector(el); | |
salvattore['register_grid'](grid); | |
}); | |
}(jQuery)); |
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 | |
//grab the active query from our search form | |
//replace `1526` with the ID of your search form | |
global $searchandfilter; | |
$sf_current_query = $searchandfilter->get(1526)->current_query(); | |
?> |