Title: print_emoji_detection_script
Published: April 23, 2015
Last modified: May 20, 2026

---

# print_emoji_detection_script()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#wp--skip-link--target)

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

## 󠀁[Source](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#source)󠁿

    ```php
    function print_emoji_detection_script() {
    	static $printed = false;

    	if ( $printed ) {
    		return;
    	}

    	$printed = true;

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/formatting.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/formatting.php#L5901)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/formatting.php#L5901-L5915)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#related)󠁿

| Uses | Description | 
| [did_action()](https://developer.wordpress.org/reference/functions/did_action/)`wp-includes/plugin.php` |

Retrieves the number of times an action has been fired during the current request.

  | 
| [add_action()](https://developer.wordpress.org/reference/functions/add_action/)`wp-includes/plugin.php` |

Adds a callback function to an action hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.2.0](https://developer.wordpress.org/reference/since/4.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fprint_emoji_detection_script%2F)
before being able to contribute a note or feedback.