Brak opisu

class-jetpack-connection-status.php 729B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Jetpack Connection Status.
  4. *
  5. * Filters the Connection Status API response
  6. *
  7. * @package jetpack
  8. */
  9. /**
  10. * Filters the Connection Status API response
  11. */
  12. class Jetpack_Connection_Status {
  13. /**
  14. * Initialize the main hooks.
  15. */
  16. public static function init() {
  17. add_filter( 'jetpack_connection_status', array( __CLASS__, 'filter_connection_status' ) );
  18. }
  19. /**
  20. * Filters the connection status API response of the Connection package and modifies isActive value expected by the UI.
  21. *
  22. * @param array $status An array containing the connection status data.
  23. */
  24. public static function filter_connection_status( $status ) {
  25. $status['isActive'] = Jetpack::is_connection_ready();
  26. return $status;
  27. }
  28. }