Naguro_Text_Image_Get_Request

The WooCommerce Naguro Connect Naguro Text Image Get Request class.

Defined (1)

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

/includes/naguro/requests/class-text-image-get-request.php  
  1. class Naguro_Text_Image_Get_Request extends Naguro_Request { 
  2. public function output() { 
  3. if ( strstr( $this->params['colour'], '#' ) ) { 
  4. $this->params['colour'] = str_replace('#', '', $this->params['colour']); 
  5.  
  6. $this->handler->handle_request('text-image', $this->params, 'post' ); 
  7. $data = $this->handler->get_data(); 
  8. $output_data = json_decode( $data['body'] ); 
  9.  
  10. $output_array = array( 
  11. 'src' => $output_data->image,  
  12. 'width' => $output_data->width,  
  13. 'height' => $output_data->height,  
  14. ); 
  15.  
  16. echo json_encode($output_array); die();