XML-RPC 3.4 methods cleanup
|Reported by:||nacin||Owned by:||nacin|
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.
Change History (22)
- Cc batmoo@… added
- Resolution fixed deleted
- Status changed from closed to reopened
Note: See TracTickets for help on using tickets.