Created
February 20, 2015 17:03
-
-
Save BoweFrankema/0969c4fc1e3aba6334ae to your computer and use it in GitHub Desktop.
Redirect logged in users from the homepage to the activity stream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function cfc_bp_profile_homepage() | |
//Redirect logged in users from homepage to activity. This happens after login or when a user tries to go back to the homepage. | |
{ | |
global $bp; | |
if( is_user_logged_in() && is_front_page() && !get_user_meta( $user->ID, 'last_activity', true ) ) | |
{ | |
wp_redirect( network_home_url( $bp->activity->root_slug ), 301 ); | |
exit(); | |
} | |
} | |
add_action('wp','cfc_bp_profile_homepage'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment