Task: New Taxonomies Powers

Task: New Taxonomies Powers

Very important when changing slugs for custom types:

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.


Another take with extra fields in custom taxonomies

At the minimum, we have two fields:

  1. Information about attached page.
  2. 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!

Adding Custom Meta Fields to Taxonomies - Pippins Plugins Bible: How to Add Custom Fields to Custom Taxonomies in Wordpress CLEANLY How to Add Custom Meta Fields to Custom Taxonomies in WordPress

In Wordpress 4.4:

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 add_term_meta, update_term_meta, get_term_meta and delete_term_meta are added as functions in the core.

6 Cool New Features Coming Up in WordPress 4.4 - WPMU DEV Quick guide to WordPress 4.4 for Developers

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

visual-term-description-editor/visual-term-description-editor.php at master · sheabunge/visual-term-description-editor

In table wp_term_taxonomy is all the data about taxonomy, but only flexible one is description.

Good resource: Shiba — Adventures in WordPress

The best article on adding metaboxes to custom taxonomy is this.

Also, good example to technique on this plugin (or this).

The most useful resources

How to add taxonomy meta fields? Read here. And the simplest answer on media upload was here You could also extend Quick-Edit functionality by learning from here.

Introducing Term Meta Data In WordPress And How To Use Them – Smashing Magazine

date 20. Sep 2016 | modified 13. May 2024
filename: Task - New Taxonomies Powers