Comments: Remove a one-time variable in `wp_rel_nofollow()` and `wp_rel_ugc()`.
See #48022. git-svn-id: https://develop.svn.wordpress.org/trunk@46396 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
56b6b1e803
commit
0200a429c7
|
@ -3063,13 +3063,12 @@ function wp_rel_callback( $matches, $rel ) {
|
||||||
* @return string Converted content.
|
* @return string Converted content.
|
||||||
*/
|
*/
|
||||||
function wp_rel_nofollow( $text ) {
|
function wp_rel_nofollow( $text ) {
|
||||||
// This is a pre save filter, so text is already escaped.
|
// This is a pre-save filter, so text is already escaped.
|
||||||
$text = stripslashes( $text );
|
$text = stripslashes( $text );
|
||||||
$rel = 'nofollow';
|
|
||||||
$text = preg_replace_callback(
|
$text = preg_replace_callback(
|
||||||
'|<a (.+?)>|i',
|
'|<a (.+?)>|i',
|
||||||
function( $matches ) use ( $rel ) {
|
function( $matches ) {
|
||||||
return wp_rel_callback( $matches, $rel );
|
return wp_rel_callback( $matches, 'nofollow' );
|
||||||
},
|
},
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
@ -3098,13 +3097,12 @@ function wp_rel_nofollow_callback( $matches ) {
|
||||||
* @return string Converted content.
|
* @return string Converted content.
|
||||||
*/
|
*/
|
||||||
function wp_rel_ugc( $text ) {
|
function wp_rel_ugc( $text ) {
|
||||||
// This is a pre save filter, so text is already escaped.
|
// This is a pre-save filter, so text is already escaped.
|
||||||
$text = stripslashes( $text );
|
$text = stripslashes( $text );
|
||||||
$rel = 'nofollow ugc';
|
|
||||||
$text = preg_replace_callback(
|
$text = preg_replace_callback(
|
||||||
'|<a (.+?)>|i',
|
'|<a (.+?)>|i',
|
||||||
function( $matches ) use ( $rel ) {
|
function( $matches ) {
|
||||||
return wp_rel_callback( $matches, $rel );
|
return wp_rel_callback( $matches, 'nofollow ugc' );
|
||||||
},
|
},
|
||||||
$text
|
$text
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue