Task: New Taxonomies Powers
Very important when changing slugs for custom types:
Quick fix: re-save permalinks
You can reset the permalink array by going to the permalinks tab in wp-admin and simply re-saving the permalink structure. Navigate to: WordPress Dashboard → Settings → Permalinks: Click “Save Changes”.
My permalink structure:
Voucher list: `/v/blumenpapa-at/` Shop groups have: `/k/buerobedarf-bueromoebel`
Note: If registering a post type inside of a plugin, call
flush_rewrite_rules() in your activation and deactivation hook (see
Flushing Rewrite on Activation below). If
flush_rewrite_rules() is not
used, then you will have to manually go to
Settings > Permalinks and
refresh your permalink structure before your custom post type will show
the correct structure » source
This trick is not working:
And there it is - the trick! Here it goes: if you create a page that has exactly the same permalink, that page will be used as a page for shop group.
If there is no page like that, generic shop group will be shown. That shop group can display rudimentary text from description (for which we can even make a visual content edior), but it can not include nothing more advanced, like featured image, SEO metas, etc.
Note: NOT WORKING!
Another take with extra fields in custom taxonomies
At the minimum, we have two fields:
- Information about attached page.
- We have to save a icon for a shop group
We have a problem: Custom taxonomies extra fields Adding Custom Meta Fields to Taxonomies
Valid solution - great news!
In Wordpress 4.4:
- #10142 (Add metadata support for taxonomy terms) – WordPress Trac
- Taxonomy term metadata proposal – Make WordPress Core
- Changelog/4.4 « WordPress Codex
Probably, functionality is same as with this plugin: Taxonomy Metadata
add_term_meta($term_id, $meta_key, $meta_value, $unique) delete_term_meta($term_id, $meta_key, $meta_value) get_term_meta($term_id, $key, $single) update_term_meta($term_id, $meta_key, $meta_value, $prev_value)
In WordPress 4.4
delete_term_meta are added as functions in the core.
I could use some of the metabox frameworks or plugins mentioned here but I think in this case it is excessive.
Visual editor on taxonomy
wp_term_taxonomy is all the data about taxonomy, but only
flexible one is
Good resource: Shiba — Adventures in WordPress
The best article on adding metaboxes to custom taxonomy is this.
The most useful resources
Ordering of taxonomies: Category Order and Taxonomy Terms Order