Created
March 8, 2021 19:22
-
-
Save andrasguseo/46caf3b83cc5461c009aae76e80b0058 to your computer and use it in GitHub Desktop.
Event Tickets Extension: Featured Image as Ticket Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Event Tickets Extension: Featured Image as Ticket Header | |
* Description: This extension will use the featured image of the event in the RSVP / ticket email header (instead of the ticket header image). | |
* Version: 1.0.0 | |
* Author: The Events Calendar | |
* Author URI: http://evnt.is/1971 | |
* License: GPL version 3 or any later version | |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html | |
* | |
* This plugin is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* any later version. | |
* | |
* This plugin is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
*/ | |
add_filter( 'tribe_tickets_email_ticket_image', | |
function ( $header_img, $header_id, $ticket ) { | |
return wp_get_attachment_image_src( get_post_thumbnail_id( $ticket['event_id'] ), 'full' ); | |
}, | |
10, 3 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment