Caldera_Forms_API_Response

Response object all non-error REST API requests should return.

Defined (1)

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

/classes/api/response.php  
  1. class Caldera_Forms_API_Response extends \WP_REST_Response { 
  2.  
  3. /** 
  4. * @inheritdoc 
  5. * @since 1.4.4 
  6. */ 
  7. public function __construct( $data = null, $status = 200, $headers = array() ) { 
  8. parent::__construct( $data, $status, $headers ); 
  9. if ( empty( $data ) ) { 
  10. $this->set_status( 404 ); 
  11.  
  12.  
  13. public function set_total_header( $total ) { 
  14. $this->header( 'X-CF-API-TOTAL', (int) $total ); 
  15.  
  16. public function set_total_pages_header( $total_pages ) { 
  17. $this->header( 'X-CF-API-TOTAL-PAGES', (int) $total_pages ); 
  18.  
  19.