Created
August 17, 2011 20:39
-
-
Save sbruner/1152556 to your computer and use it in GitHub Desktop.
WPNYC.ORG / BuddyPress: Redirect to forum on Group home page
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 | |
/** | |
* Redirect to forum on Group home page | |
* | |
* http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/changing-group-tab-display-defaults/?topic_page=2&num=15 | |
*/ | |
function sfire_redirect_to_forum() { | |
global $bp; | |
$path = clean_url( $_SERVER['REQUEST_URI'] ); | |
$path = apply_filters( 'bp_uri', $path ); | |
if ( bp_is_group_home() && $bp->current_action == $bp->bp_options_nav['groups']['home']['slug'] ) | |
bp_core_redirect( apply_filters( 'bp_uri', $bp->bp_options_nav['groups']['forum']['link']) ); | |
} | |
add_action( 'bp_init', 'sfire_redirect_to_forum' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something about this breaks the ability to post updates in a group's activity stream. Any advice? Thanks for the snippet.