Advertisement
bedas

CRED Extend Allowed Tags

Sep 28th, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. add_filter( 'wp_kses_allowed_html', 'esw_author_cap_filter',1,1 );
  2.  
  3. function esw_author_cap_filter( $allowedposttags ) {
  4.  
  5. //Here put your conditions, depending your context
  6.  
  7. if ( !current_user_can( 'publish_posts' ) )
  8. return $allowedposttags;
  9.  
  10. // Here add tags and attributes you want to allow
  11.  
  12. $allowedposttags['iframe']=array(
  13.  
  14. 'align' => true,
  15. 'width' => true,
  16. 'height' => true,
  17. 'frameborder' => true,
  18. 'name' => true,
  19. 'src' => true,
  20. 'id' => true,
  21. 'class' => true,
  22. 'style' => true,
  23. 'scrolling' => true,
  24. 'marginwidth' => true,
  25. 'marginheight' => true,
  26. );
  27. return $allowedposttags;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement