Ajalon
Forum Replies Created
-
I seem to have resolved this by setting Approvals Required to Yes. For some reason when set to No the Bookings were not going through although they were registering on the Attendees List.
A text version of the Functions.php can be viewed here: https://ww2ops.uk/functions.txt (the php file required login to view). I have made some modifications to try to just get a simple “Yes” if the user has a booking and nothing otherwise. The new code is at the very end of the file.
Many thanks.Yes, I am putting it at the end of the theme’s functions.php file before the ?> tag.
Hi Angelo
I want to confirm that the currently logged on user has a booking for an event and indicate this alongside the event in the event list. e.g.
Date Event/location AttendingI have attempted to adapt the code from the tutorials as follows, but when I add it to the functions.php file the website locks up. I am obviously doing something stupid!
add_filter(’em_event_output_placeholder’,’my_em_isbooked_placeholders’,1,3);
function my_em_isbooked_placeholders($user_id = false, $replace, $EM_Event, $result){
????global $wp_query, $wp_rewrite;
????switch( $result ){
????????case ‘#_ISBOOKED’:
????????$replace = ‘No’;
/**
* Checks to see if user has a booking for this event
* @param unknown_type $user_id
*/
if( $user_id === false ){
$user_id = get_current_user_id();
}
if( is_numeric($user_id) && $user_id > 0 ){
foreach ($this->bookings as $EM_Booking){
if( $EM_Booking->person->ID == $user_id && !in_array($EM_Booking->booking_status, array(2,3)) ){
replace ‘Yes’;
}else{
replace = ‘No’;
}
}
}
}
????return $replace;
}Forum: Plugins
In reply to: Conditional for no content in a postHi Pete
I had a similar issue and I got round it by using get_the_content()
e.g.:
$content = get_the_content();
if (empty($content)) {
/* Do something */
} else {
/* Do something else */
}Hope this helps
Allan