Kev*_*nUK 3 wordpress import custom-post-type
我正在尝试为自定义帖子类型导入数据:
<item>
<title>sausages</title>
<link>http://localhost:10293/?gmc_recipeingredient=sausages</link>
<pubDate>Tue, 18 Mar 2014 21:18:03 +0000</pubDate>
<dc:creator><![CDATA[KevinUK]]></dc:creator>
<guid isPermaLink="false">http://localhost:10293/?gmc_recipeingredient=sausages</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>123</wp:post_id>
<wp:post_date>2014-03-18 21:18:03</wp:post_date>
<wp:post_date_gmt>2014-03-18 21:18:03</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name>sausages</wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>112</wp:post_parent>
<wp:menu_order>1</wp:menu_order>
<wp:post_type>gmc_recipeingredient</wp:post_type>
<wp:post_password></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<wp:postmeta>
<wp:meta_key>gmc-ingredientquantity</wp:meta_key>
<wp:meta_value><![CDATA[2]]></wp:meta_value>
</wp:postmeta>
</item>
Run Code Online (Sandbox Code Playgroud)
post_parent 是 112,但是一旦我导入并查看 wp_posts 表,即使存在 id 为 112 的帖子,记录也会将 0 作为 post_parent。
它正确地将记录添加到 wp_posts 和 wp_postmeta 那么为什么不为 post_parent 添加值?所有其他字段看起来都已正确填充。
我在插件(https://wordpress.org/plugins/wp-re-importer/faq/)中找到了这些信息
如果该帖子也存在于导入中,则标准的 WordPress 导入器仅设置帖子的 post_parent;它无法将导入的帖子映射到数据库中已存在的帖子。
当我导出“所有内容”时,我的问题中的片段成功显示。
| 归档时间: |
|
| 查看次数: |
729 次 |
| 最近记录: |