Свойство | Тип | Описание | |
---|---|---|---|
$allow_cross_origin_request | Set to true if the endpoint accepts all cross origin requests. You probably should not set this flag. | ||
$allow_jetpack_site_auth | Set to true if the endpoint should accept site based (not user based) authentication. | ||
$allow_unauthorized_request | Set to true if the endpoint can recieve unauthorized POST requests. | ||
$allowed_if_flagged | Is this endpoint still allowed if the site in question is flagged? | ||
$allowed_if_red_flagged | Is this endpoint allowed if the site is red flagged? | ||
$api | The API Object | ||
$custom_fields_filtering | Set to true if the endpoint implements its own filtering instead of the standard fields query method | ||
$description | One liner. | ||
$example_request | Example request to make | ||
$example_request_data | Example request data (for POST methods) | ||
$example_response | Example response from $example_request | ||
$group | Object Grouping For Documentation (Users, Posts, Comments) | ||
$in_testing | Is this endpoint still in testing phase? If so, not available to the public. | ||
$links | The link-generating utility class | ||
$max_version | Maximum version of the api for which to serve this endpoint | ||
$method | HTTP Method | ||
$min_version | Minimum version of the api for which to serve this endpoint | ||
$pass_wpcom_user_details | |||
$path | Path at which to serve this endpoint: sprintf() format. | ||
$path_labels | Identifiers to fill sprintf() formatted $path | ||
$query | Accepted query parameters | ||
$request_format | Request format | ||
$response_format | Response format | ||
$stat | Stats extra value to bump | ||
$version | Version of the API |
Метод | Описание | |
---|---|---|
__construct ( $args ) | ||
add_http_build_query_to_php_content_example ( $matches ) | ||
allow_video_uploads ( $mimes ) | ||
allows_cross_origin_requests ( ) | ||
allows_unauthorized_requests ( $origin, $complete_access_origins ) | ||
callback ( $path = '' ) | Return endpoint response | |
cast_and_filter ( $data, $documentation, $return_default_values = false, $for_output = false ) | ||
cast_and_filter_item ( &$return, $type, $key, $value, $types = [], $for_output = false ) | Casts $value according to $type. | |
copy_hooks ( $from_hook, $to_hook, $base_paths ) | ||
current_user_can_access_post_type ( string $post_type, string $context = 'display' ) : boolean | Check whether a user can view or edit a post type | |
document ( $show_description = true ) | Auto generates documentation based on description, method, path, path_labels, and query parameters. | |
format_date ( $date_gmt, $date = null ) : string | Returns ISO 8601 formatted datetime: 2011-12-08T01:15:36-08:00 | |
format_taxonomy ( $taxonomy, $taxonomy_type, $context ) | ||
generate_doc_description ( $item ) |
Recursively generates the
|
|
generate_documentation ( ) | Auto generates documentation based on description, method, path, path_labels, and query parameters. | |
get_author ( $author, $show_email = false ) : (object) | Returns author object. | |
get_media_item ( $media_id ) | ||
get_media_item_v1_1 ( $media_id ) | ||
get_platform ( ) | ||
get_reflection ( $callback ) | ||
get_taxonomy ( $taxonomy_id, $taxonomy_type, $context ) | ||
handle_media_creation_v1_1 ( $media_files, $media_urls, $media_attrs = [], $force_parent_id = false ) | ||
handle_media_sideload ( $url, $parent_post_id, $type = 'any' ) | ||
input ( $return_default_values = true, $cast_and_filter = true ) | Get POST body data | |
is_current_site_multi_user ( ) | ||
is_post_type_allowed ( $post_type ) | ||
is_publicly_documentable ( ) | Checks if the endpoint is publicly displayable | |
load_theme_functions ( ) | Load the functions.php file for the current theme to get its post formats, CPTs, etc. | |
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. | |
parse_types ( $text ) | ||
query_args ( $return_default_values = true, $cast_and_filter = true ) | Get all query args. Prefill with defaults | |
user_can_view_post ( $post_id ) |
Метод | Описание | |
---|---|---|
_get_whitelisted_post_types ( ) : array | Gets the whitelisted post types that JP should allow access to. | |
is_file_supported_for_sideloading ( string $file ) : boolean | Checks that the mime type of the specified file is among those in a filterable list of mime types. |
protected _get_whitelisted_post_types ( ) : array | ||
Результат | array | Whitelisted post types. |
public add_http_build_query_to_php_content_example ( $matches ) |
public allows_unauthorized_requests ( $origin, $complete_access_origins ) |
abstract public callback ( $path = '' ) |
public cast_and_filter ( $data, $documentation, $return_default_values = false, $for_output = false ) |
public cast_and_filter_item ( &$return, $type, $key, $value, $types = [], $for_output = false ) |
public format_date ( $date_gmt, $date = null ) : string | ||
$date_gmt | (string) GMT datetime string. | |
$date | (string) Optional. Used to calculate the offset from GMT. | |
Результат | string |
public get_author ( $author, $show_email = false ) : (object) | ||
$author | user ID, user row, WP_User object, comment row, post row | |
$show_email | output the author's email address? | |
Результат | (object) |
public handle_media_creation_v1_1 ( $media_files, $media_urls, $media_attrs = [], $force_parent_id = false ) |
public handle_media_sideload ( $url, $parent_post_id, $type = 'any' ) |
public input ( $return_default_values = true, $cast_and_filter = true ) |
protected is_file_supported_for_sideloading ( string $file ) : boolean | ||
$file | string | Path to file to get its mime type. |
Результат | boolean |
public is_publicly_documentable ( ) |
public load_theme_functions ( ) |
public parse_date ( $date_string ) : array( | ||
Результат | array( |
public query_args ( $return_default_values = true, $cast_and_filter = true ) |
public $allow_cross_origin_request |
public $allow_jetpack_site_auth |
public $allow_unauthorized_request |
public $allowed_if_flagged |
public $allowed_if_red_flagged |
public $custom_fields_filtering |
public $example_request_data |
public $example_response |
public $in_testing |
public $max_version |
public $min_version |