Naguro_Fonts_Get_Request

The WooCommerce Naguro Connect Naguro Fonts Get Request class.

Defined (1)

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

/includes/naguro/requests/class-fonts-get-request.php  
  1. class Naguro_Fonts_Get_Request extends Naguro_Request { 
  2. public function output() { 
  3. $this->handler->handle_request('fonts', $this->params, 'get' ); 
  4. $data = $this->handler->get_data(); 
  5. $fonts = json_decode( $data['body'] ); 
  6.  
  7. $fonts_array = array(); 
  8.  
  9. foreach ( $fonts->data as $font ) { 
  10. array_push( $fonts_array, array( 
  11. 'id' => $font->id,  
  12. 'name' => $font->name,  
  13. 'bold' => $font->bold,  
  14. 'italic' => $font->italic,  
  15. 'src' => $font->src,  
  16. ) ); 
  17.  
  18. echo json_encode($fonts_array); die();