| 1 |
<?php |
| 2 |
if(!class_exists('MPHB_Divi_Checkout_Module') && class_exists('ET_Builder_Module')): |
| 3 |
|
| 4 |
class MPHB_Divi_Checkout_Module extends ET_Builder_Module{ |
| 5 |
|
| 6 |
public $slug = 'mphb-divi-checkout'; |
| 7 |
public $vb_support = 'off'; |
| 8 |
|
| 9 |
function init() { |
| 10 |
|
| 11 |
$this->name = esc_html__( 'HB Accom. Checkout', 'mphb-divi' ); |
| 12 |
|
| 13 |
} |
| 14 |
|
| 15 |
function get_fields() { |
| 16 |
|
| 17 |
return array( |
| 18 |
'class' => array( |
| 19 |
'label' => esc_html__( 'Class', 'mphb-divi' ), |
| 20 |
'description' => esc_html__( 'Custom CSS class for shortcode wrapper.', 'mphb-divi' ), |
| 21 |
'type' => 'text', |
| 22 |
'default' => '' |
| 23 |
), |
| 24 |
); |
| 25 |
|
| 26 |
} |
| 27 |
|
| 28 |
function render($attrs, $content = null, $render_slug){ |
| 29 |
|
| 30 |
return self::get_checkout($this->props); |
| 31 |
|
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
static function get_checkout($args = array()){ |
| 36 |
|
| 37 |
$defaults = array( |
| 38 |
'class' => '' |
| 39 |
); |
| 40 |
|
| 41 |
$args = wp_parse_args($args, $defaults); |
| 42 |
|
| 43 |
return do_shortcode('[mphb_checkout class="'.$args['class'].'"]'); |
| 44 |
|
| 45 |
} |
| 46 |
|
| 47 |
} |
| 48 |
|
| 49 |
new MPHB_Divi_Checkout_Module; |
| 50 |
|
| 51 |
endif; |
| 52 |
|