Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active October 6, 2015 13:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kurozumi/3f527296f2c5cc69e05f to your computer and use it in GitHub Desktop.
【ワードプレス】投稿できるHTMLタグ(iframeなど)を追加する方法
<?php
add_filter("wp_kses_allowed_html", function($allowedposttags, $context){
if($context != "post")
return $allowedposttags;
return array_merge($allowedposttags, array(
'iframe' => array(
'width' => true,
'height' => true,
'src' => true,
'frameborder' => true,
'allowfullscreen' => true
);
));
}, 99, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment