是否可以将数据从 table 提供给 wordpress?
Is it possible to feed data from a table to wordpress?
我正在开发一个类似存档的 wordpress 驱动的网站。现在我在考虑如何加快内容上传过程。
通常您需要先通过 wp 后端注册每个人,然后将一个或多个项目与该人相关联。我要问的是,您是否可以自动执行为每个人手动添加新条目的过程。我在 excel table 中有自定义 "person" post 类型的数据。有没有插件或其他方法可以加快速度?
谢谢!
/* 编辑 */
刚找到这个插件。您可以从 JSON 导入到 Post
https://wordpress.org/plugins/json-importer/
+
How to Export Excel to JSON
/* 编辑结束 */
不知道有没有这个插件。
但我会走另一条路。您可以创建一个 php 文件并使用 wp_insert_post() 插入来自 JSON 或 CSV 的信息。
// Create post object
$my_post = array();
$my_post['post_title'] = 'Person Name';
$my_post['post_content'] = 'Information about Person.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
$my_post['post_category'] = array(8,39);
// Insert the post into the database
wp_insert_post( $my_post );
https://developer.wordpress.org/reference/functions/wp_insert_post/
可能有帮助的答案:
我正在开发一个类似存档的 wordpress 驱动的网站。现在我在考虑如何加快内容上传过程。
通常您需要先通过 wp 后端注册每个人,然后将一个或多个项目与该人相关联。我要问的是,您是否可以自动执行为每个人手动添加新条目的过程。我在 excel table 中有自定义 "person" post 类型的数据。有没有插件或其他方法可以加快速度?
谢谢!
/* 编辑 */
刚找到这个插件。您可以从 JSON 导入到 Post
https://wordpress.org/plugins/json-importer/
+
How to Export Excel to JSON
/* 编辑结束 */
不知道有没有这个插件。
但我会走另一条路。您可以创建一个 php 文件并使用 wp_insert_post() 插入来自 JSON 或 CSV 的信息。
// Create post object
$my_post = array();
$my_post['post_title'] = 'Person Name';
$my_post['post_content'] = 'Information about Person.';
$my_post['post_status'] = 'publish';
$my_post['post_author'] = 1;
$my_post['post_category'] = array(8,39);
// Insert the post into the database
wp_insert_post( $my_post );
https://developer.wordpress.org/reference/functions/wp_insert_post/
可能有帮助的答案: