get categorys in function
-
Hi I am really struggling with this, I am trying to restrict booking to three a week in just one category. This code works globally but I can not get it to restrict by category.
Any help would be greatly appreciated.function my_em_mods($result,$EM_Booking) { global $wpdb, $current_user, $EM_Notices, $EM_Person, $EM_Location, $EM_Category, $EM_Event, $wp_query, $post, $em_category_id; $EM_Person = new EM_Person( get_current_user_id() ); $EM_Bookings = $EM_Person->get_bookings(); $bookings_count = count($EM_Bookings->bookings); $EM_Category = new EM_Category($atts['category']); if($EM_Category('micro-pt') && $bookings_count > 2 && $EM_Booking->get_status()!=3) { $EM_Booking-> errors = array_merge($EM_Booking-> errors, array ('You have already booked 3 classes this week')); $result = false ; } return $result; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘get categorys in function’ is closed to new replies.