Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Add iFrame to allowed wp_kses_post tags
  5. *
  6. * @param string $tags Allowed tags, attributes, and/or entities.
  7. * @param string $context Context to judge allowed tags by. Allowed values are 'post',
  8. *
  9. * @return mixed
  10. */
  11. function custom_wpkses_post_tags( $tags, $context ) {
  12.  
  13. if ( 'post' === $context ) {
  14. $tags['iframe'] = array(
  15. 'src' => true,
  16. 'height' => true,
  17. 'width' => true,
  18. 'frameborder' => true,
  19. 'scrolling' => true,
  20. 'allowfullscreen' => true,
  21. );
  22. }
  23.  
  24. return $tags;
  25. }
  26.  
  27. add_filter( 'wp_kses_allowed_html', 'custom_wpkses_post_tags', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement