StonehengeCreations

Use WordPress Categories in Events Manager

Dec 15th, 2019 (edited)
740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. /**
  3.  * This function enables WordPress Categories in Events Manager.
  4.  *
  5.  * This will also automatically enable dropdown for easy filtering
  6.  * in the Events Admin List before the Events Scope dropdown.
  7.  */
  8. function stonehenge_em_use_wp_categories() {
  9.     register_taxonomy_for_object_type( 'category', 'event' );
  10.     register_taxonomy_for_object_type( 'category', 'event-recurring' );
  11.  
  12.     # Uncomment the line below to also use for Events Manager Locations.
  13.     //register_taxonomy_for_object_type( 'category', 'location' );
  14. }
  15. add_action( 'init', 'stonehenge_em_use_wp_categories', 20 );
Advertisement
Add Comment
Please, Sign In to add comment