Contents
bp_core_add_message( string $message, string $type = '' )
Add a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads.
Description
Parameters
- $message
-
(Required) Feedback message to be displayed.
- $type
-
(Optional) Message type. 'updated', 'success', 'error', 'warning'. Default: 'success'.
Default value: ''
Source
File: bp-core/bp-core-functions.php
function bp_core_add_message( $message, $type = '' ) { // Success is the default. if ( empty( $type ) ) { $type = 'success'; } // Send the values to the cookie for page reload display. @setcookie( 'bp-message', $message, time() + 60 * 60 * 24, COOKIEPATH, COOKIE_DOMAIN, is_ssl() ); @setcookie( 'bp-message-type', $type, time() + 60 * 60 * 24, COOKIEPATH, COOKIE_DOMAIN, is_ssl() ); // Get BuddyPress. $bp = buddypress(); /** * Send the values to the $bp global so we can still output messages * without a page reload */ $bp->template_message = $message; $bp->template_message_type = $type; }
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. |
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-settings/actions/delete-account.php: bp_settings_action_delete_account() |
Handles the deleting of a user. |
bp-settings/actions/export.php: bp_settings_action_export() |
Handles the data export 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-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-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/actions/delete-avatar.php: xprofile_action_delete_avatar() |
Deletes the active avatar for a user. |
bp-xprofile/bp-xprofile-settings.php: bp_xprofile_settings_add_feedback_message() |
Adds feedback messages when successfully saving profile field settings. |
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/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/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/group-avatar.php: groups_screen_group_admin_avatar() |
Handle the display of a group’s Change Avatar page. |
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/actions/join.php: groups_action_join_group() |
Catch and process “Join Group” button clicks. |
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/bp-groups-functions.php: groups_leave_group() |
Remove a user from a group. |
bp-members/screens/activate.php: bp_members_action_activate_account() |
Catches and processes account activation requests. |
bp-members/screens/register.php: bp_core_screen_signup() |
Handle the loading of the signup screen. |
bp-invites/bp-invites-functions.php: bp_invites_member_invite_remove_registration_lock() |
Allows invited users to register even if registration is disabled. |
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/activity/ajax.php: bp_nouveau_ajax_spam_activity() |
AJAX spam an activity item or comment. |
bp-templates/bp-nouveau/includes/activity/ajax.php: bp_nouveau_ajax_delete_activity() |
Deletes an Activity item/Activity comment item received via a POST request. |
bp-templates/bp-nouveau/includes/groups/functions.php: bp_nouveau_groups_screen_invites_restriction() |
Group invites restriction screen. |
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/bp-core-functions.php: bp_email_unsubscribe_handler() |
Handles unsubscribing user from notification emails. |
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-core/bp-core-catchuri.php: bp_core_set_uri_globals() |
Analyze the URI and break it down into BuddyPress-usable chunks. |
bp-core/bp-core-avatars.php: bp_core_avatar_handle_upload() |
Handle avatar uploading. |
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.