Is it possible to continually update an xml file on the server with data from a wordpress page? If so, how could I do it?
I use this plugin http://plugins.elliotcondon.com/advanced-custom-fields/ to create the custom data. Would I be able to save this to an xml file?
It’s important that this xml file is updated every time a new page is created or edited.
The
save_post
hook gets called each time a post is created or updated. Just hook into that. There you can do something likefputcsv('/tmp/' . $post_id, $post)
or output to XML/JSON.== EDIT ==
Yes it is possible, I would recommend looking at PHP’s SimpleXML functions or XMLWriter, and then hook it into
save_post
.I recently made a site map that would save my post to the xml file, change the fields around for what you want to put in them but this most likely will solve your problem.
the functions you want to look into is
heres where the fun begins