Allows to change initial set up of booking calendar. Usage example:
window.jetBookingState.filters.add( "jet-booking/input/config", ( config ) => {
const validateDay = config.beforeShowDay;
<?php | |
add_filter( 'jet-engine/listings/allowed-callbacks', 'my_je_callback_register' ); | |
function my_je_callback_register( $callbacks ) { | |
$callbacks['my_je_get_link_callback'] = 'Get link by meta fields'; | |
return $callbacks; | |
} | |
function my_je_get_link_callback() { | |
$label_field = 'status'; // Replace `status` with your meta field where link label is stored |
<?php | |
add_action( 'wp_footer', function() { | |
echo '<script> | |
jQuery( document ).on( "jet-booking/init-field", ( $event, $field ) => { | |
var silent = false; | |
var format = $field.data( "format" ) || "YYYY-MM-DD"; | |
$field.bind( "datepicker-change", ( event, obj ) => { | |
silent = ! silent; | |
if ( silent ) { | |
$field.data( "dateRangePicker" ).setEnd( moment( obj.date1 ).add( 7, "d" ).format( "YYYY-MM-DD" ) ); |
<?php | |
$rel_id = 111; // Set here your actual Relation ID. You can get it from an address bar on relation settings edit page | |
$relation = jet_engine()->relations->get_active_relations( $rel_id ); | |
$parent_id = 111; // ID of prequired arent object from relation | |
$child_id = 111; // ID of prequired arent object from relation | |
$key = 'meta_key'; // Name/ID of meta field to get | |
$meta_value = $relation->get_meta( $parent_id, $child_id, $key ); |
<?php | |
/** | |
* 1. Add action Hook before Insert/update CCT, set 'validate-cct' as hook name - https://i.imgur.com/48wcTA4.png | |
* 2. Replace 'tournaments' with your actual CCT slug | |
* 3. Replace 'name' with actual parameters to find similar items | |
*/ | |
add_filter( 'jet-form-builder/custom-filter/validate-cct', function( $result, $request, $action ) { | |
$cct_slug = 'tournaments'; | |
$cct = \Jet_Engine\Modules\Custom_Content_Types\Module::instance()->manager->get_content_types( $cct_slug ); |
<?php | |
namespace Jet_Engine\Query_Builder\Queries; | |
// put this file into jet-engine\includes\components\query-builder\queries\ and replace initial file | |
// this comment is actual until 3.0.3 version | |
abstract class Base_Query { | |
public $id = false; | |
public $name = false; |
<?php | |
// Base arg class. all args must extend it | |
abstract class Base_Arg { | |
// returns main arg | |
abstract public function get_arg(); | |
// returns main arg label for UI control | |
abstract public function get_name(); | |
<?php | |
add_action( 'init', function() { | |
// Check if need to do an API request | |
if ( empty( $_GET['test_api_request'] ) ) { | |
return; | |
} | |
// get remote data |
<?php | |
add_filter( 'jet-engine/listings/ajax-listing-url', function( $url ) { | |
return esc_url( admin_url( 'admin-ajax.php' ) ); | |
} ); |