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_action( 'jet-engine/query-builder/query/after-query-setup', function( $query ) { | |
if ( $query->query_type !== 'rest-api' || ! is_array( $query->final_query['args'] ?? false ) ) { | |
return; | |
} | |
foreach ( $query->final_query['args'] as $i => $arg ) { | |
if ( empty( $arg['value'] ) || ! is_scalar( $arg['value'] ) || false === strpos( $arg['value'], 'macros_string::' ) ) { |
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 | |
function jfb_tour_get_data( $field_name, $form_id, $form_fields ) { | |
$args = array( | |
'tour_id' => $form_fields['tour_id'] ?? '', | |
'number_of_guests' => $form_fields['number_of_guests'] ?? '', | |
'date' => $form_fields['date'] ?? '', | |
); | |
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_action( 'jet-engine/query-builder/query/after-query-setup', function( $query ) { | |
if ( empty( $query->final_query['manual_query'] ) ) { | |
return; | |
} | |
$query->final_query['manual_query'] = preg_replace_callback( | |
'/\{explode(.+?)explode\}/', |
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_action( 'plugins_loaded', function() { | |
add_filter('jet-smart-filters/filter-instance/args', function($args) { | |
$filter_id = $args['filter_id']; | |
$query_var = get_post_meta($filter_id, '_query_var', true); | |
$step = get_post_meta($filter_id, '_source_step', true); | |
$source_cb = get_post_meta($filter_id, '_source_callback', true); |
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_action( 'wp_head', function () { ?> | |
<script> | |
jQuery( document ).on( 'jet-booking/init', () => { | |
window.JetPlugins.hooks.addFilter( "jet-booking.input.config", "jetBooking", modifyBookingConfig ); | |
window.JetPlugins.hooks.addFilter( "jet-booking.calendar.config", "jetBooking", modifyBookingConfig ); | |
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_action( 'init', function() { | |
if ( ! function_exists( 'jet_abaf' ) || jet_abaf()->settings->get( 'booking_mode' ) !== 'plain' ) { | |
return; | |
} | |
$settings = jet_abaf()->settings; | |
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_action( 'jet-engine/register-macros', function(){ | |
if ( ! function_exists( 'WC' ) ) { | |
return; | |
} | |
class WC_Crosssells extends \Jet_Engine_Base_Macros { |
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_filter( 'jet-smart-filters/filters/filter-options', function( $options, $filter_id ){ | |
$filter_list = array( | |
'269396' => true | |
); | |
if ( ! isset( $filter_list[ $filter_id ] ) ) { | |
return $options; |
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_action( 'jet-engine/callbacks/register', function( $callbacks ) { | |
$args = array( | |
'explode_delimiter' => array( | |
'label' => 'Delimiter', | |
'type' => 'text', | |
'default' => ',', | |
), |
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_action( 'jet-engine/register-macros', function(){ | |
class Nth_Level_Terms_Macro extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { | |
return 'nth_level_terms'; | |
} |