Opened 9 years ago
Closed 7 years ago
#2817 closed enhancement (fixed)
return WP_Error object when a reply, topic or forum
Reported by: | tharsheblows | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.2 |
Component: | Component - Any/All | Keywords: | commit |
Cc: |
Description
The error message is used in the template notice. It'd actually be nice to filter these too but I haven't done that. What do you think?
Thinking about it, not sure this is good to add because it's going to change people's error notices, hmm.
Attachments (2)
Change History (8)
#2
@
9 years ago
Ah yes, I see what they're saying about the filters. But the wp_insert_post needs to pass true to $wp_error or the error message needs to be changed as it's currently always:
The following problem(s) have been found with your reply:Please try again.
#3
@
9 years ago
I put it in the wrong wp_insert_post in replies/functions.php, argh. This one expects the WP Error object to be returned on failure, the other one doesn't.
Oops, editing to include code to show where it's expecting it, eg in forums/functions.phpL340
// Errors } else { $append_error = ( is_wp_error( $forum_id ) && $forum_id->get_error_message() ) ? $forum_id->get_error_message() . ' ' : ''; bbp_add_error( 'bbp_forum_error', __( '<strong>ERROR</strong>: The following problem(s) have been found with your forum:' . $append_error, 'bbpress' ) ); }
#5
@
7 years ago
- Component changed from General to Component - Any/All
- Keywords commit added; dev-feedback removed
- Milestone changed from Awaiting Review to 2.6
- Owner set to johnjamesjacoby
- Type changed from defect to enhancement
- Version changed from trunk to 2.2
We can do this, but we may end up pulling it later if we want to own the error messaging & verbiage to be more forum/public specific.
Moving to 2.6.
return WP_Error object on reply / topic / forum failure