From 62b51d8c0b09e8d6e1d709c0702ad3608cc9421f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 20 Apr 2015 04:14:32 +0000 Subject: [PATCH] Clean up wp_staticize_emoji() and friends. * DOMDocument was removed in [31752] but not the check. * wp_staticize_emoji() has never accepted a second arg; remove it from calls. * Remove wp_staticize_emoji_for_feeds(), no need for it. * Remove _ and @ignore from wp_staticize_emoji_for_email(), no need for it. see #31242. git-svn-id: https://develop.svn.wordpress.org/trunk@32161 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-filters.php | 6 +++--- src/wp-includes/feed.php | 13 ------------- src/wp-includes/formatting.php | 9 ++------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index ad0f47b69a..b64869ec91 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -160,19 +160,19 @@ add_filter( 'the_title_rss', 'strip_tags' ); add_filter( 'the_title_rss', 'ent2ncr', 8 ); add_filter( 'the_title_rss', 'esc_html' ); add_filter( 'the_content_rss', 'ent2ncr', 8 ); -add_filter( 'the_content_feed', '_wp_staticize_emoji_for_feeds' ); +add_filter( 'the_content_feed', 'wp_staticize_emoji' ); add_filter( 'the_excerpt_rss', 'convert_chars' ); add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); add_filter( 'comment_author_rss', 'ent2ncr', 8 ); add_filter( 'comment_text_rss', 'ent2ncr', 8 ); add_filter( 'comment_text_rss', 'esc_html' ); -add_filter( 'comment_text_rss', '_wp_staticize_emoji_for_feeds' ); +add_filter( 'comment_text_rss', 'wp_staticize_emoji' ); add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); add_filter( 'the_author', 'ent2ncr', 8 ); add_filter( 'the_guid', 'esc_url' ); // Email filters -add_filter( 'wp_mail', '_wp_staticize_emoji_for_email' ); +add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); // Misc filters add_filter( 'option_ping_sites', 'privacy_ping_filter' ); diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php index dc26188d12..8638554146 100644 --- a/src/wp-includes/feed.php +++ b/src/wp-includes/feed.php @@ -649,16 +649,3 @@ function fetch_feed( $url ) { return $feed; } - -/** - * Convert emoji characters in a feed into static images. - * - * @ignore - * @since 4.2.0 - * - * @param string $content The content to convert. - * @return The converted content. - */ -function _wp_staticize_emoji_for_feeds( $content ) { - return wp_staticize_emoji( $content, true ); -} diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 05301fcc38..679566b44c 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -4236,10 +4236,6 @@ function wp_encode_emoji( $content ) { function wp_staticize_emoji( $text ) { $text = wp_encode_emoji( $text ); - if ( ! class_exists( 'DOMDocument' ) ) { - return $text; - } - /** This filter is documented in wp-includes/formatting.php */ $cdn_url = apply_filters( 'emoji_url', set_url_scheme( '//s.w.org/images/core/emoji/72x72/' ) ); @@ -4314,13 +4310,12 @@ function wp_staticize_emoji( $text ) { /** * Convert emoji in emails into static images. * - * @ignore * @since 4.2.0 * * @param array $mail The email data array. * @return array The email data array, with emoji in the message staticized. */ -function _wp_staticize_emoji_for_email( $mail ) { +function wp_staticize_emoji_for_email( $mail ) { if ( ! isset( $mail['message'] ) ) { return $mail; } @@ -4373,7 +4368,7 @@ function _wp_staticize_emoji_for_email( $mail ) { $content_type = apply_filters( 'wp_mail_content_type', $content_type ); if ( 'text/html' === $content_type ) { - $mail['message'] = wp_staticize_emoji( $mail['message'], true ); + $mail['message'] = wp_staticize_emoji( $mail['message'] ); } return $mail;