eventsmanager

qr_custom_placeholder

Apr 14th, 2025 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. // Hook into the correct EM filter for booking/ticket placeholders
  4. add_filter('em_booking_output_placeholder', 'my_em_custom_qr_output', 100, 3);
  5. function my_em_custom_qr_output($replace, $EM_Booking, $result) {
  6. if ( $result == '#_EMTICKETBOOKINGQR' )
  7. {
  8. // Target the specific placeholder
  9. $replace = "<img src='".\EM_Pro\QR::base64('booking/' . $EM_Booking->booking_uuid)['src']."' style='width:200px; height:200px;' />";
  10. }
  11. // Return the original value or the generated img tag
  12. return $replace;
  13. }
  14.  
Add Comment
Please, Sign In to add comment