[wp-trac] [WordPress Trac] #20566: XML-RPC 3.4 methods cleanup

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 28 18:38:01 UTC 2012


#20566: XML-RPC 3.4 methods cleanup
--------------------------+-----------------
 Reporter:  nacin         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  high          |  Milestone:  3.4
Component:  XML-RPC       |    Version:  3.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20566>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list