Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2023 01:07:13 AM (16 months ago)
Author:
espellcaste
Message:

Adding PHPDoc Improvements to the Blogs (component) files.

Props imath

Closes https://github.com/buddypress/buddypress/pull/56
See #8553

File:
1 edited

Legend:

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

    r13395 r13405  
    347347 * @param bool $no_activity Optional. Whether to skip recording an activity
    348348 *                          item about this blog creation. Default: false.
    349  * @return false|null Returns false on failure.
    350349 */
    351350function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
     
    357356    // If blog is not recordable, do not record the activity.
    358357    if ( ! bp_blogs_is_blog_recordable( $blog_id, $user_id ) ) {
    359         return false;
     358        return;
    360359    }
    361360
     
    721720 * @param  array           $activity_args        Array of activity arguments.
    722721 * @param  object|null     $activity_post_object The post type tracking args object.
    723  * @return WP_Error|bool|int Returns false if no activity, the activity id otherwise.
    724722 */
    725723function bp_blogs_comment_sync_activity_comment( &$activity_id, $comment = null, $activity_args = array(), $activity_post_object = null ) {
    726724    if ( empty( $activity_args ) || empty( $comment->post->ID ) || empty( $activity_post_object->comment_action_id ) ) {
    727         return false;
     725        return;
    728726    }
    729727
     
    749747        }
    750748
    751         if ( empty( $activity_post_object ) ) {
    752             $activity_post_object = bp_activity_get_post_type_tracking_args( $comment->post->post_type );
    753         }
     749        $activity_post_object = bp_activity_get_post_type_tracking_args( $comment->post->post_type );
    754750
    755751        if ( isset( $activity_post_object->action_id ) && isset( $activity_post_object->component_id ) ) {
     
    831827
    832828    if ( 'new_blog_comment' === $activity_post_object->comment_action_id ) {
     829
    833830        /**
    834831         * Fires after BuddyPress has recorded metadata about a published blog post comment.
     
    836833         * @since 2.5.0
    837834         *
    838          * @param int     $value    Comment ID of the blog post comment being recorded.
    839          * @param WP_Post $post  WP_Comment object for the current blog post.
    840          * @param string  $value ID of the user associated with the current blog post comment.
     835         * @param int        $comment_id Comment ID of the blog post comment being recorded.
     836         * @param WP_Comment $post       WP_Comment object for the current blog post.
     837         * @param int        $user_id    ID of the user associated with the current blog post comment.
    841838         */
    842         do_action( 'bp_blogs_new_blog_comment', $comment->comment_ID, $comment, bp_loggedin_user_id() );
     839        do_action( 'bp_blogs_new_blog_comment', (int) $comment->comment_ID, $comment, bp_loggedin_user_id() );
    843840    }
    844841
     
    861858 * @param string|bool $role    User's WordPress role for this blog ID.
    862859 * @param int         $blog_id Blog ID user is being added to.
    863  * @return false|null False on failure.
    864860 */
    865861function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
     
    918914 * @since 2.1.0
    919915 *
    920  * @return string
     916 * @return array
    921917 */
    922918function bp_blogs_get_allowed_roles() {
     
    927923     * @since 2.1.0
    928924     *
    929      * @param array $value Array of potential roles user needs.
     925     * @param array $roles Array of allowed roles.
    930926     */
    931927    return apply_filters( 'bp_blogs_get_allowed_roles', array( 'contributor', 'author', 'editor', 'administrator' ) );
     
    10451041 * @param object $activity_post_object The post type tracking args object.
    10461042 * @param string $activity_type        The post type comment activity type.
    1047  *
    1048  * @return bool True on success. False on error.
    10491043 */
    10501044function bp_blogs_post_type_remove_comment( $deleted, $comment_id, $activity_post_object, $activity_type = '' ) {
     
    10971091         * @since 1.0.0
    10981092         *
    1099          * @param int $value      ID for the blog associated with the removed comment.
     1093         * @param int $blog_id    ID for the blog associated with the removed comment.
    11001094         * @param int $comment_id ID of the comment being removed.
    1101          * @param int $value      ID of the current logged in user.
     1095         * @param int $user_id    ID of the current logged in user.
    11021096         */
    11031097        do_action( 'bp_blogs_remove_comment', get_current_blog_id(), $comment_id, bp_loggedin_user_id() );
     
    14161410 *
    14171411 * @param int $user_id ID whose blog data should be removed.
    1418  * @return bool Returns false on failure.
    14191412 */
    14201413function bp_blogs_remove_data( $user_id ) {
    1421     if ( !is_multisite() )
    1422         return false;
     1414    if ( ! is_multisite() ) {
     1415        return;
     1416    }
    14231417
    14241418    /**
Note: See TracChangeset for help on using the changeset viewer.