Last active
March 11, 2019 23:12
-
-
Save luclemo/d7fa01c5a58881313949c26a00c6242b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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