Skip to content

Add support for term meta data#106

Open
stephenharris wants to merge 2 commits intohumanmade:masterfrom
stephenharris:feature/term-meta2
Open

Add support for term meta data#106
stephenharris wants to merge 2 commits intohumanmade:masterfrom
stephenharris:feature/term-meta2

Conversation

@stephenharris
Copy link

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

@stephenharris
Copy link
Author

If wxr_importer.pre_process.term_meta returns a false-y value all subsequent term meta is skipped, not just the current one. This doesn't seem to me to be the intended behaviour, but is consistent with how the corresponding hooks for post meta and comments currently work.

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.
*/
Copy link
Member

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'] );

Copy link
Member

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?

@rmccue
Copy link
Member

rmccue commented Mar 8, 2017

Agreed, I think it should be a continue not a return

… should skip the current term meta, not all subsequent term meta.
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

Successfully merging this pull request may close these issues.

2 participants