Advertisement
fauzanjeg

JKIT || Add Allowed HTML Tags

Nov 20th, 2022
1,258
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 1 0
  1. /**
  2.  * Add Allowed HTML Tags
  3.  *
  4.  * @param array $allowedtags Allowed Tags.
  5.  *
  6.  * @return array
  7.  */
  8. function custom_allowed_html( $allowedtags ) {
  9.     $allowedtags['div'] = array_merge(
  10.         isset( $allowedtags['div'] ) ? $allowedtags['div'] : array(),
  11.         array(
  12.             'style' => true,
  13.         )
  14.     );
  15.  
  16.     return $allowedtags;
  17. }
  18. add_filter( 'wp_kses_allowed_html', 'custom_allowed_html', 100 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement