Skip to:
Content

BuddyPress.org

Changeset 12756


Ignore:
Timestamp:
10/15/2020 08:36:27 PM (8 months ago)
Author:
imath
Message:

Activity: adds the ugc rel attribute to activity item links

Props vapvarun

Fixes #8326

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-filters.php

    r12745 r12756  
    375375
    376376    /**
    377      * Add rel=nofollow to a link.
    378      *
    379      * @since 1.2.0
     377     * Adds `rel="nofollow ugc"` to a link.
     378     *
     379     * @since 1.2.0 Adds the nofollow rel attribute.
     380     * @since 7.0.0 Adds the ugc rel attribute.
    380381     *
    381382     * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter().
     
    384385    function bp_activity_make_nofollow_filter_callback( $matches ) {
    385386        $text = $matches[1];
    386         $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
    387         return "<a $text rel=\"nofollow\">";
     387
     388        // The WP `make_clickable()` formatting function is adding the rel="nofollow" attribute.
     389        $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'" ), '', $text );
     390        return "<a $text rel=\"nofollow ugc\">";
    388391    }
    389392
Note: See TracChangeset for help on using the changeset viewer.