eventsmanager

Assign events tag to events using event submission form

Apr 2nd, 2019
618
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * This snippet assign event tags with event using custom event submission form -> https://pastebin.com/Nvz4t6ca
  3. *
  4. * 1. create mu-plugins folder under wp-content/mu-plugins/function.php
  5. * 2. edit function.php and Save
  6. */
  7. add_filter('em_event_save','custom_event_save',1,2);
  8. function custom_event_save($result,$EM_Event){
  9.  
  10. if ( !empty( $_REQUEST['event_tags'] ) ){
  11. wp_set_object_terms($EM_Event->post_id, $_REQUEST['event_tags'], EM_TAXONOMY_TAG);
  12. }
  13.  
  14. return $result;
  15. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×