[wp-trac] [WordPress Trac] #18429: Create custom post types via XMLRPC
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 3 15:41:44 UTC 2012
#18429: Create custom post types via XMLRPC
----------------------------+------------------------
Reporter: nprasath002 | Owner: westi
Type: task (blessed) | Status: reviewing
Priority: normal | Milestone: 3.4
Component: XML-RPC | Version:
Severity: normal | Resolution:
Keywords: has-patch |
----------------------------+------------------------
Comment (by maxcutler):
Updated the patch with several fixes:
* Renamed `date_created` to `post_date`, `date_created_gmt` to
`post_date_gmt`.
* Renamed `wp_post_format` to `post_format` and added some error handling.
* Totally reworked taxonomy term handling. See notes below.
* Updated PHPDoc as appropriate, though it still needs more work before
commit.
Regarding taxonomy terms, I decided to try a different approach than
before. It became clear after some IRC discussion that attempting to
disambiguate IDs versus names in a single array was a fool's errand, so I
changed it to be two separate fields in `content_struct`:
1. `terms`: should contain list of IDs of existing terms.
2. `terms_names`: should contain list of term names. If existing, we'll
look up the ID; if not existing, we'll create a new term for it. If the
taxonomy is hierarchical, then it checks whether there are multiple terms
with that name, and throws an error in that case (client should use an
ID).
Most existing clients should be able to just switch to `terms_names`,
while new clients should be encouraged to use `terms`. But you can use
them both together and it'll do the right thing. I've tested this fairly
thoroughly and confirmed the described behavior.
Remaining questions:
* Should we silently ignore invalid `comment_status`, `ping_status` and
`post_status` values? Or should we return errors?
* What kind of filters and hooks should we put at the end of the method?
Since #17109 is blessed, we should probably use that style?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18429#comment:27>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list