Properties

$self

$self

$endpoints

$endpoints

$token_details

$token_details

$method

$method

$url

$url

$path

$path

$version

$version

$query

$query

$post_body

$post_body

$files

$files

$content_type

$content_type

$accept

$accept

$_server_https

$_server_https

$exit

$exit

$public_api_scheme

$public_api_scheme

$trapped_error

$trapped_error

$did_output

$did_output

Methods

init()

init( $method,  $url,  $post_body)

Parameters

$method
$url
$post_body

is_truthy()

is_truthy( $value)

Parameters

$value

__construct()

__construct()

setup_inputs()

setup_inputs( $method,  $url,  $post_body)

Parameters

$method
$url
$post_body

initialize()

initialize()

serve()

serve( $exit)

Parameters

$exit

process_request()

process_request(\WPCOM_JSON_API_Endpoint $endpoint,  $path_pieces)

Parameters

\WPCOM_JSON_API_Endpoint $endpoint
$path_pieces

output_early()

output_early( $status_code,  $response,  $content_type)

Parameters

$status_code
$response
$content_type

output()

output( $status_code,  $response,  $content_type)

Parameters

$status_code
$response
$content_type

output_error()

output_error( $error)

Parameters

$error

ensure_http_scheme_of_home_url()

ensure_http_scheme_of_home_url( $url,  $path,  $original_scheme)

Parameters

$url
$path
$original_scheme

comment_edit_pre()

comment_edit_pre( $comment_content)

Parameters

$comment_content

json_encode()

json_encode( $data)

Parameters

$data

ends_with()

ends_with( $haystack,  $needle)

Parameters

$haystack
$needle

get_blog_id_for_output()

get_blog_id_for_output()

get_blog_id()

get_blog_id( $blog_id)

Parameters

$blog_id

switch_to_blog_and_validate_user()

switch_to_blog_and_validate_user( $blog_id,  $verify_token_for_blog)

Parameters

$blog_id
$verify_token_for_blog

post_like_count()

post_like_count( $blog_id,  $post_id)

Parameters

$blog_id
$post_id

is_liked()

is_liked( $blog_id,  $post_id)

Parameters

$blog_id
$post_id

is_reblogged()

is_reblogged( $blog_id,  $post_id)

Parameters

$blog_id
$post_id

is_following()

is_following( $blog_id)

Parameters

$blog_id

add_global_ID()

add_global_ID( $blog_id,  $post_id)

Parameters

$blog_id
$post_id

get_avatar_url()

get_avatar_url( $email)

Parameters

$email

trap_wp_die()

trap_wp_die( $error_code)

Traps `wp_die()` calls and outputs a JSON response instead.

The result is always output, never returned.

Parameters

$error_code

wp_die_handler_callback()

wp_die_handler_callback()

wp_die_handler()

wp_die_handler( $message,  $title,  $args)

Parameters

$message
$title
$args

output_trapped_error()

output_trapped_error()

finish_request()

finish_request()