Passed
Push — master ( 55fff1...2692d4 )
by Brian
16:18
created
widgets/getpaid.php 1 patch
Spacing   +36 added lines, -36 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,16 +22,16 @@  discard block
 block discarded – undo
22 22
             'block-keywords' => "['invoicing','buy', 'buy item', 'form']",
23 23
             'class_name'     => __CLASS__,
24 24
             'base_id'        => 'getpaid',
25
-            'name'           => __( 'GetPaid', 'invoicing' ),
25
+            'name'           => __('GetPaid', 'invoicing'),
26 26
             'widget_ops'     => array(
27 27
                 'classname'   => 'getpaid bsui',
28
-                'description' => esc_html__( 'Show payment forms or buttons.', 'invoicing' ),
28
+                'description' => esc_html__('Show payment forms or buttons.', 'invoicing'),
29 29
             ),
30 30
             'arguments'      => array(
31 31
 
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'  => '',
@@ -39,28 +39,28 @@  discard block
 block discarded – undo
39 39
 				),
40 40
 
41 41
                 'form'   => array(
42
-	                'title'       => __( 'Form', 'invoicing' ),
43
-	                'desc'        => __( 'Enter a form id in case you want to display a specific payment form', 'invoicing' ),
42
+	                'title'       => __('Form', 'invoicing'),
43
+	                'desc'        => __('Enter a form id in case you want to display a specific payment form', 'invoicing'),
44 44
 	                'type'        => 'text',
45 45
 	                'desc_tip'    => true,
46 46
 	                'default'     => '',
47
-	                'placeholder' => __( '1', 'invoicing' ),
47
+	                'placeholder' => __('1', 'invoicing'),
48 48
 	                'advanced'    => false,
49 49
 				),
50 50
 
51 51
 				'item'   => array(
52
-	                'title'       => __( 'Items', 'invoicing' ),
53
-	                'desc'        => __( 'Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing' ),
52
+	                'title'       => __('Items', 'invoicing'),
53
+	                'desc'        => __('Enter comma separated list of invoicing item id and quantity (item_id|quantity). Ex. 101|2. This will be ignored in case you specify a form above. Enter 0 as the quantity to let users select their own quantities', 'invoicing'),
54 54
 	                'type'        => 'text',
55 55
 	                'desc_tip'    => true,
56 56
 	                'default'     => '',
57
-	                'placeholder' => __( '1', 'invoicing' ),
57
+	                'placeholder' => __('1', 'invoicing'),
58 58
 	                'advanced'    => false,
59 59
 				),
60 60
 
61 61
                 'button' => array(
62
-	                'title'    => __( 'Button', 'invoicing' ),
63
-	                'desc'     => __( 'Enter button label in case you would like to display the forms in a popup.', 'invoicing' ),
62
+	                'title'    => __('Button', 'invoicing'),
63
+	                'desc'     => __('Enter button label in case you would like to display the forms in a popup.', 'invoicing'),
64 64
 	                'type'     => 'text',
65 65
 	                'desc_tip' => true,
66 66
 	                'default'  => '',
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         );
73 73
 
74
-        parent::__construct( $options );
74
+        parent::__construct($options);
75 75
     }
76 76
 
77 77
 	/**
@@ -83,23 +83,23 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return string
85 85
 	 */
