Changeset 34277
- Timestamp:
- 09/18/2015 04:35:37 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r34222 r34277 2260 2260 function wp_rel_nofollow_callback( $matches ) { 2261 2261 $text = $matches[1]; 2262 $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); 2263 return "<a $text rel=\"nofollow\">"; 2262 $atts = shortcode_parse_atts( $matches[1] ); 2263 $rel = 'nofollow'; 2264 if ( ! empty( $atts['rel'] ) ) { 2265 $parts = array_map( 'trim', explode( ' ', $atts['rel'] ) ); 2266 if ( false === array_search( 'nofollow', $parts ) ) { 2267 $parts[] = 'nofollow'; 2268 } 2269 $rel = implode( ' ', $parts ); 2270 unset( $atts['rel'] ); 2271 2272 $html = ''; 2273 foreach ( $atts as $name => $value ) { 2274 $html .= "{$name}=\"$value\" "; 2275 } 2276 $text = trim( $html ); 2277 } 2278 return "<a $text rel=\"$rel\">"; 2264 2279 } 2265 2280
Note: See TracChangeset
for help on using the changeset viewer.