[wp-trac] [WordPress Trac] #12706: Custom post status bugs in the admin
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 8 12:48:37 UTC 2010
#12706: Custom post status bugs in the admin
----------------------------+-----------------------------------------------
Reporter: ptahdunbar | Owner: ptahdunbar
Type: task (blessed) | Status: new
Priority: normal | Milestone: 3.1
Component: Post Types | Version:
Severity: normal | Keywords: needs-patch
----------------------------+-----------------------------------------------
Comment(by kevinB):
Just uploaded a
[http://core.trac.wordpress.org/attachment/ticket/12706/Custom_Stati_Support.patch
patch] for the first issue. This is mostly comprehensive, supporting use
of the following type of stati:
* private type, indicated by $status_obj->private. Some functionality as
normal private, but a separate set of capability requirements which may
include all or some of the following: "read_secret_posts",
"edit_secret_posts", "delete_secret_posts", "set_secret_posts" (the
"publish" equivalent). If a status-specific caps is not defined for some
operation, the normal private status equivalent is used.
* pending type, indicated by '''$status_obj->moderation'''. Enables
additional multi-step moderation, optionally with status-specific
capabilities. A new filter is applied to allow plugins to customize the
default moderation status for the main Submit button:
{{{
$moderation_status = apply_filters( 'post_moderation_status', 'pending',
$post->ID );
}}}
'''Remaining Issues:'''
* I didn't touch xml-rpc or map_meta_cap (but see meta mapping in attached
plugin for ideas)
* Custom '''public''' stati now have some backend support but no Edit Form
UI integration. The complication-to-benefit ratio seems much higher
here; at this point I'm not eager to push it.
* The js I moved into edit-form-advanced.php should be reviewed for
optimal delivery method.
* I don't know the WP way to compress js files. post.js and inline-edit-
post.js in this patch are a copy of uncompressed dev.js
'''Demo Plugin:'''
I also attached a [http://core.trac.wordpress.org/attachment/ticket/12706
/custom-status-helper_1.0.zip plugin] to demonstrate two custom stati via
the following roles:
* "Reviewer" - has edit_approved, delete_approved, set_approved,
edit_others, delete_others for all post types
* "Super Editor" (name='super') - has read_secret, edit_secret,
delete_secret, set_secret for all post types (in addition to regular
editor caps)
The WP roles definitions will be added to your DB, but db-stored
capabilities are only that of Contributor and Editor, respectively.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12706#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list