Contents
bp_core_redirect( string $location = '', int $status = 302 )
Perform a status-safe wp_redirect() that is compatible with BP’s URI parser.
Description
Parameters
- $location
-
(Optional) The redirect URL.
Default value: ''
- $status
-
(Optional) The numeric code to give in the redirect headers. Default: 302.
Default value: 302
Source
File: bp-core/bp-core-functions.php
function bp_core_redirect( $location = '', $status = 302 ) { // On some setups, passing the value of wp_get_referer() may result in an // empty value for $location, which results in an error. Ensure that we // have a valid URL. if ( empty( $location ) ) { $location = bp_get_root_domain(); } // Make sure we don't call status_header() in bp_core_do_catch_uri() as this // conflicts with wp_redirect() and wp_safe_redirect(). buddypress()->no_status_set = true; wp_safe_redirect( $location, $status ); // If PHPUnit is running, do not kill execution. if ( ! defined( 'BP_TESTS_DIR' ) ) { die; } }
Changelog
Version | Description |
---|---|
BuddyPress 1.0.0 | Introduced. |
Related
Uses
Uses | Description |
---|---|
bp-loader.php: buddypress() |
The main function responsible for returning the one true BuddyBoss Instance to functions everywhere. |
bp-core/bp-core-template.php: bp_get_root_domain() |
Return the “root domain”, the URL of the BP root blog. |
Used By | Description |
---|---|
bp-document/screens/folders.php: document_screen_single_folder() |
Load an individual folder screen. |
bp-groups/screens/single/folders.php: document_screen_group_single_folder() |
Load an individual folder screen. |
bp-core/admin/bp-core-admin-settings.php: bp_core_admin_settings_save() |
Save our settings. |
bp-settings/actions/capabilities.php: bp_settings_action_capabilities() |
Handles the setting of user capabilities, spamming, hamming, role, etc. |
bp-settings/actions/delete-account.php: bp_settings_action_delete_account() |
Handles the deleting of a user. |
bp-settings/actions/general.php: bp_settings_action_general() |
Handles the changing and saving of user email addresses and passwords. |
bp-settings/actions/general.php: bp_settings_verify_email_change() |
Process email change verification or cancel requests. |
bp-settings/actions/notifications.php: bp_settings_action_notifications() |
Handles the changing and saving of user notification settings. |
bp-forums/groups.php: BBP_Forums_Group_Extension::redirect_canonical() |
Ensure that forum content associated with a BuddyBoss group can only be viewed via the group URL. |
bp-forums/groups.php: BBP_Forums_Group_Extension::edit_screen_save() |
Save the Group Forum data on edit |
bp-media/screens/albums.php: media_screen_single_album() |
Load an individual album screen. |
bp-notifications/screens/read.php: bp_notifications_action_mark_unread() |
Handle marking single notifications as unread. |
bp-notifications/screens/unread.php: bp_notifications_action_mark_read() |
Handle marking single notifications as read. |
bp-notifications/actions/bulk-manage.php: bp_notifications_action_bulk_manage() |
Handles bulk management (mark as read/unread, delete) of notifications. |
bp-notifications/actions/delete.php: bp_notifications_action_delete() |
Handle deleting single notifications. |
bp-blogs/actions/random.php: bp_blogs_redirect_to_random_blog() |
Redirect to a random blog in the multisite network. |
bp-xprofile/screens/change-avatar.php: xprofile_screen_change_avatar() |
Handles the uploading and cropping of a user avatar. Displays the change avatar page. |
bp-xprofile/screens/edit.php: xprofile_screen_edit_profile() |
Handles the display of the profile edit page by loading the correct template file. |
bp-xprofile/screens/settings-profile.php: bp_xprofile_action_settings() |
Handles the saving of xprofile field visibilities. |
bp-xprofile/actions/delete-avatar.php: xprofile_action_delete_avatar() |
Deletes the active avatar for a user. |
bp-xprofile/classes/class-bp-xprofile-user-admin.php: BP_XProfile_User_Admin::user_admin_load() |
Save the profile fields in Members community profile page. |
bp-messages/actions/bulk-delete.php: messages_action_bulk_delete() |
Process a request to bulk delete messages. |
bp-messages/actions/bulk-manage-star.php: bp_messages_star_bulk_manage_handler() |
Bulk manage handler to set the star status for multiple messages. |
bp-messages/actions/notices.php: bp_messages_action_edit_notice() |
Handle editing of sitewide notices. |
bp-messages/actions/star.php: bp_messages_star_action_handler() |
Action handler to set a message’s star status for those not using JS. |
bp-messages/actions/unread.php: bp_messages_action_mark_unread() |
Handle marking a single message thread as unread. |
bp-messages/screens/view.php: messages_screen_conversation() |
Load an individual conversation screen. |
bp-messages/actions/bulk-manage.php: bp_messages_action_bulk_manage() |
Handle bulk management (mark as read/unread, delete) of message threads. |
bp-messages/actions/compose.php: bp_messages_action_create_message() |
Handle creating of private messages or sitewide notices |
bp-messages/actions/delete.php: messages_action_delete_message() |
Process a request to delete a message. |
bp-messages/actions/read.php: bp_messages_action_mark_read() |
Handle marking a single message thread as read. |
bp-messages/actions/view.php: messages_action_conversation() |
Process a request to view a single message thread. |
bp-groups/bp-groups-admin.php: bp_groups_admin_load() |
Set up the Groups admin page. |
bp-groups/screens/single/admin/delete-group.php: groups_screen_group_admin_delete_group() |
Handle the display of the Delete Group page. |
bp-groups/screens/user/invites.php: groups_screen_group_invites() |
Handle the loading of a user’s Groups > Invites page. |
bp-groups/screens/single/admin/edit-details.php: groups_screen_group_admin_edit_details() |
Handle the display of a group’s admin/edit-details page. |
bp-groups/screens/single/admin/group-settings.php: groups_screen_group_admin_settings() |
Handle the display of a group’s admin/group-settings page. |
bp-groups/screens/single/admin/manage-members.php: groups_screen_group_admin_manage_members() |
This function handles actions related to member management on the group admin. |
bp-groups/screens/single/admin/membership-requests.php: groups_screen_group_admin_requests() |
Handle the display of Admin > Membership Requests. |
bp-groups/screens/single/invite.php: groups_screen_group_invite() |
Handle the display of a group’s Send Invites page. |
bp-groups/screens/single/invite.php: groups_remove_group_invite() |
Process group invitation removal requests. |
bp-groups/screens/single/members.php: groups_screen_group_members() |
Handle the display of a group’s Members page. |
bp-groups/actions/access.php: bp_groups_group_access_protection() |
Protect access to single groups. |
bp-groups/actions/join.php: groups_action_join_group() |
Catch and process “Join Group” button clicks. |
bp-groups/actions/random.php: groups_action_redirect_to_random_group() |
Catch requests for a random group page (example.com/groups/?random-group) and redirect. |
bp-groups/screens/single/admin.php: groups_screen_group_admin() |
Handle the display of a group’s Admin pages. |
bp-groups/screens/single/request-membership.php: groups_screen_group_request_membership() |
Handle the display of a group’s Request Membership page. |
bp-groups/actions/create.php: groups_action_create_group() |
Catch and process group creation form submissions. |
bp-groups/actions/leave-group.php: groups_action_leave_group() |
Catch and process “Leave Group” button clicks. |
bp-groups/classes/class-bp-group-extension.php: BP_Group_Extension::call_edit_screen_save() |
Check the nonce, and call the edit_screen_save() method. |
bp-members/bp-members-functions.php: bp_core_wpsignup_redirect() |
Redirect away from wp-signup.php if BP registration templates are present. |
bp-members/screens/activate.php: bp_core_screen_activation() |
Handle the loading of the Activate screen. |
bp-members/screens/activate.php: bp_members_action_activate_account() |
Catches and processes account activation requests. |
bp-members/actions/random.php: bp_core_get_random_member() |
Redirect to a random member page when visiting a ?random-member URL. |
bp-members/screens/register.php: bp_core_screen_signup() |
Handle the loading of the signup screen. |
bp-members/classes/class-bp-members-admin.php: BP_Members_Admin::signups_admin_load() |
Set up the signups admin page. |
bp-members/classes/class-bp-members-admin.php: BP_Members_Admin::user_admin_load() |
Set up the user’s profile admin page. |
bp-invites/actions/revoke-invite-admin.php: bp_member_revoke_invite_admin() |
Admin revoke email invite. |
bp-invites/actions/revoke-invite.php: bp_member_revoke_invite() |
Member revoke email invite. |
bp-invites/actions/invites.php: bp_member_invite_submit() |
Member submit email invite. |
bp-friends/actions/add-friend.php: friends_action_add_friend() |
Catch and process connection requests. |
bp-friends/actions/remove-friend.php: friends_action_remove_friend() |
Catch and process Remove Connection requests. |
bp-friends/screens/requests.php: friends_screen_requests() |
Catch and process the Requests page. |
bp-templates/bp-nouveau/includes/groups/functions.php: bp_nouveau_groups_screen_invites_restriction() |
Group invites restriction screen. |
bp-core/admin/bp-core-admin-pages.php: bp_core_admin_maybe_save_pages_settings() |
Save BuddyBoss pages settings |
bp-core/admin/settings/bp-admin-setting-forums.php: BP_Admin_Setting_Forums::settings_saved() | |
bp-core/deprecated/buddypress/3.0.php: bp_core_action_set_spammer_status() |
Catch a “Mark as Spammer/Not Spammer” click from the toolbar. |
bp-core/deprecated/buddypress/3.0.php: bp_core_action_delete_user() |
Process user deletion requests. |
bp-core/classes/class-bp-admin-setting-tab.php: BP_Admin_Setting_tab::settings_saved() | |
bp-core/classes/class-bp-admin-integration-tab.php: BP_Admin_Integration_tab::settings_saved() | |
bp-core/bp-core-functions.php: bp_email_unsubscribe_handler() |
Handles unsubscribing user from notification emails. |
bp-core/bp-core-functions.php: bp_core_action_search_site() |
A JavaScript-free implementation of the search functions in BuddyPress. |
bp-core/bp-core-catchuri.php: bp_redirect_canonical() |
Canonicalize BuddyPress URLs. |
bp-core/bp-core-catchuri.php: bp_core_no_access() |
Redirect a user to log in for BP pages that require access control. |
bp-activity/screens/permalink.php: bp_activity_action_permalink_router() |
Catch and route requests for single activity item permalinks. |
bp-activity/screens/permalink.php: bp_activity_screen_single_activity_permalink() |
Load the page for a single activity item. |
bp-activity/actions/delete.php: bp_activity_action_delete_activity() |
Delete specific activity item and redirect to previous page. |
bp-activity/actions/favorite.php: bp_activity_action_mark_favorite() |
Mark activity as liked. |
bp-activity/actions/reply.php: bp_activity_action_post_comment() |
Post new activity comment. |
bp-activity/actions/spam.php: bp_activity_action_spam_activity() |
Mark specific activity item as spam and redirect to previous page. |
bp-activity/actions/unfavorite.php: bp_activity_action_remove_favorite() |
Remove activity from likes. |
bp-activity/actions/post.php: bp_activity_action_post_update() |
Post user/group activity update. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.