eventsmanager

Custom booking date placeholder for my-bookings.php template

Apr 14th, 2015
455
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * This custom booking date placeholder can be use in /templates/my-bookings.php template
  3. *
  4. */
  5. add_filter('em_booking_output_placeholder','my_em_booking_date',1,3);
  6. function my_em_booking_date($replacement, $EM_Booking, $result){
  7. global $wpdb;
  8.  
  9. if ($result == '#_CUSTOMBOOKINGDATE') {
  10. $tablename = $wpdb->prefix.'em_bookings';
  11. $sql = $wpdb->prepare( "SELECT date_format(booking_date,'%%Y-%%m-%%d') as booking_date FROM $tablename WHERE booking_id = %d ", $EM_Booking->booking_id);
  12. $replacement = $wpdb->get_var($sql);
  13. }
  14.  
  15. return $replacement;
  16. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×