I just want to make my own exporter
Well, export_wp()
will fetch the data (it builds the sql query, I think).
So I’m not sure the benefit of using an api request to try and hand that data to export_wp()
, unless you mean to generate the arguments for it via an endpoint, or some values in a GET
or POST
request.
Those argument defaults being:
$defaults = array( 'content' => 'all',
'author' => false,
'category' => false,
'start_date' => false,
'end_date' => false,
'status' => false,
);
Since it is doing the query (and I didn’t see any hooks in it to filter that), you’re not going to be able to hand it an array of post objects to parse.
On the other hand, if you wish to create an endpoint that takes a json api request response (post data) and parses it as XML to create and save a file, the function itself does provide a roadmap for you on that latter half of it.
So, unless you’re using the api to generate (POST
) only the arguments, no.
But, looking deeper into export_wp()
will definitely save you some time in getting up and running.
I hope that helps