Skip to content

Instantly share code, notes, and snippets.

@luclemo
Last active March 11, 2019 23:12
Show Gist options
  • Save luclemo/d7fa01c5a58881313949c26a00c6242b to your computer and use it in GitHub Desktop.
Save luclemo/d7fa01c5a58881313949c26a00c6242b to your computer and use it in GitHub Desktop.
<?php
/**
* Create global vaiable for accepted HTML tags in ACF fields.
*
* To be used with wp_kses. Example:
* wp_kses( get_field( 'field' ), ll_allowed_markup() );
*
* @link https://codex.wordpress.org/Function_Reference/wp_kses
*/
function ll_allowed_markup() {
$allowed_markup = array(
'a' => array(
'href' => array(),
'title' => array()
),
'br' => array(),
'em' => array(),
'strong' => array(),
'span' => array(),
);
return $allowed_markup;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment