Skip to content

Instantly share code, notes, and snippets.

@MjHead
Last active September 10, 2018 14:34
Show Gist options
  • Save MjHead/cd147e0122a4cca0c7107755a24dc491 to your computer and use it in GitHub Desktop.
Save MjHead/cd147e0122a4cca0c7107755a24dc491 to your computer and use it in GitHub Desktop.
Register custom callback for Filter field output in JetEngine / Dynamic Field widget.
<?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