Save all events as Private
-
Hi, my BuddyPress setup requires all the events created by users to be saved as private.
I achieved this by adding this to my themes functions.php
function make_event_private_by_default($result, $EM_Event) { global $wpdb; $EM_Event->event_private = 1; $wpdb->update($wpdb->posts, array('post_status'=>'private'), array('ID'=>$EM_Event->post_id)); return $result; } add_filter('em_event_save', 'make_event_private_by_default',1,2);
My problem is that the the private events still show up on other users event calendars.
When I set the event as private from the admin metabox then it doesn’t show up in the event calendar of other users.
Is there anything else that I should set as private in the function above so the event would be completely private?
I also tried using the
wp_update_post()
function with same level of success as the above example.Any advice is much appreciated!
Thanks,
Herman
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Save all events as Private’ is closed to new replies.