$post_object_format
$post_object_format
callback( $path) : \falsy:
Return endpoint response
$path |
HTTP 500, no response body WP_Error( $error_code, $error_message, $http_status_code ): HTTP $status_code, json_encode( array( 'error' => $error_code, 'message' => $error_message ) ) response body $data: HTTP 200, json_encode( $data ) response body
find_featured_media(\WP_Post $post) : object
Supporting featured media in post endpoints. Currently on for wpcom blogs since it's calling WPCOM_JSON_API_Read_Endpoint methods which presently rely on wpcom specific functionality.
\WP_Post | $post |
list of featured media
cast_and_filter_item( $return, $type, $key, $value, $types, $for_output)
Casts $value according to $type.
Handles fallbacks for certain values of $type when $value is not that $type Currently, only handles fallback between string <-> array (two way), from string -> false (one way), and from object -> false (one way)
Handles "child types" - array:URL, object:category array:URL means an array of URLs object:category means a hash of categories
Handles object typing - object>post means an object of type post
$return | ||
$type | ||
$key | ||
$value | ||
$types | ||
$for_output |
parse_date( $date_string) : \array(
Parses a date string and returns the local and GMT representations of that date & time in 'YYYY-MM-DD HH:MM:SS' format without timezones or offsets. If the parsed datetime was not localized to a particular timezone or offset we will assume it was given in GMT relative to now and will convert it to local time using either the timezone set in the options table for the blog or the GMT offset.
$date_string |
$local_time_string, $gmt_time_string )