print_emoji_detection_script()

In this article

Prints the inline Emoji detection script if it is not already printed.

Source

function print_emoji_detection_script(): void {
	static $printed = false;

	if ( $printed ) {
		return;
	}

	$printed = true;

	if ( is_admin() ) {
		if ( did_action( 'admin_print_footer_scripts' ) ) {
			_print_emoji_detection_script();
		} else {
			add_action( 'admin_print_footer_scripts', '_print_emoji_detection_script' );
		}
	} else {
		if ( did_action( 'wp_print_footer_scripts' ) ) {
			_print_emoji_detection_script();
		} else {
			add_action( 'wp_print_footer_scripts', '_print_emoji_detection_script' );
		}
	}
}

Changelog

VersionDescription
4.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.