Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#46850 closed defect (bug) (fixed)

Two parameters passed to delete_option in wp-includes/post.php. Should only pass one.

Reported by: diddledani's profile diddledani Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

delete_option expects one parameter but usage in the function _reset_front_page_settings_for_post() tries to send two arguments. The attached patch fixes it to send the required one parameter.

Attachments (1)

46850.diff (926 bytes) - added by diddledani 6 years ago.
patch to fix wrong number of parameters in delete_option() call

Download all attachments as: .zip

Change History (4)

@diddledani
6 years ago

patch to fix wrong number of parameters in delete_option() call

#1 @johnbillion
6 years ago

  • Component changed from General to Posts, Post Types
  • Milestone changed from Awaiting Review to 5.3
  • Version trunk deleted

#2 @SergeyBiryukov
5 years ago

Thanks for the patch! Looking at [25686], the intention might have been to switch to update_option() instead, to avoid deleting and then recreating the option.

#3 @SergeyBiryukov
5 years ago

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

In 45746:

Posts, Post Types: Update, not delete the page_for_posts option in _reset_front_page_settings_for_post() when a linked page is deleted or trashed.

Props diddledan.
Fixes #46850.

Note: See TracTickets for help on using tickets.