Automattic\WooCommerce\Blocks\BlockTypes

Checkout::disable_wp_emojipublicWC 10.8.0

Remove WordPress emoji detection script on pages containing this block.

The wp-emoji MutationObserver converts emoji text nodes to <img> elements when React hydrates or re-renders, corrupting the DOM tree and crashing the block. The wp-exclude-emoji class on the wrapper only prevents the initial parse, not the MutationObserver, so the script must be removed entirely.

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

Хуков нет.

Возвращает

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

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

$Checkout = new Checkout();
$Checkout->disable_wp_emoji();

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

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

Код Checkout::disable_wp_emoji() WC 11.0.1

public function disable_wp_emoji() {
	if ( has_block( $this->get_full_block_name() ) ) {
		remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
		remove_action( 'wp_print_styles', 'print_emoji_styles' );
	}
}