redirecting album page when not logged in
-
I’ve set up my buddypress installation to redirect to the home page if a user is not logged in, using this code in functions.php:
`function bp_guest_redirect() {
global $bp;
if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_forums_component() || bp_is_members_component() || bp_is_page( BP_ALBUM_SLUG ) || bp_is_profile_component() || bp_is_messages_component() || bp_is_settings_component() ) {
// enter the slug or component conditional here
if(!is_user_logged_in()) { // not logged in user
wp_redirect( get_option(‘siteurl’) . ” );
} // user will be redirect to any link to want
}
}
add_filter(‘get_header’,'bp_guest_redirect’,1);
?>`However, when I added the BP Album+ stable release plugin, the album page doesn’t redirect along with the rest of the site. I assume I need to add another declaration for the album page (tried `bp_is_album_component()` and `bp_is_page( BP_ALBUM_SLUG )`, both didn’t work. what am i doing wrong?
You must be logged in to reply to this topic.