#6098 closed enhancement (fixed)
Expose page template functionality via XML-RPC
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
One aspect of Pages in WordPress that is not currently exposed is page templates. This was mentioned by Srinivas Vedantam on the wp-xmlrpc list:
http://comox.textdrive.com/pipermail/wp-xmlrpc/2008-February/000168.html
Adding a new page_template field to page methods and providing a new method for listing available page templates seems reasonable. wp.getPageTemplates?
I'll put together a patch, with the goal of getting this in after 2.5 is released.
Attachments (2)
Change History (11)
#2
@
17 years ago
The end of the patch looks off. Seems Subversion got confused when generating the diff. So far I haven't been able to convince it to generate a correct one :-(
#3
@
17 years ago
Patch adds page template validation and the option to return WP_Error from wp_insert_post().
Note: See
TracTickets for help on using
tickets.
I've created a patch that exposes the page template via the 'wp_page_template' field in wp.getPage and can be set via wp.newPage/editPage. I also included a new method, wp.getPageTemplates, which returns a struct of the available page templates. Here's an example of what it returns:
The key in the struct is the template description and the value is the one used by the wp_page_template field. So to use the TP1 template wp_page_template would be set to 'tp1.php'.
If you provide an empty wp_page_template field no changes will happen. You can't delete the setting, only change it to another value.