Last active
May 4, 2019 13:24
-
-
Save MjHead/9670c36c80fa11e80ae468d942326adc to your computer and use it in GitHub Desktop.
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 | |
*/ | |
function jet_add_repeater_embed_filter( $filters ) { | |
$filters['embed_link'] = array( | |
'cb' => 'jet_my_embed_link', | |
'args' => false, | |
); | |
return $filters; | |
} | |
/** | |
* Filter callback | |
* | |
* @param string $link Link to embed | |
* @return string | |
*/ | |
function jet_my_embed_link( $link ) { | |
return wp_oembed_get( $link ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment