Changeset 6499 for trunk/src/includes/forums/functions.php
- Timestamp:
- 06/08/2017 04:06:24 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/forums/functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r6498 r6499 43 43 44 44 // Insert forum 45 $forum_id = wp_insert_post( $forum_data );45 $forum_id = wp_insert_post( $forum_data, false ); 46 46 47 47 // Bail if no forum was added … … 118 118 * @uses apply_filters() Calls 'bbp_new_forum_pre_content' with the content 119 119 * @uses bbPress::errors::get_error_codes() To get the {@link WP_Error} errors 120 * @uses wp_insert_post() To insert the forum121 120 * @uses do_action() Calls 'bbp_new_forum' with the forum id, forum id, 122 121 * anonymous data and reply author 123 * @uses bbp_stick_forum() To stick or super stick the forum124 * @uses bbp_unstick_forum() To unstick the forum125 122 * @uses bbp_get_forum_permalink() To get the forum permalink 126 123 * @uses bbp_redirect() To redirect to the forum link … … 280 277 281 278 // Insert forum 282 $forum_id = wp_insert_post( $forum_data );279 $forum_id = wp_insert_post( $forum_data, true ); 283 280 284 281 /** No Errors *************************************************************/ … … 355 352 bbp_redirect( $redirect_url ); 356 353 357 // Errors 354 /** Errors ****************************************************************/ 355 356 // WP_Error 357 } elseif ( is_wp_error( $forum_id ) ) { 358 bbp_add_error( 'bbp_forum_error', sprintf( __( '<strong>ERROR</strong>: The following problem(s) occurred: %s', 'bbpress' ), $forum_id->get_error_message() ) ); 359 360 // Generic error 358 361 } else { 359 $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; 360 bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum:' . $append_error, 'bbpress' ) ); 362 bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The forum was not created.', 'bbpress' ) ); 361 363 } 362 364 }
Note: See TracChangeset
for help on using the changeset viewer.