MC4WP_Lite_Checkbox_Manager

Takes care of all the sign-up checkboxes.

Defined (1)

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

/includes/class-checkbox-manager.php  
  1. class MC4WP_Lite_Checkbox_Manager 
  2. /** 
  3. * @var array Array holding all integration instances 
  4. */ 
  5. public $integrations = array(); 
  6.  
  7. /** 
  8. * @var array Array of checkbox options 
  9. */ 
  10. private $options; 
  11.  
  12. /** 
  13. * Constructor 
  14. */ 
  15. public function __construct() 
  16. $this->options = mc4wp_get_options( 'checkbox' ); 
  17.  
  18. // load checkbox css if necessary 
  19. add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheet' ) ); 
  20. add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheet' ) ); 
  21.  
  22. // Load WP Comment Form Integration 
  23. if ( $this->options['show_at_comment_form'] ) { 
  24. $this->integrations['comment_form'] = new MC4WP_Comment_Form_Integration(); 
  25.  
  26. // Load WordPress Registration Form Integration 
  27. if ( $this->options['show_at_registration_form'] ) { 
  28. $this->integrations['registration_form'] = new MC4WP_Registration_Form_Integration(); 
  29.  
  30. // Load BuddyPress Integration 
  31. if ( $this->options['show_at_buddypress_form'] ) { 
  32. $this->integrations['buddypress_form'] = new MC4WP_BuddyPress_Integration(); 
  33.  
  34. // Load MultiSite Integration 
  35. if ( $this->options['show_at_multisite_form'] ) { 
  36. $this->integrations['multisite_form'] = new MC4WP_MultiSite_Integration(); 
  37.  
  38. // Load bbPress Integration 
  39. if ( $this->options['show_at_bbpress_forms'] ) { 
  40. $this->integrations['bbpress_forms'] = new MC4WP_bbPress_Integration(); 
  41.  
  42. // Load CF7 Integration 
  43. if( function_exists( 'wpcf7_add_shortcode' ) ) { 
  44. $this->integrations['contact_form_7'] = new MC4WP_CF7_Integration(); 
  45.  
  46. // Load Events Manager integration 
  47. if( defined( 'EM_VERSION' ) ) { 
  48. $this->integrations['events_manager'] = new MC4WP_Events_Manager_Integration(); 
  49.  
  50. // Load WooCommerce Integration 
  51. if ( $this->options['show_at_woocommerce_checkout'] ) { 
  52. $this->integrations['woocommerce'] = new MC4WP_WooCommerce_Integration(); 
  53.  
  54. // Load EDD Integration 
  55. if ( $this->options['show_at_edd_checkout'] ) { 
  56. $this->integrations['easy_digital_downloads'] = new MC4WP_EDD_Integration(); 
  57.  
  58. // load General Integration on POST requests 
  59. if( $_SERVER['REQUEST_METHOD'] === 'POST' ) { 
  60. $this->integrations['general'] = new MC4WP_General_Integration(); 
  61.  
  62.  
  63. /** 
  64. * Loads the checkbox stylesheet 
  65. */ 
  66. public function load_stylesheet( ) { 
  67.  
  68. if( $this->options['css'] == false ) { 
  69. return false; 
  70.  
  71. $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; 
  72.  
  73. wp_enqueue_style( 'mailchimp-for-wp-checkbox', MC4WP_LITE_PLUGIN_URL . 'assets/css/checkbox' . $suffix . '.css', array(), MC4WP_LITE_VERSION, 'all' ); 
  74. return true; 
  75.