Last active
May 10, 2016 03:45
-
-
Save ridinghoodmedia/d97f7f6f0fa1deb4cd23c3de100c2244 to your computer and use it in GitHub Desktop.
Escape envira gallery output
This file contains 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
// 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