Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active October 6, 2015 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/3f527296f2c5cc69e05f to your computer and use it in GitHub Desktop.
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