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/query/final-query', function( $query ) { | |
// replace this with values you need | |
$meta_key = 'after'; | |
$date_format = 'Y-m-d\TH:i:s'; | |
if ( ! empty( $query['meta_query'] ) ) { | |
foreach( $query['meta_query'] as $index => $row ) { | |
if ( $meta_key === $row['key'] ) { |
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_footer', function() { | |
$days_to_book = get_post_meta( get_the_ID(), 'booking_duration' ); | |
if ( ! $days_to_book ) { | |
$days_to_book = 1; | |
} | |
$days_to_book = $days_to_book - 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 | |
add_action( 'admin_footer', function() { | |
?> | |
<script> | |
class JetEngineCheckboxSEO { | |
constructor() { | |
if ( ! window.rankMathEditor ) { | |
return; |
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 | |
/** | |
* Slug of the context. | |
* You can change it but please kepp a snake-case namin and latin letters | |
*/ | |
$custom_context_slug = 'custom-object-by-id'; | |
/** | |
* Register context for the context dropdown | |
*/ |
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-engine/twig-views/current-context', function( $context, $object ) { | |
if ( is_a( $object, 'WC_Product' ) ) { | |
$object_factory = new \Jet_Engine\Timber_Views\Object_Factory(); | |
$context['post'] = $object_factory->get_post( get_post( $object->get_id() ) ); | |
} | |
return $context; |
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_footer', function() { | |
?> | |
<script type="text/javascript"> | |
document.addEventListener( 'bricks/ajax/popup/loaded', (event) => { | |
window.JetPlugins.init( jQuery( event.detail.popupElement ) ) | |
}); | |
</script> | |
<?php |
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-form-builder/custom-action/iterate-submissions', function( $request, $action_handler ) { | |
$uid = get_option( '_my_uid', false ); | |
if ( ! $uid ) { | |
$uid = 1; | |
} | |
jet_fb_context()->update_request( $uid, '_uid' ); | |
$uid++; |
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
SELECT app.*, posts.post_title AS service_name, terms.name AS service_category | |
FROM {prefix}jet_appointments AS app | |
INNER JOIN {prefix}posts AS posts ON posts.ID = app.service | |
INNER JOIN {prefix}term_relationships AS terms_rel ON posts.ID = terms_rel.object_id | |
INNER JOIN {prefix}term_taxonomy AS term_tax ON terms_rel.term_taxonomy_id = term_tax.term_taxonomy_id | |
INNER JOIN {prefix}terms AS terms ON term_tax.term_id = terms.term_id | |
WHERE term_tax.taxonomy = 'product_cat' |
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 | |
// Replace additional-props with your CPT slug | |
DEFINE( 'BOOKING_ADDITIONAL_CPT', 'additional-props' ); | |
add_filter( 'jet-booking/settings/get/apartment_post_type', function ( $post_type ) { | |
if ( is_admin() ) { | |
if ( ! empty( $_GET['post_type'] ) && BOOKING_ADDITIONAL_CPT === $_GET['post_type'] ) { | |
$post_type = BOOKING_ADDITIONAL_CPT; | |
} | |
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 | |
/** | |
* Instructions: | |
* | |
* 1. Create a filter for guests number - https://tppr.me/H7Sjzs, https://tppr.me/D5jImO | |
* 2. In the example below used 'max_guests' query variable for filter, you need replace it with your own. | |
* You need to do this under 'Replace this with your filter variable' comment | |
* 3. After this - each time when this filter applied - selected value will be stored, now you need to apply it in form | |
* 4. Set this value as default for Guessts field in the form - https://tppr.me/vwdRCV. | |
* 5. For the form keep the query var name from example - _booking_guests_num - here will be stored selected filter value |
NewerOlder