Changeset 9471 for trunk/src/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 02/10/2015 02:49:16 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-blogs/bp-blogs-functions.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r9351 r9471 15 15 * @since BuddyPress (1.5.0) 16 16 * 17 * @global BuddyPress $bp The one true BuddyPress instance.18 *19 17 * @return bool True if set, false if empty. 20 18 */ 21 19 function bp_blogs_has_directory() { 22 global $bp;20 $bp = buddypress(); 23 21 24 22 return (bool) !empty( $bp->pages->blogs->id ); … … 827 825 */ 828 826 function bp_blogs_remove_blog( $blog_id ) { 829 global $bp;830 827 831 828 $blog_id = (int) $blog_id; … … 844 841 845 842 // Delete activity stream item 846 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) ); 843 bp_blogs_delete_activity( array( 844 'item_id' => $blog_id, 845 'component' => buddypress()->blogs->id, 846 'type' => 'new_blog' 847 ) ); 847 848 848 849 /** … … 865 866 */ 866 867 function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) { 867 global $bp;868 868 869 869 $blog_id = (int) $blog_id; … … 885 885 bp_blogs_delete_activity( array( 886 886 'item_id' => $blog_id, 887 'component' => $bp->blogs->id,887 'component' => buddypress()->blogs->id, 888 888 'type' => 'new_blog' 889 889 ) ); … … 910 910 */ 911 911 function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { 912 global $wpdb , $bp;912 global $wpdb; 913 913 914 914 if ( empty( $wpdb->blogid ) ) … … 935 935 936 936 // Delete activity stream item 937 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) ); 937 bp_blogs_delete_activity( array( 938 'item_id' => $blog_id, 939 'secondary_item_id' => $post_id, 940 'component' => buddypress()->blogs->id, 941 'type' => 'new_blog_post' 942 ) ); 938 943 939 944 /** … … 1064 1069 * @since BuddyPress (1.6.0) 1065 1070 * 1066 * @global object $bp BuddyPress global settings.1067 *1068 1071 * @param string $new_status New comment status. 1069 1072 * @param string $old_status Previous comment status. … … 1071 1074 */ 1072 1075 function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) { 1073 global $bp;1074 1076 1075 1077 // Check the Activity component is active … … 1100 1102 // Get the activity 1101 1103 if ( bp_disable_blogforum_comments() ) { 1102 $activity_id = bp_activity_get_activity_id( array( 'component' => $bp->blogs->id, 'item_id' => get_current_blog_id(), 'secondary_item_id' => $comment->comment_ID, 'type' => 'new_blog_comment', ) ); 1104 $activity_id = bp_activity_get_activity_id( array( 1105 'component' => buddypress()->blogs->id, 1106 'item_id' => get_current_blog_id(), 1107 'secondary_item_id' => $comment->comment_ID, 1108 'type' => 'new_blog_comment' 1109 ) ); 1103 1110 } else { 1104 1111 $activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true ); … … 1189 1196 */ 1190 1197 function bp_blogs_remove_data_for_blog( $blog_id ) { 1191 global $bp;1192 1198 1193 1199 /** … … 1205 1211 1206 1212 // Delete activity stream item 1207 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) ); 1213 bp_blogs_delete_activity( array( 1214 'item_id' => $blog_id, 1215 'component' => buddypress()->blogs->id, 1216 'type' => false 1217 ) ); 1208 1218 1209 1219 /** … … 1284 1294 * 1285 1295 * @global object $wpdb WordPress database access object. 1286 * @global object $bp BuddyPress global settings.1287 1296 * 1288 1297 * @param int $blog_id ID of the blog whose metadata is being deleted. … … 1298 1307 */ 1299 1308 function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = false, $delete_all = false ) { 1300 global $wpdb , $bp;1309 global $wpdb; 1301 1310 1302 1311 // Legacy - if no meta_key is passed, delete all for the blog_id … … 1326 1335 * 1327 1336 * @global object $wpdb WordPress database access object. 1328 * @global object $bp BuddyPress global settings.1329 1337 * 1330 1338 * @param int $blog_id ID of the blog whose metadata is being requested. … … 1349 1357 * 1350 1358 * @global object $wpdb WordPress database access object. 1351 * @global object $bp BuddyPress global settings.1352 1359 * 1353 1360 * @param int $blog_id ID of the blog whose metadata is being updated.
Note: See TracChangeset
for help on using the changeset viewer.