Ticket #3333: 3333.patch
File 3333.patch, 77.6 KB (added by , 5 years ago) |
---|
-
includes/common/functions.php
552 552 // Filter name 553 553 $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); 554 554 if ( empty( $r['bbp_anonymous_name'] ) ) { 555 bbp_add_error( 'bbp_anonymous_name', __( '<strong>E RROR</strong>: Invalid author name.', 'bbpress' ) );555 bbp_add_error( 'bbp_anonymous_name', __( '<strong>Error</strong>: Invalid author name.', 'bbpress' ) ); 556 556 } 557 557 558 558 // Filter email address 559 559 $r['bbp_anonymous_email'] = apply_filters( 'bbp_pre_anonymous_post_author_email', $r['bbp_anonymous_email'] ); 560 560 if ( empty( $r['bbp_anonymous_email'] ) ) { 561 bbp_add_error( 'bbp_anonymous_email', __( '<strong>E RROR</strong>: Invalid email address.', 'bbpress' ) );561 bbp_add_error( 'bbp_anonymous_email', __( '<strong>Error</strong>: Invalid email address.', 'bbpress' ) ); 562 562 } 563 563 564 564 // Website is optional (can be empty) -
includes/extend/buddypress/groups.php
376 376 377 377 // If everything else has failed, then something is wrong and we need 378 378 // to add an error to prevent this topic from saving. 379 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID is invalid.', 'bbpress' ) );379 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID is invalid.', 'bbpress' ) ); 380 380 } 381 381 382 382 /** … … 439 439 } 440 440 441 441 // Add an error to prevent this reply from saving. 442 bbp_add_error( 'bbp_reply_to_id', __( '<strong>E RROR</strong>: Reply To is invalid.', 'bbpress' ) );442 bbp_add_error( 'bbp_reply_to_id', __( '<strong>Error</strong>: Reply To is invalid.', 'bbpress' ) ); 443 443 } 444 444 445 445 /** Edit ******************************************************************/ … … 528 528 529 529 // Theme-side Nonce check 530 530 } elseif ( ! bbp_verify_nonce_request( 'groups_edit_save_' . $this->slug ) ) { 531 bbp_add_error( 'bbp_edit_group_forum_screen_save', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );531 bbp_add_error( 'bbp_edit_group_forum_screen_save', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 532 532 return; 533 533 } 534 534 … … 685 685 686 686 // Nonce check 687 687 if ( ! bbp_verify_nonce_request( 'groups_create_save_' . $this->slug ) ) { 688 bbp_add_error( 'bbp_create_group_forum_screen_save', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );688 bbp_add_error( 'bbp_create_group_forum_screen_save', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 689 689 return; 690 690 } 691 691 -
includes/extend/buddypress/notifications.php
193 193 194 194 // Check nonce 195 195 if ( ! bbp_verify_nonce_request( 'bbp_mark_topic_' . $topic_id ) ) { 196 bbp_add_error( 'bbp_notification_topic_id', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );196 bbp_add_error( 'bbp_notification_topic_id', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 197 197 198 198 // Check current user's ability to edit the user 199 199 } elseif ( ! current_user_can( 'edit_user', $user_id ) ) { 200 bbp_add_error( 'bbp_notification_permission', __( '<strong>E RROR</strong>: You do not have permission to mark notifications for that user.', 'bbpress' ) );200 bbp_add_error( 'bbp_notification_permission', __( '<strong>Error</strong>: You do not have permission to mark notifications for that user.', 'bbpress' ) ); 201 201 } 202 202 203 203 // Bail if we have errors -
includes/forums/functions.php
123 123 124 124 // Nonce check 125 125 if ( ! bbp_verify_nonce_request( 'bbp-new-forum' ) ) { 126 bbp_add_error( 'bbp_new_forum_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );126 bbp_add_error( 'bbp_new_forum_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 127 127 return; 128 128 } 129 129 … … 137 137 138 138 // User cannot create forums 139 139 if ( ! current_user_can( 'publish_forums' ) ) { 140 bbp_add_error( 'bbp_forum_permission', __( '<strong>E RROR</strong>: You do not have permission to create new forums.', 'bbpress' ) );140 bbp_add_error( 'bbp_forum_permission', __( '<strong>Error</strong>: You do not have permission to create new forums.', 'bbpress' ) ); 141 141 return; 142 142 } 143 143 … … 162 162 163 163 // No forum title 164 164 if ( empty( $forum_title ) ) { 165 bbp_add_error( 'bbp_forum_title', __( '<strong>E RROR</strong>: Your forum needs a title.', 'bbpress' ) );165 bbp_add_error( 'bbp_forum_title', __( '<strong>Error</strong>: Your forum needs a title.', 'bbpress' ) ); 166 166 } 167 167 168 168 // Title too long 169 169 if ( bbp_is_title_too_long( $forum_title ) ) { 170 bbp_add_error( 'bbp_forum_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );170 bbp_add_error( 'bbp_forum_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 171 171 } 172 172 173 173 /** Forum Content *********************************************************/ … … 181 181 182 182 // No forum content 183 183 if ( empty( $forum_content ) ) { 184 bbp_add_error( 'bbp_forum_content', __( '<strong>E RROR</strong>: Your forum description cannot be empty.', 'bbpress' ) );184 bbp_add_error( 'bbp_forum_content', __( '<strong>Error</strong>: Your forum description cannot be empty.', 'bbpress' ) ); 185 185 } 186 186 187 187 /** Forum Parent **********************************************************/ … … 196 196 197 197 // No forum parent was passed (should never happen) 198 198 if ( empty( $forum_parent_id ) ) { 199 bbp_add_error( 'bbp_new_forum_missing_parent', __( '<strong>E RROR</strong>: Your forum must have a parent.', 'bbpress' ) );199 bbp_add_error( 'bbp_new_forum_missing_parent', __( '<strong>Error</strong>: Your forum must have a parent.', 'bbpress' ) ); 200 200 201 201 // Forum exists 202 202 } elseif ( ! empty( $forum_parent_id ) ) { … … 203 203 204 204 // Forum is a category 205 205 if ( bbp_is_forum_category( $forum_parent_id ) ) { 206 bbp_add_error( 'bbp_new_forum_forum_category', __( '<strong>E RROR</strong>: This forum is a category. No forums can be created in this forum.', 'bbpress' ) );206 bbp_add_error( 'bbp_new_forum_forum_category', __( '<strong>Error</strong>: This forum is a category. No forums can be created in this forum.', 'bbpress' ) ); 207 207 } 208 208 209 209 // Forum is closed and user cannot access 210 210 if ( bbp_is_forum_closed( $forum_parent_id ) && ! current_user_can( 'edit_forum', $forum_parent_id ) ) { 211 bbp_add_error( 'bbp_new_forum_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new forums.', 'bbpress' ) );211 bbp_add_error( 'bbp_new_forum_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new forums.', 'bbpress' ) ); 212 212 } 213 213 214 214 // Forum is private and user cannot access 215 215 if ( bbp_is_forum_private( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 216 bbp_add_error( 'bbp_new_forum_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) );216 bbp_add_error( 'bbp_new_forum_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 217 217 } 218 218 219 219 // Forum is hidden and user cannot access 220 220 if ( bbp_is_forum_hidden( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 221 bbp_add_error( 'bbp_new_forum_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) );221 bbp_add_error( 'bbp_new_forum_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 222 222 } 223 223 } 224 224 … … 225 225 /** Forum Flooding ********************************************************/ 226 226 227 227 if ( ! bbp_check_for_flood( $anonymous_data, $forum_author ) ) { 228 bbp_add_error( 'bbp_forum_flood', __( '<strong>E RROR</strong>: Slow down; you move too fast.', 'bbpress' ) );228 bbp_add_error( 'bbp_forum_flood', __( '<strong>Error</strong>: Slow down; you move too fast.', 'bbpress' ) ); 229 229 } 230 230 231 231 /** Forum Duplicate *******************************************************/ 232 232 233 233 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_forum_post_type(), 'post_author' => $forum_author, 'post_content' => $forum_content, 'anonymous_data' => $anonymous_data ) ) ) { 234 bbp_add_error( 'bbp_forum_duplicate', __( '<strong>E RROR</strong>: This forum already exists.', 'bbpress' ) );234 bbp_add_error( 'bbp_forum_duplicate', __( '<strong>Error</strong>: This forum already exists.', 'bbpress' ) ); 235 235 } 236 236 237 237 /** Forum Bad Words *******************************************************/ 238 238 239 239 if ( ! bbp_check_for_moderation( $anonymous_data, $forum_author, $forum_title, $forum_content, true ) ) { 240 bbp_add_error( 'bbp_forum_moderation', __( '<strong>E RROR</strong>: Your forum cannot be created at this time.', 'bbpress' ) );240 bbp_add_error( 'bbp_forum_moderation', __( '<strong>Error</strong>: Your forum cannot be created at this time.', 'bbpress' ) ); 241 241 } 242 242 243 243 /** Forum Moderation ******************************************************/ … … 350 350 351 351 // WP_Error 352 352 } elseif ( is_wp_error( $forum_id ) ) { 353 bbp_add_error( 'bbp_forum_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) occurred: %s', 'bbpress' ), $forum_id->get_error_message() ) );353 bbp_add_error( 'bbp_forum_error', sprintf( __( '<strong>Error</strong>: The following problem(s) occurred: %s', 'bbpress' ), $forum_id->get_error_message() ) ); 354 354 355 355 // Generic error 356 356 } else { 357 bbp_add_error( 'bbp_forum_error', __( '<strong>E RROR</strong>: The forum was not created.', 'bbpress' ) );357 bbp_add_error( 'bbp_forum_error', __( '<strong>Error</strong>: The forum was not created.', 'bbpress' ) ); 358 358 } 359 359 } 360 360 … … 379 379 380 380 // Forum id was not passed 381 381 if ( empty( $_POST['bbp_forum_id'] ) ) { 382 bbp_add_error( 'bbp_edit_forum_id', __( '<strong>E RROR</strong>: Forum ID not found.', 'bbpress' ) );382 bbp_add_error( 'bbp_edit_forum_id', __( '<strong>Error</strong>: Forum ID not found.', 'bbpress' ) ); 383 383 return; 384 384 385 385 // Forum id was passed … … 390 390 391 391 // Nonce check 392 392 if ( ! bbp_verify_nonce_request( 'bbp-edit-forum_' . $forum_id ) ) { 393 bbp_add_error( 'bbp_edit_forum_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );393 bbp_add_error( 'bbp_edit_forum_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 394 394 return; 395 395 396 396 // Forum does not exist 397 397 } elseif ( empty( $forum ) ) { 398 bbp_add_error( 'bbp_edit_forum_not_found', __( '<strong>E RROR</strong>: The forum you want to edit was not found.', 'bbpress' ) );398 bbp_add_error( 'bbp_edit_forum_not_found', __( '<strong>Error</strong>: The forum you want to edit was not found.', 'bbpress' ) ); 399 399 return; 400 400 401 401 // User cannot edit this forum 402 402 } elseif ( ! current_user_can( 'edit_forum', $forum_id ) ) { 403 bbp_add_error( 'bbp_edit_forum_permission', __( '<strong>E RROR</strong>: You do not have permission to edit that forum.', 'bbpress' ) );403 bbp_add_error( 'bbp_edit_forum_permission', __( '<strong>Error</strong>: You do not have permission to edit that forum.', 'bbpress' ) ); 404 404 return; 405 405 } 406 406 … … 426 426 427 427 // Forum is closed and user cannot access 428 428 if ( bbp_is_forum_closed( $forum_parent_id ) && ! current_user_can( 'edit_forum', $forum_parent_id ) ) { 429 bbp_add_error( 'bbp_edit_forum_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new forums.', 'bbpress' ) );429 bbp_add_error( 'bbp_edit_forum_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new forums.', 'bbpress' ) ); 430 430 } 431 431 432 432 // Forum is private and user cannot access 433 433 if ( bbp_is_forum_private( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 434 bbp_add_error( 'bbp_edit_forum_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) );434 bbp_add_error( 'bbp_edit_forum_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 435 435 } 436 436 437 437 // Forum is hidden and user cannot access 438 438 if ( bbp_is_forum_hidden( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 439 bbp_add_error( 'bbp_edit_forum_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) );439 bbp_add_error( 'bbp_edit_forum_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 440 440 } 441 441 } 442 442 … … 451 451 452 452 // No forum title 453 453 if ( empty( $forum_title ) ) { 454 bbp_add_error( 'bbp_edit_forum_title', __( '<strong>E RROR</strong>: Your forum needs a title.', 'bbpress' ) );454 bbp_add_error( 'bbp_edit_forum_title', __( '<strong>Error</strong>: Your forum needs a title.', 'bbpress' ) ); 455 455 } 456 456 457 457 // Title too long 458 458 if ( bbp_is_title_too_long( $forum_title ) ) { 459 bbp_add_error( 'bbp_forum_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );459 bbp_add_error( 'bbp_forum_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 460 460 } 461 461 462 462 /** Forum Content *********************************************************/ … … 470 470 471 471 // No forum content 472 472 if ( empty( $forum_content ) ) { 473 bbp_add_error( 'bbp_edit_forum_content', __( '<strong>E RROR</strong>: Your forum description cannot be empty.', 'bbpress' ) );473 bbp_add_error( 'bbp_edit_forum_content', __( '<strong>Error</strong>: Your forum description cannot be empty.', 'bbpress' ) ); 474 474 } 475 475 476 476 /** Forum Bad Words *******************************************************/ 477 477 478 478 if ( ! bbp_check_for_moderation( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content, true ) ) { 479 bbp_add_error( 'bbp_forum_moderation', __( '<strong>E RROR</strong>: Your forum cannot be edited at this time.', 'bbpress' ) );479 bbp_add_error( 'bbp_forum_moderation', __( '<strong>Error</strong>: Your forum cannot be edited at this time.', 'bbpress' ) ); 480 480 } 481 481 482 482 /** Forum Moderation ******************************************************/ … … 590 590 591 591 } else { 592 592 $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; 593 bbp_add_error( 'bbp_forum_error', __( '<strong>E RROR</strong>: The following problem(s) have been found with your forum:' . $append_error . 'Please try again.', 'bbpress' ) );593 bbp_add_error( 'bbp_forum_error', __( '<strong>Error</strong>: The following problem(s) have been found with your forum:' . $append_error . 'Please try again.', 'bbpress' ) ); 594 594 } 595 595 } 596 596 -
includes/replies/functions.php
131 131 132 132 // Nonce check 133 133 if ( ! bbp_verify_nonce_request( 'bbp-new-reply' ) ) { 134 bbp_add_error( 'bbp_new_reply_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );134 bbp_add_error( 'bbp_new_reply_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 135 135 return; 136 136 } 137 137 … … 156 156 157 157 // User cannot create replies 158 158 if ( ! current_user_can( 'publish_replies' ) ) { 159 bbp_add_error( 'bbp_reply_permission', __( '<strong>E RROR</strong>: You do not have permission to reply.', 'bbpress' ) );159 bbp_add_error( 'bbp_reply_permission', __( '<strong>Error</strong>: You do not have permission to reply.', 'bbpress' ) ); 160 160 } 161 161 162 162 // Reply author is current user … … 167 167 168 168 // Topic id was not passed 169 169 if ( empty( $_POST['bbp_topic_id'] ) ) { 170 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>E RROR</strong>: Topic ID is missing.', 'bbpress' ) );170 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>Error</strong>: Topic ID is missing.', 'bbpress' ) ); 171 171 172 172 // Topic id is not a number 173 173 } elseif ( ! is_numeric( $_POST['bbp_topic_id'] ) ) { 174 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>E RROR</strong>: Topic ID must be a number.', 'bbpress' ) );174 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>Error</strong>: Topic ID must be a number.', 'bbpress' ) ); 175 175 176 176 // Topic id might be valid 177 177 } else { … … 181 181 182 182 // Topic id is a negative number 183 183 if ( 0 > $posted_topic_id ) { 184 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>E RROR</strong>: Topic ID cannot be a negative number.', 'bbpress' ) );184 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>Error</strong>: Topic ID cannot be a negative number.', 'bbpress' ) ); 185 185 186 186 // Topic does not exist 187 187 } elseif ( ! bbp_get_topic( $posted_topic_id ) ) { 188 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>E RROR</strong>: Topic does not exist.', 'bbpress' ) );188 bbp_add_error( 'bbp_reply_topic_id', __( '<strong>Error</strong>: Topic does not exist.', 'bbpress' ) ); 189 189 190 190 // Use the POST'ed topic id 191 191 } else { … … 204 204 205 205 // Empty Forum id was passed 206 206 if ( empty( $_POST['bbp_forum_id'] ) ) { 207 bbp_add_error( 'bbp_reply_forum_id', __( '<strong>E RROR</strong>: Forum ID is missing.', 'bbpress' ) );207 bbp_add_error( 'bbp_reply_forum_id', __( '<strong>Error</strong>: Forum ID is missing.', 'bbpress' ) ); 208 208 209 209 // Forum id is not a number 210 210 } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) { 211 bbp_add_error( 'bbp_reply_forum_id', __( '<strong>E RROR</strong>: Forum ID must be a number.', 'bbpress' ) );211 bbp_add_error( 'bbp_reply_forum_id', __( '<strong>Error</strong>: Forum ID must be a number.', 'bbpress' ) ); 212 212 213 213 // Forum id might be valid 214 214 } else { … … 218 218 219 219 // Forum id is empty 220 220 if ( 0 === $posted_forum_id ) { 221 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID is missing.', 'bbpress' ) );221 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID is missing.', 'bbpress' ) ); 222 222 223 223 // Forum id is a negative number 224 224 } elseif ( 0 > $posted_forum_id ) { 225 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID cannot be a negative number.', 'bbpress' ) );225 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID cannot be a negative number.', 'bbpress' ) ); 226 226 227 227 // Forum does not exist 228 228 } elseif ( ! bbp_get_forum( $posted_forum_id ) ) { 229 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum does not exist.', 'bbpress' ) );229 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum does not exist.', 'bbpress' ) ); 230 230 231 231 // Use the POST'ed forum id 232 232 } else { … … 240 240 241 241 // Forum is a category 242 242 if ( bbp_is_forum_category( $forum_id ) ) { 243 bbp_add_error( 'bbp_new_reply_forum_category', __( '<strong>E RROR</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) );243 bbp_add_error( 'bbp_new_reply_forum_category', __( '<strong>Error</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) ); 244 244 245 245 // Forum is not a category 246 246 } else { … … 247 247 248 248 // Forum is closed and user cannot access 249 249 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 250 bbp_add_error( 'bbp_new_reply_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new replies.', 'bbpress' ) );250 bbp_add_error( 'bbp_new_reply_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new replies.', 'bbpress' ) ); 251 251 } 252 252 253 253 // Forum is private and user cannot access 254 254 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 255 bbp_add_error( 'bbp_new_reply_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) );255 bbp_add_error( 'bbp_new_reply_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 256 256 257 257 // Forum is hidden and user cannot access 258 258 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 259 bbp_add_error( 'bbp_new_reply_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) );259 bbp_add_error( 'bbp_new_reply_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 260 260 } 261 261 } 262 262 } … … 281 281 282 282 // Title too long 283 283 if ( bbp_is_title_too_long( $reply_title ) ) { 284 bbp_add_error( 'bbp_reply_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );284 bbp_add_error( 'bbp_reply_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 285 285 } 286 286 287 287 /** Reply Content *********************************************************/ … … 295 295 296 296 // No reply content 297 297 if ( empty( $reply_content ) ) { 298 bbp_add_error( 'bbp_reply_content', __( '<strong>E RROR</strong>: Your reply cannot be empty.', 'bbpress' ) );298 bbp_add_error( 'bbp_reply_content', __( '<strong>Error</strong>: Your reply cannot be empty.', 'bbpress' ) ); 299 299 } 300 300 301 301 /** Reply Flooding ********************************************************/ 302 302 303 303 if ( ! bbp_check_for_flood( $anonymous_data, $reply_author ) ) { 304 bbp_add_error( 'bbp_reply_flood', __( '<strong>E RROR</strong>: Slow down; you move too fast.', 'bbpress' ) );304 bbp_add_error( 'bbp_reply_flood', __( '<strong>Error</strong>: Slow down; you move too fast.', 'bbpress' ) ); 305 305 } 306 306 307 307 /** Reply Duplicate *******************************************************/ 308 308 309 309 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) { 310 bbp_add_error( 'bbp_reply_duplicate', __( '<strong>E RROR</strong>: Duplicate reply detected; it looks as though you’ve already said that.', 'bbpress' ) );310 bbp_add_error( 'bbp_reply_duplicate', __( '<strong>Error</strong>: Duplicate reply detected; it looks as though you’ve already said that.', 'bbpress' ) ); 311 311 } 312 312 313 313 /** Reply Bad Words *******************************************************/ 314 314 315 315 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content, true ) ) { 316 bbp_add_error( 'bbp_reply_moderation', __( '<strong>E RROR</strong>: Your reply cannot be created at this time.', 'bbpress' ) );316 bbp_add_error( 'bbp_reply_moderation', __( '<strong>Error</strong>: Your reply cannot be created at this time.', 'bbpress' ) ); 317 317 } 318 318 319 319 /** Reply Status **********************************************************/ … … 338 338 339 339 // If topic is closed, moderators can still reply 340 340 if ( bbp_is_topic_closed( $topic_id ) && ! current_user_can( 'moderate', $topic_id ) ) { 341 bbp_add_error( 'bbp_reply_topic_closed', __( '<strong>E RROR</strong>: Topic is closed.', 'bbpress' ) );341 bbp_add_error( 'bbp_reply_topic_closed', __( '<strong>Error</strong>: Topic is closed.', 'bbpress' ) ); 342 342 } 343 343 344 344 /** Topic Tags ************************************************************/ … … 398 398 399 399 // Term error 400 400 if ( is_wp_error( $terms ) ) { 401 bbp_add_error( 'bbp_reply_tags', __( '<strong>E RROR</strong>: There was a problem adding the tags to the topic.', 'bbpress' ) );401 bbp_add_error( 'bbp_reply_tags', __( '<strong>Error</strong>: There was a problem adding the tags to the topic.', 'bbpress' ) ); 402 402 } 403 403 404 404 /** Trash Check *******************************************************/ … … 471 471 472 472 // WP_Error 473 473 } elseif ( is_wp_error( $reply_id ) ) { 474 bbp_add_error( 'bbp_reply_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) occurred: %s', 'bbpress' ), $reply_id->get_error_message() ) );474 bbp_add_error( 'bbp_reply_error', sprintf( __( '<strong>Error</strong>: The following problem(s) occurred: %s', 'bbpress' ), $reply_id->get_error_message() ) ); 475 475 476 476 // Generic error 477 477 } else { 478 bbp_add_error( 'bbp_reply_error', __( '<strong>E RROR</strong>: The reply was not created.', 'bbpress' ) );478 bbp_add_error( 'bbp_reply_error', __( '<strong>Error</strong>: The reply was not created.', 'bbpress' ) ); 479 479 } 480 480 } 481 481 … … 503 503 504 504 // Reply id was not passed 505 505 if ( empty( $_POST['bbp_reply_id'] ) ) { 506 bbp_add_error( 'bbp_edit_reply_id', __( '<strong>E RROR</strong>: Reply ID not found.', 'bbpress' ) );506 bbp_add_error( 'bbp_edit_reply_id', __( '<strong>Error</strong>: Reply ID not found.', 'bbpress' ) ); 507 507 return; 508 508 509 509 // Reply id was passed … … 514 514 515 515 // Nonce check 516 516 if ( ! bbp_verify_nonce_request( 'bbp-edit-reply_' . $reply_id ) ) { 517 bbp_add_error( 'bbp_edit_reply_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );517 bbp_add_error( 'bbp_edit_reply_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 518 518 return; 519 519 } 520 520 521 521 // Reply does not exist 522 522 if ( empty( $reply ) ) { 523 bbp_add_error( 'bbp_edit_reply_not_found', __( '<strong>E RROR</strong>: The reply you want to edit was not found.', 'bbpress' ) );523 bbp_add_error( 'bbp_edit_reply_not_found', __( '<strong>Error</strong>: The reply you want to edit was not found.', 'bbpress' ) ); 524 524 return; 525 525 526 526 // Reply exists … … 531 531 532 532 // User cannot edit this reply 533 533 if ( ! current_user_can( 'edit_reply', $reply_id ) ) { 534 bbp_add_error( 'bbp_edit_reply_permission', __( '<strong>E RROR</strong>: You do not have permission to edit that reply.', 'bbpress' ) );534 bbp_add_error( 'bbp_edit_reply_permission', __( '<strong>Error</strong>: You do not have permission to edit that reply.', 'bbpress' ) ); 535 535 return; 536 536 } 537 537 … … 566 566 567 567 // Forum is a category 568 568 if ( bbp_is_forum_category( $forum_id ) ) { 569 bbp_add_error( 'bbp_edit_reply_forum_category', __( '<strong>E RROR</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) );569 bbp_add_error( 'bbp_edit_reply_forum_category', __( '<strong>Error</strong>: This forum is a category. No replies can be created in this forum.', 'bbpress' ) ); 570 570 571 571 // Forum is not a category 572 572 } else { … … 573 573 574 574 // Forum is closed and user cannot access 575 575 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 576 bbp_add_error( 'bbp_edit_reply_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new replies.', 'bbpress' ) );576 bbp_add_error( 'bbp_edit_reply_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new replies.', 'bbpress' ) ); 577 577 } 578 578 579 579 // Forum is private and user cannot access 580 580 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 581 bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) );581 bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 582 582 583 583 // Forum is hidden and user cannot access 584 584 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 585 bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) );585 bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 586 586 } 587 587 } 588 588 } … … 598 598 599 599 // Title too long 600 600 if ( bbp_is_title_too_long( $reply_title ) ) { 601 bbp_add_error( 'bbp_reply_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );601 bbp_add_error( 'bbp_reply_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 602 602 } 603 603 604 604 /** Reply Content *********************************************************/ … … 612 612 613 613 // No reply content 614 614 if ( empty( $reply_content ) ) { 615 bbp_add_error( 'bbp_edit_reply_content', __( '<strong>E RROR</strong>: Your reply cannot be empty.', 'bbpress' ) );615 bbp_add_error( 'bbp_edit_reply_content', __( '<strong>Error</strong>: Your reply cannot be empty.', 'bbpress' ) ); 616 616 } 617 617 618 618 /** Reply Bad Words *******************************************************/ 619 619 620 620 if ( ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content, true ) ) { 621 bbp_add_error( 'bbp_reply_moderation', __( '<strong>E RROR</strong>: Your reply cannot be edited at this time.', 'bbpress' ) );621 bbp_add_error( 'bbp_reply_moderation', __( '<strong>Error</strong>: Your reply cannot be edited at this time.', 'bbpress' ) ); 622 622 } 623 623 624 624 /** Reply Status **********************************************************/ … … 708 708 709 709 // Term error 710 710 if ( is_wp_error( $terms ) ) { 711 bbp_add_error( 'bbp_reply_tags', __( '<strong>E RROR</strong>: There was a problem adding the tags to the topic.', 'bbpress' ) );711 bbp_add_error( 'bbp_reply_tags', __( '<strong>Error</strong>: There was a problem adding the tags to the topic.', 'bbpress' ) ); 712 712 } 713 713 714 714 /** No Errors *************************************************************/ … … 766 766 767 767 } else { 768 768 $append_error = ( is_wp_error( $reply_id ) && $reply_id->get_error_message() ) ? $reply_id->get_error_message() . ' ' : ''; 769 bbp_add_error( 'bbp_reply_error', __( '<strong>E RROR</strong>: The following problem(s) have been found with your reply:' . $append_error . 'Please try again.', 'bbpress' ) );769 bbp_add_error( 'bbp_reply_error', __( '<strong>Error</strong>: The following problem(s) have been found with your reply:' . $append_error . 'Please try again.', 'bbpress' ) ); 770 770 } 771 771 } 772 772 … … 1212 1212 /** Move Reply ***********************************************************/ 1213 1213 1214 1214 if ( empty( $_POST['bbp_reply_id'] ) ) { 1215 bbp_add_error( 'bbp_move_reply_reply_id', __( '<strong>E RROR</strong>: A reply ID is required', 'bbpress' ) );1215 bbp_add_error( 'bbp_move_reply_reply_id', __( '<strong>Error</strong>: A reply ID is required', 'bbpress' ) ); 1216 1216 } else { 1217 1217 $move_reply_id = (int) $_POST['bbp_reply_id']; 1218 1218 } … … 1221 1221 1222 1222 // Reply exists 1223 1223 if ( empty( $move_reply ) ) { 1224 bbp_add_error( 'bbp_mover_reply_r_not_found', __( '<strong>E RROR</strong>: The reply you want to move was not found.', 'bbpress' ) );1224 bbp_add_error( 'bbp_mover_reply_r_not_found', __( '<strong>Error</strong>: The reply you want to move was not found.', 'bbpress' ) ); 1225 1225 } 1226 1226 1227 1227 /** Topic to Move From ***************************************************/ … … 1231 1231 1232 1232 // No topic 1233 1233 if ( empty( $source_topic ) ) { 1234 bbp_add_error( 'bbp_move_reply_source_not_found', __( '<strong>E RROR</strong>: The topic you want to move from was not found.', 'bbpress' ) );1234 bbp_add_error( 'bbp_move_reply_source_not_found', __( '<strong>Error</strong>: The topic you want to move from was not found.', 'bbpress' ) ); 1235 1235 } 1236 1236 1237 1237 // Nonce check failed 1238 1238 if ( ! bbp_verify_nonce_request( 'bbp-move-reply_' . $move_reply->ID ) ) { 1239 bbp_add_error( 'bbp_move_reply_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1239 bbp_add_error( 'bbp_move_reply_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1240 1240 return; 1241 1241 } 1242 1242 1243 1243 // Use cannot edit topic 1244 1244 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1245 bbp_add_error( 'bbp_move_reply_source_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) );1245 bbp_add_error( 'bbp_move_reply_source_permission', __( '<strong>Error</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1246 1246 } 1247 1247 1248 1248 // How to move … … 1252 1252 1253 1253 // Invalid move option 1254 1254 if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ), true ) ) { 1255 bbp_add_error( 'bbp_move_reply_option', __( '<strong>E RROR</strong>: You need to choose a valid move option.', 'bbpress' ) );1255 bbp_add_error( 'bbp_move_reply_option', __( '<strong>Error</strong>: You need to choose a valid move option.', 'bbpress' ) ); 1256 1256 1257 1257 // Valid move option 1258 1258 } else { … … 1265 1265 1266 1266 // Get destination topic id 1267 1267 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1268 bbp_add_error( 'bbp_move_reply_destination_id', __( '<strong>E RROR</strong>: A topic ID is required.', 'bbpress' ) );1268 bbp_add_error( 'bbp_move_reply_destination_id', __( '<strong>Error</strong>: A topic ID is required.', 'bbpress' ) ); 1269 1269 } else { 1270 1270 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1271 1271 } … … 1275 1275 1276 1276 // No destination topic 1277 1277 if ( empty( $destination_topic ) ) { 1278 bbp_add_error( 'bbp_move_reply_destination_not_found', __( '<strong>E RROR</strong>: The topic you want to move to was not found.', 'bbpress' ) );1278 bbp_add_error( 'bbp_move_reply_destination_not_found', __( '<strong>Error</strong>: The topic you want to move to was not found.', 'bbpress' ) ); 1279 1279 } 1280 1280 1281 1281 // User cannot edit the destination topic 1282 1282 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1283 bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) );1283 bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>Error</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1284 1284 } 1285 1285 1286 1286 // Bump the reply position … … 1334 1334 1335 1335 // Shouldn't happen 1336 1336 if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) { 1337 bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>E RROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );1337 bbp_add_error( 'bbp_move_reply_destination_reply', __( '<strong>Error</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) ); 1338 1338 } 1339 1339 1340 1340 // User cannot publish posts 1341 1341 } else { 1342 bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) );1342 bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>Error</strong>: You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) ); 1343 1343 } 1344 1344 1345 1345 break; … … 1487 1487 // Make sure reply exists 1488 1488 $reply = bbp_get_reply( $reply_id ); 1489 1489 if ( empty( $reply ) ) { 1490 bbp_add_error( 'bbp_toggle_reply_missing', __( '<strong>E RROR</strong>: This reply could not be found or no longer exists.', 'bbpress' ) );1490 bbp_add_error( 'bbp_toggle_reply_missing', __( '<strong>Error</strong>: This reply could not be found or no longer exists.', 'bbpress' ) ); 1491 1491 return; 1492 1492 } 1493 1493 1494 1494 // What is the user doing here? 1495 1495 if ( ! current_user_can( 'edit_reply', $reply_id ) || ( 'bbp_toggle_reply_trash' === $action && ! current_user_can( 'delete_reply', $reply_id ) ) ) { 1496 bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>E RROR</strong>: You do not have permission to do that.', 'bbpress' ) );1496 bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>Error</strong>: You do not have permission to do that.', 'bbpress' ) ); 1497 1497 return; 1498 1498 } 1499 1499 … … 1569 1569 1570 1570 $is_approve = bbp_is_reply_pending( $r['id'] ); 1571 1571 $retval['status'] = $is_approve ? bbp_approve_reply( $r['id'] ) : bbp_unapprove_reply( $r['id'] ); 1572 $retval['message'] = $is_approve ? __( '<strong>E RROR</strong>: There was a problem approving the reply.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem unapproving the reply.', 'bbpress' );1572 $retval['message'] = $is_approve ? __( '<strong>Error</strong>: There was a problem approving the reply.', 'bbpress' ) : __( '<strong>Error</strong>: There was a problem unapproving the reply.', 'bbpress' ); 1573 1573 $retval['view_all'] = ! $is_approve; 1574 1574 1575 1575 break; … … 1580 1580 1581 1581 $is_spam = bbp_is_reply_spam( $r['id'] ); 1582 1582 $retval['status'] = $is_spam ? bbp_unspam_reply( $r['id'] ) : bbp_spam_reply( $r['id'] ); 1583 $retval['message'] = $is_spam ? __( '<strong>E RROR</strong>: There was a problem unmarking the reply as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the reply as spam.', 'bbpress' );1583 $retval['message'] = $is_spam ? __( '<strong>Error</strong>: There was a problem unmarking the reply as spam.', 'bbpress' ) : __( '<strong>Error</strong>: There was a problem marking the reply as spam.', 'bbpress' ); 1584 1584 $retval['view_all'] = ! $is_spam; 1585 1585 1586 1586 break; … … 1595 1595 1596 1596 $retval['view_all'] = true; 1597 1597 $retval['status'] = wp_trash_post( $r['id'] ); 1598 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem trashing the reply.', 'bbpress' );1598 $retval['message'] = __( '<strong>Error</strong>: There was a problem trashing the reply.', 'bbpress' ); 1599 1599 1600 1600 break; 1601 1601 … … 1603 1603 check_ajax_referer( "untrash-{$nonce_suffix}" ); 1604 1604 1605 1605 $retval['status'] = wp_untrash_post( $r['id'] ); 1606 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem untrashing the reply.', 'bbpress' );1606 $retval['message'] = __( '<strong>Error</strong>: There was a problem untrashing the reply.', 'bbpress' ); 1607 1607 1608 1608 break; 1609 1609 … … 1611 1611 check_ajax_referer( "delete-{$nonce_suffix}" ); 1612 1612 1613 1613 $retval['status'] = wp_delete_post( $r['id'] ); 1614 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem deleting the reply.', 'bbpress' );1614 $retval['message'] = __( '<strong>Error</strong>: There was a problem deleting the reply.', 'bbpress' ); 1615 1615 1616 1616 break; 1617 1617 } -
includes/topics/functions.php
102 102 103 103 // Nonce check 104 104 if ( ! bbp_verify_nonce_request( 'bbp-new-topic' ) ) { 105 bbp_add_error( 'bbp_new_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );105 bbp_add_error( 'bbp_new_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 106 106 return; 107 107 } 108 108 … … 129 129 130 130 // User cannot create topics 131 131 if ( ! current_user_can( 'publish_topics' ) ) { 132 bbp_add_error( 'bbp_topic_permission', __( '<strong>E RROR</strong>: You do not have permission to create new topics.', 'bbpress' ) );132 bbp_add_error( 'bbp_topic_permission', __( '<strong>Error</strong>: You do not have permission to create new topics.', 'bbpress' ) ); 133 133 return; 134 134 } 135 135 … … 155 155 156 156 // No topic title 157 157 if ( empty( $topic_title ) ) { 158 bbp_add_error( 'bbp_topic_title', __( '<strong>E RROR</strong>: Your topic needs a title.', 'bbpress' ) );158 bbp_add_error( 'bbp_topic_title', __( '<strong>Error</strong>: Your topic needs a title.', 'bbpress' ) ); 159 159 } 160 160 161 161 // Title too long 162 162 if ( bbp_is_title_too_long( $topic_title ) ) { 163 bbp_add_error( 'bbp_topic_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );163 bbp_add_error( 'bbp_topic_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 164 164 } 165 165 166 166 /** Topic Content *********************************************************/ … … 174 174 175 175 // No topic content 176 176 if ( empty( $topic_content ) ) { 177 bbp_add_error( 'bbp_topic_content', __( '<strong>E RROR</strong>: Your topic cannot be empty.', 'bbpress' ) );177 bbp_add_error( 'bbp_topic_content', __( '<strong>Error</strong>: Your topic cannot be empty.', 'bbpress' ) ); 178 178 } 179 179 180 180 /** Topic Forum ***********************************************************/ … … 184 184 185 185 // Empty Forum id was passed 186 186 if ( empty( $_POST['bbp_forum_id'] ) ) { 187 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID is missing.', 'bbpress' ) );187 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID is missing.', 'bbpress' ) ); 188 188 189 189 // Forum id is not a number 190 190 } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) { 191 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID must be a number.', 'bbpress' ) );191 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID must be a number.', 'bbpress' ) ); 192 192 193 193 // Forum id might be valid 194 194 } else { … … 198 198 199 199 // Forum id is empty 200 200 if ( 0 === $posted_forum_id ) { 201 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID is missing.', 'bbpress' ) );201 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID is missing.', 'bbpress' ) ); 202 202 203 203 // Forum id is a negative number 204 204 } elseif ( 0 > $posted_forum_id ) { 205 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID cannot be a negative number.', 'bbpress' ) );205 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID cannot be a negative number.', 'bbpress' ) ); 206 206 207 207 // Forum does not exist 208 208 } elseif ( ! bbp_get_forum( $posted_forum_id ) ) { 209 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum does not exist.', 'bbpress' ) );209 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum does not exist.', 'bbpress' ) ); 210 210 211 211 // Use the POST'ed forum id 212 212 } else { … … 220 220 221 221 // Forum is a category 222 222 if ( bbp_is_forum_category( $forum_id ) ) { 223 bbp_add_error( 'bbp_new_topic_forum_category', __( '<strong>E RROR</strong>: This forum is a category. No topics can be created in this forum.', 'bbpress' ) );223 bbp_add_error( 'bbp_new_topic_forum_category', __( '<strong>Error</strong>: This forum is a category. No topics can be created in this forum.', 'bbpress' ) ); 224 224 225 225 // Forum is not a category 226 226 } else { … … 227 227 228 228 // Forum is closed and user cannot access 229 229 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 230 bbp_add_error( 'bbp_new_topic_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new topics.', 'bbpress' ) );230 bbp_add_error( 'bbp_new_topic_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new topics.', 'bbpress' ) ); 231 231 } 232 232 233 233 // Forum is private and user cannot access 234 234 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 235 bbp_add_error( 'bbp_new_topic_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) );235 bbp_add_error( 'bbp_new_topic_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) ); 236 236 237 237 // Forum is hidden and user cannot access 238 238 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 239 bbp_add_error( 'bbp_new_topic_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) );239 bbp_add_error( 'bbp_new_topic_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) ); 240 240 } 241 241 } 242 242 } … … 244 244 /** Topic Flooding ********************************************************/ 245 245 246 246 if ( ! bbp_check_for_flood( $anonymous_data, $topic_author ) ) { 247 bbp_add_error( 'bbp_topic_flood', __( '<strong>E RROR</strong>: Slow down; you move too fast.', 'bbpress' ) );247 bbp_add_error( 'bbp_topic_flood', __( '<strong>Error</strong>: Slow down; you move too fast.', 'bbpress' ) ); 248 248 } 249 249 250 250 /** Topic Duplicate *******************************************************/ 251 251 252 252 if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_topic_post_type(), 'post_author' => $topic_author, 'post_content' => $topic_content, 'anonymous_data' => $anonymous_data ) ) ) { 253 bbp_add_error( 'bbp_topic_duplicate', __( '<strong>E RROR</strong>: Duplicate topic detected; it looks as though you’ve already said that.', 'bbpress' ) );253 bbp_add_error( 'bbp_topic_duplicate', __( '<strong>Error</strong>: Duplicate topic detected; it looks as though you’ve already said that.', 'bbpress' ) ); 254 254 } 255 255 256 256 /** Topic Bad Words *******************************************************/ 257 257 258 258 if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content, true ) ) { 259 bbp_add_error( 'bbp_topic_moderation', __( '<strong>E RROR</strong>: Your topic cannot be created at this time.', 'bbpress' ) );259 bbp_add_error( 'bbp_topic_moderation', __( '<strong>Error</strong>: Your topic cannot be created at this time.', 'bbpress' ) ); 260 260 } 261 261 262 262 /** Topic Status **********************************************************/ … … 397 397 398 398 // WP_Error 399 399 } elseif ( is_wp_error( $topic_id ) ) { 400 bbp_add_error( 'bbp_topic_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) occurred: %s', 'bbpress' ), $topic_id->get_error_message() ) );400 bbp_add_error( 'bbp_topic_error', sprintf( __( '<strong>Error</strong>: The following problem(s) occurred: %s', 'bbpress' ), $topic_id->get_error_message() ) ); 401 401 402 402 // Generic error 403 403 } else { 404 bbp_add_error( 'bbp_topic_error', __( '<strong>E RROR</strong>: The topic was not created.', 'bbpress' ) );404 bbp_add_error( 'bbp_topic_error', __( '<strong>Error</strong>: The topic was not created.', 'bbpress' ) ); 405 405 } 406 406 } 407 407 … … 427 427 428 428 // Topic id was not passed 429 429 if ( empty( $_POST['bbp_topic_id'] ) ) { 430 bbp_add_error( 'bbp_edit_topic_id', __( '<strong>E RROR</strong>: Topic ID not found.', 'bbpress' ) );430 bbp_add_error( 'bbp_edit_topic_id', __( '<strong>Error</strong>: Topic ID not found.', 'bbpress' ) ); 431 431 return; 432 432 433 433 // Topic id was passed … … 438 438 439 439 // Topic does not exist 440 440 if ( empty( $topic ) ) { 441 bbp_add_error( 'bbp_edit_topic_not_found', __( '<strong>E RROR</strong>: The topic you want to edit was not found.', 'bbpress' ) );441 bbp_add_error( 'bbp_edit_topic_not_found', __( '<strong>Error</strong>: The topic you want to edit was not found.', 'bbpress' ) ); 442 442 return; 443 443 444 444 // Topic exists … … 449 449 450 450 // User cannot edit this topic 451 451 if ( ! current_user_can( 'edit_topic', $topic_id ) ) { 452 bbp_add_error( 'bbp_edit_topic_permission', __( '<strong>E RROR</strong>: You do not have permission to edit that topic.', 'bbpress' ) );452 bbp_add_error( 'bbp_edit_topic_permission', __( '<strong>Error</strong>: You do not have permission to edit that topic.', 'bbpress' ) ); 453 453 } 454 454 455 455 // Set topic author … … 465 465 466 466 // Nonce check 467 467 if ( ! bbp_verify_nonce_request( 'bbp-edit-topic_' . $topic_id ) ) { 468 bbp_add_error( 'bbp_edit_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );468 bbp_add_error( 'bbp_edit_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 469 469 return; 470 470 } 471 471 … … 480 480 481 481 // Forum id was not passed 482 482 if ( empty( $_POST['bbp_forum_id'] ) ) { 483 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>E RROR</strong>: Forum ID is missing.', 'bbpress' ) );483 bbp_add_error( 'bbp_topic_forum_id', __( '<strong>Error</strong>: Forum ID is missing.', 'bbpress' ) ); 484 484 485 485 // Forum id was passed 486 486 } elseif ( is_numeric( $_POST['bbp_forum_id'] ) ) { … … 495 495 496 496 // Forum is a category 497 497 if ( bbp_is_forum_category( $forum_id ) ) { 498 bbp_add_error( 'bbp_edit_topic_forum_category', __( '<strong>E RROR</strong>: This forum is a category. No topics can be created in it.', 'bbpress' ) );498 bbp_add_error( 'bbp_edit_topic_forum_category', __( '<strong>Error</strong>: This forum is a category. No topics can be created in it.', 'bbpress' ) ); 499 499 500 500 // Forum is not a category 501 501 } else { … … 502 502 503 503 // Forum is closed and user cannot access 504 504 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 505 bbp_add_error( 'bbp_edit_topic_forum_closed', __( '<strong>E RROR</strong>: This forum has been closed to new topics.', 'bbpress' ) );505 bbp_add_error( 'bbp_edit_topic_forum_closed', __( '<strong>Error</strong>: This forum has been closed to new topics.', 'bbpress' ) ); 506 506 } 507 507 508 508 // Forum is private and user cannot access 509 509 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 510 bbp_add_error( 'bbp_edit_topic_forum_private', __( '<strong>E RROR</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) );510 bbp_add_error( 'bbp_edit_topic_forum_private', __( '<strong>Error</strong>: This forum is private and you do not have the capability to read or create new topics in it.', 'bbpress' ) ); 511 511 512 512 // Forum is hidden and user cannot access 513 513 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 514 bbp_add_error( 'bbp_edit_topic_forum_hidden', __( '<strong>E RROR</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) );514 bbp_add_error( 'bbp_edit_topic_forum_hidden', __( '<strong>Error</strong>: This forum is hidden and you do not have the capability to read or create new topics in it.', 'bbpress' ) ); 515 515 } 516 516 } 517 517 } … … 527 527 528 528 // No topic title 529 529 if ( empty( $topic_title ) ) { 530 bbp_add_error( 'bbp_edit_topic_title', __( '<strong>E RROR</strong>: Your topic needs a title.', 'bbpress' ) );530 bbp_add_error( 'bbp_edit_topic_title', __( '<strong>Error</strong>: Your topic needs a title.', 'bbpress' ) ); 531 531 } 532 532 533 533 // Title too long 534 534 if ( bbp_is_title_too_long( $topic_title ) ) { 535 bbp_add_error( 'bbp_topic_title', __( '<strong>E RROR</strong>: Your title is too long.', 'bbpress' ) );535 bbp_add_error( 'bbp_topic_title', __( '<strong>Error</strong>: Your title is too long.', 'bbpress' ) ); 536 536 } 537 537 538 538 /** Topic Content *********************************************************/ … … 546 546 547 547 // No topic content 548 548 if ( empty( $topic_content ) ) { 549 bbp_add_error( 'bbp_edit_topic_content', __( '<strong>E RROR</strong>: Your topic cannot be empty.', 'bbpress' ) );549 bbp_add_error( 'bbp_edit_topic_content', __( '<strong>Error</strong>: Your topic cannot be empty.', 'bbpress' ) ); 550 550 } 551 551 552 552 /** Topic Bad Words *******************************************************/ 553 553 554 554 if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content, true ) ) { 555 bbp_add_error( 'bbp_topic_moderation', __( '<strong>E RROR</strong>: Your topic cannot be edited at this time.', 'bbpress' ) );555 bbp_add_error( 'bbp_topic_moderation', __( '<strong>Error</strong>: Your topic cannot be edited at this time.', 'bbpress' ) ); 556 556 } 557 557 558 558 /** Topic Status **********************************************************/ … … 713 713 714 714 } else { 715 715 $append_error = ( is_wp_error( $topic_id ) && $topic_id->get_error_message() ) ? $topic_id->get_error_message() . ' ' : ''; 716 bbp_add_error( 'bbp_topic_error', __( '<strong>E RROR</strong>: The following problem(s) have been found with your topic:' . $append_error . 'Please try again.', 'bbpress' ) );716 bbp_add_error( 'bbp_topic_error', __( '<strong>Error</strong>: The following problem(s) have been found with your topic:' . $append_error . 'Please try again.', 'bbpress' ) ); 717 717 } 718 718 } 719 719 … … 1083 1083 1084 1084 // Topic id 1085 1085 if ( empty( $_POST['bbp_topic_id'] ) ) { 1086 bbp_add_error( 'bbp_merge_topic_source_id', __( '<strong>E RROR</strong>: Topic ID not found.', 'bbpress' ) );1086 bbp_add_error( 'bbp_merge_topic_source_id', __( '<strong>Error</strong>: Topic ID not found.', 'bbpress' ) ); 1087 1087 } else { 1088 1088 $source_topic_id = (int) $_POST['bbp_topic_id']; 1089 1089 } … … 1090 1090 1091 1091 // Nonce check 1092 1092 if ( ! bbp_verify_nonce_request( 'bbp-merge-topic_' . $source_topic_id ) ) { 1093 bbp_add_error( 'bbp_merge_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1093 bbp_add_error( 'bbp_merge_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1094 1094 return; 1095 1095 1096 1096 // Source topic not found 1097 1097 } elseif ( ! $source_topic = bbp_get_topic( $source_topic_id ) ) { 1098 bbp_add_error( 'bbp_merge_topic_source_not_found', __( '<strong>E RROR</strong>: The topic you want to merge was not found.', 'bbpress' ) );1098 bbp_add_error( 'bbp_merge_topic_source_not_found', __( '<strong>Error</strong>: The topic you want to merge was not found.', 'bbpress' ) ); 1099 1099 return; 1100 1100 } 1101 1101 1102 1102 // Cannot edit source topic 1103 1103 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1104 bbp_add_error( 'bbp_merge_topic_source_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) );1104 bbp_add_error( 'bbp_merge_topic_source_permission', __( '<strong>Error</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1105 1105 return; 1106 1106 } 1107 1107 … … 1109 1109 1110 1110 // Topic id 1111 1111 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1112 bbp_add_error( 'bbp_merge_topic_destination_id', __( '<strong>E RROR</strong>: Destination topic ID not found.', 'bbpress' ) );1112 bbp_add_error( 'bbp_merge_topic_destination_id', __( '<strong>Error</strong>: Destination topic ID not found.', 'bbpress' ) ); 1113 1113 } else { 1114 1114 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1115 1115 } … … 1116 1116 1117 1117 // Destination topic not found 1118 1118 if ( ! $destination_topic = bbp_get_topic( $destination_topic_id ) ) { 1119 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( '<strong>E RROR</strong>: The topic you want to merge to was not found.', 'bbpress' ) );1119 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( '<strong>Error</strong>: The topic you want to merge to was not found.', 'bbpress' ) ); 1120 1120 } 1121 1121 1122 1122 // Cannot edit destination topic 1123 1123 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1124 bbp_add_error( 'bbp_merge_topic_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) );1124 bbp_add_error( 'bbp_merge_topic_destination_permission', __( '<strong>Error</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1125 1125 } 1126 1126 1127 1127 // Bail if errors … … 1341 1341 /** Split Reply ***********************************************************/ 1342 1342 1343 1343 if ( empty( $_POST['bbp_reply_id'] ) ) { 1344 bbp_add_error( 'bbp_split_topic_reply_id', __( '<strong>E RROR</strong>: A reply ID is required.', 'bbpress' ) );1344 bbp_add_error( 'bbp_split_topic_reply_id', __( '<strong>Error</strong>: A reply ID is required.', 'bbpress' ) ); 1345 1345 } else { 1346 1346 $from_reply_id = (int) $_POST['bbp_reply_id']; 1347 1347 } … … 1350 1350 1351 1351 // Reply exists 1352 1352 if ( empty( $from_reply ) ) { 1353 bbp_add_error( 'bbp_split_topic_r_not_found', __( '<strong>E RROR</strong>: The reply you want to split from was not found.', 'bbpress' ) );1353 bbp_add_error( 'bbp_split_topic_r_not_found', __( '<strong>Error</strong>: The reply you want to split from was not found.', 'bbpress' ) ); 1354 1354 } 1355 1355 1356 1356 /** Topic to Split ********************************************************/ … … 1360 1360 1361 1361 // No topic 1362 1362 if ( empty( $source_topic ) ) { 1363 bbp_add_error( 'bbp_split_topic_source_not_found', __( '<strong>E RROR</strong>: The topic you want to split was not found.', 'bbpress' ) );1363 bbp_add_error( 'bbp_split_topic_source_not_found', __( '<strong>Error</strong>: The topic you want to split was not found.', 'bbpress' ) ); 1364 1364 } 1365 1365 1366 1366 // Nonce check failed 1367 1367 if ( ! bbp_verify_nonce_request( 'bbp-split-topic_' . $source_topic->ID ) ) { 1368 bbp_add_error( 'bbp_split_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1368 bbp_add_error( 'bbp_split_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1369 1369 return; 1370 1370 } 1371 1371 1372 1372 // Use cannot edit topic 1373 1373 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1374 bbp_add_error( 'bbp_split_topic_source_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) );1374 bbp_add_error( 'bbp_split_topic_source_permission', __( '<strong>Error</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1375 1375 } 1376 1376 1377 1377 // How to Split … … 1381 1381 1382 1382 // Invalid split option 1383 1383 if ( empty( $split_option ) || ! in_array( $split_option, array( 'existing', 'reply' ), true ) ) { 1384 bbp_add_error( 'bbp_split_topic_option', __( '<strong>E RROR</strong>: You need to choose a valid split option.', 'bbpress' ) );1384 bbp_add_error( 'bbp_split_topic_option', __( '<strong>Error</strong>: You need to choose a valid split option.', 'bbpress' ) ); 1385 1385 1386 1386 // Valid Split Option 1387 1387 } else { … … 1394 1394 1395 1395 // Get destination topic id 1396 1396 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1397 bbp_add_error( 'bbp_split_topic_destination_id', __( '<strong>E RROR</strong>: A topic ID is required.', 'bbpress' ) );1397 bbp_add_error( 'bbp_split_topic_destination_id', __( '<strong>Error</strong>: A topic ID is required.', 'bbpress' ) ); 1398 1398 } else { 1399 1399 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1400 1400 } … … 1404 1404 1405 1405 // No destination topic 1406 1406 if ( empty( $destination_topic ) ) { 1407 bbp_add_error( 'bbp_split_topic_destination_not_found', __( '<strong>E RROR</strong>: The topic you want to split to was not found.', 'bbpress' ) );1407 bbp_add_error( 'bbp_split_topic_destination_not_found', __( '<strong>Error</strong>: The topic you want to split to was not found.', 'bbpress' ) ); 1408 1408 } 1409 1409 1410 1410 // User cannot edit the destination topic 1411 1411 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1412 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) );1412 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>Error</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1413 1413 } 1414 1414 1415 1415 break; … … 1447 1447 1448 1448 // Shouldn't happen 1449 1449 if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) { 1450 bbp_add_error( 'bbp_split_topic_destination_reply', __( '<strong>E RROR</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) );1450 bbp_add_error( 'bbp_split_topic_destination_reply', __( '<strong>Error</strong>: There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) ); 1451 1451 } 1452 1452 1453 1453 // User cannot publish posts 1454 1454 } else { 1455 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) );1455 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>Error</strong>: You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) ); 1456 1456 } 1457 1457 1458 1458 break; … … 1689 1689 1690 1690 // Tag does not exist 1691 1691 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1692 bbp_add_error( 'bbp_manage_topic_invalid_tag', sprintf( __( '<strong>E RROR</strong>: The following problem(s) have been found while getting the tag: %s', 'bbpress' ), $tag->get_error_message() ) );1692 bbp_add_error( 'bbp_manage_topic_invalid_tag', sprintf( __( '<strong>Error</strong>: The following problem(s) have been found while getting the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1693 1693 return; 1694 1694 } 1695 1695 … … 1701 1701 1702 1702 // Nonce check 1703 1703 if ( ! bbp_verify_nonce_request( 'update-tag_' . $tag_id ) ) { 1704 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1704 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1705 1705 return; 1706 1706 } 1707 1707 1708 1708 // Can user edit topic tags? 1709 1709 if ( ! current_user_can( 'edit_topic_tag', $tag_id ) ) { 1710 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) );1710 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( '<strong>Error</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) ); 1711 1711 return; 1712 1712 } 1713 1713 1714 1714 // No tag name was provided 1715 1715 if ( empty( $_POST['tag-name'] ) || ! $name = $_POST['tag-name'] ) { 1716 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( '<strong>E RROR</strong>: You need to enter a tag name.', 'bbpress' ) );1716 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( '<strong>Error</strong>: You need to enter a tag name.', 'bbpress' ) ); 1717 1717 return; 1718 1718 } 1719 1719 … … 1728 1728 1729 1729 // Cannot update tag 1730 1730 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1731 bbp_add_error( 'bbp_manage_topic_tag_update_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) have been found while updating the tag: %s', 'bbpress' ), $tag->get_error_message() ) );1731 bbp_add_error( 'bbp_manage_topic_tag_update_error', sprintf( __( '<strong>Error</strong>: The following problem(s) have been found while updating the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1732 1732 return; 1733 1733 } 1734 1734 … … 1745 1745 1746 1746 // Nonce check 1747 1747 if ( ! bbp_verify_nonce_request( 'merge-tag_' . $tag_id ) ) { 1748 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1748 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1749 1749 return; 1750 1750 } 1751 1751 1752 1752 // Can user edit topic tags? 1753 1753 if ( ! current_user_can( 'edit_topic_tags' ) ) { 1754 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) );1754 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( '<strong>Error</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) ); 1755 1755 return; 1756 1756 } 1757 1757 1758 1758 // No tag name was provided 1759 1759 if ( empty( $_POST['tag-existing-name'] ) || ! $name = $_POST['tag-existing-name'] ) { 1760 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( '<strong>E RROR</strong>: You need to enter a tag name.', 'bbpress' ) );1760 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( '<strong>Error</strong>: You need to enter a tag name.', 'bbpress' ) ); 1761 1761 return; 1762 1762 } 1763 1763 … … 1768 1768 1769 1769 // Problem inserting the new term 1770 1770 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1771 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) );1771 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( '<strong>Error</strong>: The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) ); 1772 1772 return; 1773 1773 } 1774 1774 … … 1777 1777 1778 1778 // Attempting to merge a tag into itself 1779 1779 if ( $tag_id === $to_tag ) { 1780 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>E RROR</strong>: The tags which are being merged can not be the same.', 'bbpress' ) );1780 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>Error</strong>: The tags which are being merged can not be the same.', 'bbpress' ) ); 1781 1781 return; 1782 1782 } 1783 1783 … … 1789 1789 1790 1790 // Error merging the terms 1791 1791 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1792 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) );1792 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( '<strong>Error</strong>: The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) ); 1793 1793 return; 1794 1794 } 1795 1795 … … 1806 1806 1807 1807 // Nonce check 1808 1808 if ( ! bbp_verify_nonce_request( 'delete-tag_' . $tag_id ) ) { 1809 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1809 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1810 1810 return; 1811 1811 } 1812 1812 1813 1813 // Can user delete topic tags? 1814 1814 if ( ! current_user_can( 'delete_topic_tag', $tag_id ) ) { 1815 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( '<strong>E RROR</strong>: You do not have permission to delete the topic tags.', 'bbpress' ) );1815 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( '<strong>Error</strong>: You do not have permission to delete the topic tags.', 'bbpress' ) ); 1816 1816 return; 1817 1817 } 1818 1818 … … 1821 1821 1822 1822 // Error deleting term 1823 1823 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1824 bbp_add_error( 'bbp_manage_topic_tag_delete_error', sprintf( __( '<strong>E RROR</strong>: The following problem(s) have been found while deleting the tag: %s', 'bbpress' ), $tag->get_error_message() ) );1824 bbp_add_error( 'bbp_manage_topic_tag_delete_error', sprintf( __( '<strong>Error</strong>: The following problem(s) have been found while deleting the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1825 1825 return; 1826 1826 } 1827 1827 … … 2017 2017 // Make sure topic exists 2018 2018 $topic = bbp_get_topic( $topic_id ); 2019 2019 if ( empty( $topic ) ) { 2020 bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>E RROR</strong>: This topic could not be found or no longer exists.', 'bbpress' ) );2020 bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>Error</strong>: This topic could not be found or no longer exists.', 'bbpress' ) ); 2021 2021 return; 2022 2022 } 2023 2023 2024 2024 // What is the user doing here? 2025 2025 if ( ! current_user_can( 'edit_topic', $topic_id ) || ( 'bbp_toggle_topic_trash' === $action && ! current_user_can( 'delete_topic', $topic_id ) ) ) { 2026 bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>E RROR</strong>: You do not have permission to do that.', 'bbpress' ) );2026 bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>Error</strong>: You do not have permission to do that.', 'bbpress' ) ); 2027 2027 return; 2028 2028 } 2029 2029 … … 2107 2107 2108 2108 // Feedback 2109 2109 $retval['message'] = ( true === $is_pending ) 2110 ? __( '<strong>E RROR</strong>: There was a problem approving the topic.', 'bbpress' )2111 : __( '<strong>E RROR</strong>: There was a problem unapproving the topic.', 'bbpress' );2110 ? __( '<strong>Error</strong>: There was a problem approving the topic.', 'bbpress' ) 2111 : __( '<strong>Error</strong>: There was a problem unapproving the topic.', 'bbpress' ); 2112 2112 2113 2113 break; 2114 2114 … … 2125 2125 2126 2126 // Feedback 2127 2127 $retval['message'] = ( true === $is_open ) 2128 ? __( '<strong>E RROR</strong>: There was a problem closing the topic.', 'bbpress' )2129 : __( '<strong>E RROR</strong>: There was a problem opening the topic.', 'bbpress' );2128 ? __( '<strong>Error</strong>: There was a problem closing the topic.', 'bbpress' ) 2129 : __( '<strong>Error</strong>: There was a problem opening the topic.', 'bbpress' ); 2130 2130 2131 2131 break; 2132 2132 … … 2144 2144 2145 2145 // Feedback 2146 2146 $retval['message'] = ( true === $is_sticky ) 2147 ? __( '<strong>E RROR</strong>: There was a problem unsticking the topic.', 'bbpress' )2148 : __( '<strong>E RROR</strong>: There was a problem sticking the topic.', 'bbpress' );2147 ? __( '<strong>Error</strong>: There was a problem unsticking the topic.', 'bbpress' ) 2148 : __( '<strong>Error</strong>: There was a problem sticking the topic.', 'bbpress' ); 2149 2149 2150 2150 break; 2151 2151 … … 2163 2163 2164 2164 // Feedback 2165 2165 $retval['message'] = ( true === $is_spam ) 2166 ? __( '<strong>E RROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' )2167 : __( '<strong>E RROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );2166 ? __( '<strong>Error</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) 2167 : __( '<strong>Error</strong>: There was a problem marking the topic as spam.', 'bbpress' ); 2168 2168 2169 2169 break; 2170 2170 … … 2177 2177 2178 2178 $retval['view_all'] = true; 2179 2179 $retval['status'] = wp_trash_post( $r['id'] ); 2180 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem trashing the topic.', 'bbpress' );2180 $retval['message'] = __( '<strong>Error</strong>: There was a problem trashing the topic.', 'bbpress' ); 2181 2181 $retval['redirect_to'] = current_user_can( 'view_trash' ) 2182 2182 ? bbp_get_topic_permalink( $r['id'] ) 2183 2183 : bbp_get_forum_permalink( bbp_get_topic_forum_id( $r['id'] ) ); … … 2188 2188 check_ajax_referer( "untrash-{$nonce_suffix}" ); 2189 2189 2190 2190 $retval['status'] = wp_untrash_post( $r['id'] ); 2191 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem untrashing the topic.', 'bbpress' );2191 $retval['message'] = __( '<strong>Error</strong>: There was a problem untrashing the topic.', 'bbpress' ); 2192 2192 $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] ); 2193 2193 2194 2194 break; … … 2197 2197 check_ajax_referer( "delete-{$nonce_suffix}" ); 2198 2198 2199 2199 $retval['status'] = wp_delete_post( $r['id'] ); 2200 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem deleting the topic.', 'bbpress' );2200 $retval['message'] = __( '<strong>Error</strong>: There was a problem deleting the topic.', 'bbpress' ); 2201 2201 $retval['redirect_to'] = bbp_get_forum_permalink( $retval['status']->post_parent ); 2202 2202 2203 2203 break; -
includes/users/engagements.php
605 605 606 606 // Check for empty topic 607 607 if ( empty( $topic_id ) ) { 608 bbp_add_error( 'bbp_favorite_topic_id', __( '<strong>E RROR</strong>: No topic was found. Which topic are you marking/unmarking as favorite?', 'bbpress' ) );608 bbp_add_error( 'bbp_favorite_topic_id', __( '<strong>Error</strong>: No topic was found. Which topic are you marking/unmarking as favorite?', 'bbpress' ) ); 609 609 610 610 // Check nonce 611 611 } elseif ( ! bbp_verify_nonce_request( 'toggle-favorite_' . $topic_id ) ) { 612 bbp_add_error( 'bbp_favorite_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );612 bbp_add_error( 'bbp_favorite_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 613 613 614 614 // Check current user's ability to edit the user 615 615 } elseif ( ! current_user_can( 'edit_user', $user_id ) ) { 616 bbp_add_error( 'bbp_favorite_permission', __( '<strong>E RROR</strong>: You do not have permission to edit favorites for that user.', 'bbpress' ) );616 bbp_add_error( 'bbp_favorite_permission', __( '<strong>Error</strong>: You do not have permission to edit favorites for that user.', 'bbpress' ) ); 617 617 } 618 618 619 619 // Bail if errors … … 654 654 655 655 // Fail! Handle errors 656 656 } elseif ( 'bbp_favorite_remove' === $action ) { 657 bbp_add_error( 'bbp_favorite_remove', __( '<strong>E RROR</strong>: There was a problem removing that topic from favorites.', 'bbpress' ) );657 bbp_add_error( 'bbp_favorite_remove', __( '<strong>Error</strong>: There was a problem removing that topic from favorites.', 'bbpress' ) ); 658 658 } elseif ( 'bbp_favorite_add' === $action ) { 659 bbp_add_error( 'bbp_favorite_add', __( '<strong>E RROR</strong>: There was a problem favoriting that topic.', 'bbpress' ) );659 bbp_add_error( 'bbp_favorite_add', __( '<strong>Error</strong>: There was a problem favoriting that topic.', 'bbpress' ) ); 660 660 } 661 661 662 662 return (bool) $success; … … 846 846 847 847 // Check for empty topic 848 848 if ( empty( $object_id ) ) { 849 bbp_add_error( 'bbp_subscription_object_id', __( '<strong>E RROR</strong>: Not found. What are you subscribing/unsubscribing to?', 'bbpress' ) );849 bbp_add_error( 'bbp_subscription_object_id', __( '<strong>Error</strong>: Not found. What are you subscribing/unsubscribing to?', 'bbpress' ) ); 850 850 851 851 // Check nonce 852 852 } elseif ( ! bbp_verify_nonce_request( 'toggle-subscription_' . $object_id ) ) { 853 bbp_add_error( 'bbp_subscription_object_id', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );853 bbp_add_error( 'bbp_subscription_object_id', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 854 854 855 855 // Check current user's ability to edit the user 856 856 } elseif ( ! current_user_can( 'edit_user', $user_id ) ) { 857 bbp_add_error( 'bbp_subscription_permission', __( '<strong>E RROR</strong>: You do not have permission to edit subscriptions of that user.', 'bbpress' ) );857 bbp_add_error( 'bbp_subscription_permission', __( '<strong>Error</strong>: You do not have permission to edit subscriptions of that user.', 'bbpress' ) ); 858 858 } 859 859 860 860 // Bail if we have errors … … 897 897 898 898 // Fail! Handle errors 899 899 } elseif ( 'bbp_unsubscribe' === $action ) { 900 bbp_add_error( 'bbp_unsubscribe', __( '<strong>E RROR</strong>: There was a problem unsubscribing.', 'bbpress' ) );900 bbp_add_error( 'bbp_unsubscribe', __( '<strong>Error</strong>: There was a problem unsubscribing.', 'bbpress' ) ); 901 901 } elseif ( 'bbp_subscribe' === $action ) { 902 bbp_add_error( 'bbp_subscribe', __( '<strong>E RROR</strong>: There was a problem subscribing.', 'bbpress' ) );902 bbp_add_error( 'bbp_subscribe', __( '<strong>Error</strong>: There was a problem subscribing.', 'bbpress' ) ); 903 903 } 904 904 905 905 return (bool) $success; -
includes/users/functions.php
193 193 194 194 // Nonce check 195 195 if ( ! bbp_verify_nonce_request( 'update-user_' . $user_id ) ) { 196 bbp_add_error( 'bbp_update_user_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );196 bbp_add_error( 'bbp_update_user_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 197 197 return; 198 198 } 199 199 200 200 // Cap check 201 201 if ( ! current_user_can( 'edit_user', $user_id ) ) { 202 bbp_add_error( 'bbp_update_user_capability', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );202 bbp_add_error( 'bbp_update_user_capability', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 203 203 return; 204 204 } 205 205 206 206 // Empty email check 207 207 if ( empty( $_POST['email'] ) ) { 208 bbp_add_error( 'bbp_user_email_empty', __( '<strong>E RROR</strong>: That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) );208 bbp_add_error( 'bbp_user_email_empty', __( '<strong>Error</strong>: That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) ); 209 209 return; 210 210 } 211 211 … … 217 217 218 218 // Check that new email address is valid 219 219 if ( ! is_email( $_POST['email'] ) ) { 220 bbp_add_error( 'bbp_user_email_invalid', __( '<strong>E RROR</strong>: That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) );220 bbp_add_error( 'bbp_user_email_invalid', __( '<strong>Error</strong>: That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) ); 221 221 return; 222 222 } 223 223 224 224 // Check if email address is already in use 225 225 if ( email_exists( $_POST['email'] ) ) { 226 bbp_add_error( 'bbp_user_email_taken', __( '<strong>E RROR</strong>: That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) );226 bbp_add_error( 'bbp_user_email_taken', __( '<strong>Error</strong>: That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) ); 227 227 return; 228 228 } 229 229 … … 340 340 if ( email_exists( $new_email['newemail'] ) ) { 341 341 delete_user_meta( $user_id, $key ); 342 342 343 bbp_add_error( 'bbp_user_email_taken', __( '<strong>E RROR</strong>: That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) );343 bbp_add_error( 'bbp_user_email_taken', __( '<strong>Error</strong>: That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) ); 344 344 345 345 // Email address is good to change to 346 346 } else { … … 377 377 // Delete new email address from user options 378 378 } elseif ( ! empty( $_GET['dismiss'] ) && ( "{$user_id}{$key}" === $_GET['dismiss'] ) ) { 379 379 if ( ! bbp_verify_nonce_request( "dismiss-{$user_id}{$key}" ) ) { 380 bbp_add_error( 'bbp_dismiss_new_email_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );380 bbp_add_error( 'bbp_dismiss_new_email_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 381 381 return; 382 382 } 383 383 … … 403 403 404 404 // Bail if any relevant parameters are empty 405 405 if ( empty( $user_id ) || empty( $r['hash'] ) || empty( $r['newemail'] ) ) { 406 bbp_add_error( 'bbp_user_email_invalid_hash', __( '<strong>E RROR</strong>: An error occurred while updating your email address.', 'bbpress' ), array( 'form-field' => 'email' ) );406 bbp_add_error( 'bbp_user_email_invalid_hash', __( '<strong>Error</strong>: An error occurred while updating your email address.', 'bbpress' ), array( 'form-field' => 'email' ) ); 407 407 return; 408 408 } 409 409