diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2017-09-20 09:54:07 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2017-09-20 09:54:07 -0400 |
commit | bb31fa2d44dbbe425fa9ce92d4e7be61a1146dfb (patch) | |
tree | 33456f5889d315ad2a520fcd33fe491e612588b4 /plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php | |
parent | akismet 4.0 (diff) | |
download | blogs-gentoo-bb31fa2d44dbbe425fa9ce92d4e7be61a1146dfb.tar.gz blogs-gentoo-bb31fa2d44dbbe425fa9ce92d4e7be61a1146dfb.tar.bz2 blogs-gentoo-bb31fa2d44dbbe425fa9ce92d4e7be61a1146dfb.zip |
jetpack 5.3
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php')
-rw-r--r-- | plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php index 35efd1d3..6f2ce126 100644 --- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php +++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-list-embeds-endpoint.php @@ -1,4 +1,25 @@ <?php + +new WPCOM_JSON_API_List_Embeds_Endpoint( array( + 'description' => "Get a list of embeds available on a site. Note: The current user must have publishing access.", + 'group' => 'sites', + 'stat' => 'embeds', + 'method' => 'GET', + 'path' => '/sites/%s/embeds', + 'path_labels' => array( + '$site' => '(int|string) Site ID or domain', + ), + 'response_format' => array( + 'embeds' => '(array) A list of supported embeds by their regex pattern.', + ), + 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/82974409/embeds', + 'example_request_data' => array( + 'headers' => array( + 'authorization' => 'Bearer YOUR_API_TOKEN' + ), + ) +) ); + class WPCOM_JSON_API_List_Embeds_Endpoint extends WPCOM_JSON_API_Endpoint { // /sites/%s/embeds -> $blog_id function callback( $path = '', $blog_id = 0 ) { @@ -14,11 +35,11 @@ class WPCOM_JSON_API_List_Embeds_Endpoint extends WPCOM_JSON_API_Endpoint { // list em $output = array( 'embeds' => array() ); - + if ( ! function_exists( '_wp_oembed_get_object' ) ) { require_once( ABSPATH . WPINC . '/class-oembed.php' ); } - + global $wp_embed; $oembed = _wp_oembed_get_object(); |