• I’m generating XML from a desktop app and am successfully creating WP posts – using a custom post type. The post type has custom fields too, and I can update them through the WP UI.

    However, I’m having a mental block as I try to figure out the XML for wp.newPost to populate these custom fields from my desktop app. This is what I’m trying (no error message).

    Any ideas?

    <member>
    <name>custom_fields</name>
    <value>
    <struct>
    <member>
    <name>lrp_rating</name>
    <value>
    <string>5</string>
    </value>
    </member>
    <member>
    <name>lrp_album</name>
    <value>
    <string>sealed_knot</string>
    </value>
    </member>
    </struct>
    </value>
    </member>

Viewing 1 replies (of 1 total)
  • It should be like this:

    <member>
         <name>custom_fields</name>
         <value>
          <array>
           <data>
            <value>
             <struct>
              <member>
               <name>key</name>
               <value>
                <string>lrp_rating</string>
               </value>
              </member>
              <member>
               <name>value</name>
               <value>
                <string>5</string>
               </value>
              </member>
             </struct>
            </value>
            <value>
             <struct>
              <member>
               <name>key</name>
               <value>
                <string>lrp_album</string>
               </value>
              </member>
              <member>
               <name>value</name>
               <value>
                <string>sealed_knot</string>
               </value>
              </member>
             </struct>
            </value>
           </data>
          </array>
         </value>
        </member>
Viewing 1 replies (of 1 total)
  • The topic ‘wp.newPost XML-RPC custom fields XML format’ is closed to new replies.