Changeset 6499 for trunk/src/includes/topics/functions.php
- Timestamp:
- 06/08/2017 04:06:24 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6497 r6499 43 43 44 44 // Insert topic 45 $topic_id = wp_insert_post( $topic_data );45 $topic_id = wp_insert_post( $topic_data, false ); 46 46 47 47 // Bail if no topic was added … … 125 125 * @uses do_action() Calls 'bbp_new_topic' with the topic id, forum id, 126 126 * anonymous data and reply author 127 * @uses bbp_stick_topic() To stick or super stick the topic128 * @uses bbp_unstick_topic() To unstick the topic129 127 * @uses bbp_get_topic_permalink() To get the topic permalink 130 128 * @uses bbp_redirect() To redirect to the topic link … … 352 350 353 351 // Insert topic 354 $topic_id = wp_insert_post( $topic_data );352 $topic_id = wp_insert_post( $topic_data, true ); 355 353 356 354 /** No Errors *************************************************************/ … … 427 425 bbp_redirect( $redirect_url ); 428 426 429 // Errors 427 /** Errors ****************************************************************/ 428 429 // WP_Error 430 } elseif ( is_wp_error( $topic_id ) ) { 431 bbp_add_error( 'bbp_topic_error', sprintf( __( '<strong>ERROR</strong>: The following problem(s) occurred: %s', 'bbpress' ), $topic_id->get_error_message() ) ); 432 433 // Generic error 430 434 } else { 431 $append_error = ( is_wp_error( $topic_id ) && $topic_id->get_error_message() ) ? $topic_id->get_error_message() . ' ' : ''; 432 bbp_add_error( 'bbp_topic_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your topic:' . $append_error, 'bbpress' ) ); 435 bbp_add_error( 'bbp_topic_error', __( '<strong>ERROR</strong>: The topic was not created.', 'bbpress' ) ); 433 436 } 434 437 }
Note: See TracChangeset
for help on using the changeset viewer.