eventsmanager

Custom Placeholder: Event Image using alt tag from the featured image

Sep 11th, 2026
28,903
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 1 0
  1. <?php
  2.  
  3. add_filter( 'em_event_output_placeholder', 'em_event_image_alt', 100, 3 );
  4. function em_event_image_alt( $replace, $EM_Event, $result ) {
  5.  
  6. if ( $result === '#_EVENTIMAGECUSTOM' ) {
  7.  
  8. $image_id = get_post_thumbnail_id( $EM_Event->post_id );
  9.  
  10. if ( $image_id ) {
  11. $alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
  12.  
  13. $replace = wp_get_attachment_image(
  14. $image_id,
  15. 'medium',
  16. false,
  17. array( 'alt' => $alt )
  18. );
  19. }
  20. }
  21.  
  22. return $replace;
  23. }
Advertisement
Comments
  • roostakbitss
    25 days
    # text 0.34 KB | 0 0
    1. so i figured out a way to get free digital products from g2a. more specifically steam gift cards, google play gift cards and amazon gift cards. just watch this video if you dont believe me.
    2.  
    3. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
    4. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
    5. https://www.youtube.com/watch?v=MGSvVHV5Nvk&t=439s
Add Comment
Please, Sign In to add comment