Allows to change initial set up of booking calendar. Usage example:
window.JetPlugins.hooks.addFilter( "jet-booking.input.config", "jetBooking", ( config ) => {
const validateDay = config.beforeShowDay;
<?php | |
/** | |
* Note! Always include mcros file only on 'jet-engine/register-macros' hook - before base class is not avaialable, | |
* after - all macros already registered and you can't insert a new one. | |
*/ | |
add_action( 'jet-engine/register-macros', function() { | |
require_once get_theme_file_path( 'macros.php' ); | |
new My_JE_Macros(); | |
} ); |
<?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(){ |
<?php | |
//You may just use get_post_meta() / get_term_meta() / get_user_meta() to get post/term/user meta | |
//However, in Listing Grid, you may use get_meta() method for convenience | |
$value = jet_engine()->listings->data->get_meta( $meta_key, $object ); | |
/** | |
* Get object meta value. Works for Posts, Terms, Users, Comments | |
* $object defaults to null, then the value will be retrieved from the current listing object |
<?php | |
/** | |
* Functions may be used as a custom post type column callback | |
*/ | |
/** | |
* If the function name does not contain 'jet_engine_custom_cb' prefix, | |
* the callback takes only two arguments: column name and post ID | |
* You may use such callbacks if you do not need to specify any arguments | |
* Example: show post author in a column |
<?php | |
/** | |
* Some APIs required more than one header to be sent, | |
* or they need to give out some token first, and only after that to get the actual info | |
* Here we show only example with setting additional header, | |
* but you may run some code to do what you need in a specific case | |
* | |
* Here we have an API, which requires setting not pnly Authorization token (which may be set in REST API endpoiny options) | |
* but also a header with the version - that was a real-life example from our user |
<?php | |
//filter to add a callback to the list | |
add_filter( 'jet-engine/listings/allowed-callbacks', 'add_custom_dynamic_field_callbacks' ); | |
//filter to specify which arguments will the callback have | |
add_filter( 'jet-engine/listing/dynamic-field/callback-args', 'add_custom_dynamic_field_callbacks_args', 0, 3 ); | |
//filter to add controls | |
//controls arguments are set as in Elementor controls |
<?php | |
add_action( 'jet-engine/register-macros', function() { | |
/** | |
* Return purchased products. | |
*/ | |
class Purchased_Products_Macro extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { |
<?php | |
/** | |
* You need to set up single user base page in the settings anyway, because it need to grab a content. | |
* The only limitation - will not work without subpage slug in the URL. | |
*/ | |
// add rewrite rules | |
add_filter( 'jet-engine/profile-builder/rewrite-rules', function( $rules, $manager ) { | |
$pages = \Jet_Engine\Modules\Profile_Builder\Module::instance()->settings->get_pages(); |
<?php | |
add_action( 'jet-engine/register-macros', function() { | |
/** | |
* Format date string. | |
*/ | |
class Format_Date_String extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { |