Last active
September 10, 2018 14:34
-
-
Save MjHead/cd147e0122a4cca0c7107755a24dc491 to your computer and use it in GitHub Desktop.
Register custom callback for Filter field output in JetEngine / Dynamic Field widget.
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; | |
} | |
/** | |
* Callback function. | |
*/ | |
function jet_venues_home( $id ) { | |
return do_shortcode( '[venues-home id="' . $id . '"]' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment