WordPress.org

Ready to get started?Download WordPress

Forums

wp.newPost XML-RPC custom fields XML format (2 posts)

  1. johnbeardy
    Member
    Posted 1 year ago #

    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>

  2. lont
    Member
    Posted 1 year ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags