Skip to:
Content

BuddyPress.org

Changeset 9111


Ignore:
Timestamp:
10/30/2014 11:56:28 PM (12 years ago)
Author:
boonebgorges
Message:

Hook documentation for bp-activity-filters.php.

Props tw2113.
See #5938.

File:
1 edited

Legend:

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

    r9050 r9111  
    114114 * Types of activity stream items to moderate.
    115115 *
    116  * @since BuddyPress (1.6)
     116 * @since BuddyPress (1.6.0)
    117117 *
    118118 * @return array $types List of the activity types to moderate.
     
    123123                'activity_update'
    124124        );
     125
     126        /**
     127         * Filters the default activity types that BuddyPress should moderate.
     128         *
     129         * @since BuddyPress (1.6.0)
     130         *
     131         * @param array $types Default activity types to moderate.
     132         */
    125133        return apply_filters( 'bp_activity_check_activity_types', $types );
    126134}
     
    129137 * Moderate the posted activity item, if it contains moderate keywords.
    130138 *
    131  * @since BuddyPress (1.6)
     139 * @since BuddyPress (1.6.0)
    132140 *
    133141 * @param BP_Activity_Activity $activity The activity object to check.
     
    148156 * Mark the posted activity as spam, if it contains blacklist keywords.
    149157 *
    150  * @since BuddyPress (1.6)
     158 * @since BuddyPress (1.6.0)
    151159 *
    152160 * @param BP_Activity_Activity $activity The activity object to check.
     
    166174 * Custom kses filtering for activity content.
    167175 *
    168  * @since BuddyPress (1.1)
     176 * @since BuddyPress (1.1.0)
    169177 *
    170178 * @uses apply_filters() To call the 'bp_activity_allowed_tags' hook.
     
    197205
    198206
     207        /**
     208         * Filters the allowed HTML tags for BuddyPress Activity content.
     209         *
     210         * @since BuddyPress (1.2.0)
     211         *
     212         * @param array Array of allowed HTML tags and attributes.
     213         */
    199214        $activity_allowedtags = apply_filters( 'bp_activity_allowed_tags', $activity_allowedtags );
    200215        return wp_kses( $content, $activity_allowedtags );
     
    262277 * hook to send mention notifications after the activity item is saved.
    263278 *
    264  * @since BuddyPress (1.5)
     279 * @since BuddyPress (1.5.0)
    265280 *
    266281 * @uses bp_activity_find_mentions()
     
    299314 * Sends emails and BP notifications for users @-mentioned in an activity item.
    300315 *
    301  * @since BuddyPress (1.7)
     316 * @since BuddyPress (1.7.0)
    302317 *
    303318 * @uses bp_activity_at_message_notification()
     
    324339        // Send @mentions and setup BP notifications
    325340        foreach( (array) $usernames as $user_id => $username ) {
    326                 // If you want to disable notifications, you can use this filter to stop email sending
     341                /**
     342                 * Filters BuddyPress' ability to send email notifications for @mentions.
     343                 *
     344                 * @since BuddyPress (1.6.0)
     345                 *
     346                 * @param bool  Whether or not BuddyPress should send a notification to the mentioned users.
     347                 * @param array $usernames Array of users potentially notified.
     348                 */
    327349                if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames ) ) {
    328350                        bp_activity_at_message_notification( $activity->id, $user_id );
     
    337359 * Catch links in activity text so rel=nofollow can be added.
    338360 *
    339  * @since BuddyPress (1.2)
     361 * @since BuddyPress (1.2.0)
    340362 *
    341363 * @param string $text Activity text.
     
    349371         * Add rel=nofollow to a link.
    350372         *
    351          * @since BuddyPress (1.2)
     373         * @since BuddyPress (1.2.0)
    352374         *
    353375         * @param array $matches
     
    365387 * Truncate long activity entries when viewed in activity streams.
    366388 *
    367  * @since BuddyPress (1.5)
     389 * @since BuddyPress (1.5.0)
    368390 *
    369391 * @uses bp_is_single_activity()
     
    385407                return $text;
    386408
     409        /**
     410         * Filters the appended text for the activity excerpt.
     411         *
     412         * @since BuddyPress (1.5.0)
     413         *
     414         * @param string $read_more Internationalized "Read more" text.
     415         */
    387416        $append_text    = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
     417
     418        /**
     419         * Filters the excerpt length for the activity excerpt.
     420         *
     421         * @since BuddyPress (1.5.0)
     422         *
     423         * @param int $excerpt_length Number indicating how many words to trim the excerpt down to.
     424         */
    388425        $excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
    389426
     
    401438        }
    402439
     440        /**
     441         * Filters the composite activity excerpt entry.
     442         *
     443         * @since BuddyPress (1.5.0)
     444         *
     445         * @param string $excerpt Excerpt text and markup to be displayed.
     446         * @param string $text The original activity entry text.
     447         * @param string $append_text The final append text applied.
     448         */
    403449        return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
    404450}
     
    553599        $global_pulse = 0;
    554600
    555         // Check whether the global heartbeat settings already exist.
     601        /**
     602         * Filter that checks whether the global heartbeat settings already exist.
     603         *
     604         * @since BuddyPress (2.0.0)
     605         *
     606         * @param array $settings Heartbeat settings array.
     607         */
    556608        $heartbeat_settings = apply_filters( 'heartbeat_settings', array() );
    557609        if ( ! empty( $heartbeat_settings['interval'] ) ) {
     
    560612        }
    561613
    562         // Filter here to specify a BP-specific pulse frequency
     614        /**
     615         * Filters the pulse frequency to be used for the BuddyPress Activity heartbeat.
     616         *
     617         * @since BuddyPress (2.0.0)
     618         *
     619         * @param int $frequency The frequency in seconds between pulses.
     620         */
    563621        $bp_activity_pulse = apply_filters( 'bp_activity_heartbeat_pulse', 15 );
    564622
Note: See TracChangeset for help on using the changeset viewer.