-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add support for term meta data #106
base: master
Are you sure you want to change the base?
Conversation
If If that is indeed a bug then I'm happy to open another PR to fix that, and modify this one accordingly. |
* @param array $meta_item Meta data. (Return empty to skip.) | ||
* @param int $term_id Term the meta is attached to. | ||
*/ | ||
$meta_item = apply_filters( 'wxr_importer.pre_process.term_meta', $meta_item, $term_id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing from #18 (comment)
I think the term_id is different to the term data, so we can't just pass term.
// export gets meta straight from the DB so could have a serialized string | ||
$value = maybe_unserialize( $meta_item['value'] ); | ||
|
||
add_term_meta( $term_id, $key, $value ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be slashed?
Agreed, I think it should be a |
… should skip the current term meta, not all subsequent term meta.
WordPress 4.4 adds term meta data, and trac ticket 34602, adds term meta data to the WXR export file. Although that ticket is still open, and is unlikely to be in 4.4, this PR adds support for importing term meta data, following the schema set out in that ticket.
This PR replaces #18