summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php')
-rw-r--r--plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php b/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php
new file mode 100644
index 00000000..8f6b1dd6
--- /dev/null
+++ b/plugins/jetpack/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php
@@ -0,0 +1,13 @@
+<?php
+
+class Jetpack_JSON_API_Sync_Endpoint extends Jetpack_JSON_API_Endpoint {
+ // POST /sites/%s/sync
+ protected $needed_capabilities = 'manage_options';
+
+ protected function result() {
+ Jetpack::init();
+ do_action( 'jetpack_sync_all_registered_options' );
+ $result['scheduled'] = true;
+ return $result;
+ }
+}