Changeset 13405
- Timestamp:
- 01/19/2023 01:07:13 AM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-activity.php
r13342 r13405 15 15 * 16 16 * @since 1.0.0 17 *18 * @return bool|null Returns false if activity component is not active.19 17 */ 20 18 function bp_blogs_register_activity_actions() { … … 241 239 restore_current_blog(); 242 240 243 if ( ! empty( $post ) && ! is_wp_error( $post )) {241 if ( ! empty( $post ) && $post instanceof WP_Post ) { 244 242 $post_url = add_query_arg( 'p', $post->ID, trailingslashit( get_home_url( $activity->item_id ) ) ); 245 243 $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' ); … … 353 351 restore_current_blog(); 354 352 355 if ( ! empty( $comment ) && ! is_wp_error( $comment )) {353 if ( ! empty( $comment ) && $comment instanceof WP_Comment ) { 356 354 $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' ); 357 355 } … … 454 452 * @since 1.2.0 455 453 * 456 * @param string $ valueGenerated summary from content for the activity stream.457 * @param string $ valueContent 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. 459 457 */ 460 458 $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_activity_create_summary( $r['content'], $r ), $r['content'], $r ); … … 500 498 ); 501 499 502 bp_activity_delete_by_item_id( $r );500 return bp_activity_delete_by_item_id( $r ); 503 501 } 504 502 … … 615 613 * @since 1.1.0 616 614 * 617 * @param string $ valueBlog primary link.618 * @param int $ valueBlog ID.615 * @param string $link Blog primary link. 616 * @param int $blog_id Blog ID. 619 617 */ 620 618 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ), … … 678 676 * @param int $user_id Optional. Defaults to the logged-in user ID. This param 679 677 * is currently unused in the function (but is passed to hooks). 680 * @return bool681 678 */ 682 679 function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { -
trunk/src/bp-blogs/bp-blogs-filters.php
r12906 r13405 26 26 * @since 1.6.0 27 27 * 28 * returned value.29 *30 28 * @param string $url The original URL (points to wp-signup.php by default). 31 29 * @return string The new URL. … … 38 36 * @since 1.6.0 39 37 * 40 * @param string $value URL for the 'Create a new site' signup page. 38 * @param string $permalink URL for the 'Create a new site' signup page. 39 * @param string $url The original URL (points to wp-signup.php by default). 41 40 */ 42 41 return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), $url ); -
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 /** -
trunk/src/bp-blogs/bp-blogs-template.php
r13395 r13405 1522 1522 * 1523 1523 * @since 2.2.0 1524 *1525 * @return string|null HTML Output1526 1524 */ 1527 1525 function bp_blog_backcompat_create_nav_item() { -
trunk/src/bp-blogs/classes/class-bp-blogs-blog.php
r13372 r13405 81 81 * @since 1.0.0 82 82 * 83 * @param int $ valueUser ID.84 * @param int $ valueSite ID.83 * @param int $user_id User ID. 84 * @param int $site_id Site ID. 85 85 */ 86 86 $this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id ); … … 91 91 * @since 1.0.0 92 92 * 93 * @param int $ valueBlog ID.94 * @param int $ valueSite ID.93 * @param int $blog_id Blog ID. 94 * @param int $site_id Site ID. 95 95 */ 96 96 $this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id ); -
trunk/src/bp-blogs/classes/class-bp-blogs-component.php
r13144 r13405 265 265 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 266 266 * for description. 267 * @return bool268 267 */ 269 268 public function setup_admin_bar( $wp_admin_nav = array() ) { … … 275 274 */ 276 275 if ( ! is_multisite() ) { 277 return false;276 return; 278 277 } 279 278 -
trunk/src/bp-blogs/classes/class-bp-blogs-template.php
r13399 r13405 30 30 * @var int 31 31 */ 32 public $blog_count = 0;32 public $blog_count; 33 33 34 34 /** … … 86 86 * @var int 87 87 */ 88 public $total_blog_count = 0;88 public $total_blog_count; 89 89 90 90 /** … … 161 161 } 162 162 163 $max = (int) wp_unslash( $r['max'] ); 164 163 165 // Set the total blog count. 164 if ( empty( $ r['max'] ) || ( $r['max']>= (int) $this->blogs['total'] ) ) {166 if ( empty( $max ) || ( $max >= (int) $this->blogs['total'] ) ) { 165 167 $this->total_blog_count = (int) $this->blogs['total']; 166 168 } else { 167 $this->total_blog_count = (int)$max;169 $this->total_blog_count = $max; 168 170 } 169 171 … … 175 177 176 178 // Set the current blog count. 177 if ( empty( $ r['max'] ) || ( $r['max']>= (int) $blog_count ) ) {179 if ( empty( $max ) || ( $max >= (int) $blog_count ) ) { 178 180 $this->blog_count = (int) $blog_count; 179 181 } else { 180 $this->blog_count = (int)$max;182 $this->blog_count = $max; 181 183 } 182 184 -
trunk/src/bp-core/bp-core-caps.php
r12740 r13405 21 21 * @since 2.1.0 22 22 * 23 * @return object 23 * @global WP_Roles $wp_roles WordPress role management object. 24 * 25 * @return array 24 26 */ 25 27 function bp_get_current_blog_roles() { … … 57 59 * 58 60 * @since 1.6.0 61 * 62 * @global WP_Roles $wp_roles WordPress role management object. 59 63 */ 60 64 function bp_add_caps() { … … 89 93 * 90 94 * @since 1.6.0 95 * 96 * @global WP_Roles $wp_roles WordPress role management object. 91 97 */ 92 98 function bp_remove_caps() {
Note: See TracChangeset
for help on using the changeset viewer.