[wp-trac] [WordPress Trac] #47908: "post_updated" hook not working properly with Gutenberg
WordPress Trac
noreply at wordpress.org
Wed Aug 21 21:09:10 UTC 2019
#47908: "post_updated" hook not working properly with Gutenberg
--------------------------+------------------------------
Reporter: giuse | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.2.2
Severity: critical | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):
* component: General => Editor
Old description:
> The "post_updated" action hook doesn't work properly when Gutenberg is
> active.
> The content passed to $post_after and $post_before of the following
> example is always the same, no matter if you change something in the
> content before the post saving.
>
> Disabling Gutenberg all works as normal.
>
> add_action( 'post_updated','my_post_updated_function',99,3 );
>
> function my_post_updated_function( $post_ID, $post_after,$post_before ){
> //$post_after and $post_before are always the same if Gutenberg is
> active
> }
New description:
The "post_updated" action hook doesn't work properly when Gutenberg is
active.
The content passed to $post_after and $post_before of the following
example is always the same, no matter if you change something in the
content before the post saving.
Disabling Gutenberg all works as normal.
{{{
add_action( 'post_updated','my_post_updated_function',99,3 );
function my_post_updated_function( $post_ID, $post_after,$post_before ){
//$post_after and $post_before are always the same if Gutenberg is
active
}
}}}
--
Comment:
Related: #47576
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47908#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list