Jetpack_JSON_API_Sync_Unlock_Endpoint

The WordPress Core Jetpack JSON API Sync Unlock Endpoint class.

Defined (1)

The class is defined in the following location(s).

/json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php  
  1. class Jetpack_JSON_API_Sync_Unlock_Endpoint extends Jetpack_JSON_API_Sync_Endpoint { 
  2. protected function result() { 
  3. $args = $this->input(); 
  4.  
  5. if ( ! isset( $args['queue'] ) ) { 
  6. return new WP_Error( 'invalid_queue', 'Queue name is required', 400 ); 
  7.  
  8. if ( ! in_array( $args['queue'], array( 'sync', 'full_sync' ) ) ) { 
  9. return new WP_Error( 'invalid_queue', 'Queue name should be sync or full_sync', 400 ); 
  10.  
  11. require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-queue.php'; 
  12. $queue = new Jetpack_Sync_Queue( $args['queue'] ); 
  13.  
  14. // False means that there was no lock to delete. 
  15. $response = $queue->unlock(); 
  16. return array( 
  17. 'success' => $response 
  18. );