[wp-trac] [WordPress Trac] #11889: Create post with special post_status when viewing Add New screen
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 27 23:29:10 UTC 2010
#11889: Create post with special post_status when viewing Add New screen
----------------------------+-----------------------------------------------
Reporter: markjaquith | Owner: markjaquith
Type: task (blessed) | Status: accepted
Priority: high | Milestone: 3.0
Component: Autosave | Version: 3.0
Severity: normal | Keywords: featured
----------------------------+-----------------------------------------------
Comment(by rovo89):
Updating the status to "draft" seems to work fine for autosave, where it
is set explicitly. It works fine as well for manual "Save Draft", but only
if the user has publishing capabilities. Otherwise, the combobox for
changing the post_status (which defaults to "draft") is not included in
the HTML and thus missing in the POST data.
So if e.g. a Contributor creates a new post, types some words into the
editor, clicks "Save Draft" and navigates to the list of posts, this post
will be missing as it still has post_status "auto-draft". This does not
happen if the user fills in the title, as the post will be autosaved upon
leaving the title input field. Considering that custom post types might
hide the title input field and users might disable Javascript, I think
this should be fixed.
I'm attaching a patch which adds a hidden post_status field with the value
"draft" for non-publishers. Another option might be to explicitly set the
post_status to "draft" if it was "auto-draft" before and no post_status
was passed in the POST data.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11889#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list