This file contains hidden or 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
// ## Description | |
// This code listens for the `jet-engine/listing-grid/after-load-more` event triggered by JetEngine's infinite scroll or "load more" feature. When the event is fired (i.e., new content is loaded into the listing grid), it reinitializes custom scripts by calling the `initializeCustomScripts` function. | |
// ## How to Use | |
// 1. Ensure you have a function named `initializeCustomScripts` defined in your JavaScript. This function will handle reinitialization of any custom functionality for the newly loaded content. | |
// 2. Include this script in your project. It will automatically attach a listener to the `jet-engine/listing-grid/after-load-more` event. | |
// 3. Check the browser console for the log message: `"Infinite scroll content loaded (after-load-more). Reinitializing custom scripts..."` to confirm the event is being detected. | |
(($) => { | |
$(document).ready(function () { |
This file contains hidden or 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
/** | |
* Filter for searching publications by post_title, meta field 'authors', and taxonomy 'conference' in JetSmartFilters. | |
* Uses the _search_publications query variable. | |
*/ | |
add_filter( 'jet-smart-filters/query/final-query', function( $query ) { | |
global $wpdb; | |
// Loop through meta_query to check for _search_publications | |
foreach ( $query['meta_query'] as $index => $meta_query_item ) { | |
if ( isset( $meta_query_item['key'] ) && $meta_query_item['key'] === '_search_publications' ) { |
This file contains hidden or 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
/* Adicione esse trecho no functions.php do tema [ou tema filho mais seguro] */ | |
/* no campo search do smartfilters no query variable coloque: | |
user_prop::user_email; user_prop::user_login; user_prop::user_nicename; user_prop::ID; user_prop::user_url | |
--->> importante use ponto e virgula (;) para adicionar mais de um termo caso necessário. */ | |
/* | |
Veja o Prints: | |
https://imgur.com/a/amQwmzv | |
https://imgur.com/a/3foNmbH | |
*/ |
This file contains hidden or 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
jQuery(document).ready(function($) { | |
$('.micro-unit-type-submit-button').on('click', function() { | |
let listingSelector = '.elementor-element-085ed4a'; // Your listing grid selector | |
// Reload title | |
$('.elementor-element-bdcf9fb').load(window.location.href + ' .elementor-element-bdcf9fb'); | |
// Reload the listing grid | |
$(listingSelector).load(window.location.href + ' ' + listingSelector, function() { | |
console.log('Listing reloaded!'); |
This file contains hidden or 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 | |
/** | |
* Note! | |
* Register macros on jet-engine/register-macros action only, | |
* as the base macro class \Jet_Engine_Base_Macros is not available before that action; | |
* after it - all macros are registered already | |
*/ | |
add_action( 'jet-engine/register-macros', function(){ |
This file contains hidden or 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 the glossary label by having the value | |
// Change "35" to the the ID of the glossary | |
// This ID can be seen when you hit "save" while inspecting admin-ajax.php request on Network Dev Tools tab (item[id]) | |
// Or you can also check it in the database | |
$glossary_value = 'example'; | |
$glossary_label = jet_engine_label_by_glossary($glossary_value, 35); |
This file contains hidden or 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 by year Jet Smart Filters */ | |
/* I want to share this code that allows you to search by year on Jet Smart Filters. */ | |
// 1. Create a meta field named 'example-date', which is type date saved as timestamp. | |
// 2. Set a query on query builder that will fetch all the years of a meta field (in this case, meta field is named example-date, created on step 1). |
This file contains hidden or 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 | |
use Jet_Form_Builder\Exceptions\Action_Exception; | |
add_action( 'jet-form-builder/custom-action/test_action', function ( $request, $handler ) { | |
if ( empty( $request['age'] ) ) { | |
/** | |
* You can use one of the default statuses | |
* 'success' => 'Form successfully submitted.', | |
* 'failed' => 'There was an error trying to submit form. Please try again later.', |
This file contains hidden or 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
<style> | |
body:not(.elementor-editor-active) .hide-listing { | |
display: none; | |
height: 0; | |
} | |
</style> | |
<script> |
This file contains hidden or 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 this to functions.php or using a code snippet plugin */ | |
add_action( 'jet-engine/register-macros', function(){ | |
/** | |
* Return current object property. | |
*/ | |
class Current_Object_Prop_Macro extends \Jet_Engine_Base_Macros { |
NewerOlder