Skip to content

Instantly share code, notes, and snippets.

@skyshab
Created January 16, 2018 17:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyshab/7112ceb63bf6641faee4aa28527ed3e1 to your computer and use it in GitHub Desktop.
Save skyshab/7112ceb63bf6641faee4aa28527ed3e1 to your computer and use it in GitHub Desktop.
Example of changing allowed html in the events calendar excerpts.
add_filter('tribe_events_excerpt_allowed_html', 'my_custom_allowed_html' );
function my_custom_allowed_html() {
// this array contains all the html elements that can be added
$allowed_html = array(
'a' => array(
'class' => array(),
'href' => array(),
'rel' => array(),
'title' => array(),
),
'abbr' => array(
'title' => array(),
),
'b' => array(),
'blockquote' => array(
'cite' => array(),
),
'cite' => array(
'title' => array(),
),
'code' => array(),
'del' => array(
'datetime' => array(),
'title' => array(),
),
'dd' => array(),
'div' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'dl' => array(),
'dt' => array(),
'em' => array(),
'h1' => array(),
'h2' => array(),
'h3' => array(),
'h4' => array(),
'h5' => array(),
'h6' => array(),
'i' => array(),
'img' => array(
'alt' => array(),
'class' => array(),
'height' => array(),
'src' => array(),
'width' => array(),
),
'li' => array(
'class' => array(),
),
'ol' => array(
'class' => array(),
),
'p' => array(
'class' => array(),
),
'q' => array(
'cite' => array(),
'title' => array(),
),
'span' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'strike' => array(),
'strong' => array(),
'ul' => array(
'class' => array(),
),
);
return $allowed_html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment