[wp-trac] [WordPress Trac] #18692: wp_insert_post() enhancements
WordPress Trac
wp-trac at lists.automattic.com
Sat Sep 17 21:33:12 UTC 2011
#18692: wp_insert_post() enhancements
-------------------------+-----------------------------
Reporter: sirzooro | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.2.1
Severity: normal | Keywords: has-patch
-------------------------+-----------------------------
I have created enhancement for `wp_insert_post()` function. There re two
changes:[[BR]]
- allows to return WP_Error from `wp_insert_post_data` - in this case
function returns that value (or 0 if param `$wp_error == false`) and do
not continue;[[BR]]
- filter categories, tags and other taxonomies through new filters:
`wp_insert_post_category`, `wp_insert_post_tags` and `wp_insert_post_tax`.
New code also checks if these filters returned WP_Error;
These changes will allow me to implement following features in my
[http://wordpress.org/extend/plugins/wypiekacz/ WyPiekacz] plugin:[[BR]]
- do not create new post when it does not satisfy appropriate rules.
Although WP code will not display that error by itself (#10480, #18266), I
will be able to display appropriate error from plugin code (at least when
normal editor was used). This will also help me to stop flood of automated
post spam;[[BR]]
- allow to review tags attached to post submitted for review - this way
tags will be actually created when post will be published; before this
they will be stored as post metadata. In order to do this I need to modify
tags - unfortunately `wp_insert_post_data` filter does not allow to modify
them (it allows read-only access to them only).
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18692>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list