print_emoji_styles()WP 4.2.0

Deprecated since 6.4.0. It is no longer supported and may be removed in future releases. Use wp_enqueue_emoji_styles() instead.

Outputs important styles related to the loading of emoji.

The function print_emoji_styles() is hooked to the default events that are triggered in the file wp-includes/default-filters.php:

add_action( 'wp_print_styles', 'print_emoji_styles' );
add_action( 'admin_print_styles', 'print_emoji_styles' );

This means that these styles can be disabled. To disable the output of additional emoji styles, you need to remove the hooks:

remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
1 time — 0.000013 sec (very fast) | 50000 times — 0.01 sec (speed of light)

No Hooks.

Returns

null. Nothing. Outputs HTML to the screen.

Usage

print_emoji_styles();

Examples

0

#1 Demo

print_emoji_styles()

Retrieve:

<style type="text/css">
img.wp-smiley,
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 .07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;
}
</style>

Changelog

Since 4.2.0 Introduced.
Deprecated since 6.4.0 Use wp_enqueue_emoji_styles() instead.

print_emoji_styles() code WP 6.8.3

<?php
function print_emoji_styles() {
	_deprecated_function( __FUNCTION__, '6.4.0', 'wp_enqueue_emoji_styles' );
	static $printed = false;

	if ( $printed ) {
		return;
	}

	$printed = true;

	$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
	?>
	<style<?php echo $type_attr; ?>>
	img.wp-smiley,
	img.emoji {
		display: inline !important;
		border: none !important;
		box-shadow: none !important;
		height: 1em !important;
		width: 1em !important;
		margin: 0 0.07em !important;
		vertical-align: -0.1em !important;
		background: none !important;
		padding: 0 !important;
	}
	</style>
	<?php
}