_data; } if( isset( $this->_data['debug'] ) ) { $this->_debug = array_merge( $this->_debug, $this->_data[ 'debug' ] ); } if( isset( $this->_data['errors'] ) && $this->_data[ 'errors' ] ) { $this->_errors = array_merge( $this->_errors, $this->_data[ 'errors' ] ); } $response = array( 'data' => $data, 'errors' => $this->_errors, 'debug' => $this->_debug ); echo wp_json_encode( $response ); wp_die(); // this is required to terminate immediately and return a proper response } }