Title: print_emoji_detection_script
Published: April 23, 2015
Last modified: August 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(): 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' );
    		}
    	}
    }
    ```

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

## 󠀁[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.

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

Determines whether the current request is for an administrative interface page.

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

Adds a callback function to an action hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/print_emoji_detection_script/?output_format=md#)

## 󠀁[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.