WordPress set menu_order via XML RPC

Question

I am importing thousands of pages into WordPress controlled via the XML RPC API. The only issue I have is that WordPress is obviously resistent against setting menu_order via this API. This is my XML document:

<?xml version="1.0"?>
<methodCall>
  <methodName>wp.editPost</methodName>
  <params>
    <param>
      <value>
        <int>0</int>
      </value>
    </param>
    <param>
      <value>
        <string>username</string>
      </value>
    </param>
    <param>
      <value>
        <string>pa55w0rd</string>
      </value>
    </param>
    <param>
      <value>
        <int>8192</int>
      </value>
    </param>
    <param>
      <value>
        <struct>
          <member>
            <name>menu_order</name>
            <value>
              <int>30</int>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>

I want to know why it is not working with this XML document, and how it should work. What is wrong with this XML RPC request?

As a side note: Creating the post and editing in any other manner (content, state, title, parent Id, custom fields) works fine.

I tested with the JSON API: HTTP POST request to /?rest_route=/wp/v2/pages/8192 with this JSON content:

{"menu_order":30}

works perfectly.

0
rexkogitans 4 days 0 Answers 6 views 0

Leave an answer