#20566 closed defect (bug) (fixed)
XML-RPC 3.4 methods cleanup
Reported by: | nacin | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4 | Priority: | high |
Severity: | normal | Version: | 3.4 |
Component: | XML-RPC | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Attached patch does the following:
- Forces _prepare_taxonomy() and _prepare_post_type() to accept a post type or taxonomy object. (You arrays are not welcome here!)
- Limits the return of _prepare_taxonomy() and _prepare_post_type() to a specific type-cast whitelist for things that are potentially useful for mobile apps. The type-casting is important as some arguments can be (or may be in the future) overloaded with arrays, strings, etc. Limiting is important for things like 'capability_type', which is used for registration only; 'rewrite', which can be overloaded and is not something that needs to be exposed to a client, etc. Forwards compatibility is very important to consider. (There is still a filter there, as well.)
- Adds $filter and $fields to _prepare_taxonomy() and therefore wp_getTaxonomies, to match the functionality of wp_getPostTypes. fixes #20407.
- Prevents post types from being changed in _insert_post(). Fixes #20475.
- Removes post_type_supports() checks around comment_status, ping_status, and custom_fields. post_type_supports() handles the admin UI, but should not have any effect on the API. A post type not supporting custom fields (which I'd encourage) would otherwise not be able to have their metadata modified (sad panda).
- Fixes sticky handling. The current code only allows published posts to be stickied. A post can be stickied as long as it is neither private nor password-protected. It now issues an error if the client tries to stick a private post; it will silently unstick a post that is stuck and then changed to be private/protected.
- Unsets tags_input and post_category, as tax_input is also unset already.
- Adds @since's, fixes some docs, trims trailing spaces. Uses rtrim() to remove then force Zulu onto timestamps rather than an str_replace().
With help from maxcutler.
Attachments (3)
Change History (22)
#3
@
13 years ago
Unit test fixes: http://unit-tests.trac.wordpress.org/changeset/700.
#5
@
13 years ago
20566.phpdocs.patch adds $fields
parameter description for _prepare_taxonomy()
.
#8
@
13 years ago
- Cc batmoo@… added
- Resolution fixed deleted
- Status changed from closed to reopened
There are copy-paste errors in [20632]. Some of the GMT hackery changed the references of $content_struct['date_created_gmt']
to $post_data['post_date_gmt']
. This is causing fatal errors:
Fatal error: Call to a member function getIso() on a non-object in /wp-includes/class-wp-xmlrpc-server.php
#10
@
13 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The array keys in [20664] are still incorrect; should be 'date_created_gmt'
.
#15
@
13 years ago
We should resolve the discrepancy with _prepare_taxonomy() and _prepare_post_type() accepting 'capabilities', 'object_types', etc. but keying the data as 'cap' and 'object_type'. Since we are returning all data exactly how it is keyed in the taxonomy and post type objects, we should make the field groups named the same way.
In [20632]: