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_trim_callback', 10, 2 ); | |
function jet_add_trim_callback( $callbacks ) { | |
$callbacks['jet_trim_string'] = 'Trim string'; | |
return $callbacks; | |
} | |
function jet_trim_string( $string ) { |
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
.chess-listing .jet-listing-grid__item:nth-child(even) .chess-col-1 { | |
order: 2; | |
} | |
.chess-listing .jet-listing-grid__item:nth-child(even) .chess-col-2 { | |
order: 1; | |
} |
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 | |
/** | |
* Testimonials start template | |
*/ | |
$settings = $this->get_settings(); | |
$data_settings = $this->generate_setting_json(); | |
$use_comment_corner = $this->get_settings( 'use_comment_corner' ); | |
$class_array[] = 'jet-testimonials__instance'; |
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_calc_callback', 10, 2 ); | |
function jet_add_calc_callback( $callbacks ) { | |
$callbacks['jet_calc_fileds'] = 'Calculated field example'; | |
return $callbacks; | |
} | |
function jet_calc_fileds( $field_1_value ) { | |
return $field_1_value * get_post_meta( get_the_ID(), 'field_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_filter( 'jet-engine/listings/allowed-callbacks', 'jet_he_add_calc_callback', 10, 2 ); | |
function jet_he_add_calc_callback( $callbacks ) { | |
$callbacks['jet_he_calc_fileds'] = 'Calculated total price'; | |
$callbacks['jet_he_calc_fileds_no_discount'] = 'Calculated total price (without discount)'; | |
return $callbacks; | |
} | |
function jet_he_calc_fileds( $field_1_value ) { | |
$license_fee = absint( get_post_meta( get_the_ID(), 'license-fee', 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_filter( 'jet-abaf/db/additional-db-columns', function( $columns ) { | |
$columns = array( | |
'user_email', | |
'order_id' | |
); | |
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/listing/grid/posts-query-args', 'je_custom_listing_order', 10, 2 ); | |
/** | |
* Add multiple order by paramters to listing grid widget. | |
* | |
* What you need t replace: | |
* - speakers_list - replace this with your custom ID added to Listing widget | |
* - is-featured, speaker-name - meta fields names we need to sort by. |
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( 'register_post_type_args', 'je_change_post_type_rewrite_slug', 10, 2 ); | |
/** | |
* Change post type rewirte | |
* Where: | |
* - apartments - is a post type slug. Replace is with your actual slug. | |
* - %locations% - is a placeholder for taxonomy term in URL. | |
* | |
* @param array $args | |
* @param string $post_type_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 | |
/** | |
* Method 1 | |
* Can be used for: Any storage type | |
* | |
* page-slug - replace this with your Option Page slug | |
* option-name - replace this with your option Name/ID | |
*/ | |
$value = jet_engine()->listings->data->get_option( 'page-slug::option-name' ); |