Ticket #3210: 3210.diff
| File 3210.diff, 74.4 KB (added by , 8 years ago) |
|---|
-
src/includes/common/functions.php
526 526 // Filter name 527 527 $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); 528 528 if ( empty( $r['bbp_anonymous_name'] ) ) { 529 bbp_add_error( 'bbp_anonymous_name', __( ' <strong>ERROR</strong>:Invalid author name.', 'bbpress' ) );529 bbp_add_error( 'bbp_anonymous_name', __( 'Invalid author name.', 'bbpress' ) ); 530 530 } 531 531 532 532 // Filter email address 533 533 $r['bbp_anonymous_email'] = apply_filters( 'bbp_pre_anonymous_post_author_email', $r['bbp_anonymous_email'] ); 534 534 if ( empty( $r['bbp_anonymous_email'] ) ) { 535 bbp_add_error( 'bbp_anonymous_email', __( ' <strong>ERROR</strong>:Invalid email address.', 'bbpress' ) );535 bbp_add_error( 'bbp_anonymous_email', __( 'Invalid email address.', 'bbpress' ) ); 536 536 } 537 537 538 538 // Website is optional (can be empty) -
src/includes/core/functions.php
286 286 * @param string $message Translated error message 287 287 * @param string $data Any additional data passed with the error message 288 288 */ 289 function bbp_add_ error( $code = '', $message = '', $data = '' ) {289 function bbp_add_notice( $code = '', $message = '', $data = '' ) { 290 290 bbpress()->errors->add( $code, $message, $data ); 291 291 } 292 292 293 293 /** 294 * Adds an error message to later be output in the theme 295 * 296 * @since 2.0.0 bbPress (r3381) 297 * 298 * @see WP_Error() 299 * 300 * @param string $code Unique code for the error message 301 * @param string $message Translated error message 302 * @param string $data Any additional data passed with the error message 303 */ 304 function bbp_add_error( $code = '', $message = '', $data = '' ) { 305 306 // Add "Error" prefix 307 $prefix = __( '<strong>ERROR</strong>: ', 'bbpress' ); 308 309 bbpress()->errors->add( $code, $prefix . $message, $data ); 310 } 311 312 /** 294 313 * Check if error messages exist in queue 295 314 * 296 315 * @since 2.0.0 bbPress (r3381) -
src/includes/extend/buddypress/groups.php
397 397 398 398 // Theme-side Nonce check 399 399 } elseif ( ! bbp_verify_nonce_request( 'groups_edit_save_' . $this->slug ) ) { 400 bbp_add_error( 'bbp_edit_group_forum_screen_save', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );400 bbp_add_error( 'bbp_edit_group_forum_screen_save', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 401 401 return; 402 402 } 403 403 … … 554 554 555 555 // Nonce check 556 556 if ( ! bbp_verify_nonce_request( 'groups_create_save_' . $this->slug ) ) { 557 bbp_add_error( 'bbp_create_group_forum_screen_save', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );557 bbp_add_error( 'bbp_create_group_forum_screen_save', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 558 558 return; 559 559 } 560 560 -
src/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>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );196 bbp_add_error( 'bbp_notification_topic_id', __( '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>ERROR</strong>:You do not have permission to mark notifications for that user.', 'bbpress' ) );200 bbp_add_error( 'bbp_notification_permission', __( 'You do not have permission to mark notifications for that user.', 'bbpress' ) ); 201 201 } 202 202 203 203 // Bail if we have errors -
src/includes/forums/functions.php
119 119 120 120 // Nonce check 121 121 if ( ! bbp_verify_nonce_request( 'bbp-new-forum' ) ) { 122 bbp_add_error( 'bbp_new_forum_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );122 bbp_add_error( 'bbp_new_forum_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 123 123 return; 124 124 } 125 125 … … 133 133 134 134 // User cannot create forums 135 135 if ( ! current_user_can( 'publish_forums' ) ) { 136 bbp_add_error( 'bbp_forum_permission', __( ' <strong>ERROR</strong>:You do not have permission to create new forums.', 'bbpress' ) );136 bbp_add_error( 'bbp_forum_permission', __( 'You do not have permission to create new forums.', 'bbpress' ) ); 137 137 return; 138 138 } 139 139 … … 158 158 159 159 // No forum title 160 160 if ( empty( $forum_title ) ) { 161 bbp_add_error( 'bbp_forum_title', __( ' <strong>ERROR</strong>:Your forum needs a title.', 'bbpress' ) );161 bbp_add_error( 'bbp_forum_title', __( 'Your forum needs a title.', 'bbpress' ) ); 162 162 } 163 163 164 164 // Title too long 165 165 if ( bbp_is_title_too_long( $forum_title ) ) { 166 bbp_add_error( 'bbp_forum_title', __( ' <strong>ERROR</strong>:Your title is too long.', 'bbpress' ) );166 bbp_add_error( 'bbp_forum_title', __( 'Your title is too long.', 'bbpress' ) ); 167 167 } 168 168 169 169 /** Forum Content *********************************************************/ … … 177 177 178 178 // No forum content 179 179 if ( empty( $forum_content ) ) { 180 bbp_add_error( 'bbp_forum_content', __( ' <strong>ERROR</strong>:Your forum description cannot be empty.', 'bbpress' ) );180 bbp_add_error( 'bbp_forum_content', __( 'Your forum description cannot be empty.', 'bbpress' ) ); 181 181 } 182 182 183 183 /** Forum Parent **********************************************************/ … … 192 192 193 193 // No forum parent was passed (should never happen) 194 194 if ( empty( $forum_parent_id ) ) { 195 bbp_add_error( 'bbp_new_forum_missing_parent', __( ' <strong>ERROR</strong>:Your forum must have a parent.', 'bbpress' ) );195 bbp_add_error( 'bbp_new_forum_missing_parent', __( 'Your forum must have a parent.', 'bbpress' ) ); 196 196 197 197 // Forum exists 198 198 } elseif ( ! empty( $forum_parent_id ) ) { 199 199 200 200 // Forum is a category 201 201 if ( bbp_is_forum_category( $forum_parent_id ) ) { 202 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' ) );202 bbp_add_error( 'bbp_new_forum_forum_category', __( 'This forum is a category. No forums can be created in this forum.', 'bbpress' ) ); 203 203 } 204 204 205 205 // Forum is closed and user cannot access 206 206 if ( bbp_is_forum_closed( $forum_parent_id ) && ! current_user_can( 'edit_forum', $forum_parent_id ) ) { 207 bbp_add_error( 'bbp_new_forum_forum_closed', __( ' <strong>ERROR</strong>:This forum has been closed to new forums.', 'bbpress' ) );207 bbp_add_error( 'bbp_new_forum_forum_closed', __( 'This forum has been closed to new forums.', 'bbpress' ) ); 208 208 } 209 209 210 210 // Forum is private and user cannot access 211 211 if ( bbp_is_forum_private( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 212 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' ) );212 bbp_add_error( 'bbp_new_forum_forum_private', __( 'This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 213 213 } 214 214 215 215 // Forum is hidden and user cannot access 216 216 if ( bbp_is_forum_hidden( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 217 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' ) );217 bbp_add_error( 'bbp_new_forum_forum_hidden', __( 'This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 218 218 } 219 219 } 220 220 221 221 /** Forum Flooding ********************************************************/ 222 222 223 223 if ( ! bbp_check_for_flood( $anonymous_data, $forum_author ) ) { 224 bbp_add_error( 'bbp_forum_flood', __( ' <strong>ERROR</strong>:Slow down; you move too fast.', 'bbpress' ) );224 bbp_add_error( 'bbp_forum_flood', __( 'Slow down; you move too fast.', 'bbpress' ) ); 225 225 } 226 226 227 227 /** Forum Duplicate *******************************************************/ 228 228 229 229 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 ) ) ) { 230 bbp_add_error( 'bbp_forum_duplicate', __( ' <strong>ERROR</strong>:This forum already exists.', 'bbpress' ) );230 bbp_add_error( 'bbp_forum_duplicate', __( 'This forum already exists.', 'bbpress' ) ); 231 231 } 232 232 233 233 /** Forum Blacklist *******************************************************/ 234 234 235 235 if ( ! bbp_check_for_blacklist( $anonymous_data, $forum_author, $forum_title, $forum_content ) ) { 236 bbp_add_error( 'bbp_forum_blacklist', __( ' <strong>ERROR</strong>:Your forum cannot be created at this time.', 'bbpress' ) );236 bbp_add_error( 'bbp_forum_blacklist', __( 'Your forum cannot be created at this time.', 'bbpress' ) ); 237 237 } 238 238 239 239 /** Forum Moderation ******************************************************/ … … 346 346 347 347 // WP_Error 348 348 } elseif ( is_wp_error( $forum_id ) ) { 349 bbp_add_error( 'bbp_forum_error', sprintf( __( ' <strong>ERROR</strong>:The following problem(s) occurred: %s', 'bbpress' ), $forum_id->get_error_message() ) );349 bbp_add_error( 'bbp_forum_error', sprintf( __( 'The following problem(s) occurred: %s', 'bbpress' ), $forum_id->get_error_message() ) ); 350 350 351 351 // Generic error 352 352 } else { 353 bbp_add_error( 'bbp_forum_error', __( ' <strong>ERROR</strong>:The forum was not created.', 'bbpress' ) );353 bbp_add_error( 'bbp_forum_error', __( 'The forum was not created.', 'bbpress' ) ); 354 354 } 355 355 } 356 356 … … 375 375 376 376 // Forum id was not passed 377 377 if ( empty( $_POST['bbp_forum_id'] ) ) { 378 bbp_add_error( 'bbp_edit_forum_id', __( ' <strong>ERROR</strong>:Forum ID not found.', 'bbpress' ) );378 bbp_add_error( 'bbp_edit_forum_id', __( 'Forum ID not found.', 'bbpress' ) ); 379 379 return; 380 380 381 381 // Forum id was passed … … 386 386 387 387 // Nonce check 388 388 if ( ! bbp_verify_nonce_request( 'bbp-edit-forum_' . $forum_id ) ) { 389 bbp_add_error( 'bbp_edit_forum_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );389 bbp_add_error( 'bbp_edit_forum_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 390 390 return; 391 391 392 392 // Forum does not exist 393 393 } elseif ( empty( $forum ) ) { 394 bbp_add_error( 'bbp_edit_forum_not_found', __( ' <strong>ERROR</strong>:The forum you want to edit was not found.', 'bbpress' ) );394 bbp_add_error( 'bbp_edit_forum_not_found', __( 'The forum you want to edit was not found.', 'bbpress' ) ); 395 395 return; 396 396 397 397 // User cannot edit this forum 398 398 } elseif ( ! current_user_can( 'edit_forum', $forum_id ) ) { 399 bbp_add_error( 'bbp_edit_forum_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit that forum.', 'bbpress' ) );399 bbp_add_error( 'bbp_edit_forum_permission', __( 'You do not have permission to edit that forum.', 'bbpress' ) ); 400 400 return; 401 401 } 402 402 … … 422 422 423 423 // Forum is closed and user cannot access 424 424 if ( bbp_is_forum_closed( $forum_parent_id ) && ! current_user_can( 'edit_forum', $forum_parent_id ) ) { 425 bbp_add_error( 'bbp_edit_forum_forum_closed', __( ' <strong>ERROR</strong>:This forum has been closed to new forums.', 'bbpress' ) );425 bbp_add_error( 'bbp_edit_forum_forum_closed', __( 'This forum has been closed to new forums.', 'bbpress' ) ); 426 426 } 427 427 428 428 // Forum is private and user cannot access 429 429 if ( bbp_is_forum_private( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 430 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' ) );430 bbp_add_error( 'bbp_edit_forum_forum_private', __( 'This forum is private and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 431 431 } 432 432 433 433 // Forum is hidden and user cannot access 434 434 if ( bbp_is_forum_hidden( $forum_parent_id ) && ! current_user_can( 'read_forum', $forum_parent_id ) ) { 435 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' ) );435 bbp_add_error( 'bbp_edit_forum_forum_hidden', __( 'This forum is hidden and you do not have the capability to read or create new forums in it.', 'bbpress' ) ); 436 436 } 437 437 } 438 438 … … 447 447 448 448 // No forum title 449 449 if ( empty( $forum_title ) ) { 450 bbp_add_error( 'bbp_edit_forum_title', __( ' <strong>ERROR</strong>:Your forum needs a title.', 'bbpress' ) );450 bbp_add_error( 'bbp_edit_forum_title', __( 'Your forum needs a title.', 'bbpress' ) ); 451 451 } 452 452 453 453 // Title too long 454 454 if ( bbp_is_title_too_long( $forum_title ) ) { 455 bbp_add_error( 'bbp_forum_title', __( ' <strong>ERROR</strong>:Your title is too long.', 'bbpress' ) );455 bbp_add_error( 'bbp_forum_title', __( 'Your title is too long.', 'bbpress' ) ); 456 456 } 457 457 458 458 /** Forum Content *********************************************************/ … … 466 466 467 467 // No forum content 468 468 if ( empty( $forum_content ) ) { 469 bbp_add_error( 'bbp_edit_forum_content', __( ' <strong>ERROR</strong>:Your forum description cannot be empty.', 'bbpress' ) );469 bbp_add_error( 'bbp_edit_forum_content', __( 'Your forum description cannot be empty.', 'bbpress' ) ); 470 470 } 471 471 472 472 /** Forum Blacklist *******************************************************/ 473 473 474 474 if ( ! bbp_check_for_blacklist( $anonymous_data, bbp_get_forum_author_id( $forum_id ), $forum_title, $forum_content ) ) { 475 bbp_add_error( 'bbp_forum_blacklist', __( ' <strong>ERROR</strong>:Your forum cannot be edited at this time.', 'bbpress' ) );475 bbp_add_error( 'bbp_forum_blacklist', __( 'Your forum cannot be edited at this time.', 'bbpress' ) ); 476 476 } 477 477 478 478 /** Forum Moderation ******************************************************/ … … 586 586 587 587 } else { 588 588 $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; 589 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' ) );589 bbp_add_error( 'bbp_forum_error', __( 'The following problem(s) have been found with your forum:' . $append_error . 'Please try again.', 'bbpress' ) ); 590 590 } 591 591 } 592 592 -
src/includes/replies/functions.php
126 126 127 127 // Nonce check 128 128 if ( ! bbp_verify_nonce_request( 'bbp-new-reply' ) ) { 129 bbp_add_error( 'bbp_new_reply_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );129 bbp_add_error( 'bbp_new_reply_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 130 130 return; 131 131 } 132 132 … … 151 151 152 152 // User cannot create replies 153 153 if ( ! current_user_can( 'publish_replies' ) ) { 154 bbp_add_error( 'bbp_reply_permission', __( ' <strong>ERROR</strong>:You do not have permission to reply.', 'bbpress' ) );154 bbp_add_error( 'bbp_reply_permission', __( 'You do not have permission to reply.', 'bbpress' ) ); 155 155 } 156 156 157 157 // Reply author is current user … … 162 162 163 163 // Topic id was not passed 164 164 if ( empty( $_POST['bbp_topic_id'] ) ) { 165 bbp_add_error( 'bbp_reply_topic_id', __( ' <strong>ERROR</strong>:Topic ID is missing.', 'bbpress' ) );165 bbp_add_error( 'bbp_reply_topic_id', __( 'Topic ID is missing.', 'bbpress' ) ); 166 166 167 167 // Topic id is not a number 168 168 } elseif ( ! is_numeric( $_POST['bbp_topic_id'] ) ) { 169 bbp_add_error( 'bbp_reply_topic_id', __( ' <strong>ERROR</strong>:Topic ID must be a number.', 'bbpress' ) );169 bbp_add_error( 'bbp_reply_topic_id', __( 'Topic ID must be a number.', 'bbpress' ) ); 170 170 171 171 // Topic id might be valid 172 172 } else { … … 176 176 177 177 // Topic id is a negative number 178 178 if ( 0 > $posted_topic_id ) { 179 bbp_add_error( 'bbp_reply_topic_id', __( ' <strong>ERROR</strong>:Topic ID cannot be a negative number.', 'bbpress' ) );179 bbp_add_error( 'bbp_reply_topic_id', __( 'Topic ID cannot be a negative number.', 'bbpress' ) ); 180 180 181 181 // Topic does not exist 182 182 } elseif ( ! bbp_get_topic( $posted_topic_id ) ) { 183 bbp_add_error( 'bbp_reply_topic_id', __( ' <strong>ERROR</strong>:Topic does not exist.', 'bbpress' ) );183 bbp_add_error( 'bbp_reply_topic_id', __( 'Topic does not exist.', 'bbpress' ) ); 184 184 185 185 // Use the POST'ed topic id 186 186 } else { … … 199 199 200 200 // Empty Forum id was passed 201 201 if ( empty( $_POST['bbp_forum_id'] ) ) { 202 bbp_add_error( 'bbp_reply_forum_id', __( ' <strong>ERROR</strong>:Forum ID is missing.', 'bbpress' ) );202 bbp_add_error( 'bbp_reply_forum_id', __( 'Forum ID is missing.', 'bbpress' ) ); 203 203 204 204 // Forum id is not a number 205 205 } elseif ( ! is_numeric( $_POST['bbp_forum_id'] ) ) { 206 bbp_add_error( 'bbp_reply_forum_id', __( ' <strong>ERROR</strong>:Forum ID must be a number.', 'bbpress' ) );206 bbp_add_error( 'bbp_reply_forum_id', __( 'Forum ID must be a number.', 'bbpress' ) ); 207 207 208 208 // Forum id might be valid 209 209 } else { … … 213 213 214 214 // Forum id is empty 215 215 if ( 0 === $posted_forum_id ) { 216 bbp_add_error( 'bbp_topic_forum_id', __( ' <strong>ERROR</strong>:Forum ID is missing.', 'bbpress' ) );216 bbp_add_error( 'bbp_topic_forum_id', __( 'Forum ID is missing.', 'bbpress' ) ); 217 217 218 218 // Forum id is a negative number 219 219 } elseif ( 0 > $posted_forum_id ) { 220 bbp_add_error( 'bbp_topic_forum_id', __( ' <strong>ERROR</strong>:Forum ID cannot be a negative number.', 'bbpress' ) );220 bbp_add_error( 'bbp_topic_forum_id', __( 'Forum ID cannot be a negative number.', 'bbpress' ) ); 221 221 222 222 // Forum does not exist 223 223 } elseif ( ! bbp_get_forum( $posted_forum_id ) ) { 224 bbp_add_error( 'bbp_topic_forum_id', __( ' <strong>ERROR</strong>:Forum does not exist.', 'bbpress' ) );224 bbp_add_error( 'bbp_topic_forum_id', __( 'Forum does not exist.', 'bbpress' ) ); 225 225 226 226 // Use the POST'ed forum id 227 227 } else { … … 235 235 236 236 // Forum is a category 237 237 if ( bbp_is_forum_category( $forum_id ) ) { 238 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' ) );238 bbp_add_error( 'bbp_new_reply_forum_category', __( 'This forum is a category. No replies can be created in this forum.', 'bbpress' ) ); 239 239 240 240 // Forum is not a category 241 241 } else { 242 242 243 243 // Forum is closed and user cannot access 244 244 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 245 bbp_add_error( 'bbp_new_reply_forum_closed', __( ' <strong>ERROR</strong>:This forum has been closed to new replies.', 'bbpress' ) );245 bbp_add_error( 'bbp_new_reply_forum_closed', __( 'This forum has been closed to new replies.', 'bbpress' ) ); 246 246 } 247 247 248 248 // Forum is private and user cannot access 249 249 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 250 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' ) );250 bbp_add_error( 'bbp_new_reply_forum_private', __( 'This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 251 251 252 252 // Forum is hidden and user cannot access 253 253 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 254 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' ) );254 bbp_add_error( 'bbp_new_reply_forum_hidden', __( 'This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 255 255 } 256 256 } 257 257 } … … 276 276 277 277 // Title too long 278 278 if ( bbp_is_title_too_long( $reply_title ) ) { 279 bbp_add_error( 'bbp_reply_title', __( ' <strong>ERROR</strong>:Your title is too long.', 'bbpress' ) );279 bbp_add_error( 'bbp_reply_title', __( 'Your title is too long.', 'bbpress' ) ); 280 280 } 281 281 282 282 /** Reply Content *********************************************************/ … … 290 290 291 291 // No reply content 292 292 if ( empty( $reply_content ) ) { 293 bbp_add_error( 'bbp_reply_content', __( ' <strong>ERROR</strong>:Your reply cannot be empty.', 'bbpress' ) );293 bbp_add_error( 'bbp_reply_content', __( 'Your reply cannot be empty.', 'bbpress' ) ); 294 294 } 295 295 296 296 /** Reply Flooding ********************************************************/ 297 297 298 298 if ( ! bbp_check_for_flood( $anonymous_data, $reply_author ) ) { 299 bbp_add_error( 'bbp_reply_flood', __( ' <strong>ERROR</strong>:Slow down; you move too fast.', 'bbpress' ) );299 bbp_add_error( 'bbp_reply_flood', __( 'Slow down; you move too fast.', 'bbpress' ) ); 300 300 } 301 301 302 302 /** Reply Duplicate *******************************************************/ 303 303 304 304 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 ) ) ) { 305 bbp_add_error( 'bbp_reply_duplicate', __( ' <strong>ERROR</strong>:Duplicate reply detected; it looks as though you’ve already said that.', 'bbpress' ) );305 bbp_add_error( 'bbp_reply_duplicate', __( 'Duplicate reply detected; it looks as though you’ve already said that.', 'bbpress' ) ); 306 306 } 307 307 308 308 /** Reply Blacklist *******************************************************/ 309 309 310 310 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 311 bbp_add_error( 'bbp_reply_blacklist', __( ' <strong>ERROR</strong>:Your reply cannot be created at this time.', 'bbpress' ) );311 bbp_add_error( 'bbp_reply_blacklist', __( 'Your reply cannot be created at this time.', 'bbpress' ) ); 312 312 } 313 313 314 314 /** Reply Status **********************************************************/ … … 333 333 334 334 // If topic is closed, moderators can still reply 335 335 if ( bbp_is_topic_closed( $topic_id ) && ! current_user_can( 'moderate', $topic_id ) ) { 336 bbp_add_error( 'bbp_reply_topic_closed', __( ' <strong>ERROR</strong>:Topic is closed.', 'bbpress' ) );336 bbp_add_error( 'bbp_reply_topic_closed', __( 'Topic is closed.', 'bbpress' ) ); 337 337 } 338 338 339 339 /** Topic Tags ************************************************************/ … … 393 393 394 394 // Term error 395 395 if ( is_wp_error( $terms ) ) { 396 bbp_add_error( 'bbp_reply_tags', __( ' <strong>ERROR</strong>:There was a problem adding the tags to the topic.', 'bbpress' ) );396 bbp_add_error( 'bbp_reply_tags', __( 'There was a problem adding the tags to the topic.', 'bbpress' ) ); 397 397 } 398 398 399 399 /** Trash Check *******************************************************/ … … 466 466 467 467 // WP_Error 468 468 } elseif ( is_wp_error( $reply_id ) ) { 469 bbp_add_error( 'bbp_reply_error', sprintf( __( ' <strong>ERROR</strong>:The following problem(s) occurred: %s', 'bbpress' ), $reply_id->get_error_message() ) );469 bbp_add_error( 'bbp_reply_error', sprintf( __( 'The following problem(s) occurred: %s', 'bbpress' ), $reply_id->get_error_message() ) ); 470 470 471 471 // Generic error 472 472 } else { 473 bbp_add_error( 'bbp_reply_error', __( ' <strong>ERROR</strong>:The reply was not created.', 'bbpress' ) );473 bbp_add_error( 'bbp_reply_error', __( 'The reply was not created.', 'bbpress' ) ); 474 474 } 475 475 } 476 476 … … 498 498 499 499 // Reply id was not passed 500 500 if ( empty( $_POST['bbp_reply_id'] ) ) { 501 bbp_add_error( 'bbp_edit_reply_id', __( ' <strong>ERROR</strong>:Reply ID not found.', 'bbpress' ) );501 bbp_add_error( 'bbp_edit_reply_id', __( 'Reply ID not found.', 'bbpress' ) ); 502 502 return; 503 503 504 504 // Reply id was passed … … 509 509 510 510 // Nonce check 511 511 if ( ! bbp_verify_nonce_request( 'bbp-edit-reply_' . $reply_id ) ) { 512 bbp_add_error( 'bbp_edit_reply_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );512 bbp_add_error( 'bbp_edit_reply_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 513 513 return; 514 514 } 515 515 516 516 // Reply does not exist 517 517 if ( empty( $reply ) ) { 518 bbp_add_error( 'bbp_edit_reply_not_found', __( ' <strong>ERROR</strong>:The reply you want to edit was not found.', 'bbpress' ) );518 bbp_add_error( 'bbp_edit_reply_not_found', __( 'The reply you want to edit was not found.', 'bbpress' ) ); 519 519 return; 520 520 521 521 // Reply exists … … 526 526 527 527 // User cannot edit this reply 528 528 if ( ! current_user_can( 'edit_reply', $reply_id ) ) { 529 bbp_add_error( 'bbp_edit_reply_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit that reply.', 'bbpress' ) );529 bbp_add_error( 'bbp_edit_reply_permission', __( 'You do not have permission to edit that reply.', 'bbpress' ) ); 530 530 return; 531 531 } 532 532 … … 561 561 562 562 // Forum is a category 563 563 if ( bbp_is_forum_category( $forum_id ) ) { 564 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' ) );564 bbp_add_error( 'bbp_edit_reply_forum_category', __( 'This forum is a category. No replies can be created in this forum.', 'bbpress' ) ); 565 565 566 566 // Forum is not a category 567 567 } else { 568 568 569 569 // Forum is closed and user cannot access 570 570 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 571 bbp_add_error( 'bbp_edit_reply_forum_closed', __( ' <strong>ERROR</strong>:This forum has been closed to new replies.', 'bbpress' ) );571 bbp_add_error( 'bbp_edit_reply_forum_closed', __( 'This forum has been closed to new replies.', 'bbpress' ) ); 572 572 } 573 573 574 574 // Forum is private and user cannot access 575 575 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 576 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' ) );576 bbp_add_error( 'bbp_edit_reply_forum_private', __( 'This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 577 577 578 578 // Forum is hidden and user cannot access 579 579 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 580 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' ) );580 bbp_add_error( 'bbp_edit_reply_forum_hidden', __( 'This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 581 581 } 582 582 } 583 583 } … … 593 593 594 594 // Title too long 595 595 if ( bbp_is_title_too_long( $reply_title ) ) { 596 bbp_add_error( 'bbp_reply_title', __( ' <strong>ERROR</strong>:Your title is too long.', 'bbpress' ) );596 bbp_add_error( 'bbp_reply_title', __( 'Your title is too long.', 'bbpress' ) ); 597 597 } 598 598 599 599 /** Reply Content *********************************************************/ … … 607 607 608 608 // No reply content 609 609 if ( empty( $reply_content ) ) { 610 bbp_add_error( 'bbp_edit_reply_content', __( ' <strong>ERROR</strong>:Your reply cannot be empty.', 'bbpress' ) );610 bbp_add_error( 'bbp_edit_reply_content', __( 'Your reply cannot be empty.', 'bbpress' ) ); 611 611 } 612 612 613 613 /** Reply Blacklist *******************************************************/ 614 614 615 615 if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 616 bbp_add_error( 'bbp_reply_blacklist', __( ' <strong>ERROR</strong>:Your reply cannot be edited at this time.', 'bbpress' ) );616 bbp_add_error( 'bbp_reply_blacklist', __( 'Your reply cannot be edited at this time.', 'bbpress' ) ); 617 617 } 618 618 619 619 /** Reply Status **********************************************************/ … … 703 703 704 704 // Term error 705 705 if ( is_wp_error( $terms ) ) { 706 bbp_add_error( 'bbp_reply_tags', __( ' <strong>ERROR</strong>:There was a problem adding the tags to the topic.', 'bbpress' ) );706 bbp_add_error( 'bbp_reply_tags', __( 'There was a problem adding the tags to the topic.', 'bbpress' ) ); 707 707 } 708 708 709 709 /** No Errors *************************************************************/ … … 761 761 762 762 } else { 763 763 $append_error = ( is_wp_error( $reply_id ) && $reply_id->get_error_message() ) ? $reply_id->get_error_message() . ' ' : ''; 764 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' ) );764 bbp_add_error( 'bbp_reply_error', __( 'The following problem(s) have been found with your reply:' . $append_error . 'Please try again.', 'bbpress' ) ); 765 765 } 766 766 } 767 767 … … 1195 1195 /** Move Reply ***********************************************************/ 1196 1196 1197 1197 if ( empty( $_POST['bbp_reply_id'] ) ) { 1198 bbp_add_error( 'bbp_move_reply_reply_id', __( ' <strong>ERROR</strong>:A reply ID is required', 'bbpress' ) );1198 bbp_add_error( 'bbp_move_reply_reply_id', __( 'A reply ID is required', 'bbpress' ) ); 1199 1199 } else { 1200 1200 $move_reply_id = (int) $_POST['bbp_reply_id']; 1201 1201 } … … 1204 1204 1205 1205 // Reply exists 1206 1206 if ( empty( $move_reply ) ) { 1207 bbp_add_error( 'bbp_mover_reply_r_not_found', __( ' <strong>ERROR</strong>:The reply you want to move was not found.', 'bbpress' ) );1207 bbp_add_error( 'bbp_mover_reply_r_not_found', __( 'The reply you want to move was not found.', 'bbpress' ) ); 1208 1208 } 1209 1209 1210 1210 /** Topic to Move From ***************************************************/ … … 1214 1214 1215 1215 // No topic 1216 1216 if ( empty( $source_topic ) ) { 1217 bbp_add_error( 'bbp_move_reply_source_not_found', __( ' <strong>ERROR</strong>:The topic you want to move from was not found.', 'bbpress' ) );1217 bbp_add_error( 'bbp_move_reply_source_not_found', __( 'The topic you want to move from was not found.', 'bbpress' ) ); 1218 1218 } 1219 1219 1220 1220 // Nonce check failed 1221 1221 if ( ! bbp_verify_nonce_request( 'bbp-move-reply_' . $move_reply->ID ) ) { 1222 bbp_add_error( 'bbp_move_reply_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1222 bbp_add_error( 'bbp_move_reply_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1223 1223 return; 1224 1224 } 1225 1225 1226 1226 // Use cannot edit topic 1227 1227 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1228 bbp_add_error( 'bbp_move_reply_source_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the source topic.', 'bbpress' ) );1228 bbp_add_error( 'bbp_move_reply_source_permission', __( 'You do not have permission to edit the source topic.', 'bbpress' ) ); 1229 1229 } 1230 1230 1231 1231 // How to move … … 1235 1235 1236 1236 // Invalid move option 1237 1237 if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ), true ) ) { 1238 bbp_add_error( 'bbp_move_reply_option', __( ' <strong>ERROR</strong>:You need to choose a valid move option.', 'bbpress' ) );1238 bbp_add_error( 'bbp_move_reply_option', __( 'You need to choose a valid move option.', 'bbpress' ) ); 1239 1239 1240 1240 // Valid move option 1241 1241 } else { … … 1248 1248 1249 1249 // Get destination topic id 1250 1250 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1251 bbp_add_error( 'bbp_move_reply_destination_id', __( ' <strong>ERROR</strong>:A topic ID is required.', 'bbpress' ) );1251 bbp_add_error( 'bbp_move_reply_destination_id', __( 'A topic ID is required.', 'bbpress' ) ); 1252 1252 } else { 1253 1253 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1254 1254 } … … 1258 1258 1259 1259 // No destination topic 1260 1260 if ( empty( $destination_topic ) ) { 1261 bbp_add_error( 'bbp_move_reply_destination_not_found', __( ' <strong>ERROR</strong>:The topic you want to move to was not found.', 'bbpress' ) );1261 bbp_add_error( 'bbp_move_reply_destination_not_found', __( 'The topic you want to move to was not found.', 'bbpress' ) ); 1262 1262 } 1263 1263 1264 1264 // User cannot edit the destination topic 1265 1265 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1266 bbp_add_error( 'bbp_move_reply_destination_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the destination topic.', 'bbpress' ) );1266 bbp_add_error( 'bbp_move_reply_destination_permission', __( 'You do not have permission to edit the destination topic.', 'bbpress' ) ); 1267 1267 } 1268 1268 1269 1269 // Bump the reply position … … 1317 1317 1318 1318 // Shouldn't happen 1319 1319 if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) { 1320 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' ) );1320 bbp_add_error( 'bbp_move_reply_destination_reply', __( 'There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) ); 1321 1321 } 1322 1322 1323 1323 // User cannot publish posts 1324 1324 } else { 1325 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' ) );1325 bbp_add_error( 'bbp_move_reply_destination_permission', __( 'You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) ); 1326 1326 } 1327 1327 1328 1328 break; … … 1470 1470 // Make sure reply exists 1471 1471 $reply = bbp_get_reply( $reply_id ); 1472 1472 if ( empty( $reply ) ) { 1473 bbp_add_error( 'bbp_toggle_reply_missing', __( ' <strong>ERROR:</strong>This reply could not be found or no longer exists.', 'bbpress' ) );1473 bbp_add_error( 'bbp_toggle_reply_missing', __( 'This reply could not be found or no longer exists.', 'bbpress' ) ); 1474 1474 return; 1475 1475 } 1476 1476 1477 1477 // What is the user doing here? 1478 1478 if ( ! current_user_can( 'edit_reply', $reply_id ) || ( 'bbp_toggle_reply_trash' === $action && ! current_user_can( 'delete_reply', $reply_id ) ) ) { 1479 bbp_add_error( 'bbp_toggle_reply_permission', __( ' <strong>ERROR:</strong>You do not have permission to do that.', 'bbpress' ) );1479 bbp_add_error( 'bbp_toggle_reply_permission', __( 'You do not have permission to do that.', 'bbpress' ) ); 1480 1480 return; 1481 1481 } 1482 1482 … … 1552 1552 1553 1553 $is_approve = bbp_is_reply_pending( $r['id'] ); 1554 1554 $retval['status'] = $is_approve ? bbp_approve_reply( $r['id'] ) : bbp_unapprove_reply( $r['id'] ); 1555 $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' );1555 $retval['message'] = $is_approve ? __( 'There was a problem approving the reply.', 'bbpress' ) : __( 'There was a problem unapproving the reply.', 'bbpress' ); 1556 1556 $retval['view_all'] = ! $is_approve; 1557 1557 1558 1558 break; … … 1563 1563 1564 1564 $is_spam = bbp_is_reply_spam( $r['id'] ); 1565 1565 $retval['status'] = $is_spam ? bbp_unspam_reply( $r['id'] ) : bbp_spam_reply( $r['id'] ); 1566 $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' );1566 $retval['message'] = $is_spam ? __( 'There was a problem unmarking the reply as spam.', 'bbpress' ) : __( 'There was a problem marking the reply as spam.', 'bbpress' ); 1567 1567 $retval['view_all'] = ! $is_spam; 1568 1568 1569 1569 break; … … 1578 1578 1579 1579 $retval['view_all'] = true; 1580 1580 $retval['status'] = wp_trash_post( $r['id'] ); 1581 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem trashing the reply.', 'bbpress' );1581 $retval['message'] = __( 'There was a problem trashing the reply.', 'bbpress' ); 1582 1582 1583 1583 break; 1584 1584 … … 1586 1586 check_ajax_referer( "untrash-{$nonce_suffix}" ); 1587 1587 1588 1588 $retval['status'] = wp_untrash_post( $r['id'] ); 1589 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem untrashing the reply.', 'bbpress' );1589 $retval['message'] = __( 'There was a problem untrashing the reply.', 'bbpress' ); 1590 1590 1591 1591 break; 1592 1592 … … 1594 1594 check_ajax_referer( "delete-{$nonce_suffix}" ); 1595 1595 1596 1596 $retval['status'] = wp_delete_post( $r['id'] ); 1597 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem deleting the reply.', 'bbpress' );1597 $retval['message'] = __( 'There was a problem deleting the reply.', 'bbpress' ); 1598 1598 1599 1599 break; 1600 1600 } -
src/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>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );105 bbp_add_error( 'bbp_new_topic_nonce', __( '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>ERROR</strong>:You do not have permission to create new topics.', 'bbpress' ) );132 bbp_add_error( 'bbp_topic_permission', __( '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>ERROR</strong>:Your topic needs a title.', 'bbpress' ) );158 bbp_add_error( 'bbp_topic_title', __( '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>ERROR</strong>:Your title is too long.', 'bbpress' ) );163 bbp_add_error( 'bbp_topic_title', __( '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>ERROR</strong>:Your topic cannot be empty.', 'bbpress' ) );177 bbp_add_error( 'bbp_topic_content', __( '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>ERROR</strong>:Forum ID is missing.', 'bbpress' ) );187 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:Forum ID must be a number.', 'bbpress' ) );191 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:Forum ID is missing.', 'bbpress' ) );201 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:Forum ID cannot be a negative number.', 'bbpress' ) );205 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:Forum does not exist.', 'bbpress' ) );209 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:This forum is a category. No topics can be created in this forum.', 'bbpress' ) );223 bbp_add_error( 'bbp_new_topic_forum_category', __( '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>ERROR</strong>:This forum has been closed to new topics.', 'bbpress' ) );230 bbp_add_error( 'bbp_new_topic_forum_closed', __( '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>ERROR</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', __( '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>ERROR</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', __( '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>ERROR</strong>:Slow down; you move too fast.', 'bbpress' ) );247 bbp_add_error( 'bbp_topic_flood', __( '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>ERROR</strong>:Duplicate topic detected; it looks as though you’ve already said that.', 'bbpress' ) );253 bbp_add_error( 'bbp_topic_duplicate', __( 'Duplicate topic detected; it looks as though you’ve already said that.', 'bbpress' ) ); 254 254 } 255 255 256 256 /** Topic Blacklist *******************************************************/ 257 257 258 258 if ( ! bbp_check_for_blacklist( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { 259 bbp_add_error( 'bbp_topic_blacklist', __( ' <strong>ERROR</strong>:Your topic cannot be created at this time.', 'bbpress' ) );259 bbp_add_error( 'bbp_topic_blacklist', __( '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>ERROR</strong>:The following problem(s) occurred: %s', 'bbpress' ), $topic_id->get_error_message() ) );400 bbp_add_error( 'bbp_topic_error', sprintf( __( '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>ERROR</strong>:The topic was not created.', 'bbpress' ) );404 bbp_add_error( 'bbp_topic_error', __( '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>ERROR</strong>:Topic ID not found.', 'bbpress' ) );430 bbp_add_error( 'bbp_edit_topic_id', __( '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>ERROR</strong>:The topic you want to edit was not found.', 'bbpress' ) );441 bbp_add_error( 'bbp_edit_topic_not_found', __( '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>ERROR</strong>:You do not have permission to edit that topic.', 'bbpress' ) );452 bbp_add_error( 'bbp_edit_topic_permission', __( '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>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );468 bbp_add_error( 'bbp_edit_topic_nonce', __( '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>ERROR</strong>:Forum ID is missing.', 'bbpress' ) );483 bbp_add_error( 'bbp_topic_forum_id', __( '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>ERROR</strong>:This forum is a category. No topics can be created in it.', 'bbpress' ) );498 bbp_add_error( 'bbp_edit_topic_forum_category', __( '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>ERROR</strong>:This forum has been closed to new topics.', 'bbpress' ) );505 bbp_add_error( 'bbp_edit_topic_forum_closed', __( '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>ERROR</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', __( '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>ERROR</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', __( '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>ERROR</strong>:Your topic needs a title.', 'bbpress' ) );530 bbp_add_error( 'bbp_edit_topic_title', __( '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>ERROR</strong>:Your title is too long.', 'bbpress' ) );535 bbp_add_error( 'bbp_topic_title', __( '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>ERROR</strong>:Your topic cannot be empty.', 'bbpress' ) );549 bbp_add_error( 'bbp_edit_topic_content', __( 'Your topic cannot be empty.', 'bbpress' ) ); 550 550 } 551 551 552 552 /** Topic Blacklist *******************************************************/ 553 553 554 554 if ( ! bbp_check_for_blacklist( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) { 555 bbp_add_error( 'bbp_topic_blacklist', __( ' <strong>ERROR</strong>:Your topic cannot be edited at this time.', 'bbpress' ) );555 bbp_add_error( 'bbp_topic_blacklist', __( '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>ERROR</strong>:The following problem(s) have been found with your topic:' . $append_error . 'Please try again.', 'bbpress' ) );716 bbp_add_error( 'bbp_topic_error', __( 'The following problem(s) have been found with your topic:' . $append_error . 'Please try again.', 'bbpress' ) ); 717 717 } 718 718 } 719 719 … … 1067 1067 1068 1068 // Topic id 1069 1069 if ( empty( $_POST['bbp_topic_id'] ) ) { 1070 bbp_add_error( 'bbp_merge_topic_source_id', __( ' <strong>ERROR</strong>:Topic ID not found.', 'bbpress' ) );1070 bbp_add_error( 'bbp_merge_topic_source_id', __( 'Topic ID not found.', 'bbpress' ) ); 1071 1071 } else { 1072 1072 $source_topic_id = (int) $_POST['bbp_topic_id']; 1073 1073 } 1074 1074 1075 1075 // Nonce check 1076 1076 if ( ! bbp_verify_nonce_request( 'bbp-merge-topic_' . $source_topic_id ) ) { 1077 bbp_add_error( 'bbp_merge_topic_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1077 bbp_add_error( 'bbp_merge_topic_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1078 1078 return; 1079 1079 1080 1080 // Source topic not found 1081 1081 } elseif ( ! $source_topic = bbp_get_topic( $source_topic_id ) ) { 1082 bbp_add_error( 'bbp_merge_topic_source_not_found', __( ' <strong>ERROR</strong>:The topic you want to merge was not found.', 'bbpress' ) );1082 bbp_add_error( 'bbp_merge_topic_source_not_found', __( 'The topic you want to merge was not found.', 'bbpress' ) ); 1083 1083 return; 1084 1084 } 1085 1085 1086 1086 // Cannot edit source topic 1087 1087 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1088 bbp_add_error( 'bbp_merge_topic_source_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the source topic.', 'bbpress' ) );1088 bbp_add_error( 'bbp_merge_topic_source_permission', __( 'You do not have permission to edit the source topic.', 'bbpress' ) ); 1089 1089 return; 1090 1090 } 1091 1091 … … 1093 1093 1094 1094 // Topic id 1095 1095 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1096 bbp_add_error( 'bbp_merge_topic_destination_id', __( ' <strong>ERROR</strong>:Destination topic ID not found.', 'bbpress' ) );1096 bbp_add_error( 'bbp_merge_topic_destination_id', __( 'Destination topic ID not found.', 'bbpress' ) ); 1097 1097 } else { 1098 1098 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1099 1099 } 1100 1100 1101 1101 // Destination topic not found 1102 1102 if ( ! $destination_topic = bbp_get_topic( $destination_topic_id ) ) { 1103 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( ' <strong>ERROR</strong>:The topic you want to merge to was not found.', 'bbpress' ) );1103 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( 'The topic you want to merge to was not found.', 'bbpress' ) ); 1104 1104 } 1105 1105 1106 1106 // Cannot edit destination topic 1107 1107 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1108 bbp_add_error( 'bbp_merge_topic_destination_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the destination topic.', 'bbpress' ) );1108 bbp_add_error( 'bbp_merge_topic_destination_permission', __( 'You do not have permission to edit the destination topic.', 'bbpress' ) ); 1109 1109 } 1110 1110 1111 1111 // Bail if errors … … 1325 1325 /** Split Reply ***********************************************************/ 1326 1326 1327 1327 if ( empty( $_POST['bbp_reply_id'] ) ) { 1328 bbp_add_error( 'bbp_split_topic_reply_id', __( ' <strong>ERROR</strong>:A reply ID is required.', 'bbpress' ) );1328 bbp_add_error( 'bbp_split_topic_reply_id', __( 'A reply ID is required.', 'bbpress' ) ); 1329 1329 } else { 1330 1330 $from_reply_id = (int) $_POST['bbp_reply_id']; 1331 1331 } … … 1334 1334 1335 1335 // Reply exists 1336 1336 if ( empty( $from_reply ) ) { 1337 bbp_add_error( 'bbp_split_topic_r_not_found', __( ' <strong>ERROR</strong>:The reply you want to split from was not found.', 'bbpress' ) );1337 bbp_add_error( 'bbp_split_topic_r_not_found', __( 'The reply you want to split from was not found.', 'bbpress' ) ); 1338 1338 } 1339 1339 1340 1340 /** Topic to Split ********************************************************/ … … 1344 1344 1345 1345 // No topic 1346 1346 if ( empty( $source_topic ) ) { 1347 bbp_add_error( 'bbp_split_topic_source_not_found', __( ' <strong>ERROR</strong>:The topic you want to split was not found.', 'bbpress' ) );1347 bbp_add_error( 'bbp_split_topic_source_not_found', __( 'The topic you want to split was not found.', 'bbpress' ) ); 1348 1348 } 1349 1349 1350 1350 // Nonce check failed 1351 1351 if ( ! bbp_verify_nonce_request( 'bbp-split-topic_' . $source_topic->ID ) ) { 1352 bbp_add_error( 'bbp_split_topic_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1352 bbp_add_error( 'bbp_split_topic_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1353 1353 return; 1354 1354 } 1355 1355 1356 1356 // Use cannot edit topic 1357 1357 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1358 bbp_add_error( 'bbp_split_topic_source_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the source topic.', 'bbpress' ) );1358 bbp_add_error( 'bbp_split_topic_source_permission', __( 'You do not have permission to edit the source topic.', 'bbpress' ) ); 1359 1359 } 1360 1360 1361 1361 // How to Split … … 1365 1365 1366 1366 // Invalid split option 1367 1367 if ( empty( $split_option ) || ! in_array( $split_option, array( 'existing', 'reply' ), true ) ) { 1368 bbp_add_error( 'bbp_split_topic_option', __( ' <strong>ERROR</strong>:You need to choose a valid split option.', 'bbpress' ) );1368 bbp_add_error( 'bbp_split_topic_option', __( 'You need to choose a valid split option.', 'bbpress' ) ); 1369 1369 1370 1370 // Valid Split Option 1371 1371 } else { … … 1378 1378 1379 1379 // Get destination topic id 1380 1380 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1381 bbp_add_error( 'bbp_split_topic_destination_id', __( ' <strong>ERROR</strong>:A topic ID is required.', 'bbpress' ) );1381 bbp_add_error( 'bbp_split_topic_destination_id', __( 'A topic ID is required.', 'bbpress' ) ); 1382 1382 } else { 1383 1383 $destination_topic_id = (int) $_POST['bbp_destination_topic']; 1384 1384 } … … 1388 1388 1389 1389 // No destination topic 1390 1390 if ( empty( $destination_topic ) ) { 1391 bbp_add_error( 'bbp_split_topic_destination_not_found', __( ' <strong>ERROR</strong>:The topic you want to split to was not found.', 'bbpress' ) );1391 bbp_add_error( 'bbp_split_topic_destination_not_found', __( 'The topic you want to split to was not found.', 'bbpress' ) ); 1392 1392 } 1393 1393 1394 1394 // User cannot edit the destination topic 1395 1395 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1396 bbp_add_error( 'bbp_split_topic_destination_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the destination topic.', 'bbpress' ) );1396 bbp_add_error( 'bbp_split_topic_destination_permission', __( 'You do not have permission to edit the destination topic.', 'bbpress' ) ); 1397 1397 } 1398 1398 1399 1399 break; … … 1431 1431 1432 1432 // Shouldn't happen 1433 1433 if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) { 1434 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' ) );1434 bbp_add_error( 'bbp_split_topic_destination_reply', __( 'There was a problem converting the reply into the topic. Please try again.', 'bbpress' ) ); 1435 1435 } 1436 1436 1437 1437 // User cannot publish posts 1438 1438 } else { 1439 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' ) );1439 bbp_add_error( 'bbp_split_topic_destination_permission', __( 'You do not have permission to create new topics. The reply could not be converted into a topic.', 'bbpress' ) ); 1440 1440 } 1441 1441 1442 1442 break; … … 1673 1673 1674 1674 // Tag does not exist 1675 1675 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1676 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() ) );1676 bbp_add_error( 'bbp_manage_topic_invalid_tag', sprintf( __( 'The following problem(s) have been found while getting the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1677 1677 return; 1678 1678 } 1679 1679 … … 1685 1685 1686 1686 // Nonce check 1687 1687 if ( ! bbp_verify_nonce_request( 'update-tag_' . $tag_id ) ) { 1688 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1688 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1689 1689 return; 1690 1690 } 1691 1691 1692 1692 // Can user edit topic tags? 1693 1693 if ( ! current_user_can( 'edit_topic_tag', $tag_id ) ) { 1694 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the topic tags.', 'bbpress' ) );1694 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( 'You do not have permission to edit the topic tags.', 'bbpress' ) ); 1695 1695 return; 1696 1696 } 1697 1697 1698 1698 // No tag name was provided 1699 1699 if ( empty( $_POST['tag-name'] ) || ! $name = $_POST['tag-name'] ) { 1700 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( ' <strong>ERROR</strong>:You need to enter a tag name.', 'bbpress' ) );1700 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( 'You need to enter a tag name.', 'bbpress' ) ); 1701 1701 return; 1702 1702 } 1703 1703 … … 1712 1712 1713 1713 // Cannot update tag 1714 1714 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1715 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() ) );1715 bbp_add_error( 'bbp_manage_topic_tag_update_error', sprintf( __( 'The following problem(s) have been found while updating the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1716 1716 return; 1717 1717 } 1718 1718 … … 1729 1729 1730 1730 // Nonce check 1731 1731 if ( ! bbp_verify_nonce_request( 'merge-tag_' . $tag_id ) ) { 1732 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1732 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1733 1733 return; 1734 1734 } 1735 1735 1736 1736 // Can user edit topic tags? 1737 1737 if ( ! current_user_can( 'edit_topic_tags' ) ) { 1738 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit the topic tags.', 'bbpress' ) );1738 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( 'You do not have permission to edit the topic tags.', 'bbpress' ) ); 1739 1739 return; 1740 1740 } 1741 1741 1742 1742 // No tag name was provided 1743 1743 if ( empty( $_POST['tag-existing-name'] ) || ! $name = $_POST['tag-existing-name'] ) { 1744 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( ' <strong>ERROR</strong>:You need to enter a tag name.', 'bbpress' ) );1744 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( 'You need to enter a tag name.', 'bbpress' ) ); 1745 1745 return; 1746 1746 } 1747 1747 … … 1752 1752 1753 1753 // Problem inserting the new term 1754 1754 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1755 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() ) );1755 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( 'The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) ); 1756 1756 return; 1757 1757 } 1758 1758 … … 1761 1761 1762 1762 // Attempting to merge a tag into itself 1763 1763 if ( $tag_id === $to_tag ) { 1764 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( ' <strong>ERROR</strong>:The tags which are being merged can not be the same.', 'bbpress' ) );1764 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( 'The tags which are being merged can not be the same.', 'bbpress' ) ); 1765 1765 return; 1766 1766 } 1767 1767 … … 1773 1773 1774 1774 // Error merging the terms 1775 1775 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1776 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() ) );1776 bbp_add_error( 'bbp_manage_topic_tag_merge_error', sprintf( __( 'The following problem(s) have been found while merging the tags: %s', 'bbpress' ), $tag->get_error_message() ) ); 1777 1777 return; 1778 1778 } 1779 1779 … … 1790 1790 1791 1791 // Nonce check 1792 1792 if ( ! bbp_verify_nonce_request( 'delete-tag_' . $tag_id ) ) { 1793 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );1793 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 1794 1794 return; 1795 1795 } 1796 1796 1797 1797 // Can user delete topic tags? 1798 1798 if ( ! current_user_can( 'delete_topic_tag', $tag_id ) ) { 1799 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( ' <strong>ERROR</strong>:You do not have permission to delete the topic tags.', 'bbpress' ) );1799 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( 'You do not have permission to delete the topic tags.', 'bbpress' ) ); 1800 1800 return; 1801 1801 } 1802 1802 … … 1805 1805 1806 1806 // Error deleting term 1807 1807 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1808 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() ) );1808 bbp_add_error( 'bbp_manage_topic_tag_delete_error', sprintf( __( 'The following problem(s) have been found while deleting the tag: %s', 'bbpress' ), $tag->get_error_message() ) ); 1809 1809 return; 1810 1810 } 1811 1811 … … 1966 1966 // Make sure topic exists 1967 1967 $topic = bbp_get_topic( $topic_id ); 1968 1968 if ( empty( $topic ) ) { 1969 bbp_add_error( 'bbp_toggle_topic_missing', __( ' <strong>ERROR:</strong>This topic could not be found or no longer exists.', 'bbpress' ) );1969 bbp_add_error( 'bbp_toggle_topic_missing', __( 'This topic could not be found or no longer exists.', 'bbpress' ) ); 1970 1970 return; 1971 1971 } 1972 1972 1973 1973 // What is the user doing here? 1974 1974 if ( ! current_user_can( 'edit_topic', $topic_id ) || ( 'bbp_toggle_topic_trash' === $action && ! current_user_can( 'delete_topic', $topic_id ) ) ) { 1975 bbp_add_error( 'bbp_toggle_topic_permission', __( ' <strong>ERROR:</strong>You do not have permission to do that.', 'bbpress' ) );1975 bbp_add_error( 'bbp_toggle_topic_permission', __( 'You do not have permission to do that.', 'bbpress' ) ); 1976 1976 return; 1977 1977 } 1978 1978 … … 2056 2056 2057 2057 // Feedback 2058 2058 $retval['message'] = ( true === $is_pending ) 2059 ? __( ' <strong>ERROR</strong>:There was a problem approving the topic.', 'bbpress' )2060 : __( ' <strong>ERROR</strong>:There was a problem unapproving the topic.', 'bbpress' );2059 ? __( 'There was a problem approving the topic.', 'bbpress' ) 2060 : __( 'There was a problem unapproving the topic.', 'bbpress' ); 2061 2061 2062 2062 break; 2063 2063 … … 2074 2074 2075 2075 // Feedback 2076 2076 $retval['message'] = ( true === $is_open ) 2077 ? __( ' <strong>ERROR</strong>:There was a problem closing the topic.', 'bbpress' )2078 : __( ' <strong>ERROR</strong>:There was a problem opening the topic.', 'bbpress' );2077 ? __( 'There was a problem closing the topic.', 'bbpress' ) 2078 : __( 'There was a problem opening the topic.', 'bbpress' ); 2079 2079 2080 2080 break; 2081 2081 … … 2093 2093 2094 2094 // Feedback 2095 2095 $retval['message'] = ( true === $is_sticky ) 2096 ? __( ' <strong>ERROR</strong>:There was a problem unsticking the topic.', 'bbpress' )2097 : __( ' <strong>ERROR</strong>:There was a problem sticking the topic.', 'bbpress' );2096 ? __( 'There was a problem unsticking the topic.', 'bbpress' ) 2097 : __( 'There was a problem sticking the topic.', 'bbpress' ); 2098 2098 2099 2099 break; 2100 2100 … … 2112 2112 2113 2113 // Feedback 2114 2114 $retval['message'] = ( true === $is_spam ) 2115 ? __( ' <strong>ERROR</strong>:There was a problem unmarking the topic as spam.', 'bbpress' )2116 : __( ' <strong>ERROR</strong>:There was a problem marking the topic as spam.', 'bbpress' );2115 ? __( 'There was a problem unmarking the topic as spam.', 'bbpress' ) 2116 : __( 'There was a problem marking the topic as spam.', 'bbpress' ); 2117 2117 2118 2118 break; 2119 2119 … … 2126 2126 2127 2127 $retval['view_all'] = true; 2128 2128 $retval['status'] = wp_trash_post( $r['id'] ); 2129 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem trashing the topic.', 'bbpress' );2129 $retval['message'] = __( 'There was a problem trashing the topic.', 'bbpress' ); 2130 2130 $retval['redirect_to'] = current_user_can( 'view_trash' ) 2131 2131 ? bbp_get_topic_permalink( $r['id'] ) 2132 2132 : bbp_get_forum_permalink( bbp_get_topic_forum_id( $r['id'] ) ); … … 2137 2137 check_ajax_referer( "untrash-{$nonce_suffix}" ); 2138 2138 2139 2139 $retval['status'] = wp_untrash_post( $r['id'] ); 2140 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem untrashing the topic.', 'bbpress' );2140 $retval['message'] = __( 'There was a problem untrashing the topic.', 'bbpress' ); 2141 2141 $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] ); 2142 2142 2143 2143 break; … … 2146 2146 check_ajax_referer( "delete-{$nonce_suffix}" ); 2147 2147 2148 2148 $retval['status'] = wp_delete_post( $r['id'] ); 2149 $retval['message'] = __( ' <strong>ERROR</strong>:There was a problem deleting the topic.', 'bbpress' );2149 $retval['message'] = __( 'There was a problem deleting the topic.', 'bbpress' ); 2150 2150 $retval['redirect_to'] = bbp_get_forum_permalink( $retval['status']->post_parent ); 2151 2151 2152 2152 break; -
src/includes/users/engagements.php
597 597 598 598 // Check for empty topic 599 599 if ( empty( $topic_id ) ) { 600 bbp_add_error( 'bbp_favorite_topic_id', __( ' <strong>ERROR</strong>:No topic was found. Which topic are you marking/unmarking as favorite?', 'bbpress' ) );600 bbp_add_error( 'bbp_favorite_topic_id', __( 'No topic was found. Which topic are you marking/unmarking as favorite?', 'bbpress' ) ); 601 601 602 602 // Check nonce 603 603 } elseif ( ! bbp_verify_nonce_request( 'toggle-favorite_' . $topic_id ) ) { 604 bbp_add_error( 'bbp_favorite_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );604 bbp_add_error( 'bbp_favorite_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 605 605 606 606 // Check current user's ability to edit the user 607 607 } elseif ( ! current_user_can( 'edit_user', $user_id ) ) { 608 bbp_add_error( 'bbp_favorite_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit favorites for that user!.', 'bbpress' ) );608 bbp_add_error( 'bbp_favorite_permission', __( 'You do not have permission to edit favorites for that user!.', 'bbpress' ) ); 609 609 } 610 610 611 611 // Bail if errors … … 646 646 647 647 // Fail! Handle errors 648 648 } elseif ( 'bbp_favorite_remove' === $action ) { 649 bbp_add_error( 'bbp_favorite_remove', __( ' <strong>ERROR</strong>:There was a problem removing that topic from favorites.', 'bbpress' ) );649 bbp_add_error( 'bbp_favorite_remove', __( 'There was a problem removing that topic from favorites.', 'bbpress' ) ); 650 650 } elseif ( 'bbp_favorite_add' === $action ) { 651 bbp_add_error( 'bbp_favorite_add', __( ' <strong>ERROR</strong>:There was a problem favoriting that topic.', 'bbpress' ) );651 bbp_add_error( 'bbp_favorite_add', __( 'There was a problem favoriting that topic.', 'bbpress' ) ); 652 652 } 653 653 654 654 return (bool) $success; … … 834 834 835 835 // Check for empty topic 836 836 if ( empty( $object_id ) ) { 837 bbp_add_error( 'bbp_subscription_object_id', __( ' <strong>ERROR</strong>:Not found. What are you subscribing/unsubscribing to?', 'bbpress' ) );837 bbp_add_error( 'bbp_subscription_object_id', __( 'Not found. What are you subscribing/unsubscribing to?', 'bbpress' ) ); 838 838 839 839 // Check nonce 840 840 } elseif ( ! bbp_verify_nonce_request( 'toggle-subscription_' . $object_id ) ) { 841 bbp_add_error( 'bbp_subscription_object_id', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );841 bbp_add_error( 'bbp_subscription_object_id', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 842 842 843 843 // Check current user's ability to edit the user 844 844 } elseif ( ! current_user_can( 'edit_user', $user_id ) ) { 845 bbp_add_error( 'bbp_subscription_permission', __( ' <strong>ERROR</strong>:You do not have permission to edit subscriptions of that user.', 'bbpress' ) );845 bbp_add_error( 'bbp_subscription_permission', __( 'You do not have permission to edit subscriptions of that user.', 'bbpress' ) ); 846 846 } 847 847 848 848 // Bail if we have errors … … 885 885 886 886 // Fail! Handle errors 887 887 } elseif ( 'bbp_unsubscribe' === $action ) { 888 bbp_add_error( 'bbp_unsubscribe', __( ' <strong>ERROR</strong>:There was a problem unsubscribing.', 'bbpress' ) );888 bbp_add_error( 'bbp_unsubscribe', __( 'There was a problem unsubscribing.', 'bbpress' ) ); 889 889 } elseif ( 'bbp_subscribe' === $action ) { 890 bbp_add_error( 'bbp_subscribe', __( ' <strong>ERROR</strong>:There was a problem subscribing.', 'bbpress' ) );890 bbp_add_error( 'bbp_subscribe', __( 'There was a problem subscribing.', 'bbpress' ) ); 891 891 } 892 892 893 893 return (bool) $success; -
src/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>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );196 bbp_add_error( 'bbp_update_user_nonce', __( '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>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );202 bbp_add_error( 'bbp_update_user_capability', __( '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>ERROR</strong>:That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) );208 bbp_add_error( 'bbp_user_email_empty', __( '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>ERROR</strong>:That is not a valid email address.', 'bbpress' ), array( 'form-field' => 'email' ) );220 bbp_add_error( 'bbp_user_email_invalid', __( '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>ERROR</strong>:That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) );226 bbp_add_error( 'bbp_user_email_taken', __( 'That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) ); 227 227 return; 228 228 } 229 229 … … 342 342 if ( email_exists( $new_email['newemail'] ) ) { 343 343 delete_option( $key ); 344 344 345 bbp_add_error( 'bbp_user_email_taken', __( ' <strong>ERROR</strong>:That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) );345 bbp_add_error( 'bbp_user_email_taken', __( 'That email address is already in use.', 'bbpress' ), array( 'form-field' => 'email' ) ); 346 346 347 347 // Email address is good to change to 348 348 } else { … … 379 379 // Delete new email address from user options 380 380 } elseif ( ! empty( $_GET['dismiss'] ) && ( $key === $_GET['dismiss'] ) ) { 381 381 if ( ! bbp_verify_nonce_request( "dismiss-{$key}" ) ) { 382 bbp_add_error( 'bbp_dismiss_new_email_nonce', __( ' <strong>ERROR</strong>:Are you sure you wanted to do that?', 'bbpress' ) );382 bbp_add_error( 'bbp_dismiss_new_email_nonce', __( 'Are you sure you wanted to do that?', 'bbpress' ) ); 383 383 return; 384 384 } 385 385 … … 405 405 406 406 // Bail if any relevant parameters are empty 407 407 if ( empty( $user_id ) || empty( $r['hash'] ) || empty( $r['newemail'] ) ) { 408 bbp_add_error( 'bbp_user_email_invalid_hash', __( ' <strong>ERROR</strong>:An error occurred while updating your email address.', 'bbpress' ), array( 'form-field' => 'email' ) );408 bbp_add_error( 'bbp_user_email_invalid_hash', __( 'An error occurred while updating your email address.', 'bbpress' ), array( 'form-field' => 'email' ) ); 409 409 return; 410 410 } 411 411 -
src/includes/users/template.php
1821 1821 1822 1822 // loggedout was passed 1823 1823 if ( ! empty( $_GET['loggedout'] ) && ( true === $_GET['loggedout'] ) ) { 1824 bbp_add_ error( 'loggedout', esc_html__( 'You are now logged out.', 'bbpress' ), 'message' );1824 bbp_add_notice( 'loggedout', esc_html__( 'You are now logged out.', 'bbpress' ), 'message' ); 1825 1825 1826 1826 // registration is disabled 1827 1827 } elseif ( ! empty( $_GET['registration'] ) && ( 'disabled' === $_GET['registration'] ) ) { 1828 bbp_add_ error( 'registerdisabled', esc_html__( 'New user registration is currently not allowed.', 'bbpress' ) );1828 bbp_add_notice( 'registerdisabled', esc_html__( 'New user registration is currently not allowed.', 'bbpress' ) ); 1829 1829 1830 1830 // Prompt user to check their email 1831 1831 } elseif ( ! empty( $_GET['checkemail'] ) && in_array( $_GET['checkemail'], array( 'confirm', 'newpass', 'registered' ), true ) ) { … … 1834 1834 1835 1835 // Email needs confirmation 1836 1836 case 'confirm' : 1837 bbp_add_ error( 'confirm', esc_html__( 'Check your e-mail for the confirmation link.', 'bbpress' ), 'message' );1837 bbp_add_notice( 'confirm', esc_html__( 'Check your e-mail for the confirmation link.', 'bbpress' ), 'message' ); 1838 1838 break; 1839 1839 1840 1840 // User requested a new password 1841 1841 case 'newpass' : 1842 bbp_add_ error( 'newpass', esc_html__( 'Check your e-mail for your new password.', 'bbpress' ), 'message' );1842 bbp_add_notice( 'newpass', esc_html__( 'Check your e-mail for your new password.', 'bbpress' ), 'message' ); 1843 1843 break; 1844 1844 1845 1845 // User is newly registered 1846 1846 case 'registered' : 1847 bbp_add_ error( 'registered', esc_html__( 'Registration complete. Please check your e-mail.', 'bbpress' ), 'message' );1847 bbp_add_notice( 'registered', esc_html__( 'Registration complete. Please check your e-mail.', 'bbpress' ), 'message' ); 1848 1848 break; 1849 1849 } 1850 1850 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)