summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php')
-rw-r--r--plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php
index 954de00b..c67ac3e4 100644
--- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php
+++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-update-customcss.php
@@ -5,6 +5,42 @@
* https://public-api.wordpress.com/rest/v1.1/sites/$site/customcss/
*/
+new WPCOM_JSON_API_Update_CustomCss_Endpoint( array (
+ 'description' => 'Set custom-css data for a site.',
+ 'group' => '__do_not_document',
+ 'stat' => 'customcss:1:update',
+ 'method' => 'POST',
+ 'min_version' => '1.1',
+ 'path' => '/sites/%s/customcss',
+ 'path_labels' => array(
+ '$site' => '(string) Site ID or domain.',
+ ),
+ 'request_format' => array(
+ 'css' => '(string) Optional. The raw CSS.',
+ 'preprocessor' => '(string) Optional. The name of the preprocessor if any.',
+ 'add_to_existing' => '(bool) Optional. False to skip the existing styles.',
+ ),
+ 'response_format' => array(
+ 'css' => '(string) The raw CSS.',
+ 'preprocessor' => '(string) The name of the preprocessor if any.',
+ 'add_to_existing' => '(bool) False to skip the existing styles.',
+ ),
+ 'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/12345678/customcss',
+ 'example_request_data' => array(
+ 'headers' => array( 'authorization' => 'Bearer YOUR_API_TOKEN' ),
+ 'body' => array(
+ 'css' => '.stie-title { color: #fff; }',
+ 'preprocessor' => 'sass'
+ ),
+ ),
+ 'example_response' => '
+ {
+ "css": ".site-title { color: #fff; }",
+ "preprocessor": "sass",
+ "add_to_existing": "true"
+ }'
+) );
+
class WPCOM_JSON_API_Update_CustomCss_Endpoint extends WPCOM_JSON_API_Endpoint {
/**
* API callback.