Allows to change initial set up of booking calendar. Usage example:
window.jetBookingState.filters.add( "jet-booking/input/config", ( config ) => {
const validateDay = config.beforeShowDay;
{"post_title":"Apply to service","post_content":"<!-- wp:jet-forms\/hidden-field {\"name\":\"provider_id\"} \/-->\n\n<!-- wp:jet-forms\/select-field {\"field_options_from\":\"posts\",\"field_options_post_type\":\"services\",\"name\":\"service_id\"} \/-->\n\n<!-- wp:jet-forms\/submit-field \/-->","meta_input":{"_gspb_post_css":"","_jf_actions":"[{\"id\":3775,\"settings\":{\"send_email\":{\"subject\":\"New order on website\",\"content\":\"Hi admin!\\n\\nThere are new order on your website.\\n\\nOrder details:\\n- Post ID: %post_id%\"},\"call_hook\":{\"hook_name\":\"apply-to-service\"}},\"type\":\"call_hook\",\"conditions\":[],\"events\":[]}]"}} |
<?php | |
add_filter( 'jet-theme-core/location/render/template-id', function( $template_id ) { | |
/** | |
* 123 - is ID of initial template you set in ThemeCore (could be found in adress bar) | |
* 'alternate-value' - is value of option which enables alternative layout for this page | |
* page-slug and option-name - there are option page slug and option name itself which are responsible for layout | |
*/ | |
if ( 123 === $template_id && 'alternate-value' === jet_engine()->listings->data->get_option( 'page-slug::option-name' ) ) { |
<?php | |
add_filter( 'jet-form-builder/form-handler/form-data', function( $request ) { | |
if ( isset( $request['field_name_to_sanitize'] ) ) { | |
$request['field_name_to_sanitize'] = wp_strip_all_tags( $request['field_name_to_sanitize'] ); | |
} | |
return $request; | |
} ); |
<?php | |
/** | |
* Add this code without opening PHP tag into funcitons.php og your active theme or with any code snippets plugin | |
*/ | |
add_action( | |
'rest_api_init', | |
function() { | |
/** | |
* Here you can set taxonomies slugs you wnat to add to Rest API response |
<?php | |
/** | |
* Add this code without opening PHP tag into funcitons.php og your active theme or with any code snippets plugin | |
*/ | |
add_action( | |
'rest_api_init', | |
function() { | |
// Here you can specify post types slug where this field should be supported | |
$supported_post_types = array( |
<?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 ); |