WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 3 months ago

#24554 closed defect (bug) (worksforme)

Errors in post.php seems silent.

Reported by: nilo85 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

wp-includes/post.php, around line 2933.

if ( 'default' != $page_template && ! isset( $page_templates[ $page_template ] ) ) {

The defined template did not exist in theme, and as a result my custom fields was not saved. The error was silent. (I as a user did not notice it).

Maybe the error should get displayed to the user?

Change History (2)

comment:1 SergeyBiryukov10 months ago

  • Keywords reporter-feedback added

In that condition, wp_insert_post() returns either a WP_Error object or 0 to the function where it was called: tags/3.5.2/wp-includes/post.php#L2930. This consistent with how other errors are handled in the function.

Could you provide the steps to reproduce the issue? If you call wp_insert_post() manually, could you share the code you're using?

comment:2 nacin3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.