Created
April 17, 2017 16:17
-
-
Save jsit/8ff5859a3b538a3e8a851362bf17d91e to your computer and use it in GitHub Desktop.
Allow CodePen attributes in <p> tags
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 | |
function add_allowed_tags($tags, $context) { | |
if ($context === 'post') { | |
$tags['p'] = array( | |
'data-height' => true, | |
'data-theme-id' => true, | |
'data-slug-hash' => true, | |
'data-default-tab' => true, | |
'data-user' => true, | |
'data-embed-version' => true, | |
'data-pen-title' => true, | |
); | |
return $tags; | |
} | |
} | |
add_filter('wp_kses_allowed_html', 'add_allowed_tags'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment