Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
add_filter('em_event_output_placeholder','my_cancel_button',100,3); function my_cancel_button( $replace, $EM_Event, $result ){ global $wpdb; if ( $result == '#_EVENTCANCELBUTTON' ){ $replace = ""; if ( is_user_logged_in() ){ if( !isset($user_bookings) || !is_array($user_bookings) ){ $sql = $wpdb->prepare('SELECT *, booking_status FROM '.EM_BOOKINGS_TABLE.' WHERE person_id=%d AND event_id=%d', array(get_current_user_id(), $EM_Event->event_id)); if ( $EM_Event->timeslot_id ) { $sql .= ' AND timeslot_id=' . absint( $this->timeslot_id ); } $user_bookings = $wpdb->get_results($sql); } if( !empty($user_bookings) ){ foreach ( $user_bookings as $EM_Booking ) { $nonce = wp_create_nonce('booking_cancel'); if( in_array( $EM_Booking->booking_status, array(1)) ){ $cancel_url = em_add_get_params($_SERVER['REQUEST_URI'], array('action'=>'booking_cancel', 'booking_id'=>$EM_Booking->booking_id, '_wpnonce'=>$nonce)); $replace = '
'.__('Cancel Booking','events-manager').'
'; } } } } } return $replace; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)