Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#41513 closed enhancement (fixed)

Pass $wp_error param to wp_insert_attachment() inside wp_update_post()

Reported by: mythemeshop's profile MyThemeShop Owned by: dd32's profile dd32
Milestone: 5.1 Priority: normal
Severity: normal Version: 4.9
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

wp_update_post() have $wp_error param which is not passed to wp_insert_attachment() in case of attachment. It is not causing any issue in core, though, as far as I can see.

Attachments (1)

41513.diff (433 bytes) - added by MyThemeShop 7 years ago.

Download all attachments as: .zip

Change History (4)

@MyThemeShop
7 years ago

#1 @dd32
7 years ago

  • Component changed from General to Posts, Post Types
  • Milestone changed from Awaiting Review to 5.0

Hey @MyThemeShop

Thanks for submitting this, this seems pretty straight forward and an obvious oversight from when wp_insert_attachment() didn't support returning a WP_Error.

#2 @dd32
7 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 42383:

Posts: When using wp_update_post() on a attachment post_type item, pass the $wp_error parameter through to wp_insert_attachment().

Props MyThemeShop.
Fixes #41513.

#3 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.