ACF_Admin::maybe_show_escaped_html_noticepublicACF 6.2.5

Notifies the user that fields rendered via shortcode or the_field() have had HTML removed/altered due to unsafe HTML being escaped.

Метод класса: ACF_Admin{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

$ACF_Admin = new ACF_Admin();
$ACF_Admin->maybe_show_escaped_html_notice();

Список изменений

С версии 6.2.5 Введена.

Код ACF_Admin::maybe_show_escaped_html_notice() ACF 6.4.2

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 ) );
	}
}