WordPress.org

Make WordPress Core

Opened 10 months ago

Last modified 10 months ago

#45801 new defect (bug)

Duplicate post publish action

Reported by: bmettee4 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0.2
Component: Posts, Post Types Keywords:
Focuses: Cc:
PR Number:

Description

I'll try to keep this short. Action "publish_to_publish" is being called twice when updating a published post under some circumstances. Web server registers two calls (one to index.php, one to /wp-admin/post.php). First call appears to update the content and non-meta data. Second call updates data from meta blocks.

Specifics: Any theme or plugin that adds meta data to a post forces a second call to the update process with the meta block data.

Problem: Any plugin that performs actions based on "publish_to_publish" is being called twice. In my specific instance the Better Notifications for WordPress plugin sends notifications mails doubled.

Wordpress version: 5.0.2
Theme: Customify, no plugins
Or
Theme: TwentyNineteen, and Plugin: Profile Builder

Basically anything that adds meta-data to a post object causes a second, duplicate, action.

If meta-data updates should trigger a second action, how can a plugin detect that there has been an additional call?

Change History (1)

#1 @SergeyBiryukov
10 months ago

  • Component changed from Plugins to Posts, Post Types
Note: See TracTickets for help on using tickets.