[wp-trac] [WordPress Trac] #44835: Add a hidden input for 'original_post_status' to the inline-edit rows so it's available on the $_POST in save_post

WordPress Trac noreply at wordpress.org
Thu Aug 23 20:15:43 UTC 2018


#44835: Add a hidden input for 'original_post_status' to the inline-edit rows so
it's available on the $_POST in save_post
-----------------------------+------------------------------
 Reporter:  garrett-eclipse  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Editor           |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------
Description changed by garrett-eclipse:

Old description:

> Hello,
>
> Can we add a hidden input for 'original_post_status' into the '.inline-
> edit-save' div found in the inline-edit rows so that it's available on
> the $_POST object form save_post as it is when you save a post from the
> post edit screen.
>
> Background: I am writing a plugin for a client to introduce Draft
> Revisions on published posts. I have a cleanup function tied to save_post
> which purges the Draft Revisions if the post being saved has a status of
> 'publish' or was previously 'publish'. From normal post submission the
> original_post_status is available on the $_POST as it's a hidden input on
> the post editor. From inline-edits this fails as there's no hidden input
> for original_post_status.
>
> I searched for some time to come up with a solution and settled on a
> jquery trigger which injected the missing input when the inline-edit row
> opens. With it present the existing ajax/etc fires properly and populated
> the missing $_POST['original_post_status'] that I required.
>
> Proposition: Add the hidden input for original_post_status onto the
> inline edit rows to make that information available to save_post.
>
> Thank you

New description:

 Hello,

 Can we add a hidden input for 'original_post_status' into the '.inline-
 edit-save' div found in the inline-edit rows so that it's available on the
 $_POST object form save_post as it is when you save a post from the post
 edit screen.

 Background: I am writing a plugin for a client to introduce Draft
 Revisions on published posts. I have a cleanup function tied to save_post
 which purges the Draft Revisions if the post being saved has a status of
 'publish' or was previously 'publish'. From normal post submission the
 original_post_status is available on the $_POST as it's a hidden input on
 the post editor. From inline-edits this fails as there's no hidden input
 for original_post_status.

 I searched for some time to come up with a solution and settled on a
 jquery trigger which injected the missing input when the inline-edit row
 opens. With it present the existing ajax/etc fires properly and populated
 the missing `$_POST['original_post_status']` that I required.

 Proposition: Add the hidden input for original_post_status onto the inline
 edit rows to make that information available to save_post.

 Thank you

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44835#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list