86
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
86
+    public function output($args = array(), $widget_args = array(), $content = '') {
87 87
 
88 88
 	    // Is the shortcode set up correctly?
89
-		if ( empty( $args['form'] ) && empty( $args['item'] ) ) {
89
+		if (empty($args['form']) && empty($args['item'])) {
90 90
 			return aui()->alert(
91 91
 				array(
92 92
 					'type'    => 'warning',
93
-					'content' => __( 'No payment form or item selected', 'invoicing' ),
93
+					'content' => __('No payment form or item selected', 'invoicing'),
94 94
 				)
95 95
 			);
96 96
 		}
97 97
 
98 98
 		// Payment form or button?
99
-		if ( ! empty( $args['form'] ) ) {
100
-			return $this->handle_payment_form( $args );
99
+		if (!empty($args['form'])) {
100
+			return $this->handle_payment_form($args);
101 101
 		} else {
102
-			return $this->handle_buy_item( $args );
102
+			return $this->handle_buy_item($args);
103 103
 		}
104 104
 
105 105
 	}
@@ -109,15 +109,15 @@  discard block
 block discarded – undo
109 109
 	 *
110 110
 	 * @return string
111 111
 	 */
112
-    protected function handle_payment_form( $args = array() ) {
112
+    protected function handle_payment_form($args = array()) {
113 113
 
114
-		if ( empty( $args['button'] ) ) {
114
+		if (empty($args['button'])) {
115 115
 			ob_start();
116
-			getpaid_display_payment_form( $args['form'] );
116
+			getpaid_display_payment_form($args['form']);
117 117
 			return ob_get_clean();
118 118
 		}
119 119
 
120
-		return $this->payment_form_button( $args['form'], $args['button'] );
120
+		return $this->payment_form_button($args['form'], $args['button']);
121 121
 	}
122 122
 
123 123
 	/**
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return string
127 127
 	 */
128
-    protected function payment_form_button( $form, $button ) {
129
-		return getpaid_get_payment_button( $button, $form );
128
+    protected function payment_form_button($form, $button) {
129
+		return getpaid_get_payment_button($button, $form);
130 130
 	}
131 131
 
132 132
 	/**
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
 	 *
135 135
 	 * @return string
136 136
 	 */
137
-    protected function handle_buy_item( $args = array() ) {
137
+    protected function handle_buy_item($args = array()) {
138 138
 
139
-		if ( empty( $args['button'] ) ) {
140
-			return $this->buy_item_form( $args['item'] );
139
+		if (empty($args['button'])) {
140
+			return $this->buy_item_form($args['item']);
141 141
 		}
142 142
 
143
-		return $this->buy_item_button( $args['item'], $args['button'] );
143
+		return $this->buy_item_button($args['item'], $args['button']);
144 144
 
145 145
 	}
146 146
 
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @return string
151 151
 	 */
152
-    protected function buy_item_form( $item ) {
153
-		$items = getpaid_convert_items_to_array( $item );
152
+    protected function buy_item_form($item) {
153
+		$items = getpaid_convert_items_to_array($item);
154 154
 		ob_start();
155
-		getpaid_display_item_payment_form( $items );
155
+		getpaid_display_item_payment_form($items);
156 156
 		return ob_get_clean();
157 157
 	}
158 158
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 	 *
162 162
 	 * @return string
163 163
 	 */
164
-    protected function buy_item_button( $item, $button ) {
165
-		$button = getpaid_get_payment_button( $button, null, $item );
166
-		return apply_filters( 'getpaid_buy_item_button_widget', $button, $item );
164
+    protected function buy_item_button($item, $button) {
165
+		$button = getpaid_get_payment_button($button, null, $item);
166
+		return apply_filters('getpaid_buy_item_button_widget', $button, $item);
167 167
     }
168 168
 
169 169
 }
Please login to merge, or discard this patch.
widgets/invoice-receipt.php 1 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
 
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
             'block-keywords' => "['invoicing','receipt']",
22 22
             'class_name'     => __CLASS__,
23 23
             'base_id'        => 'wpinv_receipt',
24
-            'name'           => __( 'GetPaid > Invoice Receipt', 'invoicing' ),
24
+            'name'           => __('GetPaid > Invoice Receipt', 'invoicing'),
25 25
             'widget_ops'     => array(
26 26
                 'classname'   => 'wpinv-receipt-class bsui',
27
-                'description' => esc_html__( 'Displays invoice receipt after checkout.', 'invoicing' ),
27
+                'description' => esc_html__('Displays invoice receipt after checkout.', 'invoicing'),
28 28
             ),
29 29
             'arguments'      => array(
30 30
                 'title' => array(
31
-                    'title'    => __( 'Widget title', 'invoicing' ),
32
-                    'desc'     => __( 'Enter widget title.', 'invoicing' ),
31
+                    'title'    => __('Widget title', 'invoicing'),
32
+                    'desc'     => __('Enter widget title.', 'invoicing'),
33 33
                     'type'     => 'text',
34 34
                     'desc_tip' => true,
35 35
                     'default'  => '',
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         );
41 41
 
42
-        parent::__construct( $options );
42
+        parent::__construct($options);
43 43
     }
44 44
 
45 45
 	/**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 *
52 52
 	 * @return mixed|string|bool
53 53
 	 */
54
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
54
+    public function output($args = array(), $widget_args = array(), $content = '') {
55 55
         return wpinv_payment_receipt();
56 56
     }
57 57
 
Please login to merge, or discard this patch.
widgets/invoice-messages.php 1 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
 
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
             'block-keywords' => "['invoicing','history']",
22 22
             'class_name'     => __CLASS__,
23 23
             'base_id'        => 'wpinv_messages',
24
-            'name'           => __( 'GetPaid > Invoice Messages', 'invoicing' ),
24
+            'name'           => __('GetPaid > Invoice Messages', 'invoicing'),
25 25
             'widget_ops'     => array(
26 26
                 'classname'   => 'wpinv-messages-class  wpi-g',
27
-                'description' => esc_html__( 'Displays invoice error and warning messages on checkout page.', 'invoicing' ),
27
+                'description' => esc_html__('Displays invoice error and warning messages on checkout page.', 'invoicing'),
28 28
             ),
29 29
             'arguments'      => array(
30 30
                 'title' => array(
31
-                    'title'    => __( 'Widget title', 'invoicing' ),
32
-                    'desc'     => __( 'Enter widget title.', 'invoicing' ),
31
+                    'title'    => __('Widget title', 'invoicing'),
32
+                    'desc'     => __('Enter widget title.', 'invoicing'),
33 33
                     'type'     => 'text',
34 34
                     'desc_tip' => true,
35 35
                     'default'  => '',
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         );
41 41
 
42
-        parent::__construct( $options );
42
+        parent::__construct($options);
43 43
     }
44 44
 
45 45
 	/**
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 *
52 52
 	 * @return mixed|string|bool
53 53
 	 */
54
-    public function output( $args = array(), $widget_args = array(), $content = '' ) {
54
+    public function output($args = array(), $widget_args = array(), $content = '') {
55 55
 
56 56
 	    ob_start();
57 57
 
Please login to merge, or discard this patch.
templates/invoice/header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
             <div class="row">
17 17
 
18 18
                 <div class="col-12 col-sm-6 text-sm-left pl-sm-0">
19
-                    <?php do_action( 'getpaid_invoice_header_left', $invoice ); ?>
19
+                    <?php do_action('getpaid_invoice_header_left', $invoice); ?>
20 20
                 </div>
21 21
 
22 22
                 <div class="col-12 col-sm-6 text-sm-right pr-sm-0">
23
-                    <?php do_action( 'getpaid_invoice_header_right', $invoice ); ?>
23
+                    <?php do_action('getpaid_invoice_header_right', $invoice); ?>
24 24
                 </div>
25 25
 
26 26
             </div>
Please login to merge, or discard this patch.
templates/invoice/invoice-logo.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$logo_width  = wpinv_get_option( 'logo_width' );
13
-$logo_height = wpinv_get_option( 'logo_height' );
12
+$logo_width  = wpinv_get_option('logo_width');
13
+$logo_height = wpinv_get_option('logo_height');
14 14
 
15 15
 ?>
16
-<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
16
+<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
17 17
 
18
-    <?php if ( $logo = wpinv_get_business_logo() ) : ?>
18
+    <?php if ($logo = wpinv_get_business_logo()) : ?>
19 19
 
20
-        <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?>
21
-            <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>">
20
+        <?php if (!empty($logo_width) && !empty($logo_height)) : ?>
21
+            <img class="logo" style="max-width:100%; width:<?php echo absint($logo_width); ?>px; height:<?php echo absint($logo_height); ?>px;" src="<?php echo esc_url($logo); ?>">
22 22
         <?php else : ?>
23
-            <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>">
23
+            <img class="logo" style="max-width:100%;" src="<?php echo esc_url($logo); ?>">
24 24
         <?php endif; ?>
25 25
 
26 26
     <?php else : ?>
27
-        <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1>
27
+        <h1 class="h3"><?php echo esc_html(wpinv_get_business_name()); ?></h1>
28 28
     <?php endif; ?>
29 29
 
30 30
 </a>
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/separator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 ?>
12 12
 
13 13
 <hr class="featurette-divider" />
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/heading.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 ?>
14 14
 <component :is='form_element.level' v-html='form_element.text'></component>
Please login to merge, or discard this patch.
templates/payment-forms/elements/items.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,44 +7,44 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $form->get_items() ) ) {
12
+if (empty($form->get_items())) {
13 13
     return;
14 14
 }
15 15
 
16
-if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) {
16
+if (!empty($GLOBALS['getpaid_force_checkbox'])) {
17 17
     $items_type = 'checkbox';
18 18
 }
19 19
 
20
-if ( empty( $items_type ) ) {
20
+if (empty($items_type)) {
21 21
     $items_type = 'total';
22 22
 }
23 23
 
24
-do_action( 'getpaid_before_payment_form_items', $form );
24
+do_action('getpaid_before_payment_form_items', $form);
25 25
 
26
-switch ( $items_type ) {
26
+switch ($items_type) {
27 27
     case 'radio':
28
-        wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) );
28
+        wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type'));
29 29
         break;
30 30
     case 'checkbox':
31
-        wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) );
31
+        wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type'));
32 32
         break;
33 33
     case 'select':
34
-        wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) );
34
+        wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type'));
35 35
         break;
36 36
 }
37 37
 
38
-do_action( 'getpaid_before_payment_form_cart', $form );
38
+do_action('getpaid_before_payment_form_cart', $form);
39 39
 
40 40
 // Display the cart totals.
41
-if ( ! empty( $hide_cart ) ) {
41
+if (!empty($hide_cart)) {
42 42
     echo '<div class="d-none">';
43 43
 }
44 44
 
45 45
 // Display the cart totals.
46
-wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) );
46
+wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type'));
47 47
 
48
-if ( ! empty( $hide_cart ) ) {
48
+if (!empty($hide_cart)) {
49 49
     echo '</div>';
50 50
 }
Please login to merge, or discard this patch.
includes/class-getpaid-post-types.php 1 patch
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  *
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit;
9
+defined('ABSPATH') || exit;
10 10
 
11 11
 /**
12 12
  * Post types Class
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 * Hook in methods.
19 19
 	 */
20 20
 	public function __construct() {
21
-		add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 );
22
-		add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 );
23
-		add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) );
24
-		add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) );
21
+		add_action('init', array(__CLASS__, 'register_post_types'), 1);
22
+		add_action('init', array(__CLASS__, 'register_post_status'), 4);
23
+		add_action('getpaid_flush_rewrite_rules', array(__CLASS__, 'flush_rewrite_rules'));
24
+		add_action('getpaid_after_register_post_types', array(__CLASS__, 'maybe_flush_rewrite_rules'));
25 25
 	}
