• Resolved jormarques

    (@jormarques)


    Hi,

    What is the process to update 2 categories for the post (Parent ID and ID)? In the documentation there is only reference to Post_category and 1 only. I have tried using the same principle of the WordPress REST API standards and it does not work. So would be great to allow to post with parent category and child.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stiofan

    (@stiofansisland)

    Hello,

    You would simply make it an array:

    $request_params = array(
    'title' => 'The London Eye',
    'status' => 'publish',
    'post_category' => array(
    81,
    80,
    82
    ),
    'default_category' => 81,
    'city' => 'London'
    ...
    );

    Thanks,

    Stiofan

    Thread Starter jormarques

    (@jormarques)

    Hi,

    I did send as an array, but I get the following error in the REST api response: post_category[0] is not of type integer.

    params: {

    title:?Hotel Sleep Nice,

    post_category:? [10,2],

    • This reply was modified 1 month, 3 weeks ago by jormarques.
    Thread Starter jormarques

    (@jormarques)

    Mea culpa actually guys.I was not pushing as integer actually. It is working now. Thanks :).

    Plugin Author Stiofan

    (@stiofansisland)

    Awesome! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.