Changeset 7097 for branches/2.6/src/includes/topics/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/topics/functions.php
r7036 r7097 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 } … … 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 } … … 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 … … 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 … … 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 … … 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 … … 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 … … 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 } … … 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 … … 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 … … 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 … … 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 } … … 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 … … 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 … … 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 … … 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 } … … 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 … … 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 … … 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 } … … 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 … … 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 … … 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 … … 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 } … … 1083 1083 // Topic id 1084 1084 if ( empty( $_POST['bbp_topic_id'] ) ) { 1085 bbp_add_error( 'bbp_merge_topic_source_id', __( '<strong>E RROR</strong>: Topic ID not found.', 'bbpress' ) );1085 bbp_add_error( 'bbp_merge_topic_source_id', __( '<strong>Error</strong>: Topic ID not found.', 'bbpress' ) ); 1086 1086 } else { 1087 1087 $source_topic_id = (int) $_POST['bbp_topic_id']; … … 1090 1090 // Nonce check 1091 1091 if ( ! bbp_verify_nonce_request( 'bbp-merge-topic_' . $source_topic_id ) ) { 1092 bbp_add_error( 'bbp_merge_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1092 bbp_add_error( 'bbp_merge_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1093 1093 return; 1094 1094 1095 1095 // Source topic not found 1096 1096 } elseif ( ! $source_topic = bbp_get_topic( $source_topic_id ) ) { 1097 bbp_add_error( 'bbp_merge_topic_source_not_found', __( '<strong>E RROR</strong>: The topic you want to merge was not found.', 'bbpress' ) );1097 bbp_add_error( 'bbp_merge_topic_source_not_found', __( '<strong>Error</strong>: The topic you want to merge was not found.', 'bbpress' ) ); 1098 1098 return; 1099 1099 } … … 1101 1101 // Cannot edit source topic 1102 1102 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1103 bbp_add_error( 'bbp_merge_topic_source_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) );1103 bbp_add_error( 'bbp_merge_topic_source_permission', __( '<strong>Error</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1104 1104 return; 1105 1105 } … … 1109 1109 // Topic id 1110 1110 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1111 bbp_add_error( 'bbp_merge_topic_destination_id', __( '<strong>E RROR</strong>: Destination topic ID not found.', 'bbpress' ) );1111 bbp_add_error( 'bbp_merge_topic_destination_id', __( '<strong>Error</strong>: Destination topic ID not found.', 'bbpress' ) ); 1112 1112 } else { 1113 1113 $destination_topic_id = (int) $_POST['bbp_destination_topic']; … … 1116 1116 // Destination topic not found 1117 1117 if ( ! $destination_topic = bbp_get_topic( $destination_topic_id ) ) { 1118 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( '<strong>E RROR</strong>: The topic you want to merge to was not found.', 'bbpress' ) );1118 bbp_add_error( 'bbp_merge_topic_destination_not_found', __( '<strong>Error</strong>: The topic you want to merge to was not found.', 'bbpress' ) ); 1119 1119 } 1120 1120 1121 1121 // Cannot edit destination topic 1122 1122 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1123 bbp_add_error( 'bbp_merge_topic_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) );1123 bbp_add_error( 'bbp_merge_topic_destination_permission', __( '<strong>Error</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1124 1124 } 1125 1125 … … 1341 1341 1342 1342 if ( empty( $_POST['bbp_reply_id'] ) ) { 1343 bbp_add_error( 'bbp_split_topic_reply_id', __( '<strong>E RROR</strong>: A reply ID is required.', 'bbpress' ) );1343 bbp_add_error( 'bbp_split_topic_reply_id', __( '<strong>Error</strong>: A reply ID is required.', 'bbpress' ) ); 1344 1344 } else { 1345 1345 $from_reply_id = (int) $_POST['bbp_reply_id']; … … 1350 1350 // Reply exists 1351 1351 if ( empty( $from_reply ) ) { 1352 bbp_add_error( 'bbp_split_topic_r_not_found', __( '<strong>E RROR</strong>: The reply you want to split from was not found.', 'bbpress' ) );1352 bbp_add_error( 'bbp_split_topic_r_not_found', __( '<strong>Error</strong>: The reply you want to split from was not found.', 'bbpress' ) ); 1353 1353 } 1354 1354 … … 1360 1360 // No topic 1361 1361 if ( empty( $source_topic ) ) { 1362 bbp_add_error( 'bbp_split_topic_source_not_found', __( '<strong>E RROR</strong>: The topic you want to split was not found.', 'bbpress' ) );1362 bbp_add_error( 'bbp_split_topic_source_not_found', __( '<strong>Error</strong>: The topic you want to split was not found.', 'bbpress' ) ); 1363 1363 } 1364 1364 1365 1365 // Nonce check failed 1366 1366 if ( ! bbp_verify_nonce_request( 'bbp-split-topic_' . $source_topic->ID ) ) { 1367 bbp_add_error( 'bbp_split_topic_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1367 bbp_add_error( 'bbp_split_topic_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1368 1368 return; 1369 1369 } … … 1371 1371 // Use cannot edit topic 1372 1372 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1373 bbp_add_error( 'bbp_split_topic_source_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) );1373 bbp_add_error( 'bbp_split_topic_source_permission', __( '<strong>Error</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1374 1374 } 1375 1375 … … 1381 1381 // Invalid split option 1382 1382 if ( empty( $split_option ) || ! in_array( $split_option, array( 'existing', 'reply' ), true ) ) { 1383 bbp_add_error( 'bbp_split_topic_option', __( '<strong>E RROR</strong>: You need to choose a valid split option.', 'bbpress' ) );1383 bbp_add_error( 'bbp_split_topic_option', __( '<strong>Error</strong>: You need to choose a valid split option.', 'bbpress' ) ); 1384 1384 1385 1385 // Valid Split Option … … 1394 1394 // Get destination topic id 1395 1395 if ( empty( $_POST['bbp_destination_topic'] ) ) { 1396 bbp_add_error( 'bbp_split_topic_destination_id', __( '<strong>E RROR</strong>: A topic ID is required.', 'bbpress' ) );1396 bbp_add_error( 'bbp_split_topic_destination_id', __( '<strong>Error</strong>: A topic ID is required.', 'bbpress' ) ); 1397 1397 } else { 1398 1398 $destination_topic_id = (int) $_POST['bbp_destination_topic']; … … 1404 1404 // No destination topic 1405 1405 if ( empty( $destination_topic ) ) { 1406 bbp_add_error( 'bbp_split_topic_destination_not_found', __( '<strong>E RROR</strong>: The topic you want to split to was not found.', 'bbpress' ) );1406 bbp_add_error( 'bbp_split_topic_destination_not_found', __( '<strong>Error</strong>: The topic you want to split to was not found.', 'bbpress' ) ); 1407 1407 } 1408 1408 1409 1409 // User cannot edit the destination topic 1410 1410 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1411 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) );1411 bbp_add_error( 'bbp_split_topic_destination_permission', __( '<strong>Error</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1412 1412 } 1413 1413 … … 1447 1447 // Shouldn't happen 1448 1448 if ( false === $destination_topic_id || is_wp_error( $destination_topic_id ) || empty( $destination_topic ) ) { 1449 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' ) );1449 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' ) ); 1450 1450 } 1451 1451 1452 1452 // User cannot publish posts 1453 1453 } else { 1454 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' ) );1454 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' ) ); 1455 1455 } 1456 1456 … … 1689 1689 // Tag does not exist 1690 1690 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1691 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() ) );1691 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() ) ); 1692 1692 return; 1693 1693 } … … 1701 1701 // Nonce check 1702 1702 if ( ! bbp_verify_nonce_request( 'update-tag_' . $tag_id ) ) { 1703 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1703 bbp_add_error( 'bbp_manage_topic_tag_update_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1704 1704 return; 1705 1705 } … … 1707 1707 // Can user edit topic tags? 1708 1708 if ( ! current_user_can( 'edit_topic_tag', $tag_id ) ) { 1709 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) );1709 bbp_add_error( 'bbp_manage_topic_tag_update_permission', __( '<strong>Error</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) ); 1710 1710 return; 1711 1711 } … … 1713 1713 // No tag name was provided 1714 1714 if ( empty( $_POST['tag-name'] ) || ! $name = $_POST['tag-name'] ) { 1715 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( '<strong>E RROR</strong>: You need to enter a tag name.', 'bbpress' ) );1715 bbp_add_error( 'bbp_manage_topic_tag_update_name', __( '<strong>Error</strong>: You need to enter a tag name.', 'bbpress' ) ); 1716 1716 return; 1717 1717 } … … 1728 1728 // Cannot update tag 1729 1729 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1730 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() ) );1730 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() ) ); 1731 1731 return; 1732 1732 } … … 1745 1745 // Nonce check 1746 1746 if ( ! bbp_verify_nonce_request( 'merge-tag_' . $tag_id ) ) { 1747 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1747 bbp_add_error( 'bbp_manage_topic_tag_merge_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1748 1748 return; 1749 1749 } … … 1751 1751 // Can user edit topic tags? 1752 1752 if ( ! current_user_can( 'edit_topic_tags' ) ) { 1753 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( '<strong>E RROR</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) );1753 bbp_add_error( 'bbp_manage_topic_tag_merge_permission', __( '<strong>Error</strong>: You do not have permission to edit the topic tags.', 'bbpress' ) ); 1754 1754 return; 1755 1755 } … … 1757 1757 // No tag name was provided 1758 1758 if ( empty( $_POST['tag-existing-name'] ) || ! $name = $_POST['tag-existing-name'] ) { 1759 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( '<strong>E RROR</strong>: You need to enter a tag name.', 'bbpress' ) );1759 bbp_add_error( 'bbp_manage_topic_tag_merge_name', __( '<strong>Error</strong>: You need to enter a tag name.', 'bbpress' ) ); 1760 1760 return; 1761 1761 } … … 1768 1768 // Problem inserting the new term 1769 1769 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1770 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() ) );1770 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() ) ); 1771 1771 return; 1772 1772 } … … 1777 1777 // Attempting to merge a tag into itself 1778 1778 if ( $tag_id === $to_tag ) { 1779 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' ) );1779 bbp_add_error( 'bbp_manage_topic_tag_merge_same', __( '<strong>Error</strong>: The tags which are being merged can not be the same.', 'bbpress' ) ); 1780 1780 return; 1781 1781 } … … 1789 1789 // Error merging the terms 1790 1790 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1791 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() ) );1791 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() ) ); 1792 1792 return; 1793 1793 } … … 1806 1806 // Nonce check 1807 1807 if ( ! bbp_verify_nonce_request( 'delete-tag_' . $tag_id ) ) { 1808 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( '<strong>E RROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );1808 bbp_add_error( 'bbp_manage_topic_tag_delete_nonce', __( '<strong>Error</strong>: Are you sure you wanted to do that?', 'bbpress' ) ); 1809 1809 return; 1810 1810 } … … 1812 1812 // Can user delete topic tags? 1813 1813 if ( ! current_user_can( 'delete_topic_tag', $tag_id ) ) { 1814 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( '<strong>E RROR</strong>: You do not have permission to delete the topic tags.', 'bbpress' ) );1814 bbp_add_error( 'bbp_manage_topic_tag_delete_permission', __( '<strong>Error</strong>: You do not have permission to delete the topic tags.', 'bbpress' ) ); 1815 1815 return; 1816 1816 } … … 1821 1821 // Error deleting term 1822 1822 if ( is_wp_error( $tag ) && $tag->get_error_message() ) { 1823 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() ) );1823 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() ) ); 1824 1824 return; 1825 1825 } … … 2017 2017 $topic = bbp_get_topic( $topic_id ); 2018 2018 if ( empty( $topic ) ) { 2019 bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>E RROR</strong>: This topic could not be found or no longer exists.', 'bbpress' ) );2019 bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>Error</strong>: This topic could not be found or no longer exists.', 'bbpress' ) ); 2020 2020 return; 2021 2021 } … … 2023 2023 // What is the user doing here? 2024 2024 if ( ! current_user_can( 'edit_topic', $topic_id ) || ( 'bbp_toggle_topic_trash' === $action && ! current_user_can( 'delete_topic', $topic_id ) ) ) { 2025 bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>E RROR</strong>: You do not have permission to do that.', 'bbpress' ) );2025 bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>Error</strong>: You do not have permission to do that.', 'bbpress' ) ); 2026 2026 return; 2027 2027 } … … 2107 2107 // Feedback 2108 2108 $retval['message'] = ( true === $is_pending ) 2109 ? __( '<strong>E RROR</strong>: There was a problem approving the topic.', 'bbpress' )2110 : __( '<strong>E RROR</strong>: There was a problem unapproving the topic.', 'bbpress' );2109 ? __( '<strong>Error</strong>: There was a problem approving the topic.', 'bbpress' ) 2110 : __( '<strong>Error</strong>: There was a problem unapproving the topic.', 'bbpress' ); 2111 2111 2112 2112 break; … … 2125 2125 // Feedback 2126 2126 $retval['message'] = ( true === $is_open ) 2127 ? __( '<strong>E RROR</strong>: There was a problem closing the topic.', 'bbpress' )2128 : __( '<strong>E RROR</strong>: There was a problem opening the topic.', 'bbpress' );2127 ? __( '<strong>Error</strong>: There was a problem closing the topic.', 'bbpress' ) 2128 : __( '<strong>Error</strong>: There was a problem opening the topic.', 'bbpress' ); 2129 2129 2130 2130 break; … … 2144 2144 // Feedback 2145 2145 $retval['message'] = ( true === $is_sticky ) 2146 ? __( '<strong>E RROR</strong>: There was a problem unsticking the topic.', 'bbpress' )2147 : __( '<strong>E RROR</strong>: There was a problem sticking the topic.', 'bbpress' );2146 ? __( '<strong>Error</strong>: There was a problem unsticking the topic.', 'bbpress' ) 2147 : __( '<strong>Error</strong>: There was a problem sticking the topic.', 'bbpress' ); 2148 2148 2149 2149 break; … … 2163 2163 // Feedback 2164 2164 $retval['message'] = ( true === $is_spam ) 2165 ? __( '<strong>E RROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' )2166 : __( '<strong>E RROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );2165 ? __( '<strong>Error</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) 2166 : __( '<strong>Error</strong>: There was a problem marking the topic as spam.', 'bbpress' ); 2167 2167 2168 2168 break; … … 2177 2177 $retval['view_all'] = true; 2178 2178 $retval['status'] = wp_trash_post( $r['id'] ); 2179 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem trashing the topic.', 'bbpress' );2179 $retval['message'] = __( '<strong>Error</strong>: There was a problem trashing the topic.', 'bbpress' ); 2180 2180 $retval['redirect_to'] = current_user_can( 'view_trash' ) 2181 2181 ? bbp_get_topic_permalink( $r['id'] ) … … 2188 2188 2189 2189 $retval['status'] = wp_untrash_post( $r['id'] ); 2190 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem untrashing the topic.', 'bbpress' );2190 $retval['message'] = __( '<strong>Error</strong>: There was a problem untrashing the topic.', 'bbpress' ); 2191 2191 $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] ); 2192 2192 … … 2197 2197 2198 2198 $retval['status'] = wp_delete_post( $r['id'] ); 2199 $retval['message'] = __( '<strong>E RROR</strong>: There was a problem deleting the topic.', 'bbpress' );2199 $retval['message'] = __( '<strong>Error</strong>: There was a problem deleting the topic.', 'bbpress' ); 2200 2200 $retval['redirect_to'] = bbp_get_forum_permalink( $retval['status']->post_parent ); 2201 2201
Note: See TracChangeset
for help on using the changeset viewer.