Skip to content

Instantly share code, notes, and snippets.

@ridinghoodmedia
Last active May 10, 2016 03:45
Show Gist options
  • Save ridinghoodmedia/d97f7f6f0fa1deb4cd23c3de100c2244 to your computer and use it in GitHub Desktop.
Save ridinghoodmedia/d97f7f6f0fa1deb4cd23c3de100c2244 to your computer and use it in GitHub Desktop.
Escape envira gallery output
// Essentially this, but need to escape the output, as images are taken from ACF pro fields
function rl_gallery() {
envira_gallery( 'gallery', 'slug' );
}
// Escape and echo gallery
echo wp_kses( rl_gallery(), array(
'div' => array(
'class' => array(),
'class' => array(),
'id' => array(),
'data-envira-columns' => array()),
'a' => array(
'class' => array(),
'data-envira-caption' => array(),
'data-thumbnail' => array(),
'href' => array(),
'id' => array(),
'rel' => array(),
'src' => array(),
'style' => array(),
'title' => array()),
'img' => array(
'alt' => array(),
'class' => array(),
'class' => array(),
'data-envira-gallery-id'=> array(),
'data-envira-item-id' => array(),
'data-envira-index' => array(),
'data-envira-src' => array(),
'id' => array(),
'src' => array(),
'style' => array(),
'title' => array()),
'noscript' => array(
'class' => array()),
),
array ( 'http', 'https', 'ftp', 'javascript', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' )
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment