Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/05/2025 02:27:53 AM (6 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: docs & code formatting improvements.

Props johnjamesjacoby, noruzzaman.

Fixes #3659.

File:
1 edited

Legend:

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

    r7378 r7380  
    22
    33/**
    4  * bbPress BuddyPress Activity Class
     4 * bbPress BuddyPress Activity Class.
    55 *
    66 * @package bbPress
     
    1313if ( ! class_exists( 'BBP_BuddyPress_Activity' ) ) :
    1414/**
    15  * Loads BuddyPress Activity extension
     15 * Loads BuddyPress Activity extension.
    1616 *
    1717 * @since 2.0.0 bbPress (r3395)
     
    2525
    2626    /**
    27      * The name of the BuddyPress component, used in activity streams
     27     * The name of the BuddyPress component, used in activity streams.
    2828     *
    2929     * @var string
     
    3232
    3333    /**
    34      * Forum Create Activity Action
     34     * Forum Create Activity Action.
    3535     *
    3636     * @var string
     
    3939
    4040    /**
    41      * Topic Create Activity Action
     41     * Topic Create Activity Action.
    4242     *
    4343     * @var string
     
    4646
    4747    /**
    48      * Topic Close Activity Action
     48     * Topic Close Activity Action.
    4949     *
    5050     * @var string
     
    5353
    5454    /**
    55      * Topic Edit Activity Action
     55     * Topic Edit Activity Action.
    5656     *
    5757     * @var string
     
    6060
    6161    /**
    62      * Topic Open Activity Action
     62     * Topic Open Activity Action.
    6363     *
    6464     * @var string
     
    6767
    6868    /**
    69      * Reply Create Activity Action
     69     * Reply Create Activity Action.
    7070     *
    7171     * @var string
     
    7474
    7575    /**
    76      * Reply Edit Activity Action
     76     * Reply Edit Activity Action.
    7777     *
    7878     * @var string
     
    8383
    8484    /**
    85      * The bbPress BuddyPress Activity loader
     85     * The bbPress BuddyPress Activity loader.
    8686     *
    8787     * @since 2.0.0 bbPress (r3395)
     
    9595
    9696    /**
    97      * Extension variables
     97     * Extension variables.
    9898     *
    9999     * @since 2.0.0 bbPress (r3395)
     
    121121
    122122    /**
    123      * Setup the actions
     123     * Setup the actions.
    124124     *
    125125     * @since 2.0.0 bbPress (r3395)
     
    146146
    147147    /**
    148      * Setup the filters
     148     * Setup the filters.
    149149     *
    150150     * @since 2.0.0 bbPress (r3395)
     
    174174
    175175    /**
    176      * Register our activity actions with BuddyPress
     176     * Register our activity actions with BuddyPress.
    177177     *
    178178     * @since 2.0.0 bbPress (r3395)
     
    202202
    203203    /**
    204      * Wrapper for recoding bbPress actions to the BuddyPress activity stream
    205      *
    206      * @since 2.0.0 bbPress (r3395)
    207      *
    208      * @param  array $args Array of arguments for bp_activity_add()
    209      *
    210      * @return int   Activity ID if successful, false if not
     204     * Wrapper for recoding bbPress actions to the BuddyPress activity stream.
     205     *
     206     * @since 2.0.0 bbPress (r3395)
     207     *
     208     * @param  array $args Array of arguments for bp_activity_add().
     209     *
     210     * @return int   Activity ID if successful, false if not.
    211211     */
    212212    private function record_activity( $args = array() ) {
     
    236236
    237237    /**
    238      * Wrapper for deleting bbPress actions from BuddyPress activity stream
    239      *
    240      * @since 2.0.0 bbPress (r3395)
    241      *
    242      * @param  array $args Array of arguments for bp_activity_add()
    243      *
    244      * @return int   Activity ID if successful, false if not
     238     * Wrapper for deleting bbPress actions from BuddyPress activity stream.
     239     *
     240     * @since 2.0.0 bbPress (r3395)
     241     *
     242     * @param  array $args Array of arguments for bp_activity_add().
     243     *
     244     * @return int   Activity ID if successful, false if not.
    245245     */
    246246    public function delete_activity( $args = array() ) {
     
    264264
    265265    /**
    266      * Check for an existing activity stream entry for a given post_id
    267      *
    268      * @param int $post_id ID of the topic or reply
    269      * @return int if an activity id is verified, false if not
     266     * Check for an existing activity stream entry for a given post_id.
     267     *
     268     * @param int $post_id ID of the topic or reply.
     269     * @return int if an activity id is verified, false if not.
    270270     */
    271271    private static function get_activity_id( $post_id = 0 ) {
     
    290290
    291291    /**
    292      * Maybe disable activity stream comments on select actions
     292     * Maybe disable activity stream comments on select actions.
    293293     *
    294294     * @since 2.0.0 bbPress (r3399)
     
    328328
    329329    /**
    330      * Maybe link directly to topics and replies in activity stream entries
     330     * Maybe link directly to topics and replies in activity stream entries.
    331331     *
    332332     * @since 2.0.0 bbPress (r3399)
     
    334334     * @param string $link
    335335     * @param mixed $activity_object
    336      * @return string The link to the activity stream item
     336     * @return string The link to the activity stream item.
    337337     */
    338338    public function activity_get_permalink( $link = '', $activity_object = false ) {
     
    355355
    356356    /**
    357      * Record an activity stream entry when a topic is created or updated
     357     * Record an activity stream entry when a topic is created or updated.
    358358     *
    359359     * @since 2.0.0 bbPress (r3395)
     
    363363     * @param array $anonymous_data
    364364     * @param int $topic_author_id
    365      * @return Bail early if topic is by anonymous user
     365     * @return Bail early if topic is by anonymous user.
    366366     */
    367367    public function topic_create( $topic_id = 0, $forum_id = 0, $anonymous_data = array(), $topic_author_id = 0 ) {
     
    440440
    441441    /**
    442      * Delete the activity stream entry when a topic is spammed, trashed, or deleted
     442     * Delete the activity stream entry when a topic is spammed, trashed, or deleted.
    443443     *
    444444     * @param int $topic_id
     
    456456
    457457    /**
    458      * Update the activity stream entry when a topic status changes
     458     * Update the activity stream entry when a topic status changes.
    459459     *
    460460     * @param int $topic_id
    461461     * @param obj $post
    462      * @return Bail early if not a topic, or topic is by anonymous user
     462     * @return Bail early if not a topic, or topic is by anonymous user.
    463463     */
    464464    public function topic_update( $topic_id = 0, $post = null ) {
     
    497497
    498498    /**
    499      * Record an activity stream entry when a reply is created
     499     * Record an activity stream entry when a reply is created.
    500500     *
    501501     * @since 2.0.0 bbPress (r3395)
     
    505505     * @param array $anonymous_data
    506506     * @param int $topic_author_id
    507      * @return Bail early if topic is by anonymous user
     507     * @return Bail early if topic is by anonymous user.
    508508     */
    509509    public function reply_create( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = array(), $reply_author_id = 0 ) {
     
    586586
    587587    /**
    588      * Delete the activity stream entry when a reply is spammed, trashed, or deleted
     588     * Delete the activity stream entry when a reply is spammed, trashed, or deleted.
    589589     *
    590590     * @param int $reply_id
     
    602602
    603603    /**
    604      * Update the activity stream entry when a reply status changes
     604     * Update the activity stream entry when a reply status changes.
    605605     *
    606606     * @param int $reply_id
    607607     * @param obj $post
    608      * @return Bail early if not a reply, or reply is by anonymous user
     608     * @return Bail early if not a reply, or reply is by anonymous user.
    609609     */
    610610    public function reply_update( $reply_id, $post ) {
Note: See TracChangeset for help on using the changeset viewer.