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 | |
/** | |
* Returns an array of image IDs stored in gllery meta field | |
* | |
* @param string $field_key Gallery field meta key | |
* @param int $post_id Post ID to get field from. If not set - will try to use current post. | |
* @return array | |
*/ | |
function my_get_jet_engine_gallery( $field_key = '', $post_id = null ) { |
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_loaded', function() { | |
$query = new WP_Query( array( | |
'post_type' => 'jet-engine', | |
'posts_per_page' => -1, | |
) ); | |
if ( ! empty( $query->posts ) ) { |
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
jQuery( window ).trigger( { | |
type: 'jet-popup-open-trigger', | |
popupData: { | |
popupId: 'jet-popup-<numeric popup ID>', | |
} | |
} ); |
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/forms/booking/notification/insert_post', function( $notification, $manager ) { | |
if ( ! empty( $manager->data['_date_field'] ) ) { | |
$manager->data['_date_field'] = strtotime( $manager->data['_date_field'] ); | |
} | |
}, 0, 2 ); | |
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( 'import_post_meta', function( $post_id, $key, $value ) { | |
$slashit = array( '_form_data', '_notifications_data' ); | |
if ( in_array( $key, $slashit ) && '[]' !== $value ) { | |
delete_post_meta( $post_id, $key ); | |
update_post_meta( $post_id, $key, $value ); | |
} |
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/listings/macros-list', 'jet_register_custom_macros' ); | |
/** | |
* Add new macros to default macros list | |
* | |
* %business_users% - macros name | |
* | |
*/ |
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/listings/allowed-callbacks', 'jet_add_attachment_link_callback', 10, 2 ); | |
function jet_add_attachment_link_callback( $callbacks ) { | |
$callbacks['jet_get_attachment_file_link'] = 'Get attachment file link by ID'; | |
return $callbacks; | |
} | |
function jet_get_attachment_file_link( $attachment_id ) { |
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/meta-boxes/register-instances', 'my_register_meta_box' ); | |
function my_register_meta_box( $meta_boxes_manager ) { | |
// Replace my_post_type_slug with your actual post type slug | |
$post_type = 'my_post_type_slug'; | |
$object_name = $post_type . '_group'; |
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/meta-boxes/register-instances', 'my_register_meta_box' ); | |
function my_register_meta_box( $meta_boxes_manager ) { | |
// Replace my_post_type_slug with your actual post type slug | |
$post_type = 'my_post_type_slug'; | |
$object_name = $post_type . '_group'; |