Tribe__Tickets__REST__V1__Post_Repository::get_attendee_global_id( int $attendee_id )
Returns an attendee Global ID.
Contents
If not set/updated for the attendee than the method will generate/update it.
Parameters
- $attendee_id
-
(int) (Required) The attendee ID.
Return
(string)
Source
File: src/Tribe/REST/V1/Post_Repository.php
public function get_attendee_global_id( $attendee_id ) {
$existing = get_post_meta( $attendee_id, $this->global_id_key, true );
if ( ! empty( $existing ) ) {
return $existing;
}
$generator = new Tribe__Tickets__Global_ID();
$generator->origin( home_url() );
$generator->type( 'attendee' );
$global_id = $generator->generate( array(
'type' => 'attendee',
'id' => $attendee_id,
) );
update_post_meta( $attendee_id, $this->global_id_key, $global_id );
return $global_id;
}
Changelog
| Version | Description |
|---|---|
| 4.8 | Introduced. |