26 26
 
27 27
 	/**
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public static function register_post_types() {
31 31
 
32
-		if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) {
32
+		if (!is_blog_installed() || post_type_exists('wpi_item')) {
33 33
 			return;
34 34
 		}
35 35
 
36 36
 		$capabilities = wpinv_current_user_can_manage_invoicing();
37 37
 
38 38
 		// Fires before registering post types.
39
-		do_action( 'getpaid_register_post_types' );
39
+		do_action('getpaid_register_post_types');
40 40
 
41 41
 		// Register item post type.
42 42
 		register_post_type(
@@ -45,29 +45,29 @@  discard block
 block discarded – undo
45 45
 				'wpinv_register_post_type_invoice_item',
46 46
 				array(
47 47
 					'labels'            => array(
48
-						'name'               => _x( 'Items', 'post type general name', 'invoicing' ),
49
-						'singular_name'      => _x( 'Item', 'post type singular name', 'invoicing' ),
50
-						'menu_name'          => _x( 'Items', 'admin menu', 'invoicing' ),
51
-						'name_admin_bar'     => _x( 'Item', 'add new on admin bar', 'invoicing' ),
52
-						'add_new'            => _x( 'Add New', 'Item', 'invoicing' ),
53
-						'add_new_item'       => __( 'Add New Item', 'invoicing' ),
54
-						'new_item'           => __( 'New Item', 'invoicing' ),
55
-						'edit_item'          => __( 'Edit Item', 'invoicing' ),
56
-						'view_item'          => __( 'View Item', 'invoicing' ),
57
-						'all_items'          => __( 'Items', 'invoicing' ),
58
-						'search_items'       => __( 'Search items', 'invoicing' ),
59
-						'parent_item_colon'  => __( 'Parent item:', 'invoicing' ),
60
-						'not_found'          => __( 'No items found.', 'invoicing' ),
61
-						'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ),
48
+						'name'               => _x('Items', 'post type general name', 'invoicing'),
49
+						'singular_name'      => _x('Item', 'post type singular name', 'invoicing'),
50
+						'menu_name'          => _x('Items', 'admin menu', 'invoicing'),
51
+						'name_admin_bar'     => _x('Item', 'add new on admin bar', 'invoicing'),
52
+						'add_new'            => _x('Add New', 'Item', 'invoicing'),
53
+						'add_new_item'       => __('Add New Item', 'invoicing'),
54
+						'new_item'           => __('New Item', 'invoicing'),
55
+						'edit_item'          => __('Edit Item', 'invoicing'),
56
+						'view_item'          => __('View Item', 'invoicing'),
57
+						'all_items'          => __('Items', 'invoicing'),
58
+						'search_items'       => __('Search items', 'invoicing'),
59
+						'parent_item_colon'  => __('Parent item:', 'invoicing'),
60
+						'not_found'          => __('No items found.', 'invoicing'),
61
+						'not_found_in_trash' => __('No items found in trash.', 'invoicing'),
62 62
 					),
63
-					'description'       => __( 'This is where you can add new invoice items.', 'invoicing' ),
63
+					'description'       => __('This is where you can add new invoice items.', 'invoicing'),
64 64
 					'public'            => false,
65 65
 					'has_archive'       => false,
66 66
 					'_builtin'          => false,
67 67
 					'show_ui'           => true,
68 68
 					'show_in_menu'      => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
69 69
 					'show_in_nav_menus' => false,
70
-					'supports'          => array( 'title', 'excerpt', 'thumbnail' ),
70
+					'supports'          => array('title', 'excerpt', 'thumbnail'),
71 71
 					'rewrite'           => false,
72 72
 					'query_var'         => false,
73 73
 					'map_meta_cap'      => true,
@@ -84,22 +84,22 @@  discard block
 block discarded – undo
84 84
 				'wpinv_register_post_type_payment_form',
85 85
 				array(
86 86
 					'labels'            => array(
87
-						'name'               => _x( 'Payment Forms', 'post type general name', 'invoicing' ),
88
-						'singular_name'      => _x( 'Payment Form', 'post type singular name', 'invoicing' ),
89
-						'menu_name'          => _x( 'Payment Forms', 'admin menu', 'invoicing' ),
90
-						'name_admin_bar'     => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ),
91
-						'add_new'            => _x( 'Add New', 'Payment Form', 'invoicing' ),
92
-						'add_new_item'       => __( 'Add New Payment Form', 'invoicing' ),
93
-						'new_item'           => __( 'New Payment Form', 'invoicing' ),
94
-						'edit_item'          => __( 'Edit Payment Form', 'invoicing' ),
95
-						'view_item'          => __( 'View Payment Form', 'invoicing' ),
96
-						'all_items'          => __( 'Payment Forms', 'invoicing' ),
97
-						'search_items'       => __( 'Search Payment Forms', 'invoicing' ),
98
-						'parent_item_colon'  => __( 'Parent Payment Forms:', 'invoicing' ),
99
-						'not_found'          => __( 'No payment forms found.', 'invoicing' ),
100
-						'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ),
87
+						'name'               => _x('Payment Forms', 'post type general name', 'invoicing'),
88
+						'singular_name'      => _x('Payment Form', 'post type singular name', 'invoicing'),
89
+						'menu_name'          => _x('Payment Forms', 'admin menu', 'invoicing'),
90
+						'name_admin_bar'     => _x('Payment Form', 'add new on admin bar', 'invoicing'),
91
+						'add_new'            => _x('Add New', 'Payment Form', 'invoicing'),
92
+						'add_new_item'       => __('Add New Payment Form', 'invoicing'),
93
+						'new_item'           => __('New Payment Form', 'invoicing'),
94
+						'edit_item'          => __('Edit Payment Form', 'invoicing'),
95
+						'view_item'          => __('View Payment Form', 'invoicing'),
96
+						'all_items'          => __('Payment Forms', 'invoicing'),
97
+						'search_items'       => __('Search Payment Forms', 'invoicing'),
98
+						'parent_item_colon'  => __('Parent Payment Forms:', 'invoicing'),
99
+						'not_found'          => __('No payment forms found.', 'invoicing'),
100
+						'not_found_in_trash' => __('No payment forms found in trash.', 'invoicing'),
101 101
 					),
102
-					'description'       => __( 'Add new payment forms.', 'invoicing' ),
102
+					'description'       => __('Add new payment forms.', 'invoicing'),
103 103
 					'public'            => false,
104 104
 					'show_ui'           => true,
105 105
 					'show_in_menu'      => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 					'has_archive'       => false,
111 111
 					'hierarchical'      => false,
112 112
 					'menu_position'     => null,
113
-					'supports'          => array( 'title' ),
113
+					'supports'          => array('title'),
114 114
 					'menu_icon'         => 'dashicons-media-form',
115 115
 				)
116 116
 			)
@@ -123,32 +123,32 @@  discard block
 block discarded – undo
123 123
 				'wpinv_register_post_type_invoice',
124 124
 				array(
125 125
 					'labels'              => array(
126
-						'name'                  => __( 'Invoices', 'invoicing' ),
127
-						'singular_name'         => __( 'Invoice', 'invoicing' ),
128
-						'all_items'             => __( 'Invoices', 'invoicing' ),
129
-						'menu_name'             => _x( 'Invoices', 'Admin menu name', 'invoicing' ),
130
-						'add_new'               => __( 'Add New', 'invoicing' ),
131
-						'add_new_item'          => __( 'Add new invoice', 'invoicing' ),
132
-						'edit'                  => __( 'Edit', 'invoicing' ),
133
-						'edit_item'             => __( 'Edit invoice', 'invoicing' ),
134
-						'new_item'              => __( 'New invoice', 'invoicing' ),
135
-						'view_item'             => __( 'View invoice', 'invoicing' ),
136
-						'view_items'            => __( 'View Invoices', 'invoicing' ),
137
-						'search_items'          => __( 'Search invoices', 'invoicing' ),
138
-						'not_found'             => __( 'No invoices found', 'invoicing' ),
139
-						'not_found_in_trash'    => __( 'No invoices found in trash', 'invoicing' ),
140
-						'parent'                => __( 'Parent invoice', 'invoicing' ),
141
-						'featured_image'        => __( 'Invoice image', 'invoicing' ),
142
-						'set_featured_image'    => __( 'Set invoice image', 'invoicing' ),
143
-						'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ),
144
-						'use_featured_image'    => __( 'Use as invoice image', 'invoicing' ),
145
-						'insert_into_item'      => __( 'Insert into invoice', 'invoicing' ),
146
-						'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ),
147
-						'filter_items_list'     => __( 'Filter invoices', 'invoicing' ),
148
-						'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ),
149
-						'items_list'            => __( 'Invoices list', 'invoicing' ),
126
+						'name'                  => __('Invoices', 'invoicing'),
127
+						'singular_name'         => __('Invoice', 'invoicing'),
128
+						'all_items'             => __('Invoices', 'invoicing'),
129
+						'menu_name'             => _x('Invoices', 'Admin menu name', 'invoicing'),
130
+						'add_new'               => __('Add New', 'invoicing'),
131
+						'add_new_item'          => __('Add new invoice', 'invoicing'),
132
+						'edit'                  => __('Edit', 'invoicing'),
133
+						'edit_item'             => __('Edit invoice', 'invoicing'),
134
+						'new_item'              => __('New invoice', 'invoicing'),
135
+						'view_item'             => __('View invoice', 'invoicing'),
136
+						'view_items'            => __('View Invoices', 'invoicing'),
137
+						'search_items'          => __('Search invoices', 'invoicing'),
138
+						'not_found'             => __('No invoices found', 'invoicing'),
139
+						'not_found_in_trash'    => __('No invoices found in trash', 'invoicing'),
140
+						'parent'                => __('Parent invoice', 'invoicing'),
141
+						'featured_image'        => __('Invoice image', 'invoicing'),
142
+						'set_featured_image'    => __('Set invoice image', 'invoicing'),
143
+						'remove_featured_image' => __('Remove invoice image', 'invoicing'),
144
+						'use_featured_image'    => __('Use as invoice image', 'invoicing'),
145
+						'insert_into_item'      => __('Insert into invoice', 'invoicing'),
146
+						'uploaded_to_this_item' => __('Uploaded to this invoice', 'invoicing'),
147
+						'filter_items_list'     => __('Filter invoices', 'invoicing'),
148
+						'items_list_navigation' => __('Invoices navigation', 'invoicing'),
149
+						'items_list'            => __('Invoices list', 'invoicing'),
150 150
 					),
151
-					'description'         => __( 'This is where invoices are stored.', 'invoicing' ),
151
+					'description'         => __('This is where invoices are stored.', 'invoicing'),
152 152
 					'public'              => true,
153 153
 					'has_archive'         => false,
154 154
 					'publicly_queryable'  => true,
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         			'show_ui'             => true,
157 157
 					'show_in_menu'        => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
158 158
 					'show_in_nav_menus'   => false,
159
-					'supports'            => array( 'title', 'author', 'excerpt' ),
159
+					'supports'            => array('title', 'author', 'excerpt'),
160 160
 					'rewrite'             => array(
161 161
 						'slug'       => 'invoice',
162 162
 						'with_front' => false,
@@ -179,32 +179,32 @@  discard block
 block discarded – undo
179 179
 				'wpinv_register_post_type_discount',
180 180
 				array(
181 181
 					'labels'              => array(
182
-						'name'                  => __( 'Discounts', 'invoicing' ),
183
-						'singular_name'         => __( 'Discount', 'invoicing' ),
184
-						'all_items'             => __( 'Discounts', 'invoicing' ),
185
-						'menu_name'             => _x( 'Discounts', 'Admin menu name', 'invoicing' ),
186
-						'add_new'               => __( 'Add New', 'invoicing' ),
187
-						'add_new_item'          => __( 'Add new discount', 'invoicing' ),
188
-						'edit'                  => __( 'Edit', 'invoicing' ),
189
-						'edit_item'             => __( 'Edit discount', 'invoicing' ),
190
-						'new_item'              => __( 'New discount', 'invoicing' ),
191
-						'view_item'             => __( 'View discount', 'invoicing' ),
192
-						'view_items'            => __( 'View Discounts', 'invoicing' ),
193
-						'search_items'          => __( 'Search discounts', 'invoicing' ),
194
-						'not_found'             => __( 'No discounts found', 'invoicing' ),
195
-						'not_found_in_trash'    => __( 'No discounts found in trash', 'invoicing' ),
196
-						'parent'                => __( 'Parent discount', 'invoicing' ),
197
-						'featured_image'        => __( 'Discount image', 'invoicing' ),
198
-						'set_featured_image'    => __( 'Set discount image', 'invoicing' ),
199
-						'remove_featured_image' => __( 'Remove discount image', 'invoicing' ),
200
-						'use_featured_image'    => __( 'Use as discount image', 'invoicing' ),
201
-						'insert_into_item'      => __( 'Insert into discount', 'invoicing' ),
202
-						'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ),
203
-						'filter_items_list'     => __( 'Filter discounts', 'invoicing' ),
204
-						'items_list_navigation' => __( 'Discount navigation', 'invoicing' ),
205
-						'items_list'            => __( 'Discounts list', 'invoicing' ),
182
+						'name'                  => __('Discounts', 'invoicing'),
183
+						'singular_name'         => __('Discount', 'invoicing'),
184
+						'all_items'             => __('Discounts', 'invoicing'),
185
+						'menu_name'             => _x('Discounts', 'Admin menu name', 'invoicing'),
186
+						'add_new'               => __('Add New', 'invoicing'),
187
+						'add_new_item'          => __('Add new discount', 'invoicing'),
188
+						'edit'                  => __('Edit', 'invoicing'),
189
+						'edit_item'             => __('Edit discount', 'invoicing'),
190
+						'new_item'              => __('New discount', 'invoicing'),
191
+						'view_item'             => __('View discount', 'invoicing'),
192
+						'view_items'            => __('View Discounts', 'invoicing'),
193
+						'search_items'          => __('Search discounts', 'invoicing'),
194
+						'not_found'             => __('No discounts found', 'invoicing'),
195
+						'not_found_in_trash'    => __('No discounts found in trash', 'invoicing'),
196
+						'parent'                => __('Parent discount', 'invoicing'),
197
+						'featured_image'        => __('Discount image', 'invoicing'),
198
+						'set_featured_image'    => __('Set discount image', 'invoicing'),
199
+						'remove_featured_image' => __('Remove discount image', 'invoicing'),
200
+						'use_featured_image'    => __('Use as discount image', 'invoicing'),
201
+						'insert_into_item'      => __('Insert into discount', 'invoicing'),
202
+						'uploaded_to_this_item' => __('Uploaded to this discount', 'invoicing'),
203
+						'filter_items_list'     => __('Filter discounts', 'invoicing'),
204
+						'items_list_navigation' => __('Discount navigation', 'invoicing'),
205
+						'items_list'            => __('Discounts list', 'invoicing'),
206 206
 					),
207
-					'description'         => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ),
207
+					'description'         => __('This is where you can add new discounts that users can use in invoices.', 'invoicing'),
208 208
 					'public'              => false,
209 209
 					'can_export'          => true,
210 210
 					'_builtin'            => false,
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 					'map_meta_cap'        => true,
218 218
 					'has_archive'         => false,
219 219
 					'hierarchical'        => false,
220
-					'supports'            => array( 'title', 'excerpt' ),
220
+					'supports'            => array('title', 'excerpt'),
221 221
 					'show_in_nav_menus'   => false,
222 222
 					'show_in_admin_bar'   => true,
223 223
 					'menu_position'       => null,
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 			)
226 226
 		);
227 227
 
228
-		do_action( 'getpaid_after_register_post_types' );
228
+		do_action('getpaid_after_register_post_types');
229 229
 	}
230 230
 
231 231
 	/**
@@ -238,79 +238,79 @@  discard block
 block discarded – undo
238 238
 			array(
239 239
 
240 240
 				'wpi-pending'    => array(
241
-					'label'                     => _x( 'Pending Payment', 'Invoice status', 'invoicing' ),
241
+					'label'                     => _x('Pending Payment', 'Invoice status', 'invoicing'),
242 242
         			'public'                    => true,
243 243
         			'exclude_from_search'       => true,
244 244
         			'show_in_admin_all_list'    => true,
245 245
 					'show_in_admin_status_list' => true,
246 246
 					/* translators: %s: number of invoices */
247
-        			'label_count'               => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ),
247
+        			'label_count'               => _n_noop('Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing'),
248 248
 				),
249 249
 
250 250
 				'wpi-processing' => array(
251
-					'label'                     => _x( 'Processing', 'Invoice status', 'invoicing' ),
251
+					'label'                     => _x('Processing', 'Invoice status', 'invoicing'),
252 252
         			'public'                    => true,
253 253
         			'exclude_from_search'       => true,
254 254
         			'show_in_admin_all_list'    => true,
255 255
 					'show_in_admin_status_list' => true,
256 256
 					/* translators: %s: number of invoices */
257
-        			'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ),
257
+        			'label_count'               => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing'),
258 258
 				),
259 259
 
260 260
 				'wpi-onhold'     => array(
261
-					'label'                     => _x( 'On Hold', 'Invoice status', 'invoicing' ),
261
+					'label'                     => _x('On Hold', 'Invoice status', 'invoicing'),
262 262
         			'public'                    => true,
263 263
         			'exclude_from_search'       => true,
264 264
         			'show_in_admin_all_list'    => true,
265 265
 					'show_in_admin_status_list' => true,
266 266
 					/* translators: %s: number of invoices */
267
-        			'label_count'               => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ),
267
+        			'label_count'               => _n_noop('On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing'),
268 268
 				),
269 269
 
270 270
 				'wpi-cancelled'  => array(
271
-					'label'                     => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
271
+					'label'                     => _x('Cancelled', 'Invoice status', 'invoicing'),
272 272
         			'public'                    => true,
273 273
         			'exclude_from_search'       => true,
274 274
         			'show_in_admin_all_list'    => true,
275 275
 					'show_in_admin_status_list' => true,
276 276
 					/* translators: %s: number of invoices */
277
-        			'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ),
277
+        			'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing'),
278 278
 				),
279 279
 
280 280
 				'wpi-refunded'   => array(
281
-					'label'                     => _x( 'Refunded', 'Invoice status', 'invoicing' ),
281
+					'label'                     => _x('Refunded', 'Invoice status', 'invoicing'),
282 282
         			'public'                    => true,
283 283
         			'exclude_from_search'       => true,
284 284
         			'show_in_admin_all_list'    => true,
285 285
 					'show_in_admin_status_list' => true,
286 286
 					/* translators: %s: number of invoices */
287
-        			'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ),
287
+        			'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing'),
288 288
 				),
289 289
 
290 290
 				'wpi-failed'     => array(
291
-					'label'                     => _x( 'Failed', 'Invoice status', 'invoicing' ),
291
+					'label'                     => _x('Failed', 'Invoice status', 'invoicing'),
292 292
         			'public'                    => true,
293 293
         			'exclude_from_search'       => true,
294 294
         			'show_in_admin_all_list'    => true,
295 295
 					'show_in_admin_status_list' => true,
296 296
 					/* translators: %s: number of invoices */
297
-        			'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ),
297
+        			'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing'),
298 298
 				),
299 299
 
300 300
 				'wpi-renewal'    => array(
301
-					'label'                     => _x( 'Renewal', 'Invoice status', 'invoicing' ),
301
+					'label'                     => _x('Renewal', 'Invoice status', 'invoicing'),
302 302
         			'public'                    => true,
303 303
         			'exclude_from_search'       => true,
304 304
         			'show_in_admin_all_list'    => true,
305 305
 					'show_in_admin_status_list' => true,
306 306
 					/* translators: %s: number of invoices */
307
-        			'label_count'               => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ),
307
+        			'label_count'               => _n_noop('Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing'),
308 308
 				),
309 309
 			)
310 310
 		);
311 311
 
312
-		foreach ( $invoice_statuses as $invoice_statuse => $args ) {
313
-			register_post_status( $invoice_statuse, $args );
312
+		foreach ($invoice_statuses as $invoice_statuse => $args) {
313
+			register_post_status($invoice_statuse, $args);
314 314
 		}
315 315
 	}
316 316
 
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 	 *
327 327
 	 */
328 328
 	public static function maybe_flush_rewrite_rules() {
329
-		if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) {
330
-			update_option( 'getpaid_flushed_rewrite_rules', '1' );
329
+		if (!get_option('getpaid_flushed_rewrite_rules')) {
330
+			update_option('getpaid_flushed_rewrite_rules', '1');
331 331
 			self::flush_rewrite_rules();
332 332
 		}
333 333
 	}
Please login to merge, or discard this patch.