This file contains 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 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/macros-list', 'register_format_date_string_macro' ); | |
function register_format_date_string_macro( $macros_list ) { | |
$macros_list['format_date'] = array( | |
'label' => 'Format date string', | |
'cb' => '_get_format_date_string', | |
'args' => array( 'format' => array( | |
'label' => 'Format', | |
'type' => 'text', |
This file contains 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 | |
//filter to add a callback to the list | |
add_filter( 'jet-engine/listings/allowed-callbacks', 'add_custom_dynamic_field_callbacks' ); | |
//filter to specify which arguments will the callback have | |
add_filter( 'jet-engine/listing/dynamic-field/callback-args', 'add_custom_dynamic_field_callbacks_args', 0, 3 ); | |
//filter to add controls | |
//controls arguments are set as in Elementor controls |
This file contains 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 ) { | |
if ( ! isset( $query['meta_query'] ) ) { | |
return $query; | |
} | |
foreach ( $query['meta_query'] as $index => $meta_query_item ) { |