Skip to main content
added 1532 characters in body
Source Link
Rarst
  • 99.9k
  • 10
  • 160
  • 298
<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp>
<methodCall>
   <methodName>wp.newPost</methodName><params><param><value><int>0<methodName>
   <params>
      <param>
         <value>
            <int>0</int><int>
         </value><value>
      </param><param><value><string>admin<param>
      <param>
         <value>
            <string>admin</string><string>
         </value><value>
      </param><param><value><string>password<param>
      <param>
         <value>
            <string>password</string><string>
         </value><value>
      </param><param><value><struct><member><name>post_status<param>
      <param>
         <value>
            <struct>
               <member>
                  <name>post_status</name><value><string>publish<name>
                  <value>
                     <string>publish</string><string>
                  </value><value>
               </member><member><name>post_title<member>
               <member>
                  <name>post_title</name><value><string>testname>
                  <value>
                     <string>test 0.762719240039587</string><string>
                  </value><value>
               </member><member><name>post_content<member>
               <member>
                  <name>post_content</name><value><dateTimename>
                  <value>
                     <dateTime.iso8601>20140111T20:39:15</dateTime.iso8601><iso8601>
                  </value><value>
               </member><member><name>post_date<member>
               <member>
                  <name>post_date</name><value><dateTimename>
                  <value>
                     <dateTime.iso8601>20140111T20:39:15</dateTime.iso8601><iso8601>
                  </value><value>
               </member><member><name>terms_names<member>
               <member>
                  <name>terms_names</name><value><struct><member><name>category<name>
                  <value>
                     <struct>
                        <member>
                           <name>category</name><value><array><data><value><string>test<name>
                           <value>
                              <array>
                                 <data>
                                    <value>
                                       <string>test</string><string>
                                    </value><value>
                                 </data><data>
                              </array><array>
                           </value><value>
                        </member><member>
                     </struct><struct>
                  </value><value>
               </member><member>
            </struct><struct>
         </value><value>
      </param><param>
   </params><params>
</methodCall>
<?xml version="1.0"?><methodCall><methodName>wp.newPost</methodName><params><param><value><int>0</int></value></param><param><value><string>admin</string></value></param><param><value><string>password</string></value></param><param><value><struct><member><name>post_status</name><value><string>publish</string></value></member><member><name>post_title</name><value><string>test 0.762719240039587</string></value></member><member><name>post_content</name><value><dateTime.iso8601>20140111T20:39:15</dateTime.iso8601></value></member><member><name>post_date</name><value><dateTime.iso8601>20140111T20:39:15</dateTime.iso8601></value></member><member><name>terms_names</name><value><struct><member><name>category</name><value><array><data><value><string>test</string></value></data></array></value></member></struct></value></member></struct></value></param></params></methodCall>
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
   <methodName>wp.newPost</methodName>
   <params>
      <param>
         <value>
            <int>0</int>
         </value>
      </param>
      <param>
         <value>
            <string>admin</string>
         </value>
      </param>
      <param>
         <value>
            <string>password</string>
         </value>
      </param>
      <param>
         <value>
            <struct>
               <member>
                  <name>post_status</name>
                  <value>
                     <string>publish</string>
                  </value>
               </member>
               <member>
                  <name>post_title</name>
                  <value>
                     <string>test 0.762719240039587</string>
                  </value>
               </member>
               <member>
                  <name>post_content</name>
                  <value>
                     <dateTime.iso8601>20140111T20:39:15</dateTime.iso8601>
                  </value>
               </member>
               <member>
                  <name>post_date</name>
                  <value>
                     <dateTime.iso8601>20140111T20:39:15</dateTime.iso8601>
                  </value>
               </member>
               <member>
                  <name>terms_names</name>
                  <value>
                     <struct>
                        <member>
                           <name>category</name>
                           <value>
                              <array>
                                 <data>
                                    <value>
                                       <string>test</string>
                                    </value>
                                 </data>
                              </array>
                           </value>
                        </member>
                     </struct>
                  </value>
               </member>
            </struct>
         </value>
      </param>
   </params>
</methodCall>
Source Link

XML RPC post produces immediate revision with odd post_date_gmt

I am sending a post to Wordpress 3.8 with XML RPC. Here is the raw XML being sent to wordpress:

<?xml version="1.0"?><methodCall><methodName>wp.newPost</methodName><params><param><value><int>0</int></value></param><param><value><string>admin</string></value></param><param><value><string>password</string></value></param><param><value><struct><member><name>post_status</name><value><string>publish</string></value></member><member><name>post_title</name><value><string>test 0.762719240039587</string></value></member><member><name>post_content</name><value><dateTime.iso8601>20140111T20:39:15</dateTime.iso8601></value></member><member><name>post_date</name><value><dateTime.iso8601>20140111T20:39:15</dateTime.iso8601></value></member><member><name>terms_names</name><value><struct><member><name>category</name><value><array><data><value><string>test</string></value></data></array></value></member></struct></value></member></struct></value></param></params></methodCall>

Seems ok. The Date is being sent with the correct UTC (the post was made at 14:39 Chicago time, -6 GMT) time and I get a post ID back (in this case 28062). Groovy.

Taking a look at it in phpMyAdmin the results go a bit weird.

phpMyAdmin Results

ID #28063 has the correct timestamp on post_date_gmt, but the parent (28062), has a date that is 12 hours out from the date that was sent. Double the correct GMT offset. What is going on here?