The MU forums have moved to WordPress.org

WordPress 2.6 (MU) XML-RPC => Change in result from wp.suggestCategories (4 posts)

  1. iolaire
    Member
    Posted 15 years ago #

    FYI: It appears that WordPress 2.6 changes the format of the results returned from wp.suggestCategories. (I've also just moved hosts (to futurehost) so it could also be host related but my guess is 2.6 related.)

    I automatically post to my sites via ruby. Previously the results from wp.suggestCategories returned an array where category name was equal to the values in array['name']['data'] , since 2.6 it appears that it now returns a similar array with a category name of array['category_name'].

    For example fro m the code:

    blog_server = "mymu.blog.com"
    blog_rpc_script = "/xmlrpc.php"
    require 'xmlrpc/client'
    blog_username = 'siteadminname'
    blog_password = 'siteadminpass'
    cat_name = "My New Category"

    server = XMLRPC::Client.new(blog_server, blog_rpc_script)
    result = server.call('wp.suggestCategories' , '1', blog_username, blog_password, cat_name,1)

    Previously the result was an array which included the category name in the values result['name']['data'], its since moved to a format where result['category_name'] equals the category name.

    I just wanted to get this tip out there since it caused me some issues.

  2. andrea_r
    Moderator
    Posted 15 years ago #

    If you mean in single-user WP, you're in the wrong spot. Also, it may have been addressed in 2.6.1

  3. iolaire
    Member
    Posted 15 years ago #

    I'm on MU, but we can be sure that the changes are coming from single user. Yes, it looks like it is fixed in trac, I'll need to note that I'll need to revert on the next MU upgrade. Thanks

  4. iolaire
    Member
    Posted 15 years ago #

    Actually it looks like it is staying as returning only category_id and category_name, both single and MU are showing the same code as is in there now.

About this Topic