$30 off During Our Annual Pro Sale. View Details »

Taking Taxonomies Totally To The Top

Taking Taxonomies Totally To The Top

A swift perusal of some interesting things you can do with taxonomies: flagging content for particular purposes, bookmarking systems, syncing post types and taxonomies, and syncing terms between sites in a multisite.

As always, the slides are only part of it, but do give you a flavour.

Plugins mentioned (if they're our plugins, and they're on Github, consider them move relevant to developers):
https://github.com/cftp/feature-posts-on-root-blog
https://github.com/cftp/sync-post-types-to-taxonomies
https://github.com/cftp/universal-taxonomy (mentioned in the questions)

Blogposts mentioned:
http://alexking.org/blog/2011/08/29/wordpress-post-meta-taxonomies
http://webdevstudios.com/2013/07/08/replace-wordpress-default-taxonomy-metabox-with-a-radio-select-metabox/

Tickets mentioned:
http://core.trac.wordpress.org/ticket/14084
http://core.trac.wordpress.org/ticket/15475
http://core.trac.wordpress.org/ticket/10142
http://core.trac.wordpress.org/ticket/17646
http://core.trac.wordpress.org/ticket/14084

Simon Wheatley

July 13, 2013
Tweet

More Decks by Simon Wheatley

Other Decks in Programming

Transcript

  1. Taking Taxonomies Totally To The Top Simon Wheatley, @simonwheatley ©

    Jeremy Keith - http://www.flickr.com/photos/74105777@N00/3373755775/
  2. I’m Simon, nice to meet you all

  3. spot the mistakes

  4. None
  5. None
  6. None
  7. None
  8. “in this world nothing can be said to be certain,

    except death and taxes taxonomies” – Benjamin Franklin
  9. organising your content © See-ming Lee - http://www.flickr.com/photos/seeminglee/4556156477/in/photostream/

  10. structure © Claudio Alejandro Mufarrege - http://www.flickr.com/photos/claudio_ar/2702433442/

  11. three tables © marya- http://www.flickr.com/photos/emdot/32815499/

  12. wp_terms

  13. wp_term_taxonomy

  14. wp_term_relationships

  15. None
  16. register_taxonomy

  17. term names and slugs are shared

  18. None
  19. flags for special treatment © Alden Jewell - http://www.flickr.com/photos/autohistorian/6940002890/

  20. sticky © Matt Reinbold - http://www.flickr.com/photos/furryscalyman/3830578747/in/photostream/

  21. sliders © Pedro Moura Pinheiro - http://www.flickr.com/photos/pedromourapinheiro/7684755096/

  22. carousels © Chris Smith - http://www.flickr.com/photos/cjsmithphotography/5500801561/in/photostream/

  23. simple taxonomy meta boxes © Popupology - http://www.flickr.com/photos/popupology/4750769171/

  24. None
  25. bookmarks © Vipul ᶶ Mathur - http://www.flickr.com/photos/vipulmathur/471634239/

  26. bookmark-{user_id}

  27. currently adding is easy © Luz Adriana Villa - http://www.flickr.com/photos/luchilu/408299457/

  28. wp_set_object_terms( $object_id, $terms, $taxonomy, $append )

  29. removing one term © Herman Rhoids - http://www.flickr.com/photos/rhoids/6820661300/in/photostream/

  30. wp_delete_object_term_relationships ( $object_id, $taxonomies )

  31. wp_get_object_terms( $object_ids, $taxonomies, $args )

  32. wp_set_object_terms( $object_id, $terms, $taxonomy, $append )

  33. wp_remove_object_terms( $object_id, $terms, $taxonomy )

  34. wp_add_object_terms( $object_id, $terms, $taxonomy )

  35. gotchas © Breanna Sisk - http://www.flickr.com/photos/breamarie/3366487089/

  36. None
  37. argh! © Andy Pixel - http://www.flickr.com/photos/smull/356355984/

  38. no meta data makes the NSA sad

  39. Why not?

  40. lots of solutions © karl sinfield - http://www.flickr.com/photos/sindesign/268430073/

  41. the (poor old) options table

  42. © H.Powers - http://www.flickr.com/photos/melisande-origami/108813447/sizes/l/ sync post types & taxonomies

  43. © H.Powers - http://www.flickr.com/photos/melisande-origami/108813447/sizes/l/ we can use post meta!

  44. © H.Powers - http://www.flickr.com/photos/melisande-origami/108813447/sizes/l/ for every post a term

  45. © H.Powers - http://www.flickr.com/photos/melisande-origami/108813447/sizes/l/ for every term a post

  46. hooks for create, delete & edit © Gillie - http://www.flickr.com/photos/lovestruck94/3329381854/

  47. exportable and importable

  48. sptt_taxonomy_syncs_with( $taxonomy )

  49. sptt_post_type_syncs_with( $post_type )

  50. sptt_get_related_post_for_term( $term_id )

  51. sptt_get_related_term_for_post( $post )

  52. syncing terms in a multisite

  53. feature post on root blog

  54. switch_to_blog

  55. stash it for (not very much) later

  56. wp_get_object_terms( 1, 'category', array( 'fields' => 'tt_ids' ) )

  57. aggregate counts © Thomas Hawk - http://www.flickr.com/photos/thomashawk/72778694/

  58. questions? © Tom - http://www.flickr.com/photos/an_untrained_eye/6630719431/

  59. We’re looking for freelance WordPress developers simonw@codeforthepeople.com