Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imported posts are not assigned to a post-format when that is speficied in the WXR #122

Open
pbiron opened this issue Jun 14, 2017 · 0 comments

Comments

@pbiron
Copy link

pbiron commented Jun 14, 2017

When an import contains something like:

<item>
   <wp:post_id>123</wp:post_id>
   ...
   <category domain='post-format' nicename='some-post-format'>Some Post Format</category>
   ...
</item>

The some-post-format term is added (if needed) to the 'post-format' taxonomy, but the post is not associated with that term in the term_relationships table.

I don't understand the code well enough yet to do a fix for this, but it has something to do with WXR_Importer::process_post(). As it loops thru the terms for an imported post it does the following:

if ( isset( $this->mapping['term'][ $key ] ) ) {
	$term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ];
} else {
	$meta[] = array( 'key' => '_wxr_import_term', 'value' => $term );
	$requires_remapping = true;
}

and terms in the post-format taxonomy seem to always end up in the else clause. However, it doesn't appear that anything is done with that $meta after the fact (e.g., in WXR_Importer::post_process_posts()).

I suspect that under certain circumstances the above could also result in other terms not being associated with imported posts, but those from the post-format taxonomy are the only ones I've seen it happen with in my testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant