Ticket #4107 (closed task (blessed): fixed)
Tags to categories importer
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.2 |
| Component: | Administration | Version: | |
| Severity: | critical | Keywords: | |
| Cc: |
Description
Basically, a category to tag importer that *selectively* converts categories. This is because, for example, if you have a Politics category, but have a one-time (maybe two-time) category for Iraq War, the Iraq War is more tag material, whereas the Politics category should stay that way.
So the solution that was reached in #wordpress-dev was to have the user presented with a checklist of categories, and they can choose which categories to import and which not to.
I'm planning to have it done by this weekend (weekend of 4/6).
Attachments
Change History
Okay, that's about 80% done. Just the bitwise stuff and count adjustments that need to be made. If you could post some examples of the bitwise stuff, that'd be great. I'm completely ignorant of bitwise functions :\.
I'll tackle the rest tomorrow morning, PST.
Todo: Add call to clean_category_cache(). Link to converter from Manage->Categories.
- Status changed from new to closed
- Resolution set to fixed
I think the initial work is pretty much done. We can open other tickets in reference to this one, or just reopen this.
- Status changed from closed to reopened
- Resolution fixed deleted
To do -- link to converter.
- Status changed from reopened to closed
- Resolution set to fixed
comment:9
glitch010101 — 5 years ago
I get the "cheatin' uh?" error when I go to use this. Doing a little googling, it seems I may have some permission issues causing that error but everything looks okay.
3 1 gNYC_capabilities a:1:{s:13:"administrator";b:1;} I'm also using a custom table prefix (gNYC_ instead of wp_), and I put my wp_cat2tags.php file in wp-admin
I'm running the nightly 2.2-bleeding from 4/9/2007
P.S. - This is my first bug here, so please let me know if I can provide more info or if this is the wrong place for this issue.
Thanks Eric Skiff
comment:10
Viper007Bond — 5 years ago
Confirmed issue and I'm not using any custom permissions plugin.
comment:11
foolswisdom — 5 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
comment:12
rob1n — 5 years ago
This may be because I checked for current_user_can('manage_tags') -- not sure if that's set up.
comment:13
rob1n — 5 years ago
Yep. Took that out and worked for me.
comment:15
rob1n — 5 years ago
- Status changed from reopened to closed
- Resolution set to fixed
comment:16
follow-up:
↓ 17
matt — 5 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
Every time I run this it gives me this error, for every category:
Converting category #79... Category doesn't exist!
It also seems to list tags in the checkbox thing, where it should really only lists categories.
comment:17
in reply to:
↑ 16
rob1n — 5 years ago
Replying to matt:
Every time I run this it gives me this error, for every category:
Converting category #79... Category doesn't exist!
I *think* this is because apparently category_exists return the category ID on success, and also it takes the nicename. I'll add in a function local to the importer class that checks based on ID, and returns either boolean true or false.
It also seems to list tags in the checkbox thing, where it should really only lists categories.
This is just my stupid mistake :\.
comment:18
rob1n — 5 years ago
- Status changed from reopened to closed
- Resolution set to fixed


Misc thoughts. Convert category to tag by setting the type bitfield to TAXONOMY_TAG unless the category is also a link category (link_count > 0). In that case, bitwise or TAXONOMY_TAG into the bitfield. Change rel_type in post2cat from category to tag for all posts with that category id. Copy count to tag_count and then zero out count. Link to the importer from Manage->Categories for better discoverability.