Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Term Meta WordCamp Paris 2016

Matt Perry
February 06, 2016

Term Meta WordCamp Paris 2016

This presentation tells the story of the new Term Meta feature in WordPress 4.4, and provides a view of the human and technical story behind this new feature.

Matt Perry

February 06, 2016
Tweet

Other Decks in Technology

Transcript

  1. plugin developers had to develop their own method of storing

    data [for taxonomy terms] … it would be good to add new functions for this.
  2. 1. create a category called Testing 2. create a tag

    called Testing 3. Rename the Testing category to “Another Test” 4. check the name of the tag
  3. wp_terms wp_term_taxonomy < 4.2 wp_term_relationships what unique terms exist? term

    slugs unique what terms are in what taxonomies? what taxonomy terms are associated with which posts
  4. wp_terms wp_term_taxonomy < 4.2 wp_term_relationships what unique terms exist? term

    slugs unique what terms are in what taxonomies? what taxonomy terms are associated with which posts
  5. The Plan • Stop making things worse (don’t make any

    new shared terms) • Start to fix shared terms on update • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy • introduce term_meta • combine wp_terms and wp_taxonomy_terms tables
  6. The Plan • Stop making things worse (don’t make any

    new shared terms) [4.1] • Start to fix shared terms on update • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy • introduce term_meta • combine wp_terms and wp_taxonomy_terms tables
  7. The Plan • Stop making things worse (don’t make any

    new shared terms) [4.1] • Start to fix shared terms on update [4.2] • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy • introduce term_meta • combine wp_terms and wp_taxonomy_terms tables
  8. The Plan • Stop making things worse (don’t make any

    new shared terms) [4.1] • Start to fix shared terms on update [4.2] • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy [4.3] • introduce term_meta • combine wp_terms and wp_taxonomy_terms tables
  9. The Plan • Stop making things worse (don’t make any

    new shared terms) [4.1] • Start to fix shared terms on update [4.2] • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy [4.3] • introduce term_meta [4.4] • combine wp_terms and wp_taxonomy_terms tables
  10. The Plan • Stop making things worse (don’t make any

    new shared terms) [4.1] • Start to fix shared terms on update [4.2] • Split all remaining shared terms, establishing a one-to- one correspondence between rows in wp_terms and wp_term_taxonomy [4.3] • introduce term_meta [4.4] • combine wp_terms and wp_taxonomy_terms tables [?]
  11. • add_term_meta, update_term_meta, get_term_meta, delete_term_meta • same underlying API (ie:

    get_metadata) • meta_query argument for get_terms • cache priming for functions that fetch terms (can be turned off via a filter)