Last active
January 27, 2024 21:43
-
-
Save taricco/f3ccde8a67aa4e2f3bd6be7234a58632 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
/*** ACF 6.2.5 Security Fix | |
@link https://wpfieldwork.com/diving-into-acfs-latest-security-release/ | |
–––––––––––––––––––––––––––––––––––––––––––––––––– ***/ | |
add_filter('acf/shortcode/allow_unsafe_html', function ($allowed, $atts) { | |
// Array of field names that allow unsafe HTML | |
$allowed_fields = [ | |
'global_after_body_code', | |
'footer_code', | |
'global_footer_code', | |
'header_code', | |
'global_header_code', | |
'homepage_footer_code', | |
'homepage_header_code' | |
]; | |
// Check if the field is in the list of allowed fields | |
if (in_array($atts['field'], $allowed_fields)) { | |
return true; | |
} | |
// Return the default allowed state if not in the allowed fields | |
return $allowed; | |
}, 10, 2); | |
/*** ACF 6.2.5 Security Fix | |
@link https://wpfieldwork.com/diving-into-acfs-latest-security-release/ | |
–––––––––––––––––––––––––––––––––––––––––––––––––– ***/ | |
add_filter('acf/shortcode/allow_unsafe_html', function ($allowed, $atts) { | |
// Array of field names that allow unsafe HTML | |
$allowed_fields = [ | |
'hide-header-navigation', | |
'hide-footer', | |
'show-notification-bar-link', | |
'notification-bar-link' | |
]; | |
// Check if the field is in the list of allowed fields | |
if (in_array($atts['field'], $allowed_fields)) { | |
return true; | |
} | |
// Return the default allowed state if not in the allowed fields | |
return $allowed; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment