Jetpack_JSON_API_Updates_Status

The Jetpack by WordPress.com Jetpack JSON API Updates Status class.

Defined (1)

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

/json-endpoints/jetpack/class.jetpack-json-api-updates-status-endpoint.php  
  1. class Jetpack_JSON_API_Updates_Status extends Jetpack_JSON_API_Endpoint { 
  2. // GET /sites/%s/updates 
  3. protected $needed_capabilities = 'manage_options'; 
  4.  
  5. protected function result() { 
  6.  
  7. wp_update_themes(); 
  8. wp_update_plugins(); 
  9.  
  10. $update_data = wp_get_update_data(); 
  11. if ( ! isset( $update_data['counts'] ) ) { 
  12. return new WP_Error( 'get_update_data_error', __( 'There was an error while getting the update data for this site.', 'jetpack' ), 500 ); 
  13.  
  14. $result = $update_data['counts']; 
  15.  
  16. include( ABSPATH . WPINC . '/version.php' ); // $wp_version; 
  17. $result['wp_version'] = isset( $wp_version ) ? $wp_version : null; 
  18.  
  19. if ( ! empty( $result['wordpress'] ) ) { 
  20. $cur = get_preferred_from_update_core(); 
  21. if ( isset( $cur->response ) && $cur->response === 'upgrade' ) { 
  22. $result['wp_update_version'] = $cur->current; 
  23.  
  24. $result['jp_version'] = JETPACK__VERSION; 
  25.  
  26. return $result; 
  27.