Tribe__Tickets__REST__V1__Post_Repository::get_data( int $id, string $context = '' )
Retrieves an array representation of the post.
Contents
Parameters
- $id
-
(int) (Required) The post ID.
- $context
-
(string) (Optional) Context of data.
Default value: ''
Return
(array) An array representation of the post.
Source
File: src/Tribe/REST/V1/Post_Repository.php
public function get_data( $id, $context = '' ) {
$post = get_post( $id );
if ( empty( $post ) ) {
return array();
}
if ( ! isset( $this->types_get_map[ $post->post_type ] ) ) {
return (array) $post;
}
return call_user_func( $this->types_get_map[ $post->post_type ], $id, $context );
}
Changelog
| Version | Description |
|---|---|
| 4.7.5 | Introduced. |