2014-03-18 26 views
1

我试图将数据导入自定义职位类型:WordPress的进口被忽略post_parent

<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> 

的post_parent是112,但一旦我导入和看在wp_posts表中,记录有0作为post_parent即使存在id为112的帖子。

它正确地将记录添加到wp_posts和wp_postmeta,为什么不为post_parent添加值?所有其他字段看起来像已经正确填充。

+0

今晚我会对进口商进行挖掘。在您要导入的网站中是否有ID为112的帖子? –

+0

嗨弥敦道,是的,我删除了帖子ID 123,它与帖子ID 112(仍然存在)从wp_posts相关联,我正在尝试重新导入上述内容。我正在测试这个,因为我的插件的一些用户试图导出/导入,并没有看到数据,所以我正在尝试自己,这将是他们遇到的问题。 – KevinUK

回答

1

我发现了一个插件该信息(https://wordpress.org/plugins/wp-re-importer/faq/

标准的WordPress进口商只设置一个岗位的post_parent如果 后也是在进口存在;它无法将导入的帖子映射到已存在于数据库中的 帖子。

当我导出'所有内容',而不是我的问题,我的代码片段成功显示。