[wp-xmlrpc] page template support in XML-RPC

Joseph Scott joseph at randomnetworks.com
Tue May 6 17:21:37 GMT 2008

You can now manipulate the page template setting for Pages in  
WordPress via XML-RPC:


Ryan committed this to -trunk and it will be in the 2.6 release  
(which will probably be out some time this summer).

Here's the details:

New field in wp.getPage/newPage/editPage: wp_page_template
New method: wp.getPageTemplates which returns a struct like:
		Archives = "archives.php",
		Default = "default",
		Links = "links.php",
		TP1 = "tp1.php"

The template description is used as the key, and the proper template  
value (used by wp_page_template) is the value in the struct.  In  
order to change the template a page uses wp_page_template must be  
provided a value.  If the field is sent with an empty value no  
changes will be made.  The value of "default" is special, that's the  
default page template value and is always available to use.

If you attempt to set wp_page_template to an unsupported value then  
you'll get an error on the wp.newPage/editPage call.

Please try this out and let us know if you run into any problems or  
have any questions, we want to make sure that this works as expected  
when 2.6 is released.

Joseph Scott
joseph at randomnetworks.com

More information about the wp-xmlrpc mailing list