WC_Integration

Abstract Integration Class.

Defined (1)

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

/includes/abstracts/abstract-wc-integration.php  
  1. abstract class WC_Integration extends WC_Settings_API { 
  2.  
  3. /** 
  4. * yes or no based on whether the integration is enabled. 
  5. * @var string 
  6. */ 
  7. public $enabled = 'yes'; 
  8.  
  9. /** 
  10. * Integration title. 
  11. * @var string 
  12. */ 
  13. public $method_title = ''; 
  14.  
  15. /** 
  16. * Integration description. 
  17. * @var string 
  18. */ 
  19. public $method_description = ''; 
  20.  
  21. /** 
  22. * Return the title for admin screens. 
  23. * @return string 
  24. */ 
  25. public function get_method_title() { 
  26. return apply_filters( 'woocommerce_integration_title', $this->method_title, $this ); 
  27.  
  28. /** 
  29. * Return the description for admin screens. 
  30. * @return string 
  31. */ 
  32. public function get_method_description() { 
  33. return apply_filters( 'woocommerce_integration_description', $this->method_description, $this ); 
  34.  
  35. /** 
  36. * Output the gateway settings screen. 
  37. */ 
  38. public function admin_options() { 
  39. echo '<h2>' . esc_html( $this->get_method_title() ) . '</h2>'; 
  40. echo wp_kses_post( wpautop( $this->get_method_description() ) ); 
  41. echo '<div><input type="hidden" name="section" value="' . esc_attr( $this->id ) . '" /></div>'; 
  42. parent::admin_options(); 
  43.  
  44. /** 
  45. * Init settings for gateways. 
  46. */ 
  47. public function init_settings() { 
  48. parent::init_settings(); 
  49. $this->enabled = ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'] ? 'yes' : 'no';