Changeset 14260
- Timestamp:
- 08/02/2026 11:33:11 PM (5 days ago)
- Location:
- trunk/src/bp-blogs
- Files:
-
- 4 edited
-
bp-blogs-activity.php (modified) (9 diffs)
-
bp-blogs-filters.php (modified) (1 diff)
-
bp-blogs-functions.php (modified) (10 diffs)
-
bp-blogs-template.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-activity.php
r14251 r14260 460 460 461 461 // Check for an existing entry and update if one exists. 462 $id = bp_activity_get_activity_id( array( 463 'user_id' => $r['user_id'], 464 'component' => $r['component'], 465 'type' => $r['type'], 466 'item_id' => $r['item_id'], 467 'secondary_item_id' => $r['secondary_item_id'], 468 ) ); 469 470 return bp_activity_add( array( 'id' => $id, 'user_id' => $r['user_id'], 'action' => $r['action'], 'content' => $r['content'], 'primary_link' => $r['primary_link'], 'component' => $r['component'], 'type' => $r['type'], 'item_id' => $r['item_id'], 'secondary_item_id' => $r['secondary_item_id'], 'recorded_time' => $r['recorded_time'], 'hide_sitewide' => $r['hide_sitewide'] ) ); 462 $id = bp_activity_get_activity_id( 463 array( 464 'user_id' => $r['user_id'], 465 'component' => $r['component'], 466 'type' => $r['type'], 467 'item_id' => $r['item_id'], 468 'secondary_item_id' => $r['secondary_item_id'], 469 ) 470 ); 471 472 return bp_activity_add( 473 array( 474 'id' => $id, 475 'user_id' => $r['user_id'], 476 'action' => $r['action'], 477 'content' => $r['content'], 478 'primary_link' => $r['primary_link'], 479 'component' => $r['component'], 480 'type' => $r['type'], 481 'item_id' => $r['item_id'], 482 'secondary_item_id' => $r['secondary_item_id'], 483 'recorded_time' => $r['recorded_time'], 484 'hide_sitewide' => $r['hide_sitewide'], 485 ) 486 ); 471 487 } 472 488 … … 606 622 // Only record this activity if the blog is public. 607 623 if ( ! $is_private && ! $no_activity && bp_blogs_is_blog_trackable( $recorded_blog->blog_id, $recorded_blog->user_id ) ) { 608 bp_blogs_record_activity( array( 609 'user_id' => $recorded_blog->user_id, 610 611 /** 612 * Filters the activity created blog primary link. 613 * 614 * @since 1.1.0 615 * 616 * @param string $link Blog primary link. 617 * @param int $blog_id Blog ID. 618 */ 619 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ), 620 'type' => 'new_blog', 621 'item_id' => $recorded_blog->blog_id 622 ) ); 624 bp_blogs_record_activity( 625 array( 626 'user_id' => $recorded_blog->user_id, 627 628 /** 629 * Filters the activity created blog primary link. 630 * 631 * @since 1.1.0 632 * 633 * @param string $link Blog primary link. 634 * @param int $blog_id Blog ID. 635 */ 636 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ), 637 'type' => 'new_blog', 638 'item_id' => $recorded_blog->blog_id, 639 ) 640 ); 623 641 } 624 642 } … … 637 655 'item_id' => $blog_id, 638 656 'component' => buddypress()->blogs->id, 639 'type' => 'new_blog' 657 'type' => 'new_blog', 640 658 ); 641 659 … … 661 679 */ 662 680 function bp_blogs_delete_activity_for_site( $blog_id ) { 663 bp_blogs_delete_activity( array( 664 'item_id' => $blog_id, 665 'component' => buddypress()->blogs->id, 666 'type' => false 667 ) ); 681 bp_blogs_delete_activity( 682 array( 683 'item_id' => $blog_id, 684 'component' => buddypress()->blogs->id, 685 'type' => false, 686 ) 687 ); 668 688 } 669 689 add_action( 'bp_blogs_remove_data_for_blog', 'bp_blogs_delete_activity_for_site' ); … … 709 729 do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id ); 710 730 711 bp_blogs_delete_activity( array( 712 'item_id' => $blog_id, 713 'secondary_item_id' => $post_id, 714 'component' => buddypress()->blogs->id, 715 'type' => 'new_blog_post' 716 ) ); 731 bp_blogs_delete_activity( 732 array( 733 'item_id' => $blog_id, 734 'secondary_item_id' => $post_id, 735 'component' => buddypress()->blogs->id, 736 'type' => 'new_blog_post', 737 ) 738 ); 717 739 718 740 /** … … 794 816 'comment_parent' => (int) $comment_parent, 795 817 'user_id' => $params['user_id'], 796 'comment_approved' => 1 818 'comment_approved' => 1, 797 819 ); 798 820 … … 885 907 886 908 // Fetch the activity comments for the activity item. 887 $activity = bp_activity_get( array( 888 'in' => $activity_id, 889 'display_comments' => 'stream', 890 'spam' => 'all', 891 ) ); 909 $activity = bp_activity_get( 910 array( 911 'in' => $activity_id, 912 'display_comments' => 'stream', 913 'spam' => 'all', 914 ) 915 ); 892 916 893 917 // Get all activity comment IDs for the pending deleted item. … … 973 997 } else { 974 998 // Update the blog post comment. 975 wp_update_comment( array( 976 'comment_ID' => $post_comment_id, 977 'comment_content' => $activity->content, 978 ) ); 999 wp_update_comment( 1000 array( 1001 'comment_ID' => $post_comment_id, 1002 'comment_content' => $activity->content, 1003 ) 1004 ); 979 1005 } 980 1006 } … … 1086 1112 'column' => 'id', 1087 1113 'value' => $activity_ids, 1088 'compare' => 'IN' 1114 'compare' => 'IN', 1089 1115 ), 1090 1116 ); -
trunk/src/bp-blogs/bp-blogs-filters.php
r14250 r14260 10 10 /** Display Filters **********************************************************/ 11 11 12 add_filter( 'bp_get_blog_latest_post_title', 'wptexturize' );12 add_filter( 'bp_get_blog_latest_post_title', 'wptexturize' ); 13 13 add_filter( 'bp_get_blog_latest_post_title', 'convert_chars' ); 14 add_filter( 'bp_get_blog_latest_post_title', 'trim' );15 16 add_filter( 'bp_blog_latest_post_content', 'wptexturize' );17 add_filter( 'bp_blog_latest_post_content', 'convert_smilies' );18 add_filter( 'bp_blog_latest_post_content', 'convert_chars' );19 add_filter( 'bp_blog_latest_post_content', 'wpautop' );20 add_filter( 'bp_blog_latest_post_content', 'shortcode_unautop' );14 add_filter( 'bp_get_blog_latest_post_title', 'trim' ); 15 16 add_filter( 'bp_blog_latest_post_content', 'wptexturize' ); 17 add_filter( 'bp_blog_latest_post_content', 'convert_smilies' ); 18 add_filter( 'bp_blog_latest_post_content', 'convert_chars' ); 19 add_filter( 'bp_blog_latest_post_content', 'wpautop' ); 20 add_filter( 'bp_blog_latest_post_content', 'shortcode_unautop' ); 21 21 add_filter( 'bp_blog_latest_post_content', 'prepend_attachment' ); 22 22 -
trunk/src/bp-blogs/bp-blogs-functions.php
r14256 r14260 192 192 193 193 // Get all users. 194 $users = get_users( array( 195 'blog_id' => $blog->blog_id, 196 'fields' => 'ID' 197 ) ); 194 $users = get_users( 195 array( 196 'blog_id' => $blog->blog_id, 197 'fields' => 'ID', 198 ) 199 ); 198 200 199 201 // Continue on if no users exist for this site (how did this happen?). … … 224 226 225 227 // We have more blogs; record offset and re-run function. 226 if ( ! empty( $blog_ids ) ) {228 if ( ! empty( $blog_ids ) ) { 227 229 bp_update_option( '_bp_record_blogs_offset', $r['limit'] + $r['offset'] ); 228 bp_blogs_record_existing_blogs( array( 229 'offset' => $r['limit'] + $r['offset'], 230 'limit' => $r['limit'], 231 'blog_ids' => $r['blog_ids'], 232 'site_id' => $r['site_id'] 233 ) ); 230 bp_blogs_record_existing_blogs( 231 array( 232 'offset' => $r['limit'] + $r['offset'], 233 'limit' => $r['limit'], 234 'blog_ids' => $r['blog_ids'], 235 'site_id' => $r['site_id'], 236 ) 237 ); 234 238 235 239 // Bail since we have more blogs to record. … … 573 577 // Save site icon URL as blogmeta. 574 578 bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_thumb', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_thumb_width() ) ); 575 bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_full_width() ) );579 bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_full_width() ) ); 576 580 } 577 581 } … … 685 689 // Query for activity comments connected to a blog post. 686 690 unset( $args['filter'] ); 687 $args['meta_query'] = array( array( 688 'key' => 'bp_blogs_' . $post->post_type . '_comment_id', 689 'value' => $comment_ids, 690 'compare' => 'IN', 691 ) ); 691 $args['meta_query'] = array( 692 array( 693 'key' => 'bp_blogs_' . $post->post_type . '_comment_id', 694 'value' => $comment_ids, 695 'compare' => 'IN', 696 ), 697 ); 692 698 $args['type'] = 'activity_comment'; 693 699 $args['display_comments'] = 'stream'; … … 759 765 if ( isset( $activity_post_object->action_id ) && isset( $activity_post_object->component_id ) ) { 760 766 // Find the parent 'new_post_type' activity entry. 761 $parent_activity_id = bp_activity_get_activity_id( array( 762 'component' => $activity_post_object->component_id, 763 'type' => $activity_post_object->action_id, 764 'item_id' => $blog_id, 765 'secondary_item_id' => $comment->comment_post_ID 766 ) ); 767 $parent_activity_id = bp_activity_get_activity_id( 768 array( 769 'component' => $activity_post_object->component_id, 770 'type' => $activity_post_object->action_id, 771 'item_id' => $blog_id, 772 'secondary_item_id' => $comment->comment_post_ID, 773 ) 774 ); 767 775 768 776 // Try to create a new activity item for the parent blog post. … … 912 920 } 913 921 add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 ); 914 add_action( 'profile_update', 'bp_blogs_add_user_to_blog' );915 add_action( 'user_register', 'bp_blogs_add_user_to_blog' );922 add_action( 'profile_update', 'bp_blogs_add_user_to_blog' ); 923 add_action( 'user_register', 'bp_blogs_add_user_to_blog' ); 916 924 917 925 /** … … 1066 1074 if ( ! empty( $activity_id ) ) { 1067 1075 // Fetch the activity comments for the activity item. 1068 $activity = bp_activity_get( array( 1069 'in' => $activity_id, 1070 'display_comments' => 'stream', 1071 'spam' => 'all', 1072 ) ); 1076 $activity = bp_activity_get( 1077 array( 1078 'in' => $activity_id, 1079 'display_comments' => 'stream', 1080 'spam' => 'all', 1081 ) 1082 ); 1073 1083 1074 1084 // Get all activity comment IDs for the pending deleted item. … … 1079 1089 // Delete activity items. 1080 1090 foreach ( $activity_ids as $activity_id ) { 1081 bp_activity_delete( array( 1082 'id' => $activity_id 1083 ) ); 1091 bp_activity_delete( 1092 array( 1093 'id' => $activity_id, 1094 ) 1095 ); 1084 1096 } 1085 1097 … … 1135 1147 'value' => implode( ',', (array) $activity_ids ), 1136 1148 'compare' => 'IN', 1137 ) 1138 ) 1149 ), 1150 ), 1139 1151 ); 1140 1152 … … 1272 1284 'type' => 'random', 1273 1285 'per_page' => $per_page, 1274 'page' => $page 1286 'page' => $page, 1275 1287 ) 1276 1288 ); -
trunk/src/bp-blogs/bp-blogs-template.php
r14251 r14260 92 92 array_intersect_key( $path_chunks, $supported_chunks ), 93 93 array( 94 'component_id' => 'blogs' 94 'component_id' => 'blogs', 95 95 ) 96 96 ); … … 463 463 } 464 464 465 $avatar = sprintf( '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" />', 465 $avatar = sprintf( 466 '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" />', 466 467 esc_url( $site_icon ), 467 468 esc_attr( "{$r['class']} avatar-{$size}" ), … … 1135 1136 * } 1136 1137 */ 1137 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 1138 $filtered_results = apply_filters( 1139 'signup_another_blog_init', 1140 array( 1141 'blogname' => $blogname, 1142 'blog_title' => $blog_title, 1143 'errors' => $errors, 1144 ) 1145 ); 1138 1146 $blogname = $filtered_results['blogname']; 1139 1147 $blog_title = $filtered_results['blog_title']; … … 1272 1280 $url = sprintf( 1273 1281 /* translators: %s is the site domain and path. */ 1274 __( '%sblogname', 'buddypress' ),1282 __( '%sblogname', 'buddypress' ), 1275 1283 $current_site->domain . $current_site->path 1276 1284 ); … … 1281 1289 sprintf( 1282 1290 /* translators: %s is the site url. */ 1283 esc_html__( 'Your address will be %s', 'buddypress' ), esc_url( $url ) 1291 esc_html__( 'Your address will be %s', 'buddypress' ), 1292 esc_url( $url ) 1284 1293 ), 1285 1294 esc_html__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!', 'buddypress' ) … … 1290 1299 ?> 1291 1300 <p> 1292 <label for="blog_title"><?php esc_html_e( 'Site Title:', 'buddypress') ?></label>1301 <label for="blog_title"><?php esc_html_e( 'Site Title:', 'buddypress' ) ?></label> 1293 1302 <input name="blog_title" type="text" id="blog_title" value="<?php echo esc_html( $blog_title ); ?>" /> 1294 1303 … … 1307 1316 <label class="checkbox" for="blog_public_on"> 1308 1317 <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php checked( ! isset( $_POST['blog_public'] ) || 1 === (int) $_POST['blog_public'] ); ?> /> 1309 <strong><?php esc_html_e( 'Yes', 'buddypress' ); ?></strong>1318 <strong><?php esc_html_e( 'Yes', 'buddypress' ); ?></strong> 1310 1319 </label> 1311 1320 </p> … … 1314 1323 <label class="checkbox" for="blog_public_off"> 1315 1324 <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php checked( isset( $_POST['blog_public'] ) && 0 === (int) $_POST['blog_public'] ); ?> /> 1316 <strong><?php esc_html_e( 'No', 'buddypress' ); ?></strong>1325 <strong><?php esc_html_e( 'No', 'buddypress' ); ?></strong> 1317 1326 </label> 1318 1327 </p> … … 1380 1389 * } 1381 1390 */ 1382 $meta = apply_filters( 'add_signup_meta', array( 'lang_id' => 1, 'public' => $public ) ); 1391 $meta = apply_filters( 1392 'add_signup_meta', 1393 array( 1394 'lang_id' => 1, 1395 'public' => $public, 1396 ) 1397 ); 1383 1398 1384 1399 return wpmu_create_blog( … … 1386 1401 $blog['path'], 1387 1402 $blog['blog_title'], 1388 $current_user->ID, $meta, 1403 $current_user->ID, 1404 $meta, 1389 1405 $current_site->id 1390 1406 );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)