WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 6 months ago

Last modified 6 months ago

#44908 closed enhancement (fixed)

Unecessary to set post_modified info in the wp_update_post of wp_generate_user_request_key as wp_insert_post handles it already

Reported by: garrett-eclipse Owned by: garrett-eclipse
Milestone: 5.1 Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords: has-patch
Focuses: Cc:

Description

Hello,

Was reviewing some code specifically this wp_update_post from the wp_generate_user_request_key function found here;
https://github.com/WordPress/WordPress/blob/7ee752e40cf47feb2591711efb8074217b6961f2/wp-includes/user.php#L3515-L3523

In here it specifies the post_modified and post_modified_gmt which appear to get overwritten in wp_insert_post anyway so can probably be removed.

Cheers

Attachments (1)

44908.diff (488 bytes) - added by garrett-eclipse 10 months ago.
Strip unnecessary post_modified args, they get overwritten in wp_insert_post when $update

Download all attachments as: .zip

Change History (9)

@garrett-eclipse
10 months ago

Strip unnecessary post_modified args, they get overwritten in wp_insert_post when $update

#1 @garrett-eclipse
10 months ago

  • Keywords has-patch added

Added 44908.diff to clean-up and remove the unnecessary post_modified args as they get set within the wp_insert_post on $update here;
https://github.com/WordPress/WordPress/blob/f7ba175491b725a5f3d636072c8b432774d38ae3/wp-includes/post.php#L3506-L3508

#2 @garrett-eclipse
10 months ago

  • Owner set to garrett-eclipse
  • Status changed from new to assigned

#3 @garrett-eclipse
9 months ago

  • Milestone changed from Awaiting Review to 5.0.1

#4 @pento
7 months ago

  • Milestone changed from 5.0.1 to 5.0.2

#5 @pento
7 months ago

  • Milestone changed from 5.0.2 to 5.0.3

#6 @desrosj
7 months ago

  • Milestone changed from 5.0.3 to 5.1

This falls outside the 5.0.3 scope. Let's tackle in 5.1.

#7 @pento
6 months ago

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

In 44491:

Privacy: Remove some unnecessary parameters being passed to wp_update_post() by wp_generate_user_request_key().

Props garrett-eclipse.
Fixes #44908.

#8 @pento
6 months ago

In 44494:

Privacy: Fix a code formatting error introduced in [44491].

See #44908.

Note: See TracTickets for help on using tickets.