Changeset 10374 for trunk/src/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 11/23/2015 03:55:00 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r10277 r10374 7 7 */ 8 8 9 // Exit if accessed directly 9 // Exit if accessed directly. 10 10 defined( 'ABSPATH' ) || exit; 11 11 … … 43 43 function bp_blogs_get_blogs( $args = '' ) { 44 44 45 // Parse query arguments 45 // Parse query arguments. 46 46 $r = bp_parse_args( $args, array( 47 47 'type' => 'active', // 'active', 'alphabetical', 'newest', or 'random' … … 54 54 ), 'blogs_get_blogs' ); 55 55 56 // Get the blogs 56 // Get the blogs. 57 57 $blogs = BP_Blogs_Blog::get( 58 58 $r['type'], … … 65 65 ); 66 66 67 // Filter and return 67 // Filter and return. 68 68 return apply_filters( 'bp_blogs_get_blogs', $blogs, $r ); 69 69 } … … 83 83 global $wpdb; 84 84 85 // Query for all sites in network 85 // Query for all sites in network. 86 86 if ( is_multisite() ) { 87 87 88 // Get blog ID's if not a large network 88 // Get blog ID's if not a large network. 89 89 if ( ! wp_is_large_network() ) { 90 90 $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d", $wpdb->siteid ) ); 91 91 92 // If error running this query, set blog ID's to false 92 // If error running this query, set blog ID's to false. 93 93 if ( is_wp_error( $blog_ids ) ) { 94 94 $blog_ids = false; 95 95 } 96 96 97 // Large networks are not currently supported 97 // Large networks are not currently supported. 98 98 } else { 99 99 $blog_ids = false; 100 100 } 101 101 102 // Record a single site 102 // Record a single site. 103 103 } else { 104 104 $blog_ids = $wpdb->blogid; 105 105 } 106 106 107 // Bail if there are no blogs in the network 107 // Bail if there are no blogs in the network. 108 108 if ( empty( $blog_ids ) ) { 109 109 return false; 110 110 } 111 111 112 // Get BuddyPress 112 // Get BuddyPress. 113 113 $bp = buddypress(); 114 114 115 // Truncate user blogs table 115 // Truncate user blogs table. 116 116 $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name}" ); 117 117 if ( is_wp_error( $truncate ) ) { … … 119 119 } 120 120 121 // Truncate user blogsmeta table 121 // Truncate user blogsmeta table. 122 122 $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name_blogmeta}" ); 123 123 if ( is_wp_error( $truncate ) ) { … … 125 125 } 126 126 127 // Loop through users of blogs and record the relationship 127 // Loop through users of blogs and record the relationship. 128 128 foreach ( (array) $blog_ids as $blog_id ) { 129 129 130 // Ensure that the cache is clear after the table TRUNCATE above 130 // Ensure that the cache is clear after the table TRUNCATE above. 131 131 wp_cache_delete( $blog_id, 'blog_meta' ); 132 132 133 // Get all users 133 // Get all users. 134 134 $users = get_users( array( 135 135 'blog_id' => $blog_id 136 136 ) ); 137 137 138 // Continue on if no users exist for this site (how did this happen?) 138 // Continue on if no users exist for this site (how did this happen?). 139 139 if ( empty( $users ) ) { 140 140 continue; 141 141 } 142 142 143 // Loop through users and record their relationship to this blog 143 // Loop through users and record their relationship to this blog. 144 144 foreach ( (array) $users as $user ) { 145 145 bp_blogs_add_user_to_blog( $user->ID, false, $blog_id ); … … 154 154 do_action( 'bp_blogs_recorded_existing_blogs' ); 155 155 156 // No errors 156 // No errors. 157 157 return true; 158 158 } … … 170 170 * @param int $blog_id ID of the blog being checked. 171 171 * @param int $user_id Optional. ID of the user for whom access is being checked. 172 *173 172 * @return bool True if blog is recordable, otherwise false. 174 173 */ … … 203 202 * @param int $blog_id ID of the blog being checked. 204 203 * @param int $user_id Optional. ID of the user for whom access is being checked. 205 *206 204 * @return bool True if blog is trackable, otherwise false. 207 205 */ … … 234 232 * @param bool $no_activity Optional. Whether to skip recording an activity 235 233 * item about this blog creation. Default: false. 236 *237 234 * @return bool|null Returns false on failure. 238 235 */ … … 261 258 $thread_depth = get_blog_option( $blog_id, 'thread_comments_depth' ); 262 259 } else { 263 // perhaps filter this?260 // Perhaps filter this? 264 261 $thread_depth = 1; 265 262 } … … 282 279 $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 283 280 284 // Only record this activity if the blog is public 281 // Only record this activity if the blog is public. 285 282 if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) { 286 283 287 // Record this in activity streams 284 // Record this in activity streams. 288 285 bp_blogs_record_activity( array( 289 286 'user_id' => $recorded_blog->user_id, … … 565 562 * @param bool|string $is_approved Optional. The $is_approved value passed to 566 563 * the 'comment_post' action. Default: true. 567 *568 564 * @return bool|object Returns false on failure, the comment object on success. 569 565 */ 570 566 function bp_blogs_record_comment( $comment_id, $is_approved = true ) { 571 // bail if activity component is not active567 // Bail if activity component is not active. 572 568 if ( ! bp_is_active( 'activity' ) ) { 573 569 return; 574 570 } 575 571 576 // Get the users comment 572 // Get the users comment. 577 573 $recorded_comment = get_comment( $comment_id ); 578 574 579 // Don't record activity if the comment hasn't been approved 575 // Don't record activity if the comment hasn't been approved. 580 576 if ( empty( $is_approved ) ) 581 577 return false; 582 578 583 // Don't record activity if no email address has been included 579 // Don't record activity if no email address has been included. 584 580 if ( empty( $recorded_comment->comment_author_email ) ) 585 581 return false; 586 582 587 // Don't record activity if the comment has already been marked as spam 583 // Don't record activity if the comment has already been marked as spam. 588 584 if ( 'spam' === $is_approved ) 589 585 return false; … … 592 588 $user = get_user_by( 'email', $recorded_comment->comment_author_email ); 593 589 594 // If user isn't registered, don't record activity 590 // If user isn't registered, don't record activity. 595 591 if ( empty( $user ) ) 596 592 return false; 597 593 598 // Get the user_id 594 // Get the user_id. 599 595 $user_id = (int) $user->ID; 600 596 601 // Get blog and post data 597 // Get blog and post data. 602 598 $blog_id = get_current_blog_id(); 603 599 … … 611 607 return false; 612 608 613 // If this is a password protected post, don't record the comment 609 // If this is a password protected post, don't record the comment. 614 610 if ( !empty( $recorded_comment->post->post_password ) ) 615 611 return false; 616 612 617 // Don't record activity if the comment's associated post isn't a WordPress Post 613 // Don't record activity if the comment's associated post isn't a WordPress Post. 618 614 if ( !in_array( $recorded_comment->post->post_type, apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) ) ) ) 619 615 return false; … … 621 617 $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); 622 618 623 // If blog is public allow activity to be posted 619 // If blog is public allow activity to be posted. 624 620 if ( $is_blog_public ) { 625 621 626 // Get activity related links 622 // Get activity related links. 627 623 $post_permalink = get_permalink( $recorded_comment->comment_post_ID ); 628 624 $comment_link = get_comment_link( $recorded_comment->comment_ID ); 629 625 630 // Setup activity args 626 // Setup activity args. 631 627 $args = array(); 632 628 … … 637 633 638 634 // Setup some different activity args depending if activity commenting is 639 // enabled or not 640 635 // enabled or not. 641 636 // if cannot comment, record separate activity entry 642 // this is the old way of doing things 637 // this is the old way of doing things. 643 638 if ( bp_disable_blogforum_comments() ) { 644 639 $args['type'] = 'new_blog_comment'; … … 646 641 $args['secondary_item_id'] = $comment_id; 647 642 648 // record the activity entry643 // Record the activity entry. 649 644 $activity_id = bp_blogs_record_activity( $args ); 650 645 651 // add some post info in activity meta646 // Add some post info in activity meta. 652 647 bp_activity_update_meta( $activity_id, 'post_title', $recorded_comment->post->post_title ); 653 648 bp_activity_update_meta( $activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) ); 654 649 655 // record comment as BP activity comment under the parent 'new_blog_post'656 // activity item 650 // Record comment as BP activity comment under the parent 'new_blog_post' 651 // activity item. 657 652 } else { 658 // this is a comment edit659 // check to see if corresponding activity entry already exists 653 // This is a comment edit 654 // check to see if corresponding activity entry already exists. 660 655 if ( ! empty( $_REQUEST['action'] ) ) { 661 656 $existing_activity_id = get_comment_meta( $comment_id, 'bp_activity_comment_id', true ); … … 666 661 } 667 662 668 // find the parent 'new_blog_post' activity entry663 // Find the parent 'new_blog_post' activity entry. 669 664 $parent_activity_id = bp_activity_get_activity_id( array( 670 665 'component' => 'blogs', … … 674 669 ) ); 675 670 676 // Try to create a new activity item for the parent blog post 671 // Try to create a new activity item for the parent blog post. 677 672 if ( empty( $parent_activity_id ) ) { 678 673 $parent_activity_id = bp_activity_post_type_publish( $recorded_comment->comment_post_ID, $recorded_comment->post ); 679 674 } 680 675 681 // we found the parent activity entry682 // so let's go ahead and reconfigure some activity args 676 // We found the parent activity entry 677 // so let's go ahead and reconfigure some activity args. 683 678 if ( ! empty( $parent_activity_id ) ) { 684 // set the 'item_id' with the parent activity entry ID679 // Set the 'item_id' with the parent activity entry ID. 685 680 $args['item_id'] = $parent_activity_id; 686 681 687 // now see if the WP parent comment has a BP activity ID682 // Now see if the WP parent comment has a BP activity ID. 688 683 $comment_parent = 0; 689 684 if ( ! empty( $recorded_comment->comment_parent ) ) { … … 692 687 693 688 // WP parent comment does not have a BP activity ID 694 // so set to 'new_blog_post' activity ID 689 // so set to 'new_blog_post' activity ID. 695 690 if ( empty( $comment_parent ) ) { 696 691 $comment_parent = $parent_activity_id; … … 701 696 $args['type'] = 'activity_comment'; 702 697 703 // could not find corresponding parent activity entry704 // so wipe out $args array 698 // Could not find corresponding parent activity entry 699 // so wipe out $args array. 705 700 } else { 706 701 $args = array(); 707 702 } 708 703 709 // Record in activity streams 704 // Record in activity streams. 710 705 if ( ! empty( $args ) ) { 711 706 // @todo should we use bp_activity_new_comment()? that function will also send 712 // an email to people in the activity comment thread 707 // an email to people in the activity comment thread. 713 708 // 714 // what if a site already has some comment email notification plugin setup?709 // What if a site already has some comment email notification plugin setup? 715 710 // this is why I decided to go with bp_activity_add() to avoid any conflict 716 // with existing comment email notification plugins 711 // with existing comment email notification plugins. 717 712 $comment_activity_id = bp_activity_add( $args ); 718 713 719 714 if ( empty( $args['id'] ) ) { 720 // add meta to activity comment715 // Add meta to activity comment. 721 716 bp_activity_update_meta( $comment_activity_id, 'bp_blogs_post_comment_id', $comment_id ); 722 717 bp_activity_update_meta( $comment_activity_id, 'post_title', $recorded_comment->post->post_title ); 723 718 bp_activity_update_meta( $comment_activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) ); 724 719 725 // add meta to comment720 // Add meta to comment. 726 721 add_comment_meta( $comment_id, 'bp_activity_comment_id', $comment_activity_id ); 727 722 } … … 729 724 } 730 725 731 // Update the blogs last active date 726 // Update the blogs last active date. 732 727 bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); 733 728 } … … 752 747 * @param string|bool $role User's WordPress role for this blog ID. 753 748 * @param int $blog_id Blog ID user is being added to. 754 *755 749 * @return bool|null False on failure. 756 750 */ … … 758 752 global $wpdb; 759 753 760 // If no blog ID was passed, use the root blog ID 754 // If no blog ID was passed, use the root blog ID. 761 755 if ( empty( $blog_id ) ) { 762 756 $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id(); 763 757 } 764 758 765 // If no role was passed, try to find the blog role 759 // If no role was passed, try to find the blog role. 766 760 if ( empty( $role ) ) { 767 761 768 // Get user capabilities 762 // Get user capabilities. 769 763 $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities'; 770 764 $user_roles = array_keys( (array) bp_get_user_meta( $user_id, $key, true ) ); 771 765 772 // User has roles so lets 766 // User has roles so lets. 773 767 if ( ! empty( $user_roles ) ) { 774 768 775 // Get blog roles 769 // Get blog roles. 776 770 $blog_roles = array_keys( bp_get_current_blog_roles() ); 777 771 778 // Look for blog only roles of the user 772 // Look for blog only roles of the user. 779 773 $intersect_roles = array_intersect( $user_roles, $blog_roles ); 780 774 … … 789 783 } 790 784 791 // Bail if no role was found or role is not in the allowed roles array 785 // Bail if no role was found or role is not in the allowed roles array. 792 786 if ( empty( $role ) || ! in_array( $role, bp_blogs_get_allowed_roles() ) ) { 793 787 return false; 794 788 } 795 789 796 // Record the blog activity for this user being added to this blog 790 // Record the blog activity for this user being added to this blog. 797 791 bp_blogs_record_blog( $blog_id, $user_id, true ); 798 792 } … … 873 867 BP_Blogs_Blog::delete_blog_for_all( $blog_id ); 874 868 875 // Delete activity stream item 869 // Delete activity stream item. 876 870 bp_blogs_delete_activity( array( 877 871 'item_id' => $blog_id, … … 915 909 BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id ); 916 910 917 // Delete activity stream item 911 // Delete activity stream item. 918 912 bp_blogs_delete_activity( array( 919 913 'item_id' => $blog_id, … … 941 935 * @param int $user_id Optional. Defaults to the logged-in user ID. This param 942 936 * is currently unused in the function (but is passed to hooks). 943 *944 937 * @return bool 945 938 */ … … 969 962 do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id ); 970 963 971 // Delete activity stream item 964 // Delete activity stream item. 972 965 bp_blogs_delete_activity( array( 973 966 'item_id' => $blog_id, … … 998 991 global $wpdb; 999 992 1000 // activity comments are disabled for blog posts1001 // which means that individual activity items exist for blog comments 993 // Activity comments are disabled for blog posts 994 // which means that individual activity items exist for blog comments. 1002 995 if ( bp_disable_blogforum_comments() ) { 1003 // Delete the individual activity stream item 996 // Delete the individual activity stream item. 1004 997 bp_blogs_delete_activity( array( 1005 998 'item_id' => $wpdb->blogid, … … 1008 1001 ) ); 1009 1002 1010 // activity comments are enabled for blog posts1011 // remove the associated activity item 1003 // Activity comments are enabled for blog posts 1004 // remove the associated activity item. 1012 1005 } else { 1013 // get associated activity ID from comment meta1006 // Get associated activity ID from comment meta. 1014 1007 $activity_id = get_comment_meta( $comment_id, 'bp_activity_comment_id', true ); 1015 1008 1016 // delete the associated activity comment1009 // Delete the associated activity comment. 1017 1010 // 1018 // also removes child post comments and associated activity comments1011 // Also removes child post comments and associated activity comments. 1019 1012 if ( ! empty( $activity_id ) && bp_is_active( 'activity' ) ) { 1020 // fetch the activity comments for the activity item1013 // Fetch the activity comments for the activity item. 1021 1014 $activity = bp_activity_get( array( 1022 1015 'in' => $activity_id, … … 1025 1018 ) ); 1026 1019 1027 // get all activity comment IDs for the pending deleted item1020 // Get all activity comment IDs for the pending deleted item. 1028 1021 if ( ! empty( $activity['activities'] ) ) { 1029 1022 $activity_ids = bp_activity_recurse_comments_activity_ids( $activity ); 1030 1023 $activity_ids[] = $activity_id; 1031 1024 1032 // delete activity items1025 // Delete activity items. 1033 1026 foreach ( $activity_ids as $activity_id ) { 1034 1027 bp_activity_delete( array( … … 1037 1030 } 1038 1031 1039 // remove associated blog comments1032 // Remove associated blog comments. 1040 1033 bp_blogs_remove_associated_blog_comments( $activity_ids ); 1041 1034 1042 // rebuild activity comment tree1035 // Rebuild activity comment tree. 1043 1036 BP_Activity_Activity::rebuild_activity_comment_tree( $activity['activities'][0]->item_id ); 1044 1037 } … … 1069 1062 * @param array $activity_ids The activity IDs to check association with blog 1070 1063 * comments. 1071 * @param bool $force_delete Whether to force delete the comments. If false,1064 * @param bool $force_delete Whether to force delete the comments. If false, 1072 1065 * comments are trashed instead. 1073 1066 */ 1074 1067 function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $force_delete = true ) { 1075 // query args1068 // Query args. 1076 1069 $query_args = array( 1077 1070 'meta_query' => array( … … 1084 1077 ); 1085 1078 1086 // get comment1079 // Get comment. 1087 1080 $comment_query = new WP_Comment_Query; 1088 1081 $comments = $comment_query->query( $query_args ); 1089 1082 1090 // found the corresponding comments1083 // Found the corresponding comments 1091 1084 // let's delete them! 1092 1085 foreach ( $comments as $comment ) { 1093 1086 wp_delete_comment( $comment->comment_ID, $force_delete ); 1094 1087 1095 // if we're trashing the comment, remove the meta key as well1088 // If we're trashing the comment, remove the meta key as well. 1096 1089 if ( empty( $force_delete ) ) { 1097 1090 delete_comment_meta( $comment->comment_ID, 'bp_activity_comment_id' ); … … 1111 1104 function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) { 1112 1105 1113 // Check the Activity component is active 1106 // Check the Activity component is active. 1114 1107 if ( ! bp_is_active( 'activity' ) ) 1115 1108 return; … … 1136 1129 } 1137 1130 1138 // Get the activity 1131 // Get the activity. 1139 1132 if ( bp_disable_blogforum_comments() ) { 1140 1133 $activity_id = bp_activity_get_activity_id( array( … … 1148 1141 } 1149 1142 1150 // Check activity item exists 1143 // Check activity item exists. 1151 1144 if ( empty( $activity_id ) ) { 1152 1145 // If no activity exists, but the comment has been approved, record it into the activity table. … … 1158 1151 } 1159 1152 1160 // Create an activity object 1153 // Create an activity object. 1161 1154 $activity = new BP_Activity_Activity( $activity_id ); 1162 1155 if ( empty( $activity->component ) ) 1163 1156 return; 1164 1157 1165 // Spam/ham the activity if it's not already in that state 1158 // Spam/ham the activity if it's not already in that state. 1166 1159 if ( 'spam_activity' == $action && ! $activity->is_spam ) { 1167 1160 bp_activity_mark_as_spam( $activity ); … … 1170 1163 } 1171 1164 1172 // Add "new_blog_comment" to the whitelisted activity types, so that the activity's Akismet history is generated 1165 // Add "new_blog_comment" to the whitelisted activity types, so that the activity's Akismet history is generated. 1173 1166 $comment_akismet_history = create_function( '$t', '$t[] = "new_blog_comment"; return $t;' ); 1174 1167 add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); 1175 1168 1176 // Save the updated activity 1169 // Save the updated activity. 1177 1170 $activity->save(); 1178 1171 1179 // Remove the "new_blog_comment" activity type whitelist so we don't break anything 1172 // Remove the "new_blog_comment" activity type whitelist so we don't break anything. 1180 1173 remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); 1181 1174 } … … 1205 1198 * @param int $user_id ID of the user being queried. Default: on a user page, 1206 1199 * the displayed user. Otherwise, the logged-in user. 1207 *1208 1200 * @return int $count Total blog count for the user. 1209 1201 */ … … 1213 1205 } 1214 1206 1215 // no user ID? do not attempt to look at cache1207 // No user ID? do not attempt to look at cache. 1216 1208 if ( empty( $user_id ) ) { 1217 1209 return 0; … … 1247 1239 BP_Blogs_Blog::delete_blog_for_all( $blog_id ); 1248 1240 1249 // Delete activity stream item 1241 // Delete activity stream item. 1250 1242 bp_blogs_delete_activity( array( 1251 1243 'item_id' => $blog_id, … … 1274 1266 * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}. 1275 1267 * @param bool $show_hidden See {@BP_Blogs_Blog::get_blogs_for_user()}. 1276 *1277 1268 * @return array See {@BP_Blogs_Blog::get_blogs_for_user()}. 1278 1269 */ … … 1288 1279 * @param int $limit See {@BP_Blogs_Blog::get_all()}. 1289 1280 * @param int $page See {@BP_Blogs_Blog::get_all()}. 1290 *1291 1281 * @return array See {@BP_Blogs_Blog::get_all()}. 1292 1282 */ … … 1302 1292 * @param int $limit See {@BP_Blogs_Blog::get()}. 1303 1293 * @param int $page See {@BP_Blogs_Blog::get()}. 1304 *1305 1294 * @return array See {@BP_Blogs_Blog::get()}. 1306 1295 */ … … 1315 1304 * 1316 1305 * @param int $blog_id See {@BP_Blogs_Blog::is_hidden()}. 1317 *1318 1306 * @return bool See {@BP_Blogs_Blog::is_hidden()}. 1319 1307 */ … … 1322 1310 } 1323 1311 1324 /* ******************************************************************************1312 /* 1325 1313 * Blog meta functions 1326 1314 * … … 1343 1331 * deleted if the meta_value matches this parameter. 1344 1332 * @param bool $delete_all Optional. If true, delete matching metadata entries for 1345 * all objects, ignoring the specified blog_id. Otherwise, only 1346 * delete matching metadata entries for the specified blog. 1347 * Default: false. 1348 * 1333 * all objects, ignoring the specified blog_id. Otherwise, only 1334 * delete matching metadata entries for the specified blog. 1335 * Default: false. 1349 1336 * @return bool True on success, false on failure. 1350 1337 */ … … 1352 1339 global $wpdb; 1353 1340 1354 // Legacy - if no meta_key is passed, delete all for the blog_id 1341 // Legacy - if no meta_key is passed, delete all for the blog_id. 1355 1342 if ( empty( $meta_key ) ) { 1356 1343 $keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->blogmeta} WHERE blog_id = %d", $blog_id ) ); … … 1384 1371 * metadata for the blog will be fetched. 1385 1372 * @param bool $single Optional. If true, return only the first value of the 1386 * specified meta_key. This parameter has no effect if 1387 * meta_key is not specified. Default: true. 1388 * 1373 * specified meta_key. This parameter has no effect if 1374 * meta_key is not specified. Default: true. 1389 1375 * @return mixed The meta value(s) being requested. 1390 1376 */ … … 1408 1394 * metadata entries with the specified value. 1409 1395 * Otherwise, update all entries. 1410 *1411 1396 * @return bool|int Returns false on failure. On successful update of existing 1412 1397 * metadata, returns true. On successful creation of new metadata, … … 1432 1417 * for the given key. If true, and the object already has a value for 1433 1418 * the key, no change will be made. Default: false. 1434 *1435 1419 * @return int|bool The meta ID on successful update, false on failure. 1436 1420 */ … … 1446 1430 * 1447 1431 * @param int $user_id ID whose blog data should be removed. 1448 * 1449 * @return bool|null Returns false on failure. 1432 * @return bool Returns false on failure. 1450 1433 */ 1451 1434 function bp_blogs_remove_data( $user_id ) { … … 1490 1473 } 1491 1474 1492 // Get the user's blogs 1475 // Get the user's blogs. 1493 1476 $user_blogs = get_blogs_of_user( $user_id ); 1494 1477 if ( empty( $user_blogs ) ) {
Note: See TracChangeset
for help on using the changeset viewer.