Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Propagate post recording to activity from sub site to main site
function bpdev_record_post_on_main_site($post_id, $post, $user_id = 0 ) {
global $bp, $wpdb;
$post_id = (int)$post_id;
$blog_id = (int)$wpdb->blogid;
return;//it is recording main site and we don't have to worry about it
switch_to_blog(1);//switch to main site
restore_current_blog();//restore current blog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.