admin管理员组文章数量:1130349
For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about those posts (ex: title, date, author, acf field...) in a format (json, csv...) I'm quite new to Wordpress development, can someone points me to some direction or resources? Thank you
For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about those posts (ex: title, date, author, acf field...) in a format (json, csv...) I'm quite new to Wordpress development, can someone points me to some direction or resources? Thank you
Share Improve this question asked Dec 6, 2018 at 15:36 Anthony BrebionAnthony Brebion 212 bronze badges1 Answer
Reset to default 0I would recommend doing it mostly in Javascript:
Basic steps (pseudo code):
- On the archive page add check boxes
<input type="checkbox" name="post-with-id-1" value="1">next to each post and a submit button<input type="submit" value="Submit">at the top or bottom of the page. - In js, listen for clicks on the submit button. When it is clicked check which checkboxes are checked and create an array of post ids.
- The simplest thing to do then would be to build a url that opens a page in the browser from the REST API like this http://demo.wp-api/wp-json/wp/v2/posts?include[]=470&include[]=469 where you append an 'include[]=470' for each of the selected posts. That url will build JSON Array that includes object representations of each of your posts.
For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about those posts (ex: title, date, author, acf field...) in a format (json, csv...) I'm quite new to Wordpress development, can someone points me to some direction or resources? Thank you
For an intranet project, I'd like to have not logged in users be able to manually check posts (with checkbox in front of post title on archive page) and be able to export some predefined data about those posts (ex: title, date, author, acf field...) in a format (json, csv...) I'm quite new to Wordpress development, can someone points me to some direction or resources? Thank you
Share Improve this question asked Dec 6, 2018 at 15:36 Anthony BrebionAnthony Brebion 212 bronze badges1 Answer
Reset to default 0I would recommend doing it mostly in Javascript:
Basic steps (pseudo code):
- On the archive page add check boxes
<input type="checkbox" name="post-with-id-1" value="1">next to each post and a submit button<input type="submit" value="Submit">at the top or bottom of the page. - In js, listen for clicks on the submit button. When it is clicked check which checkboxes are checked and create an array of post ids.
- The simplest thing to do then would be to build a url that opens a page in the browser from the REST API like this http://demo.wp-api/wp-json/wp/v2/posts?include[]=470&include[]=469 where you append an 'include[]=470' for each of the selected posts. That url will build JSON Array that includes object representations of each of your posts.
本文标签: Export posts manually selected by end user (not logged in)
版权声明:本文标题:Export posts manually selected by end user (not logged in) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749123143a2319336.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论