Advertisement
mbis

Events Manager - Recurring Events

Jun 17th, 2020
1,165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. function pm_generate_recurring_event_custom_permalink($result, $data, $event_ids, $post_ids) {
  2.     global $permalink_manager_uris;
  3.  
  4.     if(!empty($post_ids) && is_array($post_ids)) {
  5.         foreach($post_ids as $post_id) {
  6.             $default_uri = Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id);
  7.  
  8.             if($default_uri) {
  9.                 $permalink_manager_uris[$post_id] = $default_uri;
  10.             }
  11.         }
  12.  
  13.         update_option('permalink-manager-uris', $permalink_manager_uris);
  14.     }
  15.  
  16.     return $result;
  17. }
  18. add_filter('em_event_save_events', 'pm_generate_recurring_event_custom_permalink', 10, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement