Passed
Pull Request — master (#236)
by Patrik
03:27
created
invoicing.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@
 block discarded – undo
12 12
 */
13 13
 
14 14
 // MUST have WordPress.
15
-if ( !defined( 'WPINC' ) ) {
16
-    exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) );
15
+if (!defined('WPINC')) {
16
+    exit('Do NOT access this file directly: ' . basename(__FILE__));
17 17
 }
18 18
 
19
-if ( !defined( 'WPINV_VERSION' ) ) {
20
-    define( 'WPINV_VERSION', '1.0.12' );
19
+if (!defined('WPINV_VERSION')) {
20
+    define('WPINV_VERSION', '1.0.12');
21 21
 }
22 22
 
23
-if ( !defined( 'WPINV_PLUGIN_FILE' ) ) {
24
-    define( 'WPINV_PLUGIN_FILE', __FILE__ );
23
+if (!defined('WPINV_PLUGIN_FILE')) {
24
+    define('WPINV_PLUGIN_FILE', __FILE__);
25 25
 }
26 26
 
27
-require plugin_dir_path( __FILE__ ) . 'includes/class-wpinv.php';
27
+require plugin_dir_path(__FILE__) . 'includes/class-wpinv.php';
28 28
 
29 29
 function wpinv_run() {
30 30
     global $invoicing;
Please login to merge, or discard this patch.
widgets/invoice-history.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -46,25 +46,25 @@
 block discarded – undo
46 46
         parent::__construct( $options );
47 47
     }
48 48
 
49
-	/**
50
-	 * The Super block output function.
51
-	 *
52
-	 * @param array $args
53
-	 * @param array $widget_args
54
-	 * @param string $content
55
-	 *
56
-	 * @return mixed|string|bool
57
-	 */
49
+    /**
50
+     * The Super block output function.
51
+     *
52
+     * @param array $args
53
+     * @param array $widget_args
54
+     * @param string $content
55
+     *
56
+     * @return mixed|string|bool
57
+     */
58 58
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
59 59
 
60
-	    ob_start();
60
+        ob_start();
61 61
 
62
-	    do_action( 'wpinv_before_user_invoice_history' );
63
-	    wpinv_get_template_part( 'wpinv-invoice-history' );
64
-	    do_action( 'wpinv_after_user_invoice_history' );
62
+        do_action( 'wpinv_before_user_invoice_history' );
63
+        wpinv_get_template_part( 'wpinv-invoice-history' );
64
+        do_action( 'wpinv_after_user_invoice_history' );
65 65
 
66
-	    $output = ob_get_clean();
67
-	    return trim($output);
66
+        $output = ob_get_clean();
67
+        return trim($output);
68 68
 
69 69
     }
70 70
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
             'block-keywords'=> "['invoicing','history']",
25 25
             'class_name'     => __CLASS__,
26 26
             'base_id'       => 'wpinv_history',
27
-            'name'          => __('Invoicing > Invoice History','invoicing'),
27
+            'name'          => __('Invoicing > Invoice History', 'invoicing'),
28 28
             'widget_ops'    => array(
29 29
                 'classname'   => 'wpinv-history-class',
30
-                'description' => esc_html__('Displays invoice history.','invoicing'),
30
+                'description' => esc_html__('Displays invoice history.', 'invoicing'),
31 31
             ),
32 32
             'arguments'     => array(
33 33
                 'title'  => array(
34
-                    'title'       => __( 'Widget title', 'invoicing' ),
35
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
34
+                    'title'       => __('Widget title', 'invoicing'),
35
+                    'desc'        => __('Enter widget title.', 'invoicing'),
36 36
                     'type'        => 'text',
37 37
                     'desc_tip'    => true,
38 38
                     'default'     => '',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         );
44 44
 
45 45
 
46
-        parent::__construct( $options );
46
+        parent::__construct($options);
47 47
     }
48 48
 
49 49
 	/**
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @return mixed|string|bool
57 57
 	 */
58
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
58
+    public function output($args = array(), $widget_args = array(), $content = '') {
59 59
 
60 60
 	    ob_start();
61 61
 
62
-	    do_action( 'wpinv_before_user_invoice_history' );
63
-	    wpinv_get_template_part( 'wpinv-invoice-history' );
64
-	    do_action( 'wpinv_after_user_invoice_history' );
62
+	    do_action('wpinv_before_user_invoice_history');
63
+	    wpinv_get_template_part('wpinv-invoice-history');
64
+	    do_action('wpinv_after_user_invoice_history');
65 65
 
66 66
 	    $output = ob_get_clean();
67 67
 	    return trim($output);
Please login to merge, or discard this patch.
widgets/invoice-messages.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,22 +44,22 @@
 block discarded – undo
44 44
         parent::__construct( $options );
45 45
     }
46 46
 
47
-	/**
48
-	 * The Super block output function.
49
-	 *
50
-	 * @param array $args
51
-	 * @param array $widget_args
52
-	 * @param string $content
53
-	 *
54
-	 * @return mixed|string|bool
55
-	 */
47
+    /**
48
+     * The Super block output function.
49
+     *
50
+     * @param array $args
51
+     * @param array $widget_args
52
+     * @param string $content
53
+     *
54
+     * @return mixed|string|bool
55
+     */
56 56
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
57 57
 
58
-	    ob_start();
58
+        ob_start();
59 59
 
60
-	    wpinv_print_errors();
60
+        wpinv_print_errors();
61 61
 
62
-	    return '<div class="wpinv">' . ob_get_clean() . '</div>';
62
+        return '<div class="wpinv">' . ob_get_clean() . '</div>';
63 63
 
64 64
     }
65 65
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
             'block-keywords'=> "['invoicing','history']",
23 23
             'class_name'     => __CLASS__,
24 24
             'base_id'       => 'wpinv_messages',
25
-            'name'          => __('Invoicing > Invoice Messages','invoicing'),
25
+            'name'          => __('Invoicing > Invoice Messages', 'invoicing'),
26 26
             'widget_ops'    => array(
27 27
                 'classname'   => 'wpinv-messages-class',
28
-                'description' => esc_html__('Displays invoice error and warning messages on checkout page.','invoicing'),
28
+                'description' => esc_html__('Displays invoice error and warning messages on checkout page.', 'invoicing'),
29 29
             ),
30 30
             'arguments'     => array(
31 31
                 'title'  => array(
32
-                    'title'       => __( 'Widget title', 'invoicing' ),
33
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
32
+                    'title'       => __('Widget title', 'invoicing'),
33
+                    'desc'        => __('Enter widget title.', 'invoicing'),
34 34
                     'type'        => 'text',
35 35
                     'desc_tip'    => true,
36 36
                     'default'     => '',
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         );
42 42
 
43 43
 
44
-        parent::__construct( $options );
44
+        parent::__construct($options);
45 45
     }
46 46
 
47 47
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return mixed|string|bool
55 55
 	 */
56
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
56
+    public function output($args = array(), $widget_args = array(), $content = '') {
57 57
 
58 58
 	    ob_start();
59 59
 
Please login to merge, or discard this patch.
widgets/checkout.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,18 +46,18 @@
 block discarded – undo
46 46
         parent::__construct( $options );
47 47
     }
48 48
 
49
-	/**
50
-	 * The Super block output function.
51
-	 *
52
-	 * @param array $args
53
-	 * @param array $widget_args
54
-	 * @param string $content
55
-	 *
56
-	 * @return mixed|string|bool
57
-	 */
49
+    /**
50
+     * The Super block output function.
51
+     *
52
+     * @param array $args
53
+     * @param array $widget_args
54
+     * @param string $content
55
+     *
56
+     * @return mixed|string|bool
57
+     */
58 58
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
59 59
 
60
-	    return wpinv_checkout_form();
60
+        return wpinv_checkout_form();
61 61
 
62 62
     }
63 63
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
             'block-keywords'=> "['invoicing','checkout']",
25 25
             'class_name'     => __CLASS__,
26 26
             'base_id'       => 'wpinv_checkout',
27
-            'name'          => __('Invoicing > Checkout','invoicing'),
27
+            'name'          => __('Invoicing > Checkout', 'invoicing'),
28 28
             'widget_ops'    => array(
29 29
                 'classname'   => 'wpinv-checkout-class',
30
-                'description' => esc_html__('Displays checkout form.','invoicing'),
30
+                'description' => esc_html__('Displays checkout form.', 'invoicing'),
31 31
             ),
32 32
             'arguments'     => array(
33 33
                 'title'  => array(
34
-                    'title'       => __( 'Widget title', 'invoicing' ),
35
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
34
+                    'title'       => __('Widget title', 'invoicing'),
35
+                    'desc'        => __('Enter widget title.', 'invoicing'),
36 36
                     'type'        => 'text',
37 37
                     'desc_tip'    => true,
38 38
                     'default'     => '',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         );
44 44
 
45 45
 
46
-        parent::__construct( $options );
46
+        parent::__construct($options);
47 47
     }
48 48
 
49 49
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @return mixed|string|bool
57 57
 	 */
58
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
58
+    public function output($args = array(), $widget_args = array(), $content = '') {
59 59
 
60 60
 	    return wpinv_checkout_form();
61 61
 
Please login to merge, or discard this patch.
widgets/subscriptions.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -46,25 +46,25 @@
 block discarded – undo
46 46
         parent::__construct( $options );
47 47
     }
48 48
 
49
-	/**
50
-	 * The Super block output function.
51
-	 *
52
-	 * @param array $args
53
-	 * @param array $widget_args
54
-	 * @param string $content
55
-	 *
56
-	 * @return mixed|string|bool
57
-	 */
49
+    /**
50
+     * The Super block output function.
51
+     *
52
+     * @param array $args
53
+     * @param array $widget_args
54
+     * @param string $content
55
+     *
56
+     * @return mixed|string|bool
57
+     */
58 58
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
59 59
 
60
-	    ob_start();
60
+        ob_start();
61 61
 
62
-	    do_action( 'wpinv_before_user_subscriptions' );
63
-	    wpinv_get_template_part( 'wpinv-subscriptions-history' );
64
-	    do_action( 'wpinv_after_user_subscriptions' );
62
+        do_action( 'wpinv_before_user_subscriptions' );
63
+        wpinv_get_template_part( 'wpinv-subscriptions-history' );
64
+        do_action( 'wpinv_after_user_subscriptions' );
65 65
 
66
-	    $output = ob_get_clean();
67
-	    return trim($output);
66
+        $output = ob_get_clean();
67
+        return trim($output);
68 68
 
69 69
     }
70 70
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -24,15 +24,15 @@  discard block
 block discarded – undo
24 24
             'block-keywords'=> "['invoicing','subscriptions']",
