diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 280f371..1160190 100644
|
|
|
function bp_core_time_since( $older_date, $newer_date = false ) { |
| 1274 | 1274 | * @param string $message Feedback message to be displayed. |
| 1275 | 1275 | * @param string $type Message type. 'updated', 'success', 'error', 'warning'. |
| 1276 | 1276 | * Default: 'success'. |
| | 1277 | * @param string $context Why is this message happening? |
| | 1278 | * @param array $args Message args when helpful. |
| 1277 | 1279 | */ |
| 1278 | | function bp_core_add_message( $message, $type = '' ) { |
| | 1280 | function bp_core_add_message( $message, $type = '', $context = '', $args = array() ) { |
| 1279 | 1281 | |
| 1280 | 1282 | // Success is the default |
| 1281 | 1283 | if ( empty( $type ) ) { |
| 1282 | 1284 | $type = 'success'; |
| 1283 | 1285 | } |
| 1284 | 1286 | |
| | 1287 | // Allow filters to interact with the $message and $type values. |
| | 1288 | $message = apply_filters( 'bp_core_add_message_message', $message, $type, $context, $args ); |
| | 1289 | $type = apply_filters( 'bp_core_add_message_type', $type, $message, $context, $args ); |
| | 1290 | |
| 1285 | 1291 | // Send the values to the cookie for page reload display |
| 1286 | 1292 | @setcookie( 'bp-message', $message, time() + 60 * 60 * 24, COOKIEPATH ); |
| 1287 | 1293 | @setcookie( 'bp-message-type', $type, time() + 60 * 60 * 24, COOKIEPATH ); |
diff --git src/bp-xprofile/bp-xprofile-screens.php src/bp-xprofile/bp-xprofile-screens.php
index fa42da5..e0fd1e8 100644
|
|
|
function xprofile_screen_edit_profile() { |
| 106 | 106 | |
| 107 | 107 | // There are errors. |
| 108 | 108 | if ( !empty( $errors ) ) { |
| 109 | | bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' ); |
| | 109 | bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error', 'saving_profile_field_group', array( 'updated_profile_field_group' => bp_action_variable( 1 ), 'reason' => 'required_fields_missing' ) ); |
| 110 | 110 | |
| 111 | 111 | // No errors. |
| 112 | 112 | } else { |
| … |
… |
function xprofile_screen_edit_profile() { |
| 172 | 172 | |
| 173 | 173 | // Set the feedback messages. |
| 174 | 174 | if ( !empty( $errors ) ) { |
| 175 | | bp_core_add_message( __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ), 'error' ); |
| | 175 | bp_core_add_message( __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ), 'error', 'saving_profile_field_group', array( 'updated_profile_field_group' => bp_action_variable( 1 ), 'reason' => 'field_failed_to_save' ) ); |
| 176 | 176 | } else { |
| 177 | | bp_core_add_message( __( 'Changes saved.', 'buddypress' ) ); |
| | 177 | bp_core_add_message( __( 'Changes saved.', 'buddypress' ), 'success', 'saving_profile_field_group', array( 'updated_profile_field_group' => bp_action_variable( 1 ) ) ); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // Redirect back to the edit screen to display the updates and message. |