Passed
Pull Request — master (#375)
by Brian
85:55 queued 10s
created

GetPaid_Meta_Box_Payment_Form_Info::output()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 34
rs 9.7
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Payment Form Info
5
 *
6
 * Display the Payment Form info meta box.
7
 *
8
 */
9
10
if ( ! defined( 'ABSPATH' ) ) {
11
	exit; // Exit if accessed directly
12
}
13
14
/**
15
 * GetPaid_Meta_Box_Payment_Form_Info Class.
16
 */
17
class GetPaid_Meta_Box_Payment_Form_Info {
18
19
    /**
20
	 * Output the metabox.
21
	 *
22
	 * @param WP_Post $post
23
	 */
24
    public static function output( $post ) {
25
26
        // Prepare the form.
27
        $form = new GetPaid_Payment_Form( $post );
28
29
        ?>
30
31
        <div class='bsui' style='padding-top: 10px;'>
32
            <?php do_action( 'wpinv_payment_form_before_info_metabox', $form ); ?>
33
34
            <div class="wpinv_payment_form_shortcode form-group row">
35
                <label for="wpinv_payment_form_shortcode" class="col-sm-12 col-form-label">
36
                    <?php _e( 'Payment Form Shortcode', 'invoicing' );?>
37
                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a payment form', 'invoicing' ); ?>"></span>
38
                </label>
39
40
                <div class="col-sm-12">
41
                    <input  onClick="this.select()" type="text" id="wpinv_payment_form_shortcode" value="[getpaid form=<?php echo esc_attr( $form->get_id() ); ?>]" style="width: 100%;" />
42
                </div>
43
            </div>
44
45
            <div class="wpinv_payment_form_buy_shortcode form-group row">
46
                <label for="wpinv_payment_form_buy_shortcode" class="col-sm-12 col-form-label">
47
                    <?php _e( 'Payment Button Shortcode', 'invoicing' );?>
48
                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Displays a buy now button', 'invoicing' ); ?>"></span>
49
                </label>
50
51
                <div class="col-sm-12">
52
                    <input onClick="this.select()" type="text" id="wpinv_payment_form_buy_shortcode" value="[getpaid form=<?php echo esc_attr( $form->get_id() ); ?> button='Buy Now']" style="width: 100%;" />
53
                </div>
54
            </div>
55
56
            <?php do_action( 'wpinv_payment_form_info_metabox', $form ); ?>
57
        </div>
58
        <?php
59
60
    }
61
62
}
63