Changeset 13405 for trunk/src/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 01/19/2023 01:07:13 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r13395 r13405 347 347 * @param bool $no_activity Optional. Whether to skip recording an activity 348 348 * item about this blog creation. Default: false. 349 * @return false|null Returns false on failure.350 349 */ 351 350 function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { … … 357 356 // If blog is not recordable, do not record the activity. 358 357 if ( ! bp_blogs_is_blog_recordable( $blog_id, $user_id ) ) { 359 return false;358 return; 360 359 } 361 360 … … 721 720 * @param array $activity_args Array of activity arguments. 722 721 * @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.724 722 */ 725 723 function bp_blogs_comment_sync_activity_comment( &$activity_id, $comment = null, $activity_args = array(), $activity_post_object = null ) { 726 724 if ( empty( $activity_args ) || empty( $comment->post->ID ) || empty( $activity_post_object->comment_action_id ) ) { 727 return false;725 return; 728 726 } 729 727 … … 749 747 } 750 748 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 ); 754 750 755 751 if ( isset( $activity_post_object->action_id ) && isset( $activity_post_object->component_id ) ) { … … 831 827 832 828 if ( 'new_blog_comment' === $activity_post_object->comment_action_id ) { 829 833 830 /** 834 831 * Fires after BuddyPress has recorded metadata about a published blog post comment. … … 836 833 * @since 2.5.0 837 834 * 838 * @param int $valueComment ID of the blog post comment being recorded.839 * @param WP_ Post $postWP_Comment object for the current blog post.840 * @param string $valueID 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. 841 838 */ 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() ); 843 840 } 844 841 … … 861 858 * @param string|bool $role User's WordPress role for this blog ID. 862 859 * @param int $blog_id Blog ID user is being added to. 863 * @return false|null False on failure.864 860 */ 865 861 function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) { … … 918 914 * @since 2.1.0 919 915 * 920 * @return string916 * @return array 921 917 */ 922 918 function bp_blogs_get_allowed_roles() { … … 927 923 * @since 2.1.0 928 924 * 929 * @param array $ value Array of potential roles user needs.925 * @param array $roles Array of allowed roles. 930 926 */ 931 927 return apply_filters( 'bp_blogs_get_allowed_roles', array( 'contributor', 'author', 'editor', 'administrator' ) ); … … 1045 1041 * @param object $activity_post_object The post type tracking args object. 1046 1042 * @param string $activity_type The post type comment activity type. 1047 *1048 * @return bool True on success. False on error.1049 1043 */ 1050 1044 function bp_blogs_post_type_remove_comment( $deleted, $comment_id, $activity_post_object, $activity_type = '' ) { … … 1097 1091 * @since 1.0.0 1098 1092 * 1099 * @param int $ valueID for the blog associated with the removed comment.1093 * @param int $blog_id ID for the blog associated with the removed comment. 1100 1094 * @param int $comment_id ID of the comment being removed. 1101 * @param int $ valueID of the current logged in user.1095 * @param int $user_id ID of the current logged in user. 1102 1096 */ 1103 1097 do_action( 'bp_blogs_remove_comment', get_current_blog_id(), $comment_id, bp_loggedin_user_id() ); … … 1416 1410 * 1417 1411 * @param int $user_id ID whose blog data should be removed. 1418 * @return bool Returns false on failure.1419 1412 */ 1420 1413 function bp_blogs_remove_data( $user_id ) { 1421 if ( !is_multisite() ) 1422 return false; 1414 if ( ! is_multisite() ) { 1415 return; 1416 } 1423 1417 1424 1418 /**
Note: See TracChangeset
for help on using the changeset viewer.