Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2023 01:07:13 AM (3 years 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-activity.php

    r13342 r13405  
    1515 *
    1616 * @since 1.0.0
    17  *
    18  * @return bool|null Returns false if activity component is not active.
    1917 */
    2018function bp_blogs_register_activity_actions() {
     
    241239        restore_current_blog();
    242240
    243         if ( ! empty( $post ) && ! is_wp_error( $post ) ) {
     241        if ( ! empty( $post ) && $post instanceof WP_Post ) {
    244242            $post_url = add_query_arg( 'p', $post->ID, trailingslashit( get_home_url( $activity->item_id ) ) );
    245243            $action   = apply_filters_deprecated( 'bp_blogs_activity_new_post_action', array( $action, $post, $post_url ), '2.0.0', 'bp_blogs_format_activity_action_new_blog_post' );
     
    353351        restore_current_blog();
    354352
    355         if ( ! empty( $comment ) && ! is_wp_error( $comment ) ) {
     353        if ( ! empty( $comment ) && $comment instanceof WP_Comment ) {
    356354            $action = apply_filters_deprecated( 'bp_blogs_activity_new_comment_action', array( $action, $comment, $post_url . '#' . $activity->secondary_item_id ), '2.0.0', 'bp_blogs_format_activity_action_new_blog_comment' );
    357355        }
     
    454452         * @since 1.2.0
    455453         *
    456          * @param string $value Generated summary from content for the activity stream.
    457          * @param string $value Content for the activity stream.
    458          * @param array  $r     Array of arguments used for the activity stream item.
     454         * @param string $summary Generated summary from content for the activity stream.
     455         * @param string $content Content for the activity stream.
     456         * @param array  $r       Array of arguments used for the activity stream item.
    459457         */
    460458        $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_activity_create_summary( $r['content'], $r ), $r['content'], $r );
     
    500498    );
    501499
    502     bp_activity_delete_by_item_id( $r );
     500    return bp_activity_delete_by_item_id( $r );
    503501}
    504502
     
    615613             * @since 1.1.0
    616614             *
    617              * @param string $value Blog primary link.
    618              * @param int    $value Blog ID.
     615             * @param string $link    Blog primary link.
     616             * @param int    $blog_id Blog ID.
    619617             */
    620618            'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ),
     
    678676 * @param int $user_id Optional. Defaults to the logged-in user ID. This param
    679677 *                     is currently unused in the function (but is passed to hooks).
    680  * @return bool
    681678 */
    682679function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.