Tribe__Tickets_Plus__Commerce__PayPal__Meta::maybe_alter_post_data( array $post_data )
Hooked to a PayPal action right before add-to-cart to potentially manipulate data for attendee-registration
Contents
Parameters
- $post_data
-
(array) (Required) The passed $_POST.
Source
File: src/Tribe/Commerce/PayPal/Meta.php
public function maybe_alter_post_data( $post_data ) {
global $post;
if ( empty( $post_data['tribe_tickets_saving_attendees'] ) ) {
return;
}
$storage = new Tribe__Tickets_Plus__Meta__Storage;
$data = $storage->get_meta_data();
if ( ! $data ) {
return;
}
$keys = array_keys( $data );
$product_id = current( $keys );
$_POST['product_id'] = $keys;
$_POST['quantity_' . $product_id ] = count( $data[ $product_id ] );
$event_ids = tribe_tickets_get_event_ids( $product_id );
$post = get_post( current( $event_ids ) );
if ( $provider = tribe_tickets_get_ticket_provider( $product_id ) ) {
$_POST['provider'] = get_class( $provider );
}
}
Changelog
| Version | Description |
|---|---|
| 4.9 | Introduced. |