Skip to content

Instantly share code, notes, and snippets.

@MjHead
Last active May 4, 2019 13:24
Show Gist options
  • Save MjHead/9670c36c80fa11e80ae468d942326adc to your computer and use it in GitHub Desktop.
Save MjHead/9670c36c80fa11e80ae468d942326adc to your computer and use it in GitHub Desktop.
<?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