Uma área de pesquisa sobre o WordPress para devs e autores do tema



_wp_staticize_emoji ›

Desde4.8.1
Obsoleton/a
_wp_staticize_emoji ( $matches )
Acesso:
  • private
Parâmetros:
  • (array) $matches The matched data.
    Required: Yes
Ver:
Retorna:
  • (string) HTML for the static emoji image.
Definido em:
Codex:

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



Fonte

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] ) );
}