\WP_Stager_Integration\Component::render_event_ticket(string $title, int $price, string $subtext = '', int $base_price = 0, int $service_fee = 0, string $url = null): void
\WP_Stager_Integration\Component::render_event_ticket(string $title, int $price, string $subtext = '', int $base_price = 0, int $service_fee = 0, string $url = null): voidDescription
Render the event ticket component.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$title | string | The ticket title. |
$price | int | The ticket price in cents. |
$subtext | string | The ticket subtext template. |
$base_price | int | The base price in cents. |
$service_fee | int | The service fee in cents. |
$url | string | The ticket URL (optional). |
Returns:
void
Information
| File | class-component.php line 454 |
|---|
Full Code
/**
* Render the event ticket component.
*
* @param string $title The ticket title.
* @param int $price The ticket price in cents.
* @param string $subtext The ticket subtext template.
* @param int $base_price The base price in cents.
* @param int $service_fee The service fee in cents.
* @param string $url The ticket URL (optional).
*
* @return void
*/
public static function render_event_ticket( $title, $price, $subtext = '', $base_price = 0, $service_fee = 0, $url = null ) {
// Get data
$title = (string) $title;
$price = (int) $price;
$subtext = (string) $subtext;
$base_price = (int) $base_price;
$service_fee = (int) $service_fee;
$url = $url ? (string) $url : null;
// Render the component
self::render( 'event-ticket', 'template-parts/event-page', array(
'title' => $title,
'price' => $price,
'subtext' => $subtext,
'base_price' => $base_price,
'service_fee' => $service_fee,
'url' => $url,
) );
}💡 If you ever get stuck or have a question, please check our FAQs, our Free Integration Service, our paid Full Integration Service, or reach out to us!

Get WP Stager Integration
🎁 Limited offer: Use code WELCOME26 to get your first month for free!

