Changeset 7097 for branches/2.6/src/includes/forums/functions.php
- Timestamp:
- 06/04/2020 09:28:24 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/forums/functions.php
r6971 r7097 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 } … … 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 } … … 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 … … 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 … … 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 … … 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 } … … 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 … … 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 … … 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 … … 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 } … … 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 … … 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 } … … 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 } … … 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 … … 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 … … 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 … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.