Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



_wp_staticize_emoji ›

Seit4.8.1
Veraltetn/v
_wp_staticize_emoji ( $matches )
Zugriff:
  • private
Parameter:
  • (array) $matches The matched data.
    Erforderlich: Ja
Siehe:
Gibt zurück:
  • (string) HTML for the static emoji image.
Definiert in:
Codex:

Callback for wp_staticize_emoji() to turn matched emoji glyphs into images.



Quellcode

function _wp_staticize_emoji( $matches ) {
	static $cdn_url;
	if ( ! $cdn_url ) {
		/** This filter is documented in wp-includes/formatting.php */
		$cdn_url = apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/2.3/72x72/' );
	}

	static $ext;
	if ( ! $ext ) {
		/** This filter is documented in wp-includes/formatting.php */
		$ext = apply_filters( 'emoji_ext', '.png' );
	}

	$char = str_replace( ';&#x', '-', $matches[1] );
	$char = str_replace( array( '&#x', ';'), '', $char );

	return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $char . $ext, html_entity_decode( $matches[1] ) );
}