Skip to content

transition_post_status hook doesn't have any POST data when fired #12897

@drov0

Description

@drov0

Hello,

Describe the bug

When placing a hook on transition_post_status I can see it fired but no POST data is available, to get that post data I have to use the save_post hook which is inconvenient since I don't get the $new_status and $old_status infos.

To Reproduce

  1. Hook into transition_post_status. Something like the following code in functions.php will do the job:

add_action( 'transition_post_status', 'log_data', 10, 3 );
function log_data( $new_status, $old_status, $post ) {
error_log(json_encode($_POST));
}

  1. Create a new gutenberg post and publish it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Technical FeedbackNeeds testing from a developer perspective.REST API InteractionRelated to REST API[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions