Jetpack_JSON_API_Maybe_Auto_Update_Endpoint

The WordPress Core Jetpack JSON API Maybe Auto Update Endpoint class.

Defined (1)

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

/json-endpoints/jetpack/class.jetpack-json-api-maybe-auto-update-endpoint.php  
  1. class Jetpack_JSON_API_Maybe_Auto_Update_Endpoint extends Jetpack_JSON_API_Endpoint { 
  2. // POST /sites/%s/maybe_auto_update 
  3. protected $needed_capabilities = array( 'update_core', 'update_plugins', 'update_themes' ); 
  4.  
  5. protected $update_results = array(); 
  6.  
  7. protected function result() { 
  8. add_action( 'automatic_updates_complete', array( $this, 'get_update_results' ), 100, 1 ); 
  9.  
  10. wp_maybe_auto_update(); 
  11.  
  12. $result['log'] = $this->update_results; 
  13.  
  14. if ( empty( $result['log'] ) ) { 
  15. $possible_reasons_for_failure = Jetpack_Autoupdate::get_possible_failures(); 
  16.  
  17. if ( $possible_reasons_for_failure ) { 
  18. $result['log']['error'] = $possible_reasons_for_failure; 
  19.  
  20.  
  21. return $result; 
  22.  
  23. public function get_update_results( $results ) { 
  24. $this->update_results = $results; 
  25.