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_custom_callback' ); | |
/** | |
* Add callback to list. | |
*/ | |
function jet_custom_callback( $callbacks ) { | |
$callbacks['jet_venues_home'] = __( 'Venues Home', 'txt-domain' ); | |
return $callbacks; |
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_custom_callbacks' ); | |
/** | |
* Add callback to list. | |
*/ | |
function jet_custom_callbacks( $callbacks ) { | |
$callbacks['jet_team_name'] = __( 'Team Member Name', 'txt-domain' ); |
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_callback', 10, 2 ); | |
function jet_add_attachment_callback( $callbacks ) { | |
$callbacks['jet_get_attachment_file'] = 'Get attachment file by ID'; | |
return $callbacks; | |
} | |
function jet_get_attachment_file( $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/filters-list', 'jet_add_pdf_link_filter' ); | |
/** | |
* Add 'get_pdf_link' to allowed filters list | |
* | |
* @param array $filters Registered filters | |
* @return array | |
*/ |
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 | |
$tax = 'your-taxonomy'; | |
$terms = wp_get_post_terms( get_the_ID(), $tax ); | |
$delimiter = ', '; | |
$is_first = true; | |
if ( ! $terms ) { | |
$terms = array(); | |
} |
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( 'manage_<your_post_type_slug>_posts_columns', 'jet_add_custom_admin_columns' ); | |
add_action( 'manage_<your_post_type_slug>_posts_custom_column', 'jet_render_custom_admin_columns', 10, 2 ); | |
function jet_add_custom_admin_columns( $columns ) { | |
$columns['jet_custom_column_1'] = __( 'Column name #1', 'text-domain' ); | |
$columns['jet_custom_column_2'] = __( 'Column name #2', 'text-domain' ); | |
return $columns; | |
} |
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 | |
* | |
* %jet_current_category% - 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 | |
// Returns an array of repeater rows or boolean false | |
$meta = get_post_meta( get_the_ID(), 'repeater_field_name', true ); | |
if ( ! empty( $meta ) ) { | |
foreach( $meta as $row ) { | |
echo $row['child_field_name_1']; | |
echo $row['child_field_name_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 | |
/** | |
* Custom callback example | |
* | |
* @param string $column Column name | |
* @param int $post_id Post ID | |
* @return string | |
*/ | |
function jet_admin_column_callback_example( $column, $post_id ) { |