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( 'edit_user_profile', 'my_user_likes' ); | |
add_action( 'show_user_profile', 'my_user_likes' ); | |
function my_user_likes( $user ) { | |
// user-meta-store you need to replace with your actual Data Store slug | |
$liked = get_user_meta( $user->ID, 'je_data_store_user-meta-store', true ); | |
echo '<h2>User Likes</h2>'; |
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 | |
/* | |
form_submissions - replace this with your actual CCT slug | |
cct_single_post_id - replace this with your actual field name | |
*/ | |
add_filter( 'jet-engine/custom-content-types/admin-columns', function( $columns, $factory ) { | |
if ( 'form_submissions' === $factory->get_arg( 'slug' ) && isset( $columns['cct_single_post_id'] ) ) { | |
$columns['cct_single_post_id']['_cb'] = 'my_get_edit_post_link'; | |
} |
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 | |
/** | |
This function should be called on the 'init' hook with priority 11 or later, | |
if not custom content type instances will not be registered yet | |
Available operators: | |
= | |
!= |
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_shortcode( 'post_terms', function( $atts = array() ) { | |
$atts = shortcode_atts( array( | |
'tax' => '', | |
'tax_2' => '', | |
'tax_3' => '', | |
), $atts, 'post_terms' ); |
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'; |
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_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_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_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 ); | |