ACF_Admin::maybe_show_escaped_html_notice
Notifies the user that fields rendered via shortcode or the_field() have had HTML removed/altered due to unsafe HTML being escaped.
Method of the class: ACF_Admin{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$ACF_Admin = new ACF_Admin(); $ACF_Admin->maybe_show_escaped_html_notice();
Changelog
| Since 6.2.5 | Introduced. |
ACF_Admin::maybe_show_escaped_html_notice() ACF Admin::maybe show escaped html notice code ACF 6.8.8
public function maybe_show_escaped_html_notice() {
// Only show to editors and above.
if ( ! current_user_can( 'edit_others_posts' ) ) {
return;
}
// Allow opting-out of the notice.
if ( apply_filters( 'acf/admin/prevent_escaped_html_notice', true ) ) {
return;
}
if ( get_option( 'acf_escaped_html_notice_dismissed' ) ) {
return;
}
$escaped = _acf_get_escaped_html_log();
// Notice for when HTML has already been escaped.
if ( ! empty( $escaped ) ) {
acf_get_view( 'escaped-html-notice', array( 'acf_escaped' => $escaped ) );
}
}