Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/06/2011 12:30:01 PM (15 years ago)
Author:
boonebgorges
Message:

Adds PHPDoc throughout the activity component. References #2345. Turbo props cnorris23

File:
1 edited

Legend:

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

    r4989 r5109  
    11<?php
     2
     3/**
     4 * The Activity filters
     5 *
     6 * @package BuddyPress
     7 * @subpackage ActivityFilters
     8 */
     9
    210// Exit if accessed directly
    311if ( !defined( 'ABSPATH' ) ) exit;
     
    8088add_filter( 'bp_get_activity_parent_content',        'bp_create_excerpt' );
    8189
     90/**
     91 * Custom kses filtering for activity content
     92 *
     93 * @since 1.1.0
     94 *
     95 * @param string $content The activity content
     96 *
     97 * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook.
     98 * @uses wp_kses()
     99 *
     100 * @return string $content Filtered activity content
     101 */
    82102function bp_activity_filter_kses( $content ) {
    83103    global $allowedtags;
     
    110130 * Finds and links @-mentioned users in the contents of activity items
    111131 *
    112  * @package BuddyPress Activity
     132 * @since 1.2.0
    113133 *
    114134 * @param string $content The activity content
    115  * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id,
    116  *   which will be added to the list of the user's unread mentions
     135 * @param int $activity_id The activity id
     136 *
     137 * @uses bp_activity_find_mentions()
     138 * @uses bp_is_username_compatibility_mode()
     139 * @uses bp_core_get_userid_from_nicename()
     140 * @uses bp_activity_at_message_notification()
     141 * @uses bp_core_get_user_domain()
     142 * @uses bp_activity_adjust_mention_count()
     143 *
     144 * @return string $content Content filtered for mentions
    117145 */
    118146function bp_activity_at_name_filter( $content, $activity_id = 0 ) {
     
    146174 * Catch mentions in saved activity items
    147175 *
    148  * @package BuddyPress
    149  * @since 1.5
     176 * @since 1.5.0
    150177 *
    151178 * @param obj $activity
     179 *
     180 * @uses remove_filter() To remove the 'bp_activity_at_name_filter_updates' hook.
     181 * @uses bp_activity_at_name_filter()
     182 * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity}
    152183 */
    153184function bp_activity_at_name_filter_updates( $activity ) {
     
    163194add_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' );
    164195
     196/**
     197 * Catches links in activity text so rel=nofollow can be added
     198 *
     199 * @since 1.2.0
     200 *
     201 * @param string $text Activity text
     202 *
     203 * @return string $text Text with rel=nofollow added to any links
     204 */
    165205function bp_activity_make_nofollow_filter( $text ) {
    166206    return preg_replace_callback( '|<a (.+?)>|i', 'bp_activity_make_nofollow_filter_callback', $text );
    167207}
     208
     209    /**
     210     * Adds rel=nofollow to a link
     211     *
     212     * @since 1.2.0
     213     *
     214     * @param array $matches
     215     *
     216     * @return string $text Link with rel=nofollow added
     217     */
    168218    function bp_activity_make_nofollow_filter_callback( $matches ) {
    169219        $text = $matches[1];
     
    175225 * Truncates long activity entries when viewed in activity streams
    176226 *
    177  * @package BuddyPress Activity
    178  * @since 1.5
     227 * @since 1.5.0
     228 *
    179229 * @param $text The original activity entry text
    180  * @return $excerpt The truncated text
     230 *
     231 * @uses bp_is_single_activity()
     232 * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook
     233 * @uses apply_filters() To call the 'bp_activity_excerpt_length' hook
     234 * @uses bp_create_excerpt()
     235 * @uses bp_get_activity_id()
     236 * @uses bp_get_activity_thread_permalink()
     237 * @uses apply_filters() To call the 'bp_activity_truncate_entry' hook
     238 *
     239 * @return string $excerpt The truncated text
    181240 */
    182241function bp_activity_truncate_entry( $text ) {
     
    206265add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
    207266add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
     267
    208268?>
Note: See TracChangeset for help on using the changeset viewer.