Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/09/2014 12:54:33 AM (10 years ago)
Author:
tw2113
Message:

Add hook documentation for the Blogs component

Fixes #5939

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r9194 r9218  
    284284    }
    285285
     286    /**
     287     * Fires after BuddyPress has been made aware of a new site for activity tracking.
     288     *
     289     * @since BuddyPress (1.0.0)
     290     *
     291     * @param BP_Blogs_Blog $recorded_blog Current blog being recorded. Passed by reference.
     292     * @param bool          $is_private    Whether or not the current blog being recorded is private.
     293     * @param bool          $is_recorded   Whether or not the current blog was recorded.
     294     */
    286295    do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded ) );
    287296}
     
    428437    bp_blogs_update_blogmeta( $args['item_id'], 'last_activity', bp_core_current_time() );
    429438
     439    /**
     440     * Fires after BuddyPress has recorded metadata about a published blog post.
     441     *
     442     * @since BuddyPress (1.0.0)
     443     *
     444     * @param int     $ID    ID of the blog post being recorded.
     445     * @param WP_Post $post  WP_Post object for the current blog post.
     446     * @param string  $value ID of the user associated with the current blog post.
     447     */
    430448    do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] );
    431449}
     
    791809 * first. See http://buddypress.trac.wordpress.org/ticket/3916.
    792810 *
    793  * @since BuddyPress (1.6)
     811 * @since BuddyPress (1.6.0)
    794812 * @access private
    795813 */
     
    812830
    813831    $blog_id = (int) $blog_id;
     832
     833    /**
     834     * Fires before a "blog created" item is removed from blogs
     835     * tracker and activity stream.
     836     *
     837     * @since BuddyPress (1.5.0)
     838     *
     839     * @param int $blog_id ID of the blog having its item removed.
     840     */
    814841    do_action( 'bp_blogs_before_remove_blog', $blog_id );
    815842
     
    819846    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) );
    820847
     848    /**
     849     * Fires after a "blog created" item has been removed from blogs
     850     * tracker and activity stream.
     851     *
     852     * @since BuddyPress (1.0.0)
     853     *
     854     * @param int $blog_id ID of the blog who had its item removed.
     855     */
    821856    do_action( 'bp_blogs_remove_blog', $blog_id );
    822857}
     
    835870    $user_id = (int) $user_id;
    836871
     872    /**
     873     * Fires before a blog is removed from the tracker for a specific user.
     874     *
     875     * @since BuddyPress (1.5.0)
     876     *
     877     * @param int $blog_id ID of the blog being removed.
     878     * @param int $user_id ID of the user having the blog removed for.
     879     */
    837880    do_action( 'bp_blogs_before_remove_blog_for_user', $blog_id, $user_id );
    838881
     
    846889    ) );
    847890
     891    /**
     892     * Fires after a blog has been removed from the tracker for a specific user.
     893     *
     894     * @since BuddyPress (1.0.0)
     895     *
     896     * @param int $blog_id ID of the blog that was removed.
     897     * @param int $user_id ID of the user having the blog removed for.
     898     */
    848899    do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
    849900}
     
    872923        $user_id = bp_loggedin_user_id();
    873924
     925    /**
     926     * Fires before removal of a blog post activity item from the activity stream.
     927     *
     928     * @since BuddyPress (1.5.0)
     929     *
     930     * @param int $blog_id ID of the blog associated with the post that was removed.
     931     * @param int $post_id ID of the post that was removed.
     932     * @param int $user_id ID of the user having the blog removed for.
     933     */
    874934    do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id );
    875935
     
    877937    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) );
    878938
     939    /**
     940     * Fires after removal of a blog post activity item from the activity stream.
     941     *
     942     * @since BuddyPress (1.0.0)
     943     *
     944     * @param int $blog_id ID of the blog associated with the post that was removed.
     945     * @param int $post_id ID of the post that was removed.
     946     * @param int $user_id ID of the user having the blog removed for.
     947     */
    879948    do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id );
    880949}
     
    9361005    }
    9371006
     1007    /**
     1008     * Fires after a blog comment activity item was removed from activity stream.
     1009     *
     1010     * @since BuddyPress (1.0.0)
     1011     *
     1012     * @param int $blogid     Item ID for the blog associated with the removed comment.
     1013     * @param int $comment_id ID of the comment being removed.
     1014     * @param int $value      ID of the current logged in user.
     1015     */
    9381016    do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, bp_loggedin_user_id() );
    9391017}
     
    11111189    global $bp;
    11121190
     1191    /**
     1192     * Fires before all data related to a given blog is removed from blogs tracker
     1193     * and activity stream.
     1194     *
     1195     * @since BuddyPress (1.5.0)
     1196     *
     1197     * @param int $blog_id ID of the blog whose data is being removed.
     1198     */
    11131199    do_action( 'bp_blogs_before_remove_data_for_blog', $blog_id );
    11141200
     
    11191205    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) );
    11201206
     1207    /**
     1208     * Fires after all data related to a given blog has been removed from blogs tracker
     1209     * and activity stream.
     1210     *
     1211     * @since BuddyPress (1.0.0)
     1212     *
     1213     * @param int $blog_id ID of the blog whose data is being removed.
     1214     */
    11211215    do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
    11221216}
     
    13031397        return false;
    13041398
     1399    /**
     1400     * Fires before all blog associations are removed for a given user.
     1401     *
     1402     * @since BuddyPress (1.5.0)
     1403     *
     1404     * @param int $user_id ID of the user whose blog associations are being removed.
     1405     */
    13051406    do_action( 'bp_blogs_before_remove_data', $user_id );
    13061407
     
    13081409    BP_Blogs_Blog::delete_blogs_for_user( $user_id );
    13091410
     1411    /**
     1412     * Fires after all blog associations are removed for a given user.
     1413     *
     1414     * @since BuddyPress (1.0.0)
     1415     *
     1416     * @param int $user_id ID of the user whose blog associations were removed.
     1417     */
    13101418    do_action( 'bp_blogs_remove_data', $user_id );
    13111419}
Note: See TracChangeset for help on using the changeset viewer.