25 25
             'class_name'     => __CLASS__,
26 26
             'base_id'       => 'wpinv_subscriptions',
27
-            'name'          => __('Invoicing > Subscriptions History','invoicing'),
27
+            'name'          => __('Invoicing > Subscriptions History', 'invoicing'),
28 28
             'widget_ops'    => array(
29 29
                 'classname'   => 'wpinv-checkout-class',
30
-                'description' => esc_html__('Displays subscriptions history.','invoicing'),
30
+                'description' => esc_html__('Displays subscriptions history.', 'invoicing'),
31 31
             ),
32 32
             'arguments'     => array(
33 33
                 'title'  => array(
34
-                    'title'       => __( 'Widget title', 'invoicing' ),
35
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
34
+                    'title'       => __('Widget title', 'invoicing'),
35
+                    'desc'        => __('Enter widget title.', 'invoicing'),
36 36
                     'type'        => 'text',
37 37
                     'desc_tip'    => true,
38 38
                     'default'     => '',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         );
44 44
 
45 45
 
46
-        parent::__construct( $options );
46
+        parent::__construct($options);
47 47
     }
48 48
 
49 49
 	/**
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @return mixed|string|bool
57 57
 	 */
58
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
58
+    public function output($args = array(), $widget_args = array(), $content = '') {
59 59
 
60 60
 	    ob_start();
61 61
 
62
-	    do_action( 'wpinv_before_user_subscriptions' );
63
-	    wpinv_get_template_part( 'wpinv-subscriptions-history' );
64
-	    do_action( 'wpinv_after_user_subscriptions' );
62
+	    do_action('wpinv_before_user_subscriptions');
63
+	    wpinv_get_template_part('wpinv-subscriptions-history');
64
+	    do_action('wpinv_after_user_subscriptions');
65 65
 
66 66
 	    $output = ob_get_clean();
67 67
 	    return trim($output);
Please login to merge, or discard this patch.
widgets/invoice-receipt.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -44,25 +44,25 @@
 block discarded – undo
44 44
         parent::__construct( $options );
45 45
     }
46 46
 
47
-	/**
48
-	 * The Super block output function.
49
-	 *
50
-	 * @param array $args
51
-	 * @param array $widget_args
52
-	 * @param string $content
53
-	 *
54
-	 * @return mixed|string|bool
55
-	 */
47
+    /**
48
+     * The Super block output function.
49
+     *
50
+     * @param array $args
51
+     * @param array $widget_args
52
+     * @param string $content
53
+     *
54
+     * @return mixed|string|bool
55
+     */
56 56
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
57 57
 
58
-	    ob_start();
58
+        ob_start();
59 59
 
60
-	    do_action( 'wpinv_success_content_before' );
61
-	    echo wpinv_payment_receipt( $args );
62
-	    do_action( 'wpinv_success_content_after' );
60
+        do_action( 'wpinv_success_content_before' );
61
+        echo wpinv_payment_receipt( $args );
62
+        do_action( 'wpinv_success_content_after' );
63 63
 
64
-	    $output = ob_get_clean();
65
-	    return trim($output);
64
+        $output = ob_get_clean();
65
+        return trim($output);
66 66
 
67 67
     }
68 68
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -22,15 +22,15 @@  discard block
 block discarded – undo
22 22
             'block-keywords'=> "['invoicing','receipt']",
23 23
             'class_name'     => __CLASS__,
24 24
             'base_id'       => 'wpinv_receipt',
25
-            'name'          => __('Invoicing > Invoice Receipt','invoicing'),
25
+            'name'          => __('Invoicing > Invoice Receipt', 'invoicing'),
26 26
             'widget_ops'    => array(
27 27
                 'classname'   => 'wpinv-receipt-class',
28
-                'description' => esc_html__('Displays invoice receipt after checkout.','invoicing'),
28
+                'description' => esc_html__('Displays invoice receipt after checkout.', 'invoicing'),
29 29
             ),
30 30
             'arguments'     => array(
31 31
                 'title'  => array(
32
-                    'title'       => __( 'Widget title', 'invoicing' ),
33
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
32
+                    'title'       => __('Widget title', 'invoicing'),
33
+                    'desc'        => __('Enter widget title.', 'invoicing'),
34 34
                     'type'        => 'text',
35 35
                     'desc_tip'    => true,
36 36
                     'default'     => '',
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         );
42 42
 
43 43
 
44
-        parent::__construct( $options );
44
+        parent::__construct($options);
45 45
     }
46 46
 
47 47
 	/**
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return mixed|string|bool
55 55
 	 */
56
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
56
+    public function output($args = array(), $widget_args = array(), $content = '') {
57 57
 
58 58
 	    ob_start();
59 59
 
60
-	    do_action( 'wpinv_success_content_before' );
61
-	    echo wpinv_payment_receipt( $args );
62
-	    do_action( 'wpinv_success_content_after' );
60
+	    do_action('wpinv_success_content_before');
61
+	    echo wpinv_payment_receipt($args);
62
+	    do_action('wpinv_success_content_after');
63 63
 
64 64
 	    $output = ob_get_clean();
65 65
 	    return trim($output);
Please login to merge, or discard this patch.
includes/admin/class-wpinv-admin-menus.php 1 patch
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Setup menus in WP admin.
4 4
  */
5 5
 
6
-defined( 'ABSPATH' ) || exit;
6
+defined('ABSPATH') || exit;
7 7
 
8 8
 /**
9 9
  * WC_Admin_Menus Class.
@@ -13,34 +13,34 @@  discard block
 block discarded – undo
13 13
      * Hook in tabs.
14 14
      */
15 15
     public function __construct() {
16
-        add_action( 'admin_menu', array( $this, 'admin_menu' ), 10 );
17
-        add_action( 'admin_menu', array( $this, 'add_addons_menu' ), 99 );
18
-        add_action( 'admin_menu', array( $this, 'remove_admin_submenus' ), 10 );
19
-        add_action( 'admin_head-nav-menus.php', array( $this, 'add_nav_menu_meta_boxes' ) );
16
+        add_action('admin_menu', array($this, 'admin_menu'), 10);
17
+        add_action('admin_menu', array($this, 'add_addons_menu'), 99);
18
+        add_action('admin_menu', array($this, 'remove_admin_submenus'), 10);
19
+        add_action('admin_head-nav-menus.php', array($this, 'add_nav_menu_meta_boxes'));
20 20
     }
21 21
 
22 22
     public function admin_menu() {
23 23
         global $menu;
24 24
 
25
-        if ( !(current_user_can( 'manage_invoicing' ) || current_user_can( 'manage_options' )) ) {
25
+        if (!(current_user_can('manage_invoicing') || current_user_can('manage_options'))) {
26 26
             return;
27 27
         }
28 28
 
29
-        $capability = apply_filters( 'invoicing_capability', 'manage_invoicing' );
29
+        $capability = apply_filters('invoicing_capability', 'manage_invoicing');
30 30
 
31
-        if ( current_user_can( 'manage_options' ) ) {
32
-            $menu[] = array( '', 'read', 'separator-wpinv', '', 'wp-menu-separator wpinv' );
31
+        if (current_user_can('manage_options')) {
32
+            $menu[] = array('', 'read', 'separator-wpinv', '', 'wp-menu-separator wpinv');
33 33
         }
34 34
 
35
-        $wpi_invoice = get_post_type_object( 'wpi_invoice' );
35
+        $wpi_invoice = get_post_type_object('wpi_invoice');
36 36
 
37
-        add_menu_page( __( 'Invoicing', 'invoicing' ), __( 'Invoicing', 'invoicing' ), $capability, 'wpinv', null, $wpi_invoice->menu_icon, '54.123460' );
37
+        add_menu_page(__('Invoicing', 'invoicing'), __('Invoicing', 'invoicing'), $capability, 'wpinv', null, $wpi_invoice->menu_icon, '54.123460');
38 38
 
39
-        add_submenu_page( 'wpinv', __( 'Invoice Settings', 'invoicing' ), __( 'Settings', 'invoicing' ), $capability, 'wpinv-settings', array( $this, 'options_page' ));
39
+        add_submenu_page('wpinv', __('Invoice Settings', 'invoicing'), __('Settings', 'invoicing'), $capability, 'wpinv-settings', array($this, 'options_page'));
40 40
     }
41 41
 
42
-    public function add_addons_menu(){
43
-        if ( !apply_filters( 'wpi_show_addons_page', true ) ) {
42
+    public function add_addons_menu() {
43
+        if (!apply_filters('wpi_show_addons_page', true)) {
44 44
             return;
45 45
         }
46 46
 
@@ -50,78 +50,78 @@  discard block
 block discarded – undo
50 50
             __('Extensions', 'invoicing'),
51 51
             'manage_options',
52 52
             'wpi-addons',
53
-            array( $this, 'addons_page' )
53
+            array($this, 'addons_page')
54 54
         );
55 55
     }
56 56
 
57
-    public function addons_page(){
57
+    public function addons_page() {
58 58
         $addon_obj = new WPInv_Admin_Addons();
59 59
         $addon_obj->output();
60 60
     }
61 61
 
62 62
     function options_page() {
63
-        $page       = isset( $_GET['page'] )                ? strtolower( $_GET['page'] )               : false;
63
+        $page = isset($_GET['page']) ? strtolower($_GET['page']) : false;
64 64
 
65
-        if ( $page !== 'wpinv-settings' ) {
65
+        if ($page !== 'wpinv-settings') {
66 66
             return;
67 67
         }
68 68
 
69 69
         $settings_tabs = wpinv_get_settings_tabs();
70 70
         $settings_tabs = empty($settings_tabs) ? array() : $settings_tabs;
71
-        $active_tab    = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $settings_tabs ) ? sanitize_text_field( $_GET['tab'] ) : 'general';
72
-        $sections      = wpinv_get_settings_tab_sections( $active_tab );
71
+        $active_tab    = isset($_GET['tab']) && array_key_exists($_GET['tab'], $settings_tabs) ? sanitize_text_field($_GET['tab']) : 'general';
72
+        $sections      = wpinv_get_settings_tab_sections($active_tab);
73 73
         $key           = 'main';
74 74
 
75
-        if ( is_array( $sections ) ) {
76
-            $key = key( $sections );
75
+        if (is_array($sections)) {
76
+            $key = key($sections);
77 77
         }
78 78
 
79
-        $registered_sections = wpinv_get_settings_tab_sections( $active_tab );
80
-        $section             = isset( $_GET['section'] ) && ! empty( $registered_sections ) && array_key_exists( $_GET['section'], $registered_sections ) ? $_GET['section'] : $key;
79
+        $registered_sections = wpinv_get_settings_tab_sections($active_tab);
80
+        $section             = isset($_GET['section']) && !empty($registered_sections) && array_key_exists($_GET['section'], $registered_sections) ? $_GET['section'] : $key;
81 81
         ob_start();
82 82
         ?>
83 83
         <div class="wrap">
84 84
             <h1 class="nav-tab-wrapper">
85 85
                 <?php
86
-                foreach( wpinv_get_settings_tabs() as $tab_id => $tab_name ) {
87
-                    $tab_url = add_query_arg( array(
86
+                foreach (wpinv_get_settings_tabs() as $tab_id => $tab_name) {
87
+                    $tab_url = add_query_arg(array(
88 88
                         'settings-updated' => false,
89 89
                         'tab' => $tab_id,
90
-                    ) );
90
+                    ));
91 91
 
92 92
                     // Remove the section from the tabs so we always end up at the main section
93
-                    $tab_url = remove_query_arg( 'section', $tab_url );
94
-                    $tab_url = remove_query_arg( 'wpi_sub', $tab_url );
93
+                    $tab_url = remove_query_arg('section', $tab_url);
94
+                    $tab_url = remove_query_arg('wpi_sub', $tab_url);
95 95
 
96 96
                     $active = $active_tab == $tab_id ? ' nav-tab-active' : '';
97 97
 
98
-                    echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '">';
99
-                    echo esc_html( $tab_name );
98
+                    echo '<a href="' . esc_url($tab_url) . '" title="' . esc_attr($tab_name) . '" class="nav-tab' . $active . '">';
99
+                    echo esc_html($tab_name);
100 100
                     echo '</a>';
101 101
                 }
102 102
                 ?>
103 103
             </h1>
104 104
             <?php
105
-            $number_of_sections = count( $sections );
105
+            $number_of_sections = count($sections);
106 106
             $number = 0;
107
-            if ( $number_of_sections > 1 ) {
107
+            if ($number_of_sections > 1) {
108 108
                 echo '<div><ul class="subsubsub">';
109
-                foreach( $sections as $section_id => $section_name ) {
109
+                foreach ($sections as $section_id => $section_name) {
110 110
                     echo '<li>';
111 111
                     $number++;
112
-                    $tab_url = add_query_arg( array(
112
+                    $tab_url = add_query_arg(array(
113 113
                         'settings-updated' => false,
114 114
                         'tab' => $active_tab,
115 115
                         'section' => $section_id
116
-                    ) );
117
-                    $tab_url = remove_query_arg( 'wpi_sub', $tab_url );
116
+                    ));
117
+                    $tab_url = remove_query_arg('wpi_sub', $tab_url);
118 118
                     $class = '';
119
-                    if ( $section == $section_id ) {
119
+                    if ($section == $section_id) {
120 120
                         $class = 'current';
121 121
                     }
122
-                    echo '<a class="' . $class . '" href="' . esc_url( $tab_url ) . '">' . $section_name . '</a>';
122
+                    echo '<a class="' . $class . '" href="' . esc_url($tab_url) . '">' . $section_name . '</a>';
123 123
 
124
-                    if ( $number != $number_of_sections ) {
124
+                    if ($number != $number_of_sections) {
125 125
                         echo ' | ';
126 126
                     }
127 127
                     echo '</li>';
@@ -133,19 +133,19 @@  discard block
 block discarded – undo
133 133
                 <form method="post" action="options.php">
134 134
                     <table class="form-table">
135 135
                         <?php
136
-                        settings_fields( 'wpinv_settings' );
136
+                        settings_fields('wpinv_settings');
137 137
 
138
-                        if ( 'main' === $section ) {
139
-                            do_action( 'wpinv_settings_tab_top', $active_tab );
138
+                        if ('main' === $section) {
139
+                            do_action('wpinv_settings_tab_top', $active_tab);
140 140
                         }
141 141
 
142
-                        do_action( 'wpinv_settings_tab_top_' . $active_tab . '_' . $section, $active_tab, $section );
143
-                        do_settings_sections( 'wpinv_settings_' . $active_tab . '_' . $section, $active_tab, $section );
144
-                        do_action( 'wpinv_settings_tab_bottom_' . $active_tab . '_' . $section, $active_tab, $section );
142
+                        do_action('wpinv_settings_tab_top_' . $active_tab . '_' . $section, $active_tab, $section);
143
+                        do_settings_sections('wpinv_settings_' . $active_tab . '_' . $section, $active_tab, $section);
144
+                        do_action('wpinv_settings_tab_bottom_' . $active_tab . '_' . $section, $active_tab, $section);
145 145
 
146 146
                         // For backwards compatibility
147
-                        if ( 'main' === $section ) {
148
-                            do_action( 'wpinv_settings_tab_bottom', $active_tab );
147
+                        if ('main' === $section) {
148
+                            do_action('wpinv_settings_tab_bottom', $active_tab);
149 149
                         }
150 150
                         ?>
151 151
                     </table>
@@ -159,52 +159,52 @@  discard block
 block discarded – undo
159 159
     }
160 160
 
161 161
     public function remove_admin_submenus() {
162
-        remove_submenu_page( 'edit.php?post_type=wpi_invoice', 'post-new.php?post_type=wpi_invoice' );
162
+        remove_submenu_page('edit.php?post_type=wpi_invoice', 'post-new.php?post_type=wpi_invoice');
163 163
     }
164 164
 
165
-    public function add_nav_menu_meta_boxes(){
166
-        add_meta_box( 'wpinv_endpoints_nav_link', __( 'Invoicing Pages', 'invoicing' ), array( $this, 'nav_menu_links' ), 'nav-menus', 'side', 'low' );
165
+    public function add_nav_menu_meta_boxes() {
166
+        add_meta_box('wpinv_endpoints_nav_link', __('Invoicing Pages', 'invoicing'), array($this, 'nav_menu_links'), 'nav-menus', 'side', 'low');
167 167
     }
168 168
 
169
-    public function nav_menu_links(){
169
+    public function nav_menu_links() {
170 170
         $endpoints = $this->get_menu_items();
171 171
         ?>
172 172
         <div id="invoicing-endpoints" class="posttypediv">
173
-        <?php if(!empty($endpoints['pages'])){ ?>
173
+        <?php if (!empty($endpoints['pages'])) { ?>
174 174
             <div id="tabs-panel-invoicing-endpoints" class="tabs-panel tabs-panel-active">
175 175
                 <ul id="invoicing-endpoints-checklist" class="categorychecklist form-no-clear">
176 176
                     <?php
177 177
                     $walker = new Walker_Nav_Menu_Checklist(array());
178
-                    echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $endpoints['pages']), 0, (object) array('walker' => $walker));
178
+                    echo walk_nav_menu_tree(array_map('wp_setup_nav_menu_item', $endpoints['pages']), 0, (object)array('walker' => $walker));
179 179
                     ?>
180 180
                 </ul>
181 181
             </div>
182 182
         <?php } ?>
183 183
         <p class="button-controls">
184 184
         <span class="list-controls">
185
-            <a href="<?php echo admin_url( 'nav-menus.php?page-tab=all&selectall=1#invoicing-endpoints' ); ?>" class="select-all"><?php _e( 'Select all', 'invoicing' ); ?></a>
185
+            <a href="<?php echo admin_url('nav-menus.php?page-tab=all&selectall=1#invoicing-endpoints'); ?>" class="select-all"><?php _e('Select all', 'invoicing'); ?></a>
186 186
         </span>
187 187
             <span class="add-to-menu">
188
-            <input type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to menu', 'invoicing' ); ?>" name="add-post-type-menu-item" id="submit-invoicing-endpoints">
188
+            <input type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to menu', 'invoicing'); ?>" name="add-post-type-menu-item" id="submit-invoicing-endpoints">
189 189
             <span class="spinner"></span>
190 190
         </span>
191 191
         </p>
192 192
         <?php
193 193
     }
194 194
 
195
-    public function get_menu_items(){
195
+    public function get_menu_items() {
196 196
         $items = array();
197 197
 
198
-        $wpinv_history_page_id = (int)wpinv_get_option( 'invoice_history_page' );
199
-        if($wpinv_history_page_id > 0){
198
+        $wpinv_history_page_id = (int)wpinv_get_option('invoice_history_page');
199
+        if ($wpinv_history_page_id > 0) {
200 200
             $item = new stdClass();
201 201
             $item->object_id = $wpinv_history_page_id;
202 202
             $item->db_id = 0;
203
-            $item->object =  'page';
203
+            $item->object = 'page';
204 204
             $item->menu_item_parent = 0;
205 205
             $item->type = 'post_type';
206
-            $item->title = __('Invoice History Page','invoicing');
207
-            $item->url = get_permalink( $wpinv_history_page_id );
206
+            $item->title = __('Invoice History Page', 'invoicing');
207
+            $item->url = get_permalink($wpinv_history_page_id);
208 208
             $item->target = '';
209 209
             $item->attr_title = '';
210 210
             $item->classes = array('wpinv-menu-item');
@@ -213,16 +213,16 @@  discard block
 block discarded – undo
213 213
             $items['pages'][] = $item;
214 214
         }
215 215
 
216
-        $wpinv_sub_history_page_id = (int)wpinv_get_option( 'invoice_subscription_page' );
217
-        if($wpinv_sub_history_page_id > 0){
216
+        $wpinv_sub_history_page_id = (int)wpinv_get_option('invoice_subscription_page');
217
+        if ($wpinv_sub_history_page_id > 0) {
218 218
             $item = new stdClass();
219 219
             $item->object_id = $wpinv_sub_history_page_id;
220 220
             $item->db_id = 0;
221
-            $item->object =  'page';
221
+            $item->object = 'page';
222 222
             $item->menu_item_parent = 0;
223 223
             $item->type = 'post_type';
224
-            $item->title = __('Invoice Subscriptions Page','invoicing');
225
-            $item->url = get_permalink( $wpinv_sub_history_page_id );
224
+            $item->title = __('Invoice Subscriptions Page', 'invoicing');
225
+            $item->url = get_permalink($wpinv_sub_history_page_id);
226 226
             $item->target = '';
227 227
             $item->attr_title = '';
228 228
             $item->classes = array('wpinv-menu-item');
@@ -231,16 +231,16 @@  discard block
 block discarded – undo
231 231
             $items['pages'][] = $item;
232 232
         }
233 233
 
234
-        $wpinv_checkout_page_id = (int)wpinv_get_option( 'checkout_page' );
235
-        if($wpinv_checkout_page_id > 0){
234
+        $wpinv_checkout_page_id = (int)wpinv_get_option('checkout_page');
235
+        if ($wpinv_checkout_page_id > 0) {
236 236
             $item = new stdClass();
237 237
             $item->object_id = $wpinv_checkout_page_id;
238 238
             $item->db_id = 0;
239
-            $item->object =  'page';
239
+            $item->object = 'page';
240 240
             $item->menu_item_parent = 0;
241 241
             $item->type = 'post_type';
242
-            $item->title = __('Checkout Page','invoicing');
243
-            $item->url = get_permalink( $wpinv_checkout_page_id );
242
+            $item->title = __('Checkout Page', 'invoicing');
243
+            $item->url = get_permalink($wpinv_checkout_page_id);
244 244
             $item->target = '';
245 245
             $item->attr_title = '';
246 246
             $item->classes = array('wpinv-menu-item');
@@ -249,16 +249,16 @@  discard block
 block discarded – undo
249 249
             $items['pages'][] = $item;
250 250
         }
251 251
 
252
-        $wpinv_tandc_page_id = (int)wpinv_get_option( 'tandc_page' );
253
-        if($wpinv_tandc_page_id > 0){
252
+        $wpinv_tandc_page_id = (int)wpinv_get_option('tandc_page');
253
+        if ($wpinv_tandc_page_id > 0) {
254 254
             $item = new stdClass();
255 255
             $item->object_id = $wpinv_tandc_page_id;
256 256
             $item->db_id = 0;
257
-            $item->object =  'page';
257
+            $item->object = 'page';
258 258
             $item->menu_item_parent = 0;
259 259
             $item->type = 'post_type';
260
-            $item->title = __('Terms & Conditions','invoicing');
261
-            $item->url = get_permalink( $wpinv_tandc_page_id );
260
+            $item->title = __('Terms & Conditions', 'invoicing');
261
+            $item->url = get_permalink($wpinv_tandc_page_id);
262 262
             $item->target = '';
263 263
             $item->attr_title = '';
264 264
             $item->classes = array('wpinv-menu-item');
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
             $items['pages'][] = $item;
268 268
         }
269 269
 
270
-        $wpinv_success_page_id = (int)wpinv_get_option( 'success_page' );
271
-        if($wpinv_success_page_id > 0){
270
+        $wpinv_success_page_id = (int)wpinv_get_option('success_page');
271
+        if ($wpinv_success_page_id > 0) {
272 272
             $item = new stdClass();
273 273
             $item->object_id = $wpinv_success_page_id;
274 274
             $item->db_id = 0;
275
-            $item->object =  'page';
275
+            $item->object = 'page';
276 276
             $item->menu_item_parent = 0;
277 277
             $item->type = 'post_type';
278
-            $item->title = __('Success Page','invoicing');
279
-            $item->url = get_permalink( $wpinv_success_page_id );
278
+            $item->title = __('Success Page', 'invoicing');
279
+            $item->url = get_permalink($wpinv_success_page_id);
280 280
             $item->target = '';
281 281
             $item->attr_title = '';
282 282
             $item->classes = array('wpinv-menu-item');
@@ -285,16 +285,16 @@  discard block
 block discarded – undo
285 285
             $items['pages'][] = $item;
286 286
         }
287 287
 
288
-        $wpinv_failure_page_id = (int)wpinv_get_option( 'failure_page' );
289
-        if($wpinv_failure_page_id > 0){
288
+        $wpinv_failure_page_id = (int)wpinv_get_option('failure_page');
289
+        if ($wpinv_failure_page_id > 0) {
290 290
             $item = new stdClass();
291 291
             $item->object_id = $wpinv_failure_page_id;
292 292
             $item->db_id = 0;
293
-            $item->object =  'page';
293
+            $item->object = 'page';
294 294
             $item->menu_item_parent = 0;
295 295
             $item->type = 'post_type';
296
-            $item->title = __('Failed Transaction Page','invoicing');
297
-            $item->url = get_permalink( $wpinv_failure_page_id );
296
+            $item->title = __('Failed Transaction Page', 'invoicing');
297
+            $item->url = get_permalink($wpinv_failure_page_id);
298 298
             $item->target = '';
299 299
             $item->attr_title = '';
300 300
             $item->classes = array('wpinv-menu-item');
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             $items['pages'][] = $item;
304 304
         }
305 305
 
306
-        return apply_filters( 'wpinv_menu_items', $items );
306
+        return apply_filters('wpinv_menu_items', $items);
307 307
     }
308 308
 
309 309
 }
Please login to merge, or discard this patch.
includes/class-wpinv.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
         require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-privacy.php' );
140 140
         require_once( WPINV_PLUGIN_DIR . 'includes/libraries/class-ayecode-addons.php' );
141 141
         require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-addons.php' );
142
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/checkout.php' );
143
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-history.php' );
144
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php' );
145
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php' );
146
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/subscriptions.php' );
147
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/buy-item.php' );
142
+        require_once( WPINV_PLUGIN_DIR . 'widgets/checkout.php' );
143
+        require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-history.php' );
144
+        require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php' );
145
+        require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php' );
146
+        require_once( WPINV_PLUGIN_DIR . 'widgets/subscriptions.php' );
147
+        require_once( WPINV_PLUGIN_DIR . 'widgets/buy-item.php' );
148 148
         require_once( WPINV_PLUGIN_DIR . 'vendor/autoload.php' );
149 149
 
150 150
         if ( !class_exists( 'WPInv_EUVat' ) ) {
@@ -421,16 +421,16 @@  discard block
 block discarded – undo
421 421
         require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-bp-core.php' );
422 422
     }
423 423
 
424
-	/**
425
-	 * Register widgets
426
-	 *
427
-	 */
428
-	public function register_widgets() {
429
-		register_widget( "WPInv_Checkout_Widget" );
430
-		register_widget( "WPInv_History_Widget" );
431
-		register_widget( "WPInv_Receipt_Widget" );
432
-		register_widget( "WPInv_Subscriptions_Widget" );
433
-		register_widget( "WPInv_Buy_Item_Widget" );
434
-		register_widget( "WPInv_Messages_Widget" );
435
-	}
424
+    /**
425
+     * Register widgets
426
+     *
427
+     */
428
+    public function register_widgets() {
429
+        register_widget( "WPInv_Checkout_Widget" );
430
+        register_widget( "WPInv_History_Widget" );
431
+        register_widget( "WPInv_Receipt_Widget" );
432
+        register_widget( "WPInv_Subscriptions_Widget" );
433
+        register_widget( "WPInv_Buy_Item_Widget" );
434
+        register_widget( "WPInv_Messages_Widget" );
435
+    }
436 436
 }
437 437
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +199 added lines, -199 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
  */
8 8
  
9 9
 // MUST have WordPress.
10
-if ( !defined( 'WPINC' ) ) {
11
-    exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) );
10
+if (!defined('WPINC')) {
11
+    exit('Do NOT access this file directly: ' . basename(__FILE__));
12 12
 }
13 13
 
14 14
 class WPInv_Plugin {
15 15
     private static $instance;
16 16
     
17 17
     public static function run() {
18
-        if ( !isset( self::$instance ) && !( self::$instance instanceof WPInv_Plugin ) ) {
18
+        if (!isset(self::$instance) && !(self::$instance instanceof WPInv_Plugin)) {
19 19
             self::$instance = new WPInv_Plugin;
20 20
             self::$instance->includes();
21 21
             self::$instance->actions();
@@ -31,31 +31,31 @@  discard block
 block discarded – undo
31 31
     }
32 32
     
33 33
     public function define_constants() {
34
-        define( 'WPINV_PLUGIN_DIR', plugin_dir_path( WPINV_PLUGIN_FILE ) );
35
-        define( 'WPINV_PLUGIN_URL', plugin_dir_url( WPINV_PLUGIN_FILE ) );
34
+        define('WPINV_PLUGIN_DIR', plugin_dir_path(WPINV_PLUGIN_FILE));
35
+        define('WPINV_PLUGIN_URL', plugin_dir_url(WPINV_PLUGIN_FILE));
36 36
     }
37 37
     
38 38
     private function actions() {
39 39
         /* Internationalize the text strings used. */
40
-        add_action( 'plugins_loaded', array( &$this, 'plugins_loaded' ) );
40
+        add_action('plugins_loaded', array(&$this, 'plugins_loaded'));
41 41
         
42 42
         /* Perform actions on admin initialization. */
43
-        add_action( 'admin_init', array( &$this, 'admin_init') );
44
-        add_action( 'init', array( &$this, 'init' ), 3 );
45
-        add_action( 'init', array( &$this, 'wpinv_actions' ) );
43
+        add_action('admin_init', array(&$this, 'admin_init'));
44
+        add_action('init', array(&$this, 'init'), 3);
45
+        add_action('init', array(&$this, 'wpinv_actions'));
46 46
         
47
-        if ( class_exists( 'BuddyPress' ) ) {
48
-            add_action( 'bp_include', array( &$this, 'bp_invoicing_init' ) );
47
+        if (class_exists('BuddyPress')) {
48
+            add_action('bp_include', array(&$this, 'bp_invoicing_init'));
49 49
         }
50 50
 
51
-        add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_scripts' ) );
52
-        add_action( 'widgets_init', array( &$this, 'register_widgets' ) );
51
+        add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
52
+        add_action('widgets_init', array(&$this, 'register_widgets'));
53 53
 
54
-        if ( is_admin() ) {
55
-            add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
56
-            add_action( 'admin_body_class', array( &$this, 'admin_body_class' ) );
54
+        if (is_admin()) {
55
+            add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
56
+            add_action('admin_body_class', array(&$this, 'admin_body_class'));
57 57
         } else {
58
-            add_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );
58
+            add_filter('pre_get_posts', array(&$this, 'pre_get_posts'));
59 59
         }
60 60
         
61 61
         /**
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
          *
66 66
          * @param WPInv_Plugin $this. Current WPInv_Plugin instance. Passed by reference.
67 67
          */
68
-        do_action_ref_array( 'wpinv_actions', array( &$this ) );
68
+        do_action_ref_array('wpinv_actions', array(&$this));
69 69
 
70
-        add_action( 'admin_init', array( &$this, 'activation_redirect') );
70
+        add_action('admin_init', array(&$this, 'activation_redirect'));
71 71
     }
72 72
     
73 73
     public function plugins_loaded() {
74 74
         /* Internationalize the text strings used. */
75 75
         $this->load_textdomain();
76 76
 
77
-        do_action( 'wpinv_loaded' );
77
+        do_action('wpinv_loaded');
78 78
     }
79 79
     
80 80
     /**
@@ -82,222 +82,222 @@  discard block
 block discarded – undo
82 82
      *
83 83
      * @since 1.0
84 84
      */
85
-    public function load_textdomain( $locale = NULL ) {
86
-        if ( empty( $locale ) ) {
87
-            $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
85
+    public function load_textdomain($locale = NULL) {
86
+        if (empty($locale)) {
87
+            $locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale();
88 88
         }
89 89
 
90
-        $locale = apply_filters( 'plugin_locale', $locale, 'invoicing' );
90
+        $locale = apply_filters('plugin_locale', $locale, 'invoicing');
91 91
         
92
-        unload_textdomain( 'invoicing' );
93
-        load_textdomain( 'invoicing', WP_LANG_DIR . '/invoicing/invoicing-' . $locale . '.mo' );
94
-        load_plugin_textdomain( 'invoicing', false, WPINV_PLUGIN_DIR . 'languages' );
92
+        unload_textdomain('invoicing');
93
+        load_textdomain('invoicing', WP_LANG_DIR . '/invoicing/invoicing-' . $locale . '.mo');
94
+        load_plugin_textdomain('invoicing', false, WPINV_PLUGIN_DIR . 'languages');
95 95
         
96 96
         /**
97 97
          * Define language constants.
98 98
          */
99
-        require_once( WPINV_PLUGIN_DIR . 'language.php' );
99
+        require_once(WPINV_PLUGIN_DIR . 'language.php');
100 100
     }
101 101
         
102 102
     public function includes() {
103 103
         global $wpinv_options;
104 104
         
105
-        require_once( WPINV_PLUGIN_DIR . 'includes/admin/register-settings.php' );
105
+        require_once(WPINV_PLUGIN_DIR . 'includes/admin/register-settings.php');
106 106
         $wpinv_options = wpinv_get_settings();
107 107
         
108
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-post-types.php' );
109
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-email-functions.php' );
110
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-general-functions.php' );
111
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-helper-functions.php' );
112
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-tax-functions.php' );
113
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-template-functions.php' );
114
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-address-functions.php' );
115
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-invoice-functions.php' );
116
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-item-functions.php' );
117
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-discount-functions.php' );
118
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-gateway-functions.php' );
119
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-payment-functions.php' );
120
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-user-functions.php' );
121
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-error-functions.php' );
122
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-invoice.php' );
123
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-item.php' );
124
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-notes.php' );
125
-        require_once( WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-session.php' );
126
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-session-handler.php' );
127
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-ajax.php' );
128
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-api.php' );
129
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-reports.php' );
130
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-cache-helper.php' );
131
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-db.php' );
132
-        require_once( WPINV_PLUGIN_DIR . 'includes/admin/subscriptions.php' );
133
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions-db.php' );
134
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions.php' );
135
-        require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-subscription.php' );
136
-        require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-subscriptions-list-table.php' );
137
-        require_once( WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-privacy.php' );
138
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-privacy.php' );
139
-        require_once( WPINV_PLUGIN_DIR . 'includes/libraries/class-ayecode-addons.php' );
140
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-addons.php' );
141
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/checkout.php' );
142
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-history.php' );
143
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php' );
144
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php' );
145
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/subscriptions.php' );
146
-	    require_once( WPINV_PLUGIN_DIR . 'widgets/buy-item.php' );
147
-        require_once( WPINV_PLUGIN_DIR . 'vendor/autoload.php' );
148
-
149
-        if ( !class_exists( 'WPInv_EUVat' ) ) {
150
-            require_once( WPINV_PLUGIN_DIR . 'includes/libraries/wpinv-euvat/class-wpinv-euvat.php' );
108
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-post-types.php');
109
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-email-functions.php');
110
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-general-functions.php');
111
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-helper-functions.php');
112
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-tax-functions.php');
113
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-template-functions.php');
114
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-address-functions.php');
115
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-invoice-functions.php');
116
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-item-functions.php');
117
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-discount-functions.php');
118
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-gateway-functions.php');
119
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-payment-functions.php');
120
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-user-functions.php');
121
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-error-functions.php');
122
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-invoice.php');
123
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-item.php');
124
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-notes.php');
125
+        require_once(WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-session.php');
126
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-session-handler.php');
127
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-ajax.php');
128
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-api.php');
129
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-reports.php');
130
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-cache-helper.php');
131
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-db.php');
132
+        require_once(WPINV_PLUGIN_DIR . 'includes/admin/subscriptions.php');
133
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions-db.php');
134
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions.php');
135
+        require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-subscription.php');
136
+        require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-subscriptions-list-table.php');
137
+        require_once(WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-privacy.php');
138
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-privacy.php');
139
+        require_once(WPINV_PLUGIN_DIR . 'includes/libraries/class-ayecode-addons.php');
140
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-addons.php');
141
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/checkout.php');
142
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-history.php');
143
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php');
144
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php');
145
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/subscriptions.php');
146
+	    require_once(WPINV_PLUGIN_DIR . 'widgets/buy-item.php');
147
+        require_once(WPINV_PLUGIN_DIR . 'vendor/autoload.php');
148
+
149
+        if (!class_exists('WPInv_EUVat')) {
150
+            require_once(WPINV_PLUGIN_DIR . 'includes/libraries/wpinv-euvat/class-wpinv-euvat.php');
151 151
         }
152 152
         
153
-        $gateways = array_keys( wpinv_get_enabled_payment_gateways() );
154
-        if ( !empty( $gateways ) ) {
155
-            foreach ( $gateways as $gateway ) {
156
-                if ( $gateway == 'manual' ) {
153
+        $gateways = array_keys(wpinv_get_enabled_payment_gateways());
154
+        if (!empty($gateways)) {
155
+            foreach ($gateways as $gateway) {
156
+                if ($gateway == 'manual') {
157 157
                     continue;
158 158
                 }
159 159
                 
160 160
                 $gateway_file = WPINV_PLUGIN_DIR . 'includes/gateways/' . $gateway . '.php';
161 161
                 
162
-                if ( file_exists( $gateway_file ) ) {
163
-                    require_once( $gateway_file );
162
+                if (file_exists($gateway_file)) {
163
+                    require_once($gateway_file);
164 164
                 }
165 165
             }
166 166
         }
167
-        require_once( WPINV_PLUGIN_DIR . 'includes/gateways/manual.php' );
167
+        require_once(WPINV_PLUGIN_DIR . 'includes/gateways/manual.php');
168 168
         
169
-        if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
170
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/wpinv-upgrade-functions.php' );
171
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/wpinv-admin-functions.php' );
172
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/admin-meta-boxes.php' );
169
+        if (is_admin() || (defined('WP_CLI') && WP_CLI)) {
170
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/wpinv-upgrade-functions.php');
171
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/wpinv-admin-functions.php');
172
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/admin-meta-boxes.php');
173 173
             //require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-recurring-admin.php' );
174
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-details.php' );
175
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-items.php' );
176
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-notes.php' );
177
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-address.php' );
178
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/admin-pages.php' );
179
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-admin-menus.php' );
180
-            require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-users.php' );
174
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-details.php');
175
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-items.php');
176
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-notes.php');
177
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-address.php');
178
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/admin-pages.php');
179
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-admin-menus.php');
180
+            require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-users.php');
181 181
             //require_once( WPINV_PLUGIN_DIR . 'includes/admin/subscriptions.php' );
182 182
             // load the user class only on the users.php page
183 183
             global $pagenow;
184
-            if($pagenow=='users.php'){
184
+            if ($pagenow == 'users.php') {
185 185
                 new WPInv_Admin_Users();
186 186
             }
187 187
         }
188 188
         
189 189
         // include css inliner
190
-        if ( ! class_exists( 'Emogrifier' ) && class_exists( 'DOMDocument' ) ) {
191
-            include_once( WPINV_PLUGIN_DIR . 'includes/libraries/class-emogrifier.php' );
190
+        if (!class_exists('Emogrifier') && class_exists('DOMDocument')) {
191
+            include_once(WPINV_PLUGIN_DIR . 'includes/libraries/class-emogrifier.php');
192 192
         }
193 193
         
194
-        require_once( WPINV_PLUGIN_DIR . 'includes/admin/install.php' );
194
+        require_once(WPINV_PLUGIN_DIR . 'includes/admin/install.php');
195 195
     }
196 196
     
197 197
     public function init() {
198 198
     }
199 199
     
200 200
     public function admin_init() {
201
-        add_action( 'admin_print_scripts-edit.php', array( &$this, 'admin_print_scripts_edit_php' ) );
201
+        add_action('admin_print_scripts-edit.php', array(&$this, 'admin_print_scripts_edit_php'));
202 202
     }
203 203
 
204 204
     public function activation_redirect() {
205 205
         // Bail if no activation redirect
206
-        if ( !get_transient( '_wpinv_activation_redirect' ) ) {
206
+        if (!get_transient('_wpinv_activation_redirect')) {
207 207
             return;
208 208
         }
209 209
 
210 210
         // Delete the redirect transient
211
-        delete_transient( '_wpinv_activation_redirect' );
211
+        delete_transient('_wpinv_activation_redirect');
212 212
 
213 213
         // Bail if activating from network, or bulk
214
-        if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
214
+        if (is_network_admin() || isset($_GET['activate-multi'])) {
215 215
             return;
216 216
         }
217 217
 
218
-        wp_safe_redirect( admin_url( 'admin.php?page=wpinv-settings&tab=general' ) );
218
+        wp_safe_redirect(admin_url('admin.php?page=wpinv-settings&tab=general'));
219 219
         exit;
220 220
     }
221 221
     
222 222
     public function enqueue_scripts() {
223
-        $suffix       = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
223
+        $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
224 224
         
225
-        wp_register_style( 'wpinv_front_style', WPINV_PLUGIN_URL . 'assets/css/invoice-front.css', array(), WPINV_VERSION );
226
-        wp_enqueue_style( 'wpinv_front_style' );
225
+        wp_register_style('wpinv_front_style', WPINV_PLUGIN_URL . 'assets/css/invoice-front.css', array(), WPINV_VERSION);
226
+        wp_enqueue_style('wpinv_front_style');
227 227
                
228 228
         // Register scripts
229
-        wp_register_script( 'jquery-blockui', WPINV_PLUGIN_URL . 'assets/js/jquery.blockUI.min.js', array( 'jquery' ), '2.70', true );
230
-        wp_register_script( 'wpinv-front-script', WPINV_PLUGIN_URL . 'assets/js/invoice-front.js', array( 'jquery' ),  WPINV_VERSION );
229
+        wp_register_script('jquery-blockui', WPINV_PLUGIN_URL . 'assets/js/jquery.blockUI.min.js', array('jquery'), '2.70', true);
230
+        wp_register_script('wpinv-front-script', WPINV_PLUGIN_URL . 'assets/js/invoice-front.js', array('jquery'), WPINV_VERSION);
231 231
 
232 232
         $localize                         = array();
233
-        $localize['ajax_url']             = admin_url( 'admin-ajax.php' );
234
-        $localize['nonce']                = wp_create_nonce( 'wpinv-nonce' );
233
+        $localize['ajax_url']             = admin_url('admin-ajax.php');
234
+        $localize['nonce']                = wp_create_nonce('wpinv-nonce');
235 235
         $localize['currency_symbol']      = wpinv_currency_symbol();
236 236
         $localize['currency_pos']         = wpinv_currency_position();
237 237
         $localize['thousand_sep']         = wpinv_thousands_separator();
238 238
         $localize['decimal_sep']          = wpinv_decimal_separator();
239 239
         $localize['decimals']             = wpinv_decimals();
240
-        $localize['txtComplete']          = __( 'Complete', 'invoicing' );
240
+        $localize['txtComplete']          = __('Complete', 'invoicing');
241 241
         $localize['UseTaxes']             = wpinv_use_taxes();
242
-        $localize['checkoutNonce']        = wp_create_nonce( 'wpinv_checkout_nonce' );
242
+        $localize['checkoutNonce']        = wp_create_nonce('wpinv_checkout_nonce');
243 243
 
244
-        $localize = apply_filters( 'wpinv_front_js_localize', $localize );
244
+        $localize = apply_filters('wpinv_front_js_localize', $localize);
245 245
         
246
-        wp_enqueue_script( 'jquery-blockui' );
246
+        wp_enqueue_script('jquery-blockui');
247 247
         $autofill_api = wpinv_get_option('address_autofill_api');
248 248
         $autofill_active = wpinv_get_option('address_autofill_active');
249
-        if ( isset( $autofill_active ) && 1 == $autofill_active && !empty( $autofill_api ) && wpinv_is_checkout() ) {
250
-            if ( wp_script_is( 'google-maps-api', 'enqueued' ) ) {
251
-                wp_dequeue_script( 'google-maps-api' );
249
+        if (isset($autofill_active) && 1 == $autofill_active && !empty($autofill_api) && wpinv_is_checkout()) {
250
+            if (wp_script_is('google-maps-api', 'enqueued')) {
251
+                wp_dequeue_script('google-maps-api');
252 252
             }
253
-            wp_enqueue_script( 'google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . $autofill_api . '&libraries=places', array( 'jquery' ), '', false );
254
-            wp_enqueue_script( 'google-maps-init', WPINV_PLUGIN_URL . 'assets/js/gaaf.js', array( 'jquery', 'google-maps-api' ), '', true );
253
+            wp_enqueue_script('google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . $autofill_api . '&libraries=places', array('jquery'), '', false);
254
+            wp_enqueue_script('google-maps-init', WPINV_PLUGIN_URL . 'assets/js/gaaf.js', array('jquery', 'google-maps-api'), '', true);
255 255
         }
256 256
 
257
-        wp_enqueue_style( "select2", WPINV_PLUGIN_URL . 'assets/css/select2/select2.css', array(), WPINV_VERSION, 'all' );
258
-        wp_enqueue_script('select2', WPINV_PLUGIN_URL . 'assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), WPINV_VERSION );
257
+        wp_enqueue_style("select2", WPINV_PLUGIN_URL . 'assets/css/select2/select2.css', array(), WPINV_VERSION, 'all');
258
+        wp_enqueue_script('select2', WPINV_PLUGIN_URL . 'assets/js/select2/select2.full' . $suffix . '.js', array('jquery'), WPINV_VERSION);
259 259
 
260
-        wp_enqueue_script( 'wpinv-front-script' );
261
-        wp_localize_script( 'wpinv-front-script', 'WPInv', $localize );
260
+        wp_enqueue_script('wpinv-front-script');
261
+        wp_localize_script('wpinv-front-script', 'WPInv', $localize);
262 262
     }
263 263
 
264 264
     public function admin_enqueue_scripts() {
265 265
         global $post, $pagenow;
266 266
         
267 267
         $post_type  = wpinv_admin_post_type();
268
-        $suffix     = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
269
-        $page       = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : '';
268
+        $suffix     = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
269
+        $page       = isset($_GET['page']) ? strtolower($_GET['page']) : '';
270 270
 
271 271
         $jquery_ui_css = false;
272
-        if ( ( $post_type == 'wpi_invoice' || $post_type == 'wpi_quote' || $post_type == 'wpi_discount' ) && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) ) {
272
+        if (($post_type == 'wpi_invoice' || $post_type == 'wpi_quote' || $post_type == 'wpi_discount') && ($pagenow == 'post-new.php' || $pagenow == 'post.php')) {
273 273
             $jquery_ui_css = true;
274
-        } else if ( $page == 'wpinv-settings' || $page == 'wpinv-reports' ) {
274
+        } else if ($page == 'wpinv-settings' || $page == 'wpinv-reports') {
275 275
             $jquery_ui_css = true;
276 276
         }
277
-        if ( $jquery_ui_css ) {
278
-            wp_register_style( 'jquery-ui-css', WPINV_PLUGIN_URL . 'assets/css/jquery-ui' . $suffix . '.css', array(), '1.8.16' );
279
-            wp_enqueue_style( 'jquery-ui-css' );
277
+        if ($jquery_ui_css) {
278
+            wp_register_style('jquery-ui-css', WPINV_PLUGIN_URL . 'assets/css/jquery-ui' . $suffix . '.css', array(), '1.8.16');
279
+            wp_enqueue_style('jquery-ui-css');
280 280
         }
281 281
 
282
-        wp_register_style( 'wpinv_meta_box_style', WPINV_PLUGIN_URL . 'assets/css/meta-box.css', array(), WPINV_VERSION );
283
-        wp_enqueue_style( 'wpinv_meta_box_style' );
282
+        wp_register_style('wpinv_meta_box_style', WPINV_PLUGIN_URL . 'assets/css/meta-box.css', array(), WPINV_VERSION);
283
+        wp_enqueue_style('wpinv_meta_box_style');
284 284
         
285
-        wp_register_style( 'wpinv_admin_style', WPINV_PLUGIN_URL . 'assets/css/admin.css', array(), WPINV_VERSION );
286
-        wp_enqueue_style( 'wpinv_admin_style' );
285
+        wp_register_style('wpinv_admin_style', WPINV_PLUGIN_URL . 'assets/css/admin.css', array(), WPINV_VERSION);
286
+        wp_enqueue_style('wpinv_admin_style');
287 287
 
288
-        $enqueue = ( $post_type == 'wpi_discount' || $post_type == 'wpi_invoice' && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) );
289
-        if ( $page == 'wpinv-subscriptions' ) {
290
-            wp_enqueue_script( 'jquery-ui-datepicker' );
288
+        $enqueue = ($post_type == 'wpi_discount' || $post_type == 'wpi_invoice' && ($pagenow == 'post-new.php' || $pagenow == 'post.php'));
289
+        if ($page == 'wpinv-subscriptions') {
290
+            wp_enqueue_script('jquery-ui-datepicker');
291 291
         }
292 292
         
293
-        if ( $enqueue_datepicker = apply_filters( 'wpinv_admin_enqueue_jquery_ui_datepicker', $enqueue ) ) {
294
-            wp_enqueue_script( 'jquery-ui-datepicker' );
293
+        if ($enqueue_datepicker = apply_filters('wpinv_admin_enqueue_jquery_ui_datepicker', $enqueue)) {
294
+            wp_enqueue_script('jquery-ui-datepicker');
295 295
         }
296 296
 
297
-        wp_enqueue_style( 'wp-color-picker' );
298
-        wp_enqueue_script( 'wp-color-picker' );
297
+        wp_enqueue_style('wp-color-picker');
298
+        wp_enqueue_script('wp-color-picker');
299 299
         
300
-        wp_register_script( 'jquery-blockui', WPINV_PLUGIN_URL . 'assets/js/jquery.blockUI.min.js', array( 'jquery' ), '2.70', true );
300
+        wp_register_script('jquery-blockui', WPINV_PLUGIN_URL . 'assets/js/jquery.blockUI.min.js', array('jquery'), '2.70', true);
301 301
 
302 302
         if (($post_type == 'wpi_invoice' || $post_type == 'wpi_quote') && ($pagenow == 'post-new.php' || $pagenow == 'post.php')) {
303 303
             $autofill_api = wpinv_get_option('address_autofill_api');
@@ -308,20 +308,20 @@  discard block
 block discarded – undo
308 308
             }
309 309
         }
310 310
 
311
-        wp_enqueue_style( "select2", WPINV_PLUGIN_URL . 'assets/css/select2/select2.css', array(), WPINV_VERSION, 'all' );
312
-        wp_enqueue_script('select2', WPINV_PLUGIN_URL . 'assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), WPINV_VERSION );
311
+        wp_enqueue_style("select2", WPINV_PLUGIN_URL . 'assets/css/select2/select2.css', array(), WPINV_VERSION, 'all');
312
+        wp_enqueue_script('select2', WPINV_PLUGIN_URL . 'assets/js/select2/select2.full' . $suffix . '.js', array('jquery'), WPINV_VERSION);
313 313
 
314
-        wp_register_script( 'wpinv-admin-script', WPINV_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-blockui','jquery-ui-tooltip' ),  WPINV_VERSION );
315
-        wp_enqueue_script( 'wpinv-admin-script' );
314
+        wp_register_script('wpinv-admin-script', WPINV_PLUGIN_URL . 'assets/js/admin.js', array('jquery', 'jquery-blockui', 'jquery-ui-tooltip'), WPINV_VERSION);
315
+        wp_enqueue_script('wpinv-admin-script');
316 316
         
317 317
         $localize                               = array();
318
-        $localize['ajax_url']                   = admin_url( 'admin-ajax.php' );
319
-        $localize['post_ID']                    = isset( $post->ID ) ? $post->ID : '';
320
-        $localize['wpinv_nonce']                = wp_create_nonce( 'wpinv-nonce' );
321
-        $localize['add_invoice_note_nonce']     = wp_create_nonce( 'add-invoice-note' );
322
-        $localize['delete_invoice_note_nonce']  = wp_create_nonce( 'delete-invoice-note' );
323
-        $localize['invoice_item_nonce']         = wp_create_nonce( 'invoice-item' );
324
-        $localize['billing_details_nonce']      = wp_create_nonce( 'get-billing-details' );
318
+        $localize['ajax_url']                   = admin_url('admin-ajax.php');
319
+        $localize['post_ID']                    = isset($post->ID) ? $post->ID : '';
320
+        $localize['wpinv_nonce']                = wp_create_nonce('wpinv-nonce');
321
+        $localize['add_invoice_note_nonce']     = wp_create_nonce('add-invoice-note');
322
+        $localize['delete_invoice_note_nonce']  = wp_create_nonce('delete-invoice-note');
323
+        $localize['invoice_item_nonce']         = wp_create_nonce('invoice-item');
324
+        $localize['billing_details_nonce']      = wp_create_nonce('get-billing-details');
325 325
         $localize['tax']                        = wpinv_tax_amount();
326 326
         $localize['discount']                   = wpinv_discount_amount();
327 327
         $localize['currency_symbol']            = wpinv_currency_symbol();
@@ -329,69 +329,69 @@  discard block
 block discarded – undo
329 329
         $localize['thousand_sep']               = wpinv_thousands_separator();
330 330
         $localize['decimal_sep']                = wpinv_decimal_separator();
331 331
         $localize['decimals']                   = wpinv_decimals();
332
-        $localize['save_invoice']               = __( 'Save Invoice', 'invoicing' );
333
-        $localize['status_publish']             = wpinv_status_nicename( 'publish' );
334
-        $localize['status_pending']             = wpinv_status_nicename( 'wpi-pending' );
335
-        $localize['delete_tax_rate']            = __( 'Are you sure you wish to delete this tax rate?', 'invoicing' );
336
-        $localize['OneItemMin']                 = __( 'Invoice must contain at least one item', 'invoicing' );
337
-        $localize['DeleteInvoiceItem']          = __( 'Are you sure you wish to delete this item?', 'invoicing' );
338
-        $localize['FillBillingDetails']         = __( 'Fill the user\'s billing information? This will remove any currently entered billing information', 'invoicing' );
339
-        $localize['confirmCalcTotals']          = __( 'Recalculate totals? This will recalculate totals based on the user billing country. If no billing country is set it will use the base country.', 'invoicing' );
340
-        $localize['AreYouSure']                 = __( 'Are you sure?', 'invoicing' );
341
-        $localize['emptyInvoice']               = __( 'Add at least one item to save invoice!', 'invoicing' );
342
-        $localize['errDeleteItem']              = __( 'This item is in use! Before delete this item, you need to delete all the invoice(s) using this item.', 'invoicing' );
343
-        $localize['delete_subscription']        = __( 'Are you sure you want to delete this subscription?', 'invoicing' );
344
-        $localize['action_edit']                = __( 'Edit', 'invoicing' );
345
-        $localize['action_cancel']              = __( 'Cancel', 'invoicing' );
346
-
347
-        $localize = apply_filters( 'wpinv_admin_js_localize', $localize );
348
-
349
-        wp_localize_script( 'wpinv-admin-script', 'WPInv_Admin', $localize );
350
-
351
-        if ( $page == 'wpinv-subscriptions' ) {
352
-            wp_register_script( 'wpinv-sub-admin-script', WPINV_PLUGIN_URL . 'assets/js/subscriptions.js', array( 'wpinv-admin-script' ),  WPINV_VERSION );
353
-            wp_enqueue_script( 'wpinv-sub-admin-script' );
332
+        $localize['save_invoice']               = __('Save Invoice', 'invoicing');
333
+        $localize['status_publish']             = wpinv_status_nicename('publish');
334
+        $localize['status_pending']             = wpinv_status_nicename('wpi-pending');
335
+        $localize['delete_tax_rate']            = __('Are you sure you wish to delete this tax rate?', 'invoicing');
336
+        $localize['OneItemMin']                 = __('Invoice must contain at least one item', 'invoicing');
337
+        $localize['DeleteInvoiceItem']          = __('Are you sure you wish to delete this item?', 'invoicing');
338
+        $localize['FillBillingDetails']         = __('Fill the user\'s billing information? This will remove any currently entered billing information', 'invoicing');
339
+        $localize['confirmCalcTotals']          = __('Recalculate totals? This will recalculate totals based on the user billing country. If no billing country is set it will use the base country.', 'invoicing');
340
+        $localize['AreYouSure']                 = __('Are you sure?', 'invoicing');
341
+        $localize['emptyInvoice']               = __('Add at least one item to save invoice!', 'invoicing');
342
+        $localize['errDeleteItem']              = __('This item is in use! Before delete this item, you need to delete all the invoice(s) using this item.', 'invoicing');
343
+        $localize['delete_subscription']        = __('Are you sure you want to delete this subscription?', 'invoicing');
344
+        $localize['action_edit']                = __('Edit', 'invoicing');
345
+        $localize['action_cancel']              = __('Cancel', 'invoicing');
346
+
347
+        $localize = apply_filters('wpinv_admin_js_localize', $localize);
348
+
349
+        wp_localize_script('wpinv-admin-script', 'WPInv_Admin', $localize);
350
+
351
+        if ($page == 'wpinv-subscriptions') {
352
+            wp_register_script('wpinv-sub-admin-script', WPINV_PLUGIN_URL . 'assets/js/subscriptions.js', array('wpinv-admin-script'), WPINV_VERSION);
353
+            wp_enqueue_script('wpinv-sub-admin-script');
354 354
         }
355 355
     }
356 356
     
357
-    public function admin_body_class( $classes ) {
357
+    public function admin_body_class($classes) {
358 358
         global $pagenow, $post, $current_screen;
359 359
         
360
-        if ( !empty( $current_screen->post_type ) && ( $current_screen->post_type == 'wpi_invoice' || $current_screen->post_type == 'wpi_quote' ) ) {
360
+        if (!empty($current_screen->post_type) && ($current_screen->post_type == 'wpi_invoice' || $current_screen->post_type == 'wpi_quote')) {
361 361
             $classes .= ' wpinv-cpt';
362 362
         }
363 363
         
364
-        $page = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false;
364
+        $page = isset($_GET['page']) ? strtolower($_GET['page']) : false;
365 365
 
366
-        $add_class = $page && $pagenow == 'admin.php' && strpos( $page, 'wpinv-' ) === 0 ? true : false;
367
-        if ( $add_class ) {
368
-            $classes .= ' wpi-' . wpinv_sanitize_key( $page );
366
+        $add_class = $page && $pagenow == 'admin.php' && strpos($page, 'wpinv-') === 0 ? true : false;
367
+        if ($add_class) {
368
+            $classes .= ' wpi-' . wpinv_sanitize_key($page);
369 369
         }
370 370
         
371 371
         $settings_class = array();
372
-        if ( $page == 'wpinv-settings' ) {
373
-            if ( !empty( $_REQUEST['tab'] ) ) {
374
-                $settings_class[] = sanitize_text_field( $_REQUEST['tab'] );
372
+        if ($page == 'wpinv-settings') {
373
+            if (!empty($_REQUEST['tab'])) {
374
+                $settings_class[] = sanitize_text_field($_REQUEST['tab']);
375 375
             }
376 376
             
377
-            if ( !empty( $_REQUEST['section'] ) ) {
378
-                $settings_class[] = sanitize_text_field( $_REQUEST['section'] );
377
+            if (!empty($_REQUEST['section'])) {
378
+                $settings_class[] = sanitize_text_field($_REQUEST['section']);
379 379
             }
380 380
             
381
-            $settings_class[] = isset( $_REQUEST['wpi_sub'] ) && $_REQUEST['wpi_sub'] !== '' ? sanitize_text_field( $_REQUEST['wpi_sub'] ) : 'main';
381
+            $settings_class[] = isset($_REQUEST['wpi_sub']) && $_REQUEST['wpi_sub'] !== '' ? sanitize_text_field($_REQUEST['wpi_sub']) : 'main';
382 382
         }
383 383
         
384
-        if ( !empty( $settings_class ) ) {
385
-            $classes .= ' wpi-' . wpinv_sanitize_key( implode( $settings_class, '-' ) );
384
+        if (!empty($settings_class)) {
385
+            $classes .= ' wpi-' . wpinv_sanitize_key(implode($settings_class, '-'));
386 386
         }
387 387
         
388 388
         $post_type = wpinv_admin_post_type();
389 389
 
390
-        if ( $post_type == 'wpi_invoice' || $post_type == 'wpi_quote' || $add_class !== false ) {
390
+        if ($post_type == 'wpi_invoice' || $post_type == 'wpi_quote' || $add_class !== false) {
391 391
             return $classes .= ' wpinv';
392 392
         }
393 393
         
394
-        if ( $pagenow == 'post.php' && $post_type == 'wpi_item' && !empty( $post ) && !wpinv_item_is_editable( $post ) ) {
394
+        if ($pagenow == 'post.php' && $post_type == 'wpi_item' && !empty($post) && !wpinv_item_is_editable($post)) {
395 395
             $classes .= ' wpi-editable-n';
396 396
         }
397 397
 
@@ -403,21 +403,21 @@  discard block
 block discarded – undo
403 403
     }
404 404
     
405 405
     public function wpinv_actions() {
406
-        if ( isset( $_REQUEST['wpi_action'] ) ) {
407
-            do_action( 'wpinv_' . wpinv_sanitize_key( $_REQUEST['wpi_action'] ), $_REQUEST );
406
+        if (isset($_REQUEST['wpi_action'])) {
407
+            do_action('wpinv_' . wpinv_sanitize_key($_REQUEST['wpi_action']), $_REQUEST);
408 408
         }
409 409
     }
410 410
     
411
-    public function pre_get_posts( $wp_query ) {
412
-        if ( !empty( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] == 'wpi_invoice' && is_user_logged_in() && is_single() && $wp_query->is_main_query() ) {
413
-            $wp_query->query_vars['post_status'] = array_keys( wpinv_get_invoice_statuses() );
411
+    public function pre_get_posts($wp_query) {
412
+        if (!empty($wp_query->query_vars['post_type']) && $wp_query->query_vars['post_type'] == 'wpi_invoice' && is_user_logged_in() && is_single() && $wp_query->is_main_query()) {
413
+            $wp_query->query_vars['post_status'] = array_keys(wpinv_get_invoice_statuses());
414 414
         }
415 415
         
416 416
         return $wp_query;
417 417
     }
418 418
     
419 419
     public function bp_invoicing_init() {
420
-        require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-bp-core.php' );
420
+        require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-bp-core.php');
421 421
     }
422 422
 
423 423
 	/**
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
 	 *
426 426
 	 */
427 427
 	public function register_widgets() {
428
-		register_widget( "WPInv_Checkout_Widget" );
429
-		register_widget( "WPInv_History_Widget" );
430
-		register_widget( "WPInv_Receipt_Widget" );
431
-		register_widget( "WPInv_Subscriptions_Widget" );
432
-		register_widget( "WPInv_Buy_Item_Widget" );
433
-		register_widget( "WPInv_Messages_Widget" );
428
+		register_widget("WPInv_Checkout_Widget");
429
+		register_widget("WPInv_History_Widget");
430
+		register_widget("WPInv_Receipt_Widget");
431
+		register_widget("WPInv_Subscriptions_Widget");
432
+		register_widget("WPInv_Buy_Item_Widget");
433
+		register_widget("WPInv_Messages_Widget");
434 434
 	}
435 435
 }
436 436
\ No newline at end of file
Please login to merge, or discard this patch.
widgets/buy-item.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -38,29 +38,29 @@  discard block
 block discarded – undo
38 38
                     'advanced'    => false
39 39
                 ),
40 40
                 'buy_items'  => array(
41
-	                'title'       => __( 'Items to buy', 'invoicing' ),
42
-	                'desc'        => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2 ', 'invoicing' ),
43
-	                'type'        => 'text',
44
-	                'desc_tip'    => true,
45
-	                'default'     => '',
46
-	                'placeholder' => __('Items to buy','invoicing'),
47
-	                'advanced'    => false
41
+                    'title'       => __( 'Items to buy', 'invoicing' ),
42
+                    'desc'        => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2 ', 'invoicing' ),
43
+                    'type'        => 'text',
44
+                    'desc_tip'    => true,
45
+                    'default'     => '',
46
+                    'placeholder' => __('Items to buy','invoicing'),
47
+                    'advanced'    => false
48 48
                 ),
49 49
                 'button_label'  => array(
50
-	                'title'       => __( 'Button Label', 'invoicing' ),
51
-	                'desc'        => __( 'Enter button label. Default "Buy Now".', 'invoicing' ),
52
-	                'type'        => 'text',
53
-	                'desc_tip'    => true,
54
-	                'default'     => '',
55
-	                'advanced'    => true
50
+                    'title'       => __( 'Button Label', 'invoicing' ),
51
+                    'desc'        => __( 'Enter button label. Default "Buy Now".', 'invoicing' ),
52
+                    'type'        => 'text',
53
+                    'desc_tip'    => true,
54
+                    'default'     => '',
55
+                    'advanced'    => true
56 56
                 ),
57 57
                 'post_id'  => array(
58
-	                'title'       => __( 'Post ID', 'invoicing' ),
59
-	                'desc'        => __( 'Enter related post ID. This is for 3rd party add ons and not mandatory field.', 'invoicing' ),
60
-	                'type'        => 'number',
61
-	                'desc_tip'    => true,
62
-	                'default'     => '',
63
-	                'advanced'    => true
58
+                    'title'       => __( 'Post ID', 'invoicing' ),
59
+                    'desc'        => __( 'Enter related post ID. This is for 3rd party add ons and not mandatory field.', 'invoicing' ),
60
+                    'type'        => 'number',
61
+                    'desc_tip'    => true,
62
+                    'default'     => '',
63
+                    'advanced'    => true
64 64
                 ),
65 65
             )
66 66
 
@@ -70,36 +70,36 @@  discard block
 block discarded – undo
70 70
         parent::__construct( $options );
71 71
     }
72 72
 
73
-	/**
74
-	 * The Super block output function.
75
-	 *
76
-	 * @param array $args
77
-	 * @param array $widget_args
78
-	 * @param string $content
79
-	 *
80
-	 * @return string
81
-	 */
73
+    /**
74
+     * The Super block output function.
75
+     *
76
+     * @param array $args
77
+     * @param array $widget_args
78
+     * @param string $content
79
+     *
80
+     * @return string
81
+     */
82 82
     public function output( $args = array(), $widget_args = array(), $content = '' ) {
83 83
 
84
-	    $defaults = array(
85
-		    'buy_items'     => '', // should be used like: item_id|quantity,item_id|quantity,item_id|quantity
86
-		    'button_label'  => __( 'Buy Now', 'invoicing' ), // the button title
87
-		    'post_id'   => '', // any related post_id
88
-	    );
84
+        $defaults = array(
85
+            'buy_items'     => '', // should be used like: item_id|quantity,item_id|quantity,item_id|quantity
86
+            'button_label'  => __( 'Buy Now', 'invoicing' ), // the button title
87
+            'post_id'   => '', // any related post_id
88
+        );
89 89
 
90
-	    /**
91
-	     * Parse incoming $args into an array and merge it with $defaults
92
-	     */
93
-	    $args = wp_parse_args( $args, $defaults );
90
+        /**
91
+         * Parse incoming $args into an array and merge it with $defaults
92
+         */
93
+        $args = wp_parse_args( $args, $defaults );
94 94
 
95
-	    $post_id = isset( $args['post_id'] ) ? (int)$args['post_id'] : 0;
95
+        $post_id = isset( $args['post_id'] ) ? (int)$args['post_id'] : 0;
96 96
 
97
-	    $html = '<div class="wpi-buy-button-wrapper wpi-g">';
98
-	    $html .= '<button class="button button-primary wpi-buy-button" type="button" onclick="wpi_buy(this,\'' . $args['buy_items'] . '\',' . $post_id . ');">' . $args['button_label'] . '</button>';
99
-	    $html .= wp_nonce_field( 'wpinv_buy_items', 'wpinv_buy_nonce', true, false );
100
-	    $html .= '</div>';
97
+        $html = '<div class="wpi-buy-button-wrapper wpi-g">';
98
+        $html .= '<button class="button button-primary wpi-buy-button" type="button" onclick="wpi_buy(this,\'' . $args['buy_items'] . '\',' . $post_id . ');">' . $args['button_label'] . '</button>';
99
+        $html .= wp_nonce_field( 'wpinv_buy_items', 'wpinv_buy_nonce', true, false );
100
+        $html .= '</div>';
101 101
 
102
-	    return $html;
102
+        return $html;
103 103
 
104 104
     }
105 105
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
     exit;
4 4
 }
5 5
 
@@ -23,40 +23,40 @@  discard block
 block discarded – undo
23 23
             'block-keywords'=> "['invoicing','buy', 'buy item']",
24 24
             'class_name'     => __CLASS__,
25 25
             'base_id'       => 'wpinv_buy',
26
-            'name'          => __('Invoicing > Buy Item Button','invoicing'),
26
+            'name'          => __('Invoicing > Buy Item Button', 'invoicing'),
27 27
             'widget_ops'    => array(
28 28
                 'classname'   => 'wpinv-buy-item-class',
29
-                'description' => esc_html__('Displays buy invoicing item button.','invoicing'),
29
+                'description' => esc_html__('Displays buy invoicing item button.', 'invoicing'),
30 30
             ),
31 31
             'arguments'     => array(
32 32
                 'title'  => array(
33
-                    'title'       => __( 'Widget title', 'invoicing' ),
34
-                    'desc'        => __( 'Enter widget title.', 'invoicing' ),
33
+                    'title'       => __('Widget title', 'invoicing'),
34
+                    'desc'        => __('Enter widget title.', 'invoicing'),
35 35
                     'type'        => 'text',
36 36
                     'desc_tip'    => true,
37 37
                     'default'     => '',
38 38
                     'advanced'    => false
39 39
                 ),
40 40
                 'buy_items'  => array(
41
-	                'title'       => __( 'Items to buy', 'invoicing' ),
42
-	                'desc'        => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2 ', 'invoicing' ),
41
+	                'title'       => __('Items to buy', 'invoicing'),
42
+	                'desc'        => __('Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2 ', 'invoicing'),
43 43
 	                'type'        => 'text',
44 44
 	                'desc_tip'    => true,
45 45
 	                'default'     => '',
46
-	                'placeholder' => __('Items to buy','invoicing'),
46
+	                'placeholder' => __('Items to buy', 'invoicing'),
47 47
 	                'advanced'    => false
48 48
                 ),
49 49
                 'button_label'  => array(
50
-	                'title'       => __( 'Button Label', 'invoicing' ),
51
-	                'desc'        => __( 'Enter button label. Default "Buy Now".', 'invoicing' ),
50
+	                'title'       => __('Button Label', 'invoicing'),
51
+	                'desc'        => __('Enter button label. Default "Buy Now".', 'invoicing'),
52 52
 	                'type'        => 'text',
53 53
 	                'desc_tip'    => true,
54 54
 	                'default'     => '',
55 55
 	                'advanced'    => true
56 56
                 ),
57 57
                 'post_id'  => array(
58
-	                'title'       => __( 'Post ID', 'invoicing' ),
59
-	                'desc'        => __( 'Enter related post ID. This is for 3rd party add ons and not mandatory field.', 'invoicing' ),
58
+	                'title'       => __('Post ID', 'invoicing'),
59
+	                'desc'        => __('Enter related post ID. This is for 3rd party add ons and not mandatory field.', 'invoicing'),
60 60
 	                'type'        => 'number',
61 61
 	                'desc_tip'    => true,
62 62
 	                'default'     => '',
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         );
68 68
 
69 69
 
70
-        parent::__construct( $options );
70
+        parent::__construct($options);
71 71
     }
72 72
 
73 73
 	/**
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @return string
81 81
 	 */
82
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
82
+    public function output($args = array(), $widget_args = array(), $content = '') {
83 83
 
84 84
 	    $defaults = array(
85 85
 		    'buy_items'     => '', // should be used like: item_id|quantity,item_id|quantity,item_id|quantity
86
-		    'button_label'  => __( 'Buy Now', 'invoicing' ), // the button title
86
+		    'button_label'  => __('Buy Now', 'invoicing'), // the button title
87 87
 		    'post_id'   => '', // any related post_id
88 88
 	    );
89 89
 
90 90
 	    /**
91 91
 	     * Parse incoming $args into an array and merge it with $defaults
92 92
 	     */
93
-	    $args = wp_parse_args( $args, $defaults );
93
+	    $args = wp_parse_args($args, $defaults);
94 94
 
95
-	    $post_id = isset( $args['post_id'] ) ? (int)$args['post_id'] : 0;
95
+	    $post_id = isset($args['post_id']) ? (int)$args['post_id'] : 0;
96 96
 
97 97
 	    $html = '<div class="wpi-buy-button-wrapper wpi-g">';
98 98
 	    $html .= '<button class="button button-primary wpi-buy-button" type="button" onclick="wpi_buy(this,\'' . $args['buy_items'] . '\',' . $post_id . ');">' . $args['button_label'] . '</button>';
99
-	    $html .= wp_nonce_field( 'wpinv_buy_items', 'wpinv_buy_nonce', true, false );
99
+	    $html .= wp_nonce_field('wpinv_buy_items', 'wpinv_buy_nonce', true, false);
100 100
 	    $html .= '</div>';
101 101
 
102 102
 	    return $html;
Please login to merge, or discard this patch.