Skip to content

Instantly share code, notes, and snippets.

@blupu
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save blupu/71732457596168d851d2 to your computer and use it in GitHub Desktop.

Select an option

Save blupu/71732457596168d851d2 to your computer and use it in GitHub Desktop.
WP-AppKit: allow oEmbed iframes in apps
<?php
/*
* Applies to: since WP-AppKit 0.1
* Goal: By default, iframes are stripped from post content when send to WP-AppKit apps.
* It removes iframes inserted by WordPress through the oEmbed mechanism like videos (https://codex.wordpress.org/Embeds).
* We'd like to let iframes pass to the app to display video embeds in apps.
* Usage: in the app's theme PHP folder or a separate plugin.
*/
add_filter( 'wpak_post_content_allowed_tags', 'wpak_allow_iframe_tag', 10, 2);
function wpak_allow_iframe_tag( $allowed_tags, $post ) {
$allowed_tags .= '<iframe>';
return $allowed_tags;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment