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
( function( $ ) { | |
$( document ).on( 'jet-filter-content-rendered', function( $scope, JetSmartFilters, provider ) { | |
// $scope - new DOM, generated by filter | |
// JetSmartFilters - JS object, contains all filters related methods and properties | |
// provider - requested content provider name | |
SmartPodcastPlayer.initialize(); | |
} ); | |
}( jQuery ) ); |
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
add_filter( 'jet-blog/smart-listing/query-args', 'jet_smart_list_exclude_current' ); | |
function jet_smart_list_exclude_current( $query_args ) { | |
if ( ! empty( $query_args['post__not_in'] ) && in_array( '%current_id%', $query_args['post__not_in'] ) ) { | |
$query_args['post__not_in'] = array( get_the_ID() ); | |
} | |
return $query_args; |
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
add_filter( 'jet-engine/listing/grid/posts-query-args', 'jet_listing_igonre_sticky' ); | |
function jet_listing_igonre_sticky( $query_args ) { | |
$query_args['ignore_sticky_posts'] = true; | |
return $query_args; | |
} |
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
add_filter( 'jet-engine/listings/filters-list', 'jet_engine_add_format_date_filter' ); | |
function jet_engine_add_format_date_filter( $filters ) { | |
$filters['format_date'] = array( | |
'cb' => 'jet_engine_custom_date_format', | |
'args' => false, | |
); | |
return $filters; | |
} |
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_permalink% - macros name | |
* | |
*/ | |
function jet_register_custom_macros( $macros_list ) { |
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
add_filter( 'jet-smart-filters/query/final-query', 'jet_set_compare_operator' ); | |
function jet_set_compare_operator( $query ) { | |
// Replace '_preice_level' with your custom field name | |
$meta_key = '_price_level'; | |
$new_query = array( | |
'relation' => 'OR', | |
); |
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
/** | |
* Show formated date from post meta in admin columns | |
* | |
* $meta_key - custom field to get date from | |
* $format - date format | |
*/ | |
function jet_admin_column_date( $column, $post_id ) { | |
$meta_key = '_date'; | |
$format = 'F, j Y'; |
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
/** | |
* Show image by stored image ID | |
* | |
* $meta_key - custom field to get image from | |
* $size - image size to show | |
*/ | |
function jet_admin_column_date( $column, $post_id ) { | |
$meta_key = '_image'; | |
$image_id = get_post_meta( $post_id, $meta_key, true ); |
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( | |
'elementor/element/jet-posts/section_posts_custom_fields/before_section_end', | |
'jet_custom_meta_callbacks' | |
); | |
add_action( | |
'elementor/element/jet-blog-smart-tiles/section_custom_fields/before_section_end', | |
'jet_custom_meta_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/filters-list', 'jet_add_repeater_embed_filter' ); | |
/** | |
* Add 'embed_link' to allowed filters list | |
* Usage - in repeater format %url|embed_link% | |
* | |
* @param array $filters Registered filters | |
* @return array |