Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#57473 closed defect (bug) (fixed)

Unclear Documentation for wp_insert_post for post_modified property

Reported by: dshanske's profile dshanske Owned by: audrasjb's profile audrasjb
Milestone: 6.2 Priority: low
Severity: trivial Version:
Component: Posts, Post Types Keywords: good-first-bug has-patch commit
Focuses: docs Cc:

Description

The documentation for wp_insert_post implies that post_modified and post_modified_gmt can be set using this, but it cannot if this is an update, only if it is a new post.

Personally, I actually wanted to be able to have this not updated for minor edits, which is why I was looking at the code, but noticed the explanation is misleading.

Change History (5)

#1 @johnbillion
2 years ago

  • Keywords needs-patch good-first-bug added

This ticket was mentioned in PR #3850 on WordPress/wordpress-develop by @mehulkaklotar.


2 years ago
#2

  • Keywords has-patch added; needs-patch removed

#3 @audrasjb
2 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.2
  • Owner set to audrasjb
  • Status changed from new to accepted

Thanks for the ticket @dshanske and for the patch @mehulkaklotar!

The patch removes post_modified and post_modified_gmt params from wp_insert_post() docblock, which looks good to me, since those params are not used in this function.

Self assigning for commit.

#4 @audrasjb
2 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55080:

Docs: Remove unused post_modified and post_modified_gmt params from wp_insert_post() docblock.

Props dshanske, mehulkaklotar.
Fixes #57473.
See #56792.

Note: See TracTickets for help on using tickets.