Changeset 31789 for trunk/src/wp-includes/formatting.php
- Timestamp:
- 03/16/2015 01:42:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r31786 r31789 4058 4058 /** 4059 4059 * Convert any 4 byte emoji in a string to their equivalent HTML entity. 4060 * 4060 4061 * Currently, only Unicode 7 emoji are supported. Unicode 8 emoji will be added 4061 4062 * when the spec in finalised, along with the new skin-tone modifiers. … … 4104 4105 4105 4106 /** 4106 * Convert emoji to a static <img> link.4107 * Convert emoji to a static img element. 4107 4108 * 4108 4109 * @since 4.2.0 … … 4120 4121 /** This filter is documented in wp-includes/script-loader.php */ 4121 4122 $cdn_url = apply_filters( 'emoji_url', '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72/' ); 4123 4122 4124 /** This filter is documented in wp-includes/script-loader.php */ 4123 4125 $ext = apply_filters( 'emoji_ext', '.png' ); 4124 4126 4125 4127 $output = ''; 4126 // HTML loop taken from smiley function, which was taking from texturize function. It'll never be consolidated. 4127 $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between 4128 $stop = count( $textarr );// loop stuff 4129 4130 // Ignore proessing of specific tags 4128 /* 4129 * HTML loop taken from smiley function, which was taking from texturize function. 4130 * It'll never be consolidated. 4131 * 4132 * First, capture the tags as well as in between. 4133 */ 4134 $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); 4135 $stop = count( $textarr ); 4136 4137 // Ignore processing of specific tags. 4131 4138 $tags_to_ignore = 'code|pre|style|script|textarea'; 4132 4139 $ignore_block_element = ''; … … 4135 4142 $content = $textarr[$i]; 4136 4143 4137 // If we're in an ignore block, wait until we find its closing tag 4144 // If we're in an ignore block, wait until we find its closing tag. 4138 4145 if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) { 4139 4146 $ignore_block_element = $matches[1]; 4140 4147 } 4141 4148 4142 // If it's not a tag and not in ignore block 4149 // If it's not a tag and not in ignore block. 4143 4150 if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) { 4144 4151 $matches = array(); … … 4172 4179 } 4173 4180 4174 // did we exit ignore block4181 // Did we exit ignore block. 4175 4182 if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) { 4176 4183 $ignore_block_element = ''; … … 4186 4193 * Convert emoji in emails into static images. 4187 4194 * 4195 * @since 4.2.0 4196 * 4188 4197 * @param array $mail The email data array. 4189 *4190 4198 * @return array The email data array, with emoji in the message staticized. 4191 4199 */
Note: See TracChangeset
for help on using the changeset viewer.