Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#4100 closed enhancement (fixed)

UTW Tag Importer

Reported by: MellerTime Owned by:
Milestone: 2.2 Priority: low
Severity: trivial Version: 2.2
Component: Administration Keywords: tags import
Focuses: Cc:


New importer to migrate tags and tag->post relationships from a user's existing UTW installation into the new Wordpress-native tagging structure.

Attachments (1)

utw.php (6.7 KB) - added by MellerTime 11 years ago.
UTW importer for wp-admin/import/

Download all attachments as: .zip

Change History (16)

#1 follow-up: @rob1n
11 years ago

Cool, but I don't know if this should be shipped with WordPress. Maybe we should just make it an official solution for people using UTW (but not bundle it with WP, since not everyone uses/used UTW).

Cool work, though!

#2 in reply to: ↑ 1 @MellerTime
11 years ago

Matt mentioned in #wordpress that it'd be nice to have an importer for the most-used tagging package available, and I tend to agree. Just like we provide solutions for people switching from MT, it makes sense to allow people to easily switch from the often-used UTW to the native platform easily.

If it's not going to be included, it'd probably make more sense to re-work it into a plugin. It's not often that people have to drop something new into wp-admin, so it may be a tad confusing that way.

#3 @Otto42
11 years ago

If tags are going to be added to the core, then we either need a way to: a) Import from popular tagging plugins and have that in the core too, or b) Have the ability to turn off or otherwise disable the new core tagging functions, so that people can choose to continue using their existing tagging plugins.

Without a way to import, the new tagging will not get much acceptance. This really, really needs to be in the core. Somehow.

Maybe we can just do it automatically, as part of the upgrade process?

#4 @MellerTime
11 years ago

I don't think it should be done automatically. With all the themes already built to utilize UTW functions / etc, I don't think we should automatically assume that as soon as WP-native tagging is released everyone will switch to it.

I agree that a core feature should have a way to import it from another leading system. But don't just automatically assume I want to switch from that system... I may not want to, at least not yet.

#5 @ryan
11 years ago

Use the new wp_create_tag instead of wp_create_category. I think the query in post_has_tag need to use rel_type. You could use get_post_tags, but we might not want the caching overhead in an import context. Also, does post_has_tag need to do a COUNT? We just need 1 result to know if there are tags.

add_post_tag is missing some things that need to be done, such as updating counts. Perhaps we should create wp_add_post_tag() or add an append arg to wp_set_post_tags.

#6 @rob1n
11 years ago

wp_add_post_tag() would be useful, just to add a tag.

#7 @ryan
11 years ago

Fine by me. Probably should make it wp_add_post_tags() so we can add multiple tags at once if desired. It might just call wp_set_post_tags with an arg, though, to avoid duplicate code between the two functions.

#8 @MellerTime
11 years ago

I think making it a wrapper for wp_set_post_tags (with append arg) would make sense. It'd still be nice to have an obviously-named function for adding tags.

I fixed the post_has_tag query so that it just tries to grab a rel_id and tacked on the rel_type (although to be honest... tag_id should be unique, how would we ever get a category and a tag with the same id?). Whenever you're done with any additional functions (like wp_add_post_tags), I'll post a revised version.

#9 @rob1n
11 years ago

See #4109 -- wp_add_post_tags() and $append for wp_set_post_tags().

11 years ago

UTW importer for wp-admin/import/

#10 @MellerTime
11 years ago

Alright, new version utilizes the new tagging functions and should address all the issues ryan brought up.

Thanks to h0bbel for being my first live guinea pig!

#11 @ryan
11 years ago

+1 for commit. We can iterate bug fixes on top. Robin, please review and commit if it looks good to you.

#12 @rob1n
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5213]) Add initial UTW tag converter. Props MellerTime. fixes #4100

#13 @rob1n
11 years ago

If we have any other issues, we can open other tickets and assign them to me.

#14 @rob1n
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Todo: link to importer.

#15 @rob1n
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5216]) Link to categories to tags converter and UTW importer. fixes #4100 #4107

Note: See TracTickets for help on using tickets.