Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/29/2013 08:08:21 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Now that mentions are in bbPress core, remove the extra mention code in the BuddyPress activity extension. Fixes #2185.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/extend/buddypress/activity.php

    r4733 r4739  
    172172        // Link directly to the topic or reply
    173173        add_filter( 'bp_activity_get_permalink', array( $this, 'activity_get_permalink' ), 10, 2 );
    174 
    175         /** Mentions **********************************************************/
    176 
    177         // Convert mentions into links on create
    178         add_filter( 'bbp_new_topic_pre_content',  'bp_activity_at_name_filter' );
    179         add_filter( 'bbp_new_reply_pre_content',  'bp_activity_at_name_filter' );
    180 
    181         // Convert mentions into links on edit
    182         add_filter( 'bbp_edit_topic_pre_content', 'bp_activity_at_name_filter' );
    183         add_filter( 'bbp_edit_reply_pre_content', 'bp_activity_at_name_filter' );
    184 
    185         // Revert links into text on edit
    186         add_filter( 'bbp_get_form_topic_content', array( $this, 'strip_mentions_on_edit' ) );
    187         add_filter( 'bbp_get_form_reply_content', array( $this, 'strip_mentions_on_edit' ) );
    188174    }
    189175
     
    199185
    200186    /** Methods ***************************************************************/
    201 
    202     /**
    203      * Strip out BuddyPress activity at-name HTML on topic/reply edit
    204      *
    205      * Copied from bp_forums_strip_mentions_on_post_edit() in case forums
    206      * component is not active or is not loaded in yet.
    207      *
    208      * @since bbPress (r3475)
    209      * @param type $content Optional
    210      * @uses bp_get_root_domain()
    211      * @uses bp_get_members_root_slug()
    212      * @return string
    213      */
    214     public function strip_mentions_on_edit( $content = '' ) {
    215 
    216         // Backwards compat for members root slug
    217         if ( function_exists( 'bp_get_members_root_slug' ) ) {
    218             $members_root = bp_get_members_root_slug();
    219         } elseif ( defined( 'BP_MEMBERS_SLUG' ) ) {
    220             $members_root = BP_MEMBERS_SLUG;
    221         } else {
    222             $members_root = 'members';
    223         }
    224 
    225         $pattern = "|<a href=&#039;" . bp_get_root_domain() . "/" . $members_root . "/[A-Za-z0-9-_\.]+/&#039; rel=&#039;nofollow&#039;>(@[A-Za-z0-9-_\.@]+)</a>|";
    226         $content = preg_replace( $pattern, "$1", htmlspecialchars_decode( $content ) );
    227 
    228         return $content;
    229     }
    230187
    231188    /**
Note: See TracChangeset for help on using the changeset viewer.