Passed
Pull Request — master (#462)
by Viktor
04:15
created
includes/class-getpaid-daily-maintenance.php 2 patches
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -12,108 +12,108 @@
 block discarded – undo
12 12
  */
13 13
 class GetPaid_Daily_Maintenance {
14 14
 
15
-	/**
16
-	 * Class constructor.
17
-	 */
18
-	public function __construct(){
19
-
20
-		// Clear deprecated events.
21
-		add_action( 'wp', array( $this, 'maybe_clear_deprecated_events' ) );
22
-
23
-		// (Maybe) schedule a cron that runs daily.
24
-		add_action( 'wp', array( $this, 'maybe_create_scheduled_event' ) );
25
-
26
-		// Fired everyday at 7 a.m (this might vary for sites with few visitors)
27
-		add_action( 'getpaid_daily_maintenance', array( $this, 'log_cron_run' ) );
28
-		add_action( 'getpaid_daily_maintenance', array( $this, 'backwards_compat' ) );
29
-		add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_expire_subscriptions' ) );
30
-		add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_update_geoip_databases' ) );
31
-
32
-	}
33
-
34
-	/**
35
-	 * Schedules a cron to run every day at 7 a.m
36
-	 *
37
-	 */
38
-	public function maybe_create_scheduled_event() {
39
-
40
-		if ( ! wp_next_scheduled( 'getpaid_daily_maintenance' ) ) {
41
-			$timestamp = strtotime( 'tomorrow 07:00:00', current_time( 'timestamp' ) );
42
-			wp_schedule_event( $timestamp, 'daily', 'getpaid_daily_maintenance' );
43
-		}
44
-
45
-	}
46
-
47
-	/**
48
-	 * Clears deprecated events.
49
-	 *
50
-	 */
51
-	public function maybe_clear_deprecated_events() {
52
-
53
-		if ( ! get_option( 'wpinv_cleared_old_events' ) ) {
54
-			wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
55
-			wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
56
-			update_option( 'wpinv_cleared_old_events', 1 );
57
-		}
58
-
59
-	}
60
-
61
-	/**
62
-	 * Fires the old hook for backwards compatibility.
63
-	 *
64
-	 */
65
-	public function backwards_compat() {
66
-		do_action( 'wpinv_register_schedule_event_daily' );
67
-	}
68
-
69
-	/**
70
-	 * Expires expired subscriptions.
71
-	 *
72
-	 */
73
-	public function maybe_expire_subscriptions() {
74
-
75
-		// Fetch expired subscriptions (skips those that expire today).
76
-		$args  = array(
77
-			'number'             => -1,
78
-			'count_total'        => false,
79
-			'status'             => 'trialling active failing cancelled',
80
-			'date_expires_query' => array(
81
-				'before'    => 'today',
82
-				'inclusive' => false,
83
-			),
84
-		);
85
-
86
-		$subscriptions = new GetPaid_Subscriptions_Query( $args );
87
-
88
-		foreach ( $subscriptions->get_results() as $subscription ) {
89
-			if ( apply_filters( 'getpaid_daily_maintenance_should_expire_subscription', true, $subscription ) ) {
90
-				$subscription->set_status( 'expired' );
91
-				$subscription->save();
92
-			}
93
-		}
94
-
95
-	}
96
-
97
-	/**
98
-	 * Logs cron runs.
99
-	 *
100
-	 */
101
-	public function log_cron_run() {
102
-		wpinv_error_log( 'GetPaid Daily Cron' );
103
-	}
104
-
105
-	/**
106
-	 * Updates GeoIP databases.
107
-	 *
108
-	 */
109
-	public function maybe_update_geoip_databases() {
110
-		$updated = get_transient( 'getpaid_updated_geoip_databases' );
111
-
112
-		if ( false === $updated ) {
113
-			set_transient( 'getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS );
114
-			do_action( 'getpaid_update_geoip_databases' );
115
-		}
116
-
117
-	}
15
+    /**
16
+     * Class constructor.
17
+     */
18
+    public function __construct(){
19
+
20
+        // Clear deprecated events.
21
+        add_action( 'wp', array( $this, 'maybe_clear_deprecated_events' ) );
22
+
23
+        // (Maybe) schedule a cron that runs daily.
24
+        add_action( 'wp', array( $this, 'maybe_create_scheduled_event' ) );
25
+
26
+        // Fired everyday at 7 a.m (this might vary for sites with few visitors)
27
+        add_action( 'getpaid_daily_maintenance', array( $this, 'log_cron_run' ) );
28
+        add_action( 'getpaid_daily_maintenance', array( $this, 'backwards_compat' ) );
29
+        add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_expire_subscriptions' ) );
30
+        add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_update_geoip_databases' ) );
31
+
32
+    }
33
+
34
+    /**
35
+     * Schedules a cron to run every day at 7 a.m
36
+     *
37
+     */
38
+    public function maybe_create_scheduled_event() {
39
+
40
+        if ( ! wp_next_scheduled( 'getpaid_daily_maintenance' ) ) {
41
+            $timestamp = strtotime( 'tomorrow 07:00:00', current_time( 'timestamp' ) );
42
+            wp_schedule_event( $timestamp, 'daily', 'getpaid_daily_maintenance' );
43
+        }
44
+
45
+    }
46
+
47
+    /**
48
+     * Clears deprecated events.
49
+     *
50
+     */
51
+    public function maybe_clear_deprecated_events() {
52
+
53
+        if ( ! get_option( 'wpinv_cleared_old_events' ) ) {
54
+            wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
55
+            wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
56
+            update_option( 'wpinv_cleared_old_events', 1 );
57
+        }
58
+
59
+    }
60
+
61
+    /**
62
+     * Fires the old hook for backwards compatibility.
63
+     *
64
+     */
65
+    public function backwards_compat() {
66
+        do_action( 'wpinv_register_schedule_event_daily' );
67
+    }
68
+
69
+    /**
70
+     * Expires expired subscriptions.
71
+     *
72
+     */
73
+    public function maybe_expire_subscriptions() {
74
+
75
+        // Fetch expired subscriptions (skips those that expire today).
76
+        $args  = array(
77
+            'number'             => -1,
78
+            'count_total'        => false,
79
+            'status'             => 'trialling active failing cancelled',
80
+            'date_expires_query' => array(
81
+                'before'    => 'today',
82
+                'inclusive' => false,
83
+            ),
84
+        );
85
+
86
+        $subscriptions = new GetPaid_Subscriptions_Query( $args );
87
+
88
+        foreach ( $subscriptions->get_results() as $subscription ) {
89
+            if ( apply_filters( 'getpaid_daily_maintenance_should_expire_subscription', true, $subscription ) ) {
90
+                $subscription->set_status( 'expired' );
91
+                $subscription->save();
92
+            }
93
+        }
94
+
95
+    }
96
+
97
+    /**
98
+     * Logs cron runs.
99
+     *
100
+     */
101
+    public function log_cron_run() {
102
+        wpinv_error_log( 'GetPaid Daily Cron' );
103
+    }
104
+
105
+    /**
106
+     * Updates GeoIP databases.
107
+     *
108
+     */
109
+    public function maybe_update_geoip_databases() {
110
+        $updated = get_transient( 'getpaid_updated_geoip_databases' );
111
+
112
+        if ( false === $updated ) {
113
+            set_transient( 'getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS );
114
+            do_action( 'getpaid_update_geoip_databases' );
115
+        }
116
+
117
+    }
118 118
 
119 119
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-defined( 'ABSPATH' ) || exit;
7
+defined('ABSPATH') || exit;
8 8
 
9 9
 /**
10 10
  * Daily maintenance class.
@@ -15,19 +15,19 @@  discard block
 block discarded – undo
15 15
 	/**
16 16
 	 * Class constructor.
17 17
 	 */
18
-	public function __construct(){
18
+	public function __construct() {
19 19
 
20 20
 		// Clear deprecated events.
21
-		add_action( 'wp', array( $this, 'maybe_clear_deprecated_events' ) );
21
+		add_action('wp', array($this, 'maybe_clear_deprecated_events'));
22 22
 
23 23
 		// (Maybe) schedule a cron that runs daily.
24
-		add_action( 'wp', array( $this, 'maybe_create_scheduled_event' ) );
24
+		add_action('wp', array($this, 'maybe_create_scheduled_event'));
25 25
 
26 26
 		// Fired everyday at 7 a.m (this might vary for sites with few visitors)
27
-		add_action( 'getpaid_daily_maintenance', array( $this, 'log_cron_run' ) );
28
-		add_action( 'getpaid_daily_maintenance', array( $this, 'backwards_compat' ) );
29
-		add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_expire_subscriptions' ) );
30
-		add_action( 'getpaid_daily_maintenance', array( $this, 'maybe_update_geoip_databases' ) );
27
+		add_action('getpaid_daily_maintenance', array($this, 'log_cron_run'));
28
+		add_action('getpaid_daily_maintenance', array($this, 'backwards_compat'));
29
+		add_action('getpaid_daily_maintenance', array($this, 'maybe_expire_subscriptions'));
30
+		add_action('getpaid_daily_maintenance', array($this, 'maybe_update_geoip_databases'));
31 31
 
32 32
 	}
33 33
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public function maybe_create_scheduled_event() {
39 39
 
40
-		if ( ! wp_next_scheduled( 'getpaid_daily_maintenance' ) ) {
41
-			$timestamp = strtotime( 'tomorrow 07:00:00', current_time( 'timestamp' ) );
42
-			wp_schedule_event( $timestamp, 'daily', 'getpaid_daily_maintenance' );
40
+		if (!wp_next_scheduled('getpaid_daily_maintenance')) {
41
+			$timestamp = strtotime('tomorrow 07:00:00', current_time('timestamp'));
42
+			wp_schedule_event($timestamp, 'daily', 'getpaid_daily_maintenance');
43 43
 		}
44 44
 
45 45
 	}
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function maybe_clear_deprecated_events() {
52 52
 
53
-		if ( ! get_option( 'wpinv_cleared_old_events' ) ) {
54
-			wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' );
55
-			wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' );
56
-			update_option( 'wpinv_cleared_old_events', 1 );
53
+		if (!get_option('wpinv_cleared_old_events')) {
54
+			wp_clear_scheduled_hook('wpinv_register_schedule_event_twicedaily');
55
+			wp_clear_scheduled_hook('wpinv_register_schedule_event_daily');
56
+			update_option('wpinv_cleared_old_events', 1);
57 57
 		}
58 58
 
59 59
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 */
65 65
 	public function backwards_compat() {
66
-		do_action( 'wpinv_register_schedule_event_daily' );
66
+		do_action('wpinv_register_schedule_event_daily');
67 67
 	}
68 68
 
69 69
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	public function maybe_expire_subscriptions() {
74 74
 
75 75
 		// Fetch expired subscriptions (skips those that expire today).
76
-		$args  = array(
76
+		$args = array(
77 77
 			'number'             => -1,
78 78
 			'count_total'        => false,
79 79
 			'status'             => 'trialling active failing cancelled',
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
 			),
84 84
 		);
85 85
 
86
-		$subscriptions = new GetPaid_Subscriptions_Query( $args );
86
+		$subscriptions = new GetPaid_Subscriptions_Query($args);
87 87
 
88
-		foreach ( $subscriptions->get_results() as $subscription ) {
89
-			if ( apply_filters( 'getpaid_daily_maintenance_should_expire_subscription', true, $subscription ) ) {
90
-				$subscription->set_status( 'expired' );
88
+		foreach ($subscriptions->get_results() as $subscription) {
89
+			if (apply_filters('getpaid_daily_maintenance_should_expire_subscription', true, $subscription)) {
90
+				$subscription->set_status('expired');
91 91
 				$subscription->save();
92 92
 			}
93 93
 		}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 *
100 100
 	 */
101 101
 	public function log_cron_run() {
102
-		wpinv_error_log( 'GetPaid Daily Cron' );
102
+		wpinv_error_log('GetPaid Daily Cron');
103 103
 	}
104 104
 
105 105
 	/**
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 */
109 109
 	public function maybe_update_geoip_databases() {
110
-		$updated = get_transient( 'getpaid_updated_geoip_databases' );
110
+		$updated = get_transient('getpaid_updated_geoip_databases');
111 111
 
112
-		if ( false === $updated ) {
113
-			set_transient( 'getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS );
114
-			do_action( 'getpaid_update_geoip_databases' );
112
+		if (false === $updated) {
113
+			set_transient('getpaid_updated_geoip_databases', 1, 15 * DAY_IN_SECONDS);
114
+			do_action('getpaid_update_geoip_databases');
115 115
 		}
116 116
 
117 117
 	}
Please login to merge, or discard this patch.
templates/payment-forms/elements/ip_address.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@
 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( $text ) ) {
13
-    $text = __( 'Your IP address is:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Your IP address is:', 'invoicing');
14 14
 }
15 15
 
16
-$ip_address = sanitize_text_field( wpinv_get_ip() );
16
+$ip_address = sanitize_text_field(wpinv_get_ip());
17 17
 
18 18
 ?>
19 19
 <div class="form-group getpaid-ip-info">
20
-    <span><?php echo wp_kses_post( $text ); ?></span>
20
+    <span><?php echo wp_kses_post($text); ?></span>
21 21
     <strong><?php echo $ip_address; ?></strong>
22 22
 </div>
Please login to merge, or discard this patch.
vendor/composer/platform_check.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 $issues = array();
6 6
 
7 7
 if (!(PHP_VERSION_ID >= 50600)) {
8
-    $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION  .  '.';
8
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
9 9
 }
10 10
 
11 11
 if ($issues) {
Please login to merge, or discard this patch.
includes/class-getpaid-post-types.php 2 patches
Indentation   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -15,322 +15,322 @@
 block discarded – undo
15 15
 class GetPaid_Post_Types {
16 16
 
17 17
     /**
18
-	 * Hook in methods.
19
-	 */
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' ) );
25
-	}
18
+     * Hook in methods.
19
+     */
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' ) );
25
+    }
26 26
 
27
-	/**
28
-	 * Register core post types.
29
-	 */
30
-	public static function register_post_types() {
27
+    /**
28
+     * Register core post types.
29
+     */
30
+    public static function register_post_types() {
31 31
 
32
-		if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) {
33
-			return;
34
-		}
32
+        if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) {
33
+            return;
34
+        }
35 35
 
36
-		// Fires before registering post types.
37
-		do_action( 'getpaid_register_post_types' );
36
+        // Fires before registering post types.
37
+        do_action( 'getpaid_register_post_types' );
38 38
 
39
-		// Register item post type.
40
-		register_post_type(
41
-			'wpi_item',
42
-			apply_filters(
43
-				'wpinv_register_post_type_invoice_item',
44
-				array(
45
-					'labels'             => array(
46
-						'name'               => _x( 'Items', 'post type general name', 'invoicing' ),
47
-						'singular_name'      => _x( 'Item', 'post type singular name', 'invoicing' ),
48
-						'menu_name'          => _x( 'Items', 'admin menu', 'invoicing' ),
49
-						'name_admin_bar'     => _x( 'Item', 'add new on admin bar', 'invoicing' ),
50
-						'add_new'            => _x( 'Add New', 'Item', 'invoicing' ),
51
-						'add_new_item'       => __( 'Add New Item', 'invoicing' ),
52
-						'new_item'           => __( 'New Item', 'invoicing' ),
53
-						'edit_item'          => __( 'Edit Item', 'invoicing' ),
54
-						'view_item'          => __( 'View Item', 'invoicing' ),
55
-						'all_items'          => __( 'Items', 'invoicing' ),
56
-						'search_items'       => __( 'Search items', 'invoicing' ),
57
-						'parent_item_colon'  => __( 'Parent item:', 'invoicing' ),
58
-						'not_found'          => __( 'No items found.', 'invoicing' ),
59
-						'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' )
60
-					),
61
-					'description'           => __( 'This is where you can add new invoice items.', 'invoicing' ),
62
-					'public'                => false,
63
-					'has_archive'           => false,
64
-					'_builtin'              => false,
65
-					'show_ui'               => true,
66
-					'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
67
-					'show_in_nav_menus'     => false,
68
-					'supports'              => array( 'title', 'excerpt', 'thumbnail' ),
69
-					'rewrite'               => false,
70
-					'query_var'             => false,
71
-					'capability_type'       => 'wpi_item',
72
-					'map_meta_cap'          => true,
73
-					'show_in_admin_bar'     => true,
74
-					'can_export'            => true,
75
-				)
76
-			)
77
-		);
39
+        // Register item post type.
40
+        register_post_type(
41
+            'wpi_item',
42
+            apply_filters(
43
+                'wpinv_register_post_type_invoice_item',
44
+                array(
45
+                    'labels'             => array(
46
+                        'name'               => _x( 'Items', 'post type general name', 'invoicing' ),
47
+                        'singular_name'      => _x( 'Item', 'post type singular name', 'invoicing' ),
48
+                        'menu_name'          => _x( 'Items', 'admin menu', 'invoicing' ),
49
+                        'name_admin_bar'     => _x( 'Item', 'add new on admin bar', 'invoicing' ),
50
+                        'add_new'            => _x( 'Add New', 'Item', 'invoicing' ),
51
+                        'add_new_item'       => __( 'Add New Item', 'invoicing' ),
52
+                        'new_item'           => __( 'New Item', 'invoicing' ),
53
+                        'edit_item'          => __( 'Edit Item', 'invoicing' ),
54
+                        'view_item'          => __( 'View Item', 'invoicing' ),
55
+                        'all_items'          => __( 'Items', 'invoicing' ),
56
+                        'search_items'       => __( 'Search items', 'invoicing' ),
57
+                        'parent_item_colon'  => __( 'Parent item:', 'invoicing' ),
58
+                        'not_found'          => __( 'No items found.', 'invoicing' ),
59
+                        'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' )
60
+                    ),
61
+                    'description'           => __( 'This is where you can add new invoice items.', 'invoicing' ),
62
+                    'public'                => false,
63
+                    'has_archive'           => false,
64
+                    '_builtin'              => false,
65
+                    'show_ui'               => true,
66
+                    'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
67
+                    'show_in_nav_menus'     => false,
68
+                    'supports'              => array( 'title', 'excerpt', 'thumbnail' ),
69
+                    'rewrite'               => false,
70
+                    'query_var'             => false,
71
+                    'capability_type'       => 'wpi_item',
72
+                    'map_meta_cap'          => true,
73
+                    'show_in_admin_bar'     => true,
74
+                    'can_export'            => true,
75
+                )
76
+            )
77
+        );
78 78
 
79
-		// Register payment form post type.
80
-		register_post_type(
81
-			'wpi_payment_form',
82
-			apply_filters(
83
-				'wpinv_register_post_type_payment_form',
84
-				array(
85
-					'labels'             => array(
86
-						'name'               => _x( 'Payment Forms', 'post type general name', 'invoicing' ),
87
-						'singular_name'      => _x( 'Payment Form', 'post type singular name', 'invoicing' ),
88
-						'menu_name'          => _x( 'Payment Forms', 'admin menu', 'invoicing' ),
89
-						'name_admin_bar'     => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ),
90
-						'add_new'            => _x( 'Add New', 'Payment Form', 'invoicing' ),
91
-						'add_new_item'       => __( 'Add New Payment Form', 'invoicing' ),
92
-						'new_item'           => __( 'New Payment Form', 'invoicing' ),
93
-						'edit_item'          => __( 'Edit Payment Form', 'invoicing' ),
94
-						'view_item'          => __( 'View Payment Form', 'invoicing' ),
95
-						'all_items'          => __( 'Payment Forms', 'invoicing' ),
96
-						'search_items'       => __( 'Search Payment Forms', 'invoicing' ),
97
-						'parent_item_colon'  => __( 'Parent Payment Forms:', 'invoicing' ),
98
-						'not_found'          => __( 'No payment forms found.', 'invoicing' ),
99
-						'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' )
100
-					),
101
-					'description'        => __( 'Add new payment forms.', 'invoicing' ),
102
-					'public'             => false,
103
-					'show_ui'            => true,
104
-					'show_in_menu'       => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : true,
105
-					'show_in_nav_menus'  => false,
106
-					'query_var'          => false,
107
-					'rewrite'            => true,
108
-					'map_meta_cap'       => true,
109
-					'has_archive'        => false,
110
-					'hierarchical'       => false,
111
-					'menu_position'      => null,
112
-					'supports'           => array( 'title' ),
113
-					'menu_icon'          => 'dashicons-media-form',
114
-				)
115
-			)
116
-		);
79
+        // Register payment form post type.
80
+        register_post_type(
81
+            'wpi_payment_form',
82
+            apply_filters(
83
+                'wpinv_register_post_type_payment_form',
84
+                array(
85
+                    'labels'             => array(
86
+                        'name'               => _x( 'Payment Forms', 'post type general name', 'invoicing' ),
87
+                        'singular_name'      => _x( 'Payment Form', 'post type singular name', 'invoicing' ),
88
+                        'menu_name'          => _x( 'Payment Forms', 'admin menu', 'invoicing' ),
89
+                        'name_admin_bar'     => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ),
90
+                        'add_new'            => _x( 'Add New', 'Payment Form', 'invoicing' ),
91
+                        'add_new_item'       => __( 'Add New Payment Form', 'invoicing' ),
92
+                        'new_item'           => __( 'New Payment Form', 'invoicing' ),
93
+                        'edit_item'          => __( 'Edit Payment Form', 'invoicing' ),
94
+                        'view_item'          => __( 'View Payment Form', 'invoicing' ),
95
+                        'all_items'          => __( 'Payment Forms', 'invoicing' ),
96
+                        'search_items'       => __( 'Search Payment Forms', 'invoicing' ),
97
+                        'parent_item_colon'  => __( 'Parent Payment Forms:', 'invoicing' ),
98
+                        'not_found'          => __( 'No payment forms found.', 'invoicing' ),
99
+                        'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' )
100
+                    ),
101
+                    'description'        => __( 'Add new payment forms.', 'invoicing' ),
102
+                    'public'             => false,
103
+                    'show_ui'            => true,
104
+                    'show_in_menu'       => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : true,
105
+                    'show_in_nav_menus'  => false,
106
+                    'query_var'          => false,
107
+                    'rewrite'            => true,
108
+                    'map_meta_cap'       => true,
109
+                    'has_archive'        => false,
110
+                    'hierarchical'       => false,
111
+                    'menu_position'      => null,
112
+                    'supports'           => array( 'title' ),
113
+                    'menu_icon'          => 'dashicons-media-form',
114
+                )
115
+            )
116
+        );
117 117
 
118
-		// Register invoice post type.
119
-		register_post_type(
120
-			'wpi_invoice',
121
-			apply_filters(
122
-				'wpinv_register_post_type_invoice',
123
-				array(
124
-					'labels'                 => array(
125
-						'name'                  => __( 'Invoices', 'invoicing' ),
126
-						'singular_name'         => __( 'Invoice', 'invoicing' ),
127
-						'all_items'             => __( 'Invoices', 'invoicing' ),
128
-						'menu_name'             => _x( 'Invoices', 'Admin menu name', 'invoicing' ),
129
-						'add_new'               => __( 'Add New', 'invoicing' ),
130
-						'add_new_item'          => __( 'Add new invoice', 'invoicing' ),
131
-						'edit'                  => __( 'Edit', 'invoicing' ),
132
-						'edit_item'             => __( 'Edit invoice', 'invoicing' ),
133
-						'new_item'              => __( 'New invoice', 'invoicing' ),
134
-						'view_item'             => __( 'View invoice', 'invoicing' ),
135
-						'view_items'            => __( 'View Invoices', 'invoicing' ),
136
-						'search_items'          => __( 'Search invoices', 'invoicing' ),
137
-						'not_found'             => __( 'No invoices found', 'invoicing' ),
138
-						'not_found_in_trash'    => __( 'No invoices found in trash', 'invoicing' ),
139
-						'parent'                => __( 'Parent invoice', 'invoicing' ),
140
-						'featured_image'        => __( 'Invoice image', 'invoicing' ),
141
-						'set_featured_image'    => __( 'Set invoice image', 'invoicing' ),
142
-						'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ),
143
-						'use_featured_image'    => __( 'Use as invoice image', 'invoicing' ),
144
-						'insert_into_item'      => __( 'Insert into invoice', 'invoicing' ),
145
-						'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ),
146
-						'filter_items_list'     => __( 'Filter invoices', 'invoicing' ),
147
-						'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ),
148
-						'items_list'            => __( 'Invoices list', 'invoicing' ),
149
-					),
150
-					'description'           => __( 'This is where invoices are stored.', 'invoicing' ),
151
-					'public'                => true,
152
-					'has_archive'           => false,
153
-					'publicly_queryable'    => true,
154
-        			'exclude_from_search'   => true,
155
-        			'show_ui'               => true,
156
-					'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
157
-					'show_in_nav_menus'     => false,
158
-					'supports'              => array( 'title', 'author', 'excerpt'  ),
159
-					'rewrite'               => array(
160
-						'slug'              => 'invoice',
161
-						'with_front'        => false,
162
-					),
163
-					'query_var'             => false,
164
-					'capability_type'       => 'wpi_invoice',
165
-					'map_meta_cap'          => true,
166
-					'show_in_admin_bar'     => true,
167
-					'can_export'            => true,
168
-					'hierarchical'          => false,
169
-					'menu_position'         => null,
170
-					'menu_icon'             => 'dashicons-media-spreadsheet',
171
-				)
172
-			)
173
-		);
118
+        // Register invoice post type.
119
+        register_post_type(
120
+            'wpi_invoice',
121
+            apply_filters(
122
+                'wpinv_register_post_type_invoice',
123
+                array(
124
+                    'labels'                 => array(
125
+                        'name'                  => __( 'Invoices', 'invoicing' ),
126
+                        'singular_name'         => __( 'Invoice', 'invoicing' ),
127
+                        'all_items'             => __( 'Invoices', 'invoicing' ),
128
+                        'menu_name'             => _x( 'Invoices', 'Admin menu name', 'invoicing' ),
129
+                        'add_new'               => __( 'Add New', 'invoicing' ),
130
+                        'add_new_item'          => __( 'Add new invoice', 'invoicing' ),
131
+                        'edit'                  => __( 'Edit', 'invoicing' ),
132
+                        'edit_item'             => __( 'Edit invoice', 'invoicing' ),
133
+                        'new_item'              => __( 'New invoice', 'invoicing' ),
134
+                        'view_item'             => __( 'View invoice', 'invoicing' ),
135
+                        'view_items'            => __( 'View Invoices', 'invoicing' ),
136
+                        'search_items'          => __( 'Search invoices', 'invoicing' ),
137
+                        'not_found'             => __( 'No invoices found', 'invoicing' ),
138
+                        'not_found_in_trash'    => __( 'No invoices found in trash', 'invoicing' ),
139
+                        'parent'                => __( 'Parent invoice', 'invoicing' ),
140
+                        'featured_image'        => __( 'Invoice image', 'invoicing' ),
141
+                        'set_featured_image'    => __( 'Set invoice image', 'invoicing' ),
142
+                        'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ),
143
+                        'use_featured_image'    => __( 'Use as invoice image', 'invoicing' ),
144
+                        'insert_into_item'      => __( 'Insert into invoice', 'invoicing' ),
145
+                        'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ),
146
+                        'filter_items_list'     => __( 'Filter invoices', 'invoicing' ),
147
+                        'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ),
148
+                        'items_list'            => __( 'Invoices list', 'invoicing' ),
149
+                    ),
150
+                    'description'           => __( 'This is where invoices are stored.', 'invoicing' ),
151
+                    'public'                => true,
152
+                    'has_archive'           => false,
153
+                    'publicly_queryable'    => true,
154
+                    'exclude_from_search'   => true,
155
+                    'show_ui'               => true,
156
+                    'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
157
+                    'show_in_nav_menus'     => false,
158
+                    'supports'              => array( 'title', 'author', 'excerpt'  ),
159
+                    'rewrite'               => array(
160
+                        'slug'              => 'invoice',
161
+                        'with_front'        => false,
162
+                    ),
163
+                    'query_var'             => false,
164
+                    'capability_type'       => 'wpi_invoice',
165
+                    'map_meta_cap'          => true,
166
+                    'show_in_admin_bar'     => true,
167
+                    'can_export'            => true,
168
+                    'hierarchical'          => false,
169
+                    'menu_position'         => null,
170
+                    'menu_icon'             => 'dashicons-media-spreadsheet',
171
+                )
172
+            )
173
+        );
174 174
 
175
-		// Register discount post type.
176
-		register_post_type(
177
-			'wpi_discount',
178
-			apply_filters(
179
-				'wpinv_register_post_type_discount',
180
-				array(
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' ),
206
-					),
207
-					'description'        => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ),
208
-					'public'             => false,
209
-					'can_export'         => true,
210
-					'_builtin'           => false,
211
-					'publicly_queryable' => false,
212
-					'exclude_from_search'=> true,
213
-					'show_ui'            => true,
214
-					'show_in_menu'       => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
215
-					'query_var'          => false,
216
-					'rewrite'            => false,
217
-					'capability_type'    => 'wpi_discount',
218
-					'map_meta_cap'       => true,
219
-					'has_archive'        => false,
220
-					'hierarchical'       => false,
221
-					'supports'           => array( 'title', 'excerpt' ),
222
-					'show_in_nav_menus'  => false,
223
-					'show_in_admin_bar'  => true,
224
-					'menu_position'      => null,
225
-				)
226
-			)
227
-		);
175
+        // Register discount post type.
176
+        register_post_type(
177
+            'wpi_discount',
178
+            apply_filters(
179
+                'wpinv_register_post_type_discount',
180
+                array(
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' ),
206
+                    ),
207
+                    'description'        => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ),
208
+                    'public'             => false,
209
+                    'can_export'         => true,
210
+                    '_builtin'           => false,
211
+                    'publicly_queryable' => false,
212
+                    'exclude_from_search'=> true,
213
+                    'show_ui'            => true,
214
+                    'show_in_menu'       => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
215
+                    'query_var'          => false,
216
+                    'rewrite'            => false,
217
+                    'capability_type'    => 'wpi_discount',
218
+                    'map_meta_cap'       => true,
219
+                    'has_archive'        => false,
220
+                    'hierarchical'       => false,
221
+                    'supports'           => array( 'title', 'excerpt' ),
222
+                    'show_in_nav_menus'  => false,
223
+                    'show_in_admin_bar'  => true,
224
+                    'menu_position'      => null,
225
+                )
226
+            )
227
+        );
228 228
 
229
-		do_action( 'getpaid_after_register_post_types' );
230
-	}
229
+        do_action( 'getpaid_after_register_post_types' );
230
+    }
231 231
 
232
-	/**
233
-	 * Register our custom post statuses.
234
-	 */
235
-	public static function register_post_status() {
232
+    /**
233
+     * Register our custom post statuses.
234
+     */
235
+    public static function register_post_status() {
236 236
 
237
-		$invoice_statuses = apply_filters(
238
-			'getpaid_register_invoice_post_statuses',
239
-			array(
237
+        $invoice_statuses = apply_filters(
238
+            'getpaid_register_invoice_post_statuses',
239
+            array(
240 240
 
241
-				'wpi-pending' => array(
242
-					'label'                     => _x( 'Pending Payment', 'Invoice status', 'invoicing' ),
243
-        			'public'                    => true,
244
-        			'exclude_from_search'       => true,
245
-        			'show_in_admin_all_list'    => true,
246
-					'show_in_admin_status_list' => true,
247
-					/* translators: %s: number of invoices */
248
-        			'label_count'               => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' )
249
-				),
241
+                'wpi-pending' => array(
242
+                    'label'                     => _x( 'Pending Payment', 'Invoice status', 'invoicing' ),
243
+                    'public'                    => true,
244
+                    'exclude_from_search'       => true,
245
+                    'show_in_admin_all_list'    => true,
246
+                    'show_in_admin_status_list' => true,
247
+                    /* translators: %s: number of invoices */
248
+                    'label_count'               => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' )
249
+                ),
250 250
 
251
-				'wpi-processing' => array(
252
-					'label'                     => _x( 'Processing', 'Invoice status', 'invoicing' ),
253
-        			'public'                    => true,
254
-        			'exclude_from_search'       => true,
255
-        			'show_in_admin_all_list'    => true,
256
-					'show_in_admin_status_list' => true,
257
-					/* translators: %s: number of invoices */
258
-        			'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' )
259
-				),
251
+                'wpi-processing' => array(
252
+                    'label'                     => _x( 'Processing', 'Invoice status', 'invoicing' ),
253
+                    'public'                    => true,
254
+                    'exclude_from_search'       => true,
255
+                    'show_in_admin_all_list'    => true,
256
+                    'show_in_admin_status_list' => true,
257
+                    /* translators: %s: number of invoices */
258
+                    'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' )
259
+                ),
260 260
 
261
-				'wpi-onhold' => array(
262
-					'label'                     => _x( 'On Hold', 'Invoice status', 'invoicing' ),
263
-        			'public'                    => true,
264
-        			'exclude_from_search'       => true,
265
-        			'show_in_admin_all_list'    => true,
266
-					'show_in_admin_status_list' => true,
267
-					/* translators: %s: number of invoices */
268
-        			'label_count'               => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' )
269
-				),
261
+                'wpi-onhold' => array(
262
+                    'label'                     => _x( 'On Hold', 'Invoice status', 'invoicing' ),
263
+                    'public'                    => true,
264
+                    'exclude_from_search'       => true,
265
+                    'show_in_admin_all_list'    => true,
266
+                    'show_in_admin_status_list' => true,
267
+                    /* translators: %s: number of invoices */
268
+                    'label_count'               => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' )
269
+                ),
270 270
 
271
-				'wpi-cancelled' => array(
272
-					'label'                     => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
273
-        			'public'                    => true,
274
-        			'exclude_from_search'       => true,
275
-        			'show_in_admin_all_list'    => true,
276
-					'show_in_admin_status_list' => true,
277
-					/* translators: %s: number of invoices */
278
-        			'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' )
279
-				),
271
+                'wpi-cancelled' => array(
272
+                    'label'                     => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
273
+                    'public'                    => true,
274
+                    'exclude_from_search'       => true,
275
+                    'show_in_admin_all_list'    => true,
276
+                    'show_in_admin_status_list' => true,
277
+                    /* translators: %s: number of invoices */
278
+                    'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' )
279
+                ),
280 280
 
281
-				'wpi-refunded' => array(
282
-					'label'                     => _x( 'Refunded', 'Invoice status', 'invoicing' ),
283
-        			'public'                    => true,
284
-        			'exclude_from_search'       => true,
285
-        			'show_in_admin_all_list'    => true,
286
-					'show_in_admin_status_list' => true,
287
-					/* translators: %s: number of invoices */
288
-        			'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' )
289
-				),
281
+                'wpi-refunded' => array(
282
+                    'label'                     => _x( 'Refunded', 'Invoice status', 'invoicing' ),
283
+                    'public'                    => true,
284
+                    'exclude_from_search'       => true,
285
+                    'show_in_admin_all_list'    => true,
286
+                    'show_in_admin_status_list' => true,
287
+                    /* translators: %s: number of invoices */
288
+                    'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' )
289
+                ),
290 290
 
291
-				'wpi-failed' => array(
292
-					'label'                     => _x( 'Failed', 'Invoice status', 'invoicing' ),
293
-        			'public'                    => true,
294
-        			'exclude_from_search'       => true,
295
-        			'show_in_admin_all_list'    => true,
296
-					'show_in_admin_status_list' => true,
297
-					/* translators: %s: number of invoices */
298
-        			'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' )
299
-				),
291
+                'wpi-failed' => array(
292
+                    'label'                     => _x( 'Failed', 'Invoice status', 'invoicing' ),
293
+                    'public'                    => true,
294
+                    'exclude_from_search'       => true,
295
+                    'show_in_admin_all_list'    => true,
296
+                    'show_in_admin_status_list' => true,
297
+                    /* translators: %s: number of invoices */
298
+                    'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' )
299
+                ),
300 300
 
301
-				'wpi-renewal' => array(
302
-					'label'                     => _x( 'Renewal', 'Invoice status', 'invoicing' ),
303
-        			'public'                    => true,
304
-        			'exclude_from_search'       => true,
305
-        			'show_in_admin_all_list'    => true,
306
-					'show_in_admin_status_list' => true,
307
-					/* translators: %s: number of invoices */
308
-        			'label_count'               => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' )
309
-				)
310
-			)
311
-		);
301
+                'wpi-renewal' => array(
302
+                    'label'                     => _x( 'Renewal', 'Invoice status', 'invoicing' ),
303
+                    'public'                    => true,
304
+                    'exclude_from_search'       => true,
305
+                    'show_in_admin_all_list'    => true,
306
+                    'show_in_admin_status_list' => true,
307
+                    /* translators: %s: number of invoices */
308
+                    'label_count'               => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' )
309
+                )
310
+            )
311
+        );
312 312
 
313
-		foreach ( $invoice_statuses as $invoice_statuse => $args ) {
314
-			register_post_status( $invoice_statuse, $args );
315
-		}
316
-	}
313
+        foreach ( $invoice_statuses as $invoice_statuse => $args ) {
314
+            register_post_status( $invoice_statuse, $args );
315
+        }
316
+    }
317 317
 
318
-	/**
319
-	 * Flush rewrite rules.
320
-	 */
321
-	public static function flush_rewrite_rules() {
322
-		flush_rewrite_rules();
323
-	}
318
+    /**
319
+     * Flush rewrite rules.
320
+     */
321
+    public static function flush_rewrite_rules() {
322
+        flush_rewrite_rules();
323
+    }
324 324
 
325
-	/**
326
-	 * Flush rules to prevent 404.
327
-	 *
328
-	 */
329
-	public static function maybe_flush_rewrite_rules() {
330
-		if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) {
331
-			update_option( 'getpaid_flushed_rewrite_rules', '1' );
332
-			self::flush_rewrite_rules();
333
-		}
334
-	}
325
+    /**
326
+     * Flush rules to prevent 404.
327
+     *
328
+     */
329
+    public static function maybe_flush_rewrite_rules() {
330
+        if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) {
331
+            update_option( 'getpaid_flushed_rewrite_rules', '1' );
332
+            self::flush_rewrite_rules();
333
+        }
334
+    }
335 335
 
336 336
 }
Please login to merge, or discard this 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,12 +29,12 @@  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
 		// Fires before registering post types.
37
-		do_action( 'getpaid_register_post_types' );
37
+		do_action('getpaid_register_post_types');
38 38
 
39 39
 		// Register item post type.
40 40
 		register_post_type(
@@ -43,29 +43,29 @@  discard block
 block discarded – undo
43 43
 				'wpinv_register_post_type_invoice_item',
44 44
 				array(
45 45
 					'labels'             => array(
46
-						'name'               => _x( 'Items', 'post type general name', 'invoicing' ),
47
-						'singular_name'      => _x( 'Item', 'post type singular name', 'invoicing' ),
48
-						'menu_name'          => _x( 'Items', 'admin menu', 'invoicing' ),
49
-						'name_admin_bar'     => _x( 'Item', 'add new on admin bar', 'invoicing' ),
50
-						'add_new'            => _x( 'Add New', 'Item', 'invoicing' ),
51
-						'add_new_item'       => __( 'Add New Item', 'invoicing' ),
52
-						'new_item'           => __( 'New Item', 'invoicing' ),
53
-						'edit_item'          => __( 'Edit Item', 'invoicing' ),
54
-						'view_item'          => __( 'View Item', 'invoicing' ),
55
-						'all_items'          => __( 'Items', 'invoicing' ),
56
-						'search_items'       => __( 'Search items', 'invoicing' ),
57
-						'parent_item_colon'  => __( 'Parent item:', 'invoicing' ),
58
-						'not_found'          => __( 'No items found.', 'invoicing' ),
59
-						'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' )
46
+						'name'               => _x('Items', 'post type general name', 'invoicing'),
47
+						'singular_name'      => _x('Item', 'post type singular name', 'invoicing'),
48
+						'menu_name'          => _x('Items', 'admin menu', 'invoicing'),
49
+						'name_admin_bar'     => _x('Item', 'add new on admin bar', 'invoicing'),
50
+						'add_new'            => _x('Add New', 'Item', 'invoicing'),
51
+						'add_new_item'       => __('Add New Item', 'invoicing'),
52
+						'new_item'           => __('New Item', 'invoicing'),
53
+						'edit_item'          => __('Edit Item', 'invoicing'),
54
+						'view_item'          => __('View Item', 'invoicing'),
55
+						'all_items'          => __('Items', 'invoicing'),
56
+						'search_items'       => __('Search items', 'invoicing'),
57
+						'parent_item_colon'  => __('Parent item:', 'invoicing'),
58
+						'not_found'          => __('No items found.', 'invoicing'),
59
+						'not_found_in_trash' => __('No items found in trash.', 'invoicing')
60 60
 					),
61
-					'description'           => __( 'This is where you can add new invoice items.', 'invoicing' ),
61
+					'description'           => __('This is where you can add new invoice items.', 'invoicing'),
62 62
 					'public'                => false,
63 63
 					'has_archive'           => false,
64 64
 					'_builtin'              => false,
65 65
 					'show_ui'               => true,
66 66
 					'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
67 67
 					'show_in_nav_menus'     => false,
68
-					'supports'              => array( 'title', 'excerpt', 'thumbnail' ),
68
+					'supports'              => array('title', 'excerpt', 'thumbnail'),
69 69
 					'rewrite'               => false,
70 70
 					'query_var'             => false,
71 71
 					'capability_type'       => 'wpi_item',
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
 				'wpinv_register_post_type_payment_form',
84 84
 				array(
85 85
 					'labels'             => array(
86
-						'name'               => _x( 'Payment Forms', 'post type general name', 'invoicing' ),
87
-						'singular_name'      => _x( 'Payment Form', 'post type singular name', 'invoicing' ),
88
-						'menu_name'          => _x( 'Payment Forms', 'admin menu', 'invoicing' ),
89
-						'name_admin_bar'     => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ),
90
-						'add_new'            => _x( 'Add New', 'Payment Form', 'invoicing' ),
91
-						'add_new_item'       => __( 'Add New Payment Form', 'invoicing' ),
92
-						'new_item'           => __( 'New Payment Form', 'invoicing' ),
93
-						'edit_item'          => __( 'Edit Payment Form', 'invoicing' ),
94
-						'view_item'          => __( 'View Payment Form', 'invoicing' ),
95
-						'all_items'          => __( 'Payment Forms', 'invoicing' ),
96
-						'search_items'       => __( 'Search Payment Forms', 'invoicing' ),
97
-						'parent_item_colon'  => __( 'Parent Payment Forms:', 'invoicing' ),
98
-						'not_found'          => __( 'No payment forms found.', 'invoicing' ),
99
-						'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' )
86
+						'name'               => _x('Payment Forms', 'post type general name', 'invoicing'),
87
+						'singular_name'      => _x('Payment Form', 'post type singular name', 'invoicing'),
88
+						'menu_name'          => _x('Payment Forms', 'admin menu', 'invoicing'),
89
+						'name_admin_bar'     => _x('Payment Form', 'add new on admin bar', 'invoicing'),
90
+						'add_new'            => _x('Add New', 'Payment Form', 'invoicing'),
91
+						'add_new_item'       => __('Add New Payment Form', 'invoicing'),
92
+						'new_item'           => __('New Payment Form', 'invoicing'),
93
+						'edit_item'          => __('Edit Payment Form', 'invoicing'),
94
+						'view_item'          => __('View Payment Form', 'invoicing'),
95
+						'all_items'          => __('Payment Forms', 'invoicing'),
96
+						'search_items'       => __('Search Payment Forms', 'invoicing'),
97
+						'parent_item_colon'  => __('Parent Payment Forms:', 'invoicing'),
98
+						'not_found'          => __('No payment forms found.', 'invoicing'),
99
+						'not_found_in_trash' => __('No payment forms found in trash.', 'invoicing')
100 100
 					),
101
-					'description'        => __( 'Add new payment forms.', 'invoicing' ),
101
+					'description'        => __('Add new payment forms.', 'invoicing'),
102 102
 					'public'             => false,
103 103
 					'show_ui'            => true,
104 104
 					'show_in_menu'       => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : true,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 					'has_archive'        => false,
110 110
 					'hierarchical'       => false,
111 111
 					'menu_position'      => null,
112
-					'supports'           => array( 'title' ),
112
+					'supports'           => array('title'),
113 113
 					'menu_icon'          => 'dashicons-media-form',
114 114
 				)
115 115
 			)
@@ -122,32 +122,32 @@  discard block
 block discarded – undo
122 122
 				'wpinv_register_post_type_invoice',
123 123
 				array(
124 124
 					'labels'                 => array(
125
-						'name'                  => __( 'Invoices', 'invoicing' ),
126
-						'singular_name'         => __( 'Invoice', 'invoicing' ),
127
-						'all_items'             => __( 'Invoices', 'invoicing' ),
128
-						'menu_name'             => _x( 'Invoices', 'Admin menu name', 'invoicing' ),
129
-						'add_new'               => __( 'Add New', 'invoicing' ),
130
-						'add_new_item'          => __( 'Add new invoice', 'invoicing' ),
131
-						'edit'                  => __( 'Edit', 'invoicing' ),
132
-						'edit_item'             => __( 'Edit invoice', 'invoicing' ),
133
-						'new_item'              => __( 'New invoice', 'invoicing' ),
134
-						'view_item'             => __( 'View invoice', 'invoicing' ),
135
-						'view_items'            => __( 'View Invoices', 'invoicing' ),
136
-						'search_items'          => __( 'Search invoices', 'invoicing' ),
137
-						'not_found'             => __( 'No invoices found', 'invoicing' ),
138
-						'not_found_in_trash'    => __( 'No invoices found in trash', 'invoicing' ),
139
-						'parent'                => __( 'Parent invoice', 'invoicing' ),
140
-						'featured_image'        => __( 'Invoice image', 'invoicing' ),
141
-						'set_featured_image'    => __( 'Set invoice image', 'invoicing' ),
142
-						'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ),
143
-						'use_featured_image'    => __( 'Use as invoice image', 'invoicing' ),
144
-						'insert_into_item'      => __( 'Insert into invoice', 'invoicing' ),
145
-						'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ),
146
-						'filter_items_list'     => __( 'Filter invoices', 'invoicing' ),
147
-						'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ),
148
-						'items_list'            => __( 'Invoices list', 'invoicing' ),
125
+						'name'                  => __('Invoices', 'invoicing'),
126
+						'singular_name'         => __('Invoice', 'invoicing'),
127
+						'all_items'             => __('Invoices', 'invoicing'),
128
+						'menu_name'             => _x('Invoices', 'Admin menu name', 'invoicing'),
129
+						'add_new'               => __('Add New', 'invoicing'),
130
+						'add_new_item'          => __('Add new invoice', 'invoicing'),
131
+						'edit'                  => __('Edit', 'invoicing'),
132
+						'edit_item'             => __('Edit invoice', 'invoicing'),
133
+						'new_item'              => __('New invoice', 'invoicing'),
134
+						'view_item'             => __('View invoice', 'invoicing'),
135
+						'view_items'            => __('View Invoices', 'invoicing'),
136
+						'search_items'          => __('Search invoices', 'invoicing'),
137
+						'not_found'             => __('No invoices found', 'invoicing'),
138
+						'not_found_in_trash'    => __('No invoices found in trash', 'invoicing'),
139
+						'parent'                => __('Parent invoice', 'invoicing'),
140
+						'featured_image'        => __('Invoice image', 'invoicing'),
141
+						'set_featured_image'    => __('Set invoice image', 'invoicing'),
142
+						'remove_featured_image' => __('Remove invoice image', 'invoicing'),
143
+						'use_featured_image'    => __('Use as invoice image', 'invoicing'),
144
+						'insert_into_item'      => __('Insert into invoice', 'invoicing'),
145
+						'uploaded_to_this_item' => __('Uploaded to this invoice', 'invoicing'),
146
+						'filter_items_list'     => __('Filter invoices', 'invoicing'),
147
+						'items_list_navigation' => __('Invoices navigation', 'invoicing'),
148
+						'items_list'            => __('Invoices list', 'invoicing'),
149 149
 					),
150
-					'description'           => __( 'This is where invoices are stored.', 'invoicing' ),
150
+					'description'           => __('This is where invoices are stored.', 'invoicing'),
151 151
 					'public'                => true,
152 152
 					'has_archive'           => false,
153 153
 					'publicly_queryable'    => true,
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         			'show_ui'               => true,
156 156
 					'show_in_menu'          => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false,
157 157
 					'show_in_nav_menus'     => false,
158
-					'supports'              => array( 'title', 'author', 'excerpt'  ),
158
+					'supports'              => array('title', 'author', 'excerpt'),
159 159
 					'rewrite'               => array(
160 160
 						'slug'              => 'invoice',
161 161
 						'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,
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 					'map_meta_cap'       => true,
219 219
 					'has_archive'        => false,
220 220
 					'hierarchical'       => false,
221
-					'supports'           => array( 'title', 'excerpt' ),
221
+					'supports'           => array('title', 'excerpt'),
222 222
 					'show_in_nav_menus'  => false,
223 223
 					'show_in_admin_bar'  => true,
224 224
 					'menu_position'      => null,
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			)
227 227
 		);
228 228
 
229
-		do_action( 'getpaid_after_register_post_types' );
229
+		do_action('getpaid_after_register_post_types');
230 230
 	}
231 231
 
232 232
 	/**
@@ -239,79 +239,79 @@  discard block
 block discarded – undo
239 239
 			array(
240 240
 
241 241
 				'wpi-pending' => array(
242
-					'label'                     => _x( 'Pending Payment', 'Invoice status', 'invoicing' ),
242
+					'label'                     => _x('Pending Payment', 'Invoice status', 'invoicing'),
243 243
         			'public'                    => true,
244 244
         			'exclude_from_search'       => true,
245 245
         			'show_in_admin_all_list'    => true,
246 246
 					'show_in_admin_status_list' => true,
247 247
 					/* translators: %s: number of invoices */
248
-        			'label_count'               => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' )
248
+        			'label_count'               => _n_noop('Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing')
249 249
 				),
250 250
 
251 251
 				'wpi-processing' => array(
252
-					'label'                     => _x( 'Processing', 'Invoice status', 'invoicing' ),
252
+					'label'                     => _x('Processing', 'Invoice status', 'invoicing'),
253 253
         			'public'                    => true,
254 254
         			'exclude_from_search'       => true,
255 255
         			'show_in_admin_all_list'    => true,
256 256
 					'show_in_admin_status_list' => true,
257 257
 					/* translators: %s: number of invoices */
258
-        			'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' )
258
+        			'label_count'               => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing')
259 259
 				),
260 260
 
261 261
 				'wpi-onhold' => array(
262
-					'label'                     => _x( 'On Hold', 'Invoice status', 'invoicing' ),
262
+					'label'                     => _x('On Hold', 'Invoice status', 'invoicing'),
263 263
         			'public'                    => true,
264 264
         			'exclude_from_search'       => true,
265 265
         			'show_in_admin_all_list'    => true,
266 266
 					'show_in_admin_status_list' => true,
267 267
 					/* translators: %s: number of invoices */
268
-        			'label_count'               => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' )
268
+        			'label_count'               => _n_noop('On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing')
269 269
 				),
270 270
 
271 271
 				'wpi-cancelled' => array(
272
-					'label'                     => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
272
+					'label'                     => _x('Cancelled', 'Invoice status', 'invoicing'),
273 273
         			'public'                    => true,
274 274
         			'exclude_from_search'       => true,
275 275
         			'show_in_admin_all_list'    => true,
276 276
 					'show_in_admin_status_list' => true,
277 277
 					/* translators: %s: number of invoices */
278
-        			'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' )
278
+        			'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing')
279 279
 				),
280 280
 
281 281
 				'wpi-refunded' => array(
282
-					'label'                     => _x( 'Refunded', 'Invoice status', 'invoicing' ),
282
+					'label'                     => _x('Refunded', 'Invoice status', 'invoicing'),
283 283
         			'public'                    => true,
284 284
         			'exclude_from_search'       => true,
285 285
         			'show_in_admin_all_list'    => true,
286 286
 					'show_in_admin_status_list' => true,
287 287
 					/* translators: %s: number of invoices */
288
-        			'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' )
288
+        			'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing')
289 289
 				),
290 290
 
291 291
 				'wpi-failed' => array(
292
-					'label'                     => _x( 'Failed', 'Invoice status', 'invoicing' ),
292
+					'label'                     => _x('Failed', 'Invoice status', 'invoicing'),
293 293
         			'public'                    => true,
294 294
         			'exclude_from_search'       => true,
295 295
         			'show_in_admin_all_list'    => true,
296 296
 					'show_in_admin_status_list' => true,
297 297
 					/* translators: %s: number of invoices */
298
-        			'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' )
298
+        			'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing')
299 299
 				),
300 300
 
301 301
 				'wpi-renewal' => array(
302
-					'label'                     => _x( 'Renewal', 'Invoice status', 'invoicing' ),
302
+					'label'                     => _x('Renewal', 'Invoice status', 'invoicing'),
303 303
         			'public'                    => true,
304 304
         			'exclude_from_search'       => true,
305 305
         			'show_in_admin_all_list'    => true,
306 306
 					'show_in_admin_status_list' => true,
307 307
 					/* translators: %s: number of invoices */
308
-        			'label_count'               => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' )
308
+        			'label_count'               => _n_noop('Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing')
309 309
 				)
310 310
 			)
311 311
 		);
312 312
 
313
-		foreach ( $invoice_statuses as $invoice_statuse => $args ) {
314
-			register_post_status( $invoice_statuse, $args );
313
+		foreach ($invoice_statuses as $invoice_statuse => $args) {
314
+			register_post_status($invoice_statuse, $args);
315 315
 		}
316 316
 	}
317 317
 
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 	 *
328 328
 	 */
329 329
 	public static function maybe_flush_rewrite_rules() {
330
-		if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) {
331
-			update_option( 'getpaid_flushed_rewrite_rules', '1' );
330
+		if (!get_option('getpaid_flushed_rewrite_rules')) {
331
+			update_option('getpaid_flushed_rewrite_rules', '1');
332 332
 			self::flush_rewrite_rules();
333 333
 		}
334 334
 	}
Please login to merge, or discard this patch.
admin/meta-boxes/class-getpaid-meta-box-invoice-shipping-address.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 if ( ! defined( 'ABSPATH' ) ) {
10
-	exit; // Exit if accessed directly
10
+    exit; // Exit if accessed directly
11 11
 }
12 12
 
13 13
 /**
@@ -15,22 +15,22 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class GetPaid_Meta_Box_Invoice_Shipping_Address {
17 17
 
18
-	/**
19
-	 * Output the metabox.
20
-	 *
21
-	 * @param WP_Post $post
22
-	 */
23
-	public static function output( $post ) {
18
+    /**
19
+     * Output the metabox.
20
+     *
21
+     * @param WP_Post $post
22
+     */
23
+    public static function output( $post ) {
24 24
 
25
-		// Retrieve shipping address.
26
-		$shipping_address = get_post_meta( $post->ID, 'shipping_address', true );
25
+        // Retrieve shipping address.
26
+        $shipping_address = get_post_meta( $post->ID, 'shipping_address', true );
27 27
 
28
-		// Abort if it is invalid.
29
-		if ( ! is_array( $shipping_address ) ) {
30
-			return;
31
-		}
28
+        // Abort if it is invalid.
29
+        if ( ! is_array( $shipping_address ) ) {
30
+            return;
31
+        }
32 32
 
33
-		?>
33
+        ?>
34 34
 
35 35
 		<div class="bsui">
36 36
 
@@ -55,31 +55,31 @@  discard block
 block discarded – undo
55 55
 
56 56
 		<?php
57 57
 
58
-	}
58
+    }
59 59
 
60
-	/**
61
-	 * Prepares a value.
62
-	 *
63
-	 * @param array $address
64
-	 * @param string $key
65
-	 * @return string
66
-	 */
67
-	public static function prepare_for_display( $address, $key ) {
60
+    /**
61
+     * Prepares a value.
62
+     *
63
+     * @param array $address
64
+     * @param string $key
65
+     * @return string
66
+     */
67
+    public static function prepare_for_display( $address, $key ) {
68 68
 
69
-		// Prepare the value.
70
-		$value = $address[ $key ];
69
+        // Prepare the value.
70
+        $value = $address[ $key ];
71 71
 
72
-		if ( $key == 'country' ) {
73
-			$value = wpinv_country_name( $value );
74
-		}
72
+        if ( $key == 'country' ) {
73
+            $value = wpinv_country_name( $value );
74
+        }
75 75
 
76
-		if ( $key == 'state' ) {
77
-			$country = isset( $address[ 'country' ] ) ? $address[ 'country' ] : wpinv_get_default_country();
78
-			$value = wpinv_state_name( $value, $country );
79
-		}
76
+        if ( $key == 'state' ) {
77
+            $country = isset( $address[ 'country' ] ) ? $address[ 'country' ] : wpinv_get_default_country();
78
+            $value = wpinv_state_name( $value, $country );
79
+        }
80 80
 
81
-		return sanitize_text_field( $value );
81
+        return sanitize_text_field( $value );
82 82
 
83
-	}
83
+    }
84 84
 
85 85
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  *
7 7
  */
8 8
 
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if (!defined('ABSPATH')) {
10 10
 	exit; // Exit if accessed directly
11 11
 }
12 12
 
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @param WP_Post $post
22 22
 	 */
23
-	public static function output( $post ) {
23
+	public static function output($post) {
24 24
 
25 25
 		// Retrieve shipping address.
26
-		$shipping_address = get_post_meta( $post->ID, 'shipping_address', true );
26
+		$shipping_address = get_post_meta($post->ID, 'shipping_address', true);
27 27
 
28 28
 		// Abort if it is invalid.
29
-		if ( ! is_array( $shipping_address ) ) {
29
+		if (!is_array($shipping_address)) {
30 30
 			return;
31 31
 		}
32 32
 
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 
35 35
 		<div class="bsui">
36 36
 
37
-			<?php foreach ( getpaid_user_address_fields() as $key => $label ) : ?>
37
+			<?php foreach (getpaid_user_address_fields() as $key => $label) : ?>
38 38
 
39
-					<?php if ( ! empty( $shipping_address[ $key ] ) ) : ?>
39
+					<?php if (!empty($shipping_address[$key])) : ?>
40 40
 
41 41
 						<div class="form-group form-row">
42 42
 							<div class="col">
43
-								<span style="font-weight: 600"><?php echo sanitize_text_field( $label ); ?>:</span>
43
+								<span style="font-weight: 600"><?php echo sanitize_text_field($label); ?>:</span>
44 44
 							</div>
45 45
 							<div class="col">
46
-								<?php echo self::prepare_for_display( $shipping_address, $key ); ?>
46
+								<?php echo self::prepare_for_display($shipping_address, $key); ?>
47 47
 							</div>
48 48
 						</div>
49 49
 
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 	 * @param string $key
65 65
 	 * @return string
66 66
 	 */
67
-	public static function prepare_for_display( $address, $key ) {
67
+	public static function prepare_for_display($address, $key) {
68 68
 
69 69
 		// Prepare the value.
70
-		$value = $address[ $key ];
70
+		$value = $address[$key];
71 71
 
72
-		if ( $key == 'country' ) {
73
-			$value = wpinv_country_name( $value );
72
+		if ($key == 'country') {
73
+			$value = wpinv_country_name($value);
74 74
 		}
75 75
 
76
-		if ( $key == 'state' ) {
77
-			$country = isset( $address[ 'country' ] ) ? $address[ 'country' ] : wpinv_get_default_country();
78
-			$value = wpinv_state_name( $value, $country );
76
+		if ($key == 'state') {
77
+			$country = isset($address['country']) ? $address['country'] : wpinv_get_default_country();
78
+			$value = wpinv_state_name($value, $country);
79 79
 		}
80 80
 
81
-		return sanitize_text_field( $value );
81
+		return sanitize_text_field($value);
82 82
 
83 83
 	}
84 84
 
Please login to merge, or discard this patch.
includes/data/payment-form-elements.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -9,41 +9,41 @@  discard block
 block discarded – undo
9 9
  * @version 1.0.19
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) || exit;
12
+defined('ABSPATH') || exit;
13 13
 
14 14
 return array(
15 15
 
16 16
     array(
17 17
         'type'     => 'heading',
18
-        'name'     => __( 'Heading', 'invoicing' ),
18
+        'name'     => __('Heading', 'invoicing'),
19 19
         'defaults' => array(
20 20
             'level' => 'h2',
21
-            'text'  => __( 'Heading', 'invoicing' ),
21
+            'text'  => __('Heading', 'invoicing'),
22 22
         )
23 23
     ),
24 24
 
25 25
     array(
26 26
         'type' => 'paragraph',
27
-        'name' => __( 'Paragraph', 'invoicing' ),
27
+        'name' => __('Paragraph', 'invoicing'),
28 28
         'defaults'  => array(
29
-            'text'  => __( 'Paragraph text', 'invoicing' ),
29
+            'text'  => __('Paragraph text', 'invoicing'),
30 30
         )
31 31
     ),
32 32
 
33 33
     array( 
34 34
         'type' => 'alert',
35
-        'name' => __( 'Alert', 'invoicing' ),
35
+        'name' => __('Alert', 'invoicing'),
36 36
         'defaults'  => array(
37 37
             'value'        => '',
38 38
             'class'        => 'alert-warning',
39
-            'text'         => __( 'Alert', 'invoicing' ),
39
+            'text'         => __('Alert', 'invoicing'),
40 40
             'dismissible'  => false,
41 41
         )
42 42
     ),
43 43
 
44 44
     array( 
45 45
         'type' => 'separator',
46
-        'name' => __( 'Separator', 'invoicing' ),
46
+        'name' => __('Separator', 'invoicing'),
47 47
         'defaults'  => array(
48 48
             'value'        => '',
49 49
         ),
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 
52 52
     array(
53 53
         'type' => 'text',
54
-        'name' => __( 'Text Input', 'invoicing' ),
54
+        'name' => __('Text Input', 'invoicing'),
55 55
         'defaults'  => array(
56
-            'placeholder'  => __( 'Enter some text', 'invoicing' ),
56
+            'placeholder'  => __('Enter some text', 'invoicing'),
57 57
             'value'        => '',
58
-            'label'        => __( 'Field Label', 'invoicing' ),
58
+            'label'        => __('Field Label', 'invoicing'),
59 59
             'description'  => '',
60 60
             'required'     => false,
61 61
         )
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 
64 64
     array(
65 65
         'type' => 'textarea',
66
-        'name' => __( 'Textarea', 'invoicing' ),
66
+        'name' => __('Textarea', 'invoicing'),
67 67
         'defaults'         => array(
68
-            'placeholder'  => __( 'Enter your text hear', 'invoicing' ),
68
+            'placeholder'  => __('Enter your text hear', 'invoicing'),
69 69
             'value'        => '',
70
-            'label'        => __( 'Textarea Label', 'invoicing' ),
70
+            'label'        => __('Textarea Label', 'invoicing'),
71 71
             'description'  => '',
72 72
             'required'     => false,
73 73
         )
@@ -75,27 +75,27 @@  discard block
 block discarded – undo
75 75
 
76 76
     array(
77 77
         'type' => 'select',
78
-        'name' => __( 'Dropdown', 'invoicing' ),
78
+        'name' => __('Dropdown', 'invoicing'),
79 79
         'defaults'         => array(
80
-            'placeholder'  => __( 'Select a value', 'invoicing' ),
80
+            'placeholder'  => __('Select a value', 'invoicing'),
81 81
             'value'        => '',
82
-            'label'        => __( 'Dropdown Label', 'invoicing' ),
82
+            'label'        => __('Dropdown Label', 'invoicing'),
83 83
             'description'  => '',
84 84
             'required'     => false,
85 85
             'options'      => array(
86
-                esc_attr__( 'Option One', 'invoicing' ),
87
-                esc_attr__( 'Option Two', 'invoicing' ),
88
-                esc_attr__( 'Option Three', 'invoicing' )
86
+                esc_attr__('Option One', 'invoicing'),
87
+                esc_attr__('Option Two', 'invoicing'),
88
+                esc_attr__('Option Three', 'invoicing')
89 89
             ),
90 90
         )
91 91
     ),
92 92
 
93 93
     array(
94 94
         'type' => 'checkbox',
95
-        'name' => __( 'Checkbox', 'invoicing' ),
95
+        'name' => __('Checkbox', 'invoicing'),
96 96
         'defaults'         => array(
97 97
             'value'        => '',
98
-            'label'        => __( 'Checkbox Label', 'invoicing' ),
98
+            'label'        => __('Checkbox Label', 'invoicing'),
99 99
             'description'  => '',
100 100
             'required'     => false,
101 101
         )
@@ -103,23 +103,23 @@  discard block
 block discarded – undo
103 103
 
104 104
     array( 
105 105
         'type' => 'radio',
106
-        'name' => __( 'Radio', 'invoicing' ),
106
+        'name' => __('Radio', 'invoicing'),
107 107
         'defaults'     => array(
108
-            'label'    => __( 'Select one choice', 'invoicing' ),
108
+            'label'    => __('Select one choice', 'invoicing'),
109 109
             'options'  => array(
110
-                esc_attr__( 'Choice One', 'invoicing' ),
111
-                esc_attr__( 'Choice Two', 'invoicing' ),
112
-                esc_attr__( 'Choice Three', 'invoicing' )
110
+                esc_attr__('Choice One', 'invoicing'),
111
+                esc_attr__('Choice Two', 'invoicing'),
112
+                esc_attr__('Choice Three', 'invoicing')
113 113
             ),
114 114
         )
115 115
     ),
116 116
 
117 117
     array( 
118 118
         'type' => 'date',
119
-        'name' => __( 'Date', 'invoicing' ),
119
+        'name' => __('Date', 'invoicing'),
120 120
         'defaults' => array(
121 121
             'value'        => '',
122
-            'label'        => __( 'Date', 'invoicing' ),
122
+            'label'        => __('Date', 'invoicing'),
123 123
             'description'  => '',
124 124
             'required'     => false,
125 125
         )
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 
128 128
     array( 
129 129
         'type' => 'time',
130
-        'name' => __( 'Time', 'invoicing' ),
130
+        'name' => __('Time', 'invoicing'),
131 131
         'defaults' => array(
132 132
             'value'        => '',
133
-            'label'        => __( 'Time', 'invoicing' ),
133
+            'label'        => __('Time', 'invoicing'),
134 134
             'description'  => '',
135 135
             'required'     => false,
136 136
         )
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 
139 139
     array( 
140 140
         'type' => 'number',
141
-        'name' => __( 'Number', 'invoicing' ),
141
+        'name' => __('Number', 'invoicing'),
142 142
         'defaults' => array(
143 143
             'placeholder'  => '',
144 144
             'value'        => '',
145
-            'label'        => __( 'Number', 'invoicing' ),
145
+            'label'        => __('Number', 'invoicing'),
146 146
             'description'  => '',
147 147
             'required'     => false,
148 148
         )
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 
151 151
     array( 
152 152
         'type' => 'website',
153
-        'name' => __( 'Website', 'invoicing' ),
153
+        'name' => __('Website', 'invoicing'),
154 154
         'defaults' => array(
155 155
             'placeholder'  => 'http://example.com',
156 156
             'value'        => '',
157
-            'label'        => __( 'Website', 'invoicing' ),
157
+            'label'        => __('Website', 'invoicing'),
158 158
             'description'  => '',
159 159
             'required'     => false,
160 160
         )
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 
163 163
     array( 
164 164
         'type' => 'email',
165
-        'name' => __( 'Email', 'invoicing' ),
165
+        'name' => __('Email', 'invoicing'),
166 166
         'defaults'  => array(
167 167
             'placeholder'  => '[email protected]',
168 168
             'value'        => '',
169
-            'label'        => __( 'Email Address', 'invoicing' ),
169
+            'label'        => __('Email Address', 'invoicing'),
170 170
             'description'  => '',
171 171
             'required'     => false,
172 172
         )
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
 
175 175
     array( 
176 176
         'type' => 'address',
177
-        'name' => __( 'Address', 'invoicing' ),
177
+        'name' => __('Address', 'invoicing'),
178 178
         'defaults'  => array(
179 179
 
180 180
             'address_type'            => 'billing',
181
-            'billing_address_title'   => __( 'Billing Address', 'invoicing' ),
182
-            'shipping_address_title'  => __( 'Shipping Address', 'invoicing' ),
183
-            'shipping_address_toggle' => __( 'Same billing & shipping address.', 'invoicing' ),
181
+            'billing_address_title'   => __('Billing Address', 'invoicing'),
182
+            'shipping_address_title'  => __('Shipping Address', 'invoicing'),
183
+            'shipping_address_toggle' => __('Same billing & shipping address.', 'invoicing'),
184 184
             'fields'                  => array(
185 185
                 array(
186 186
                     'placeholder'  => 'Jon',
187 187
                     'value'        => '',
188
-                    'label'        => __( 'First Name', 'invoicing' ),
188
+                    'label'        => __('First Name', 'invoicing'),
189 189
                     'description'  => '',
190 190
                     'required'     => false,
191 191
                     'visible'      => true,
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 array(
197 197
                     'placeholder'  => 'Snow',
198 198
                     'value'        => '',
199
-                    'label'        => __( 'Last Name', 'invoicing' ),
199
+                    'label'        => __('Last Name', 'invoicing'),
200 200
                     'description'  => '',
201 201
                     'required'     => false,
202 202
                     'visible'      => true,
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 array(
208 208
                     'placeholder'  => '',
209 209
                     'value'        => '',
210
-                    'label'        => __( 'Address', 'invoicing' ),
210
+                    'label'        => __('Address', 'invoicing'),
211 211
                     'description'  => '',
212 212
                     'required'     => false,
213 213
                     'visible'      => true,
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 array(
219 219
                     'placeholder'  => '',
220 220
                     'value'        => '',
221
-                    'label'        => __( 'City', 'invoicing' ),
221
+                    'label'        => __('City', 'invoicing'),
222 222
                     'description'  => '',
223 223
                     'required'     => false,
224 224
                     'visible'      => true,
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
                 ),
228 228
 
229 229
                 array(
230
-                    'placeholder'  => __( 'Select your country' ),
230
+                    'placeholder'  => __('Select your country'),
231 231
                     'value'        => '',
232
-                    'label'        => __( 'Country', 'invoicing' ),
232
+                    'label'        => __('Country', 'invoicing'),
233 233
                     'description'  => '',
234 234
                     'required'     => false,
235 235
                     'visible'      => true,
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
                 ),
239 239
 
240 240
                 array(
241
-                    'placeholder'  => __( 'Choose a state', 'invoicing' ),
241
+                    'placeholder'  => __('Choose a state', 'invoicing'),
242 242
                     'value'        => '',
243
-                    'label'        => __( 'State / Province', 'invoicing' ),
243
+                    'label'        => __('State / Province', 'invoicing'),
244 244
                     'description'  => '',
245 245
                     'required'     => false,
246 246
                     'visible'      => true,
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                 array(
252 252
                     'placeholder'  => '',
253 253
                     'value'        => '',
254
-                    'label'        => __( 'ZIP / Postcode', 'invoicing' ),
254
+                    'label'        => __('ZIP / Postcode', 'invoicing'),
255 255
                     'description'  => '',
256 256
                     'required'     => false,
257 257
                     'visible'      => true,
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 array(
263 263
                     'placeholder'  => '',
264 264
                     'value'        => '',
265
-                    'label'        => __( 'Phone', 'invoicing' ),
265
+                    'label'        => __('Phone', 'invoicing'),
266 266
                     'description'  => '',
267 267
                     'required'     => false,
268 268
                     'visible'      => true,
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                 array(
274 274
                     'placeholder'  => '',
275 275
                     'value'        => '',
276
-                    'label'        => __( 'Company', 'invoicing' ),
276
+                    'label'        => __('Company', 'invoicing'),
277 277
                     'description'  => '',
278 278
                     'required'     => false,
279 279
                     'visible'      => false,
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 array(
285 285
                     'placeholder'  => '',
286 286
                     'value'        => '',
287
-                    'label'        => __( 'VAT Number', 'invoicing' ),
287
+                    'label'        => __('VAT Number', 'invoicing'),
288 288
                     'description'  => '',
289 289
                     'required'     => false,
290 290
                     'visible'      => false,
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
 
298 298
     array( 
299 299
         'type' => 'billing_email',
300
-        'name' => __( 'Billing Email', 'invoicing' ),
300
+        'name' => __('Billing Email', 'invoicing'),
301 301
         'defaults'  => array(
302 302
             'placeholder'  => '[email protected]',
303 303
             'value'        => '',
304
-            'label'        => __( 'Billing Email', 'invoicing' ),
304
+            'label'        => __('Billing Email', 'invoicing'),
305 305
             'description'  => '',
306 306
             'premade'      => true,
307 307
         )
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 
310 310
     array( 
311 311
         'type' => 'discount',
312
-        'name' => __( 'Discount Input', 'invoicing' ),
312
+        'name' => __('Discount Input', 'invoicing'),
313 313
         'defaults'  => array(
314 314
             'value'        => '',
315
-            'input_label'  => __( 'Coupon Code', 'invoicing' ),
316
-            'button_label' => __( 'Apply Coupon', 'invoicing' ),
317
-            'description'  => __( 'Have a discount code? Enter it above.', 'invoicing' ),
315
+            'input_label'  => __('Coupon Code', 'invoicing'),
316
+            'button_label' => __('Apply Coupon', 'invoicing'),
317
+            'description'  => __('Have a discount code? Enter it above.', 'invoicing'),
318 318
         )
319 319
     ),
320 320
 
321 321
     array( 
322 322
         'type' => 'items',
323
-        'name' => __( 'Items', 'invoicing' ),
323
+        'name' => __('Items', 'invoicing'),
324 324
         'defaults'  => array(
325 325
             'value'        => '',
326 326
             'items_type'   => 'total',
@@ -332,22 +332,22 @@  discard block
 block discarded – undo
332 332
 
333 333
     array( 
334 334
         'type' => 'price_input',
335
-        'name' => __( 'Price Input', 'invoicing' ),
335
+        'name' => __('Price Input', 'invoicing'),
336 336
         'defaults'  => array(
337 337
             'placeholder'  => wpinv_format_amount(0),
338 338
             'value'        => wpinv_format_amount(0),
339 339
             'minimum'      => wpinv_format_amount(0),
340
-            'label'        => __( 'Enter Amount', 'invoicing' ),
340
+            'label'        => __('Enter Amount', 'invoicing'),
341 341
             'description'  => '',
342 342
         )
343 343
     ),
344 344
 
345 345
     array( 
346 346
         'type' => 'price_select',
347
-        'name' => __( 'Price Select', 'invoicing' ),
347
+        'name' => __('Price Select', 'invoicing'),
348 348
         'defaults'  => array(
349 349
             'description'  => '',
350
-            'label'        => __( 'Select Amount', 'invoicing' ),
350
+            'label'        => __('Select Amount', 'invoicing'),
351 351
             'options'      => 'Option 1|10, Option 2|20',
352 352
             'placeholder'  => '',
353 353
             'select_type'  => 'select',
@@ -356,39 +356,39 @@  discard block
 block discarded – undo
356 356
 
357 357
     array( 
358 358
         'type'       => 'pay_button',
359
-        'name'       => __( 'Payment Button', 'invoicing' ),
359
+        'name'       => __('Payment Button', 'invoicing'),
360 360
         'defaults'   => array(
361 361
             'value'          => '',
362 362
             'class'          => 'btn-primary',
363
-            'label'          => __( 'Pay %price% »', 'invoicing' ),
364
-            'free'           => __( 'Continue »', 'invoicing' ),
365
-            'description'    => __( 'By continuing with our payment, you are agreeing to our privacy policy and terms of service.', 'invoicing' ),
363
+            'label'          => __('Pay %price% »', 'invoicing'),
364
+            'free'           => __('Continue »', 'invoicing'),
365
+            'description'    => __('By continuing with our payment, you are agreeing to our privacy policy and terms of service.', 'invoicing'),
366 366
             'premade'        => true,
367 367
         )
368 368
     ),
369 369
 
370 370
     array(
371 371
         'type'       => 'gateway_select',
372
-        'name'       => __( 'Gateway Select', 'invoicing' ),
372
+        'name'       => __('Gateway Select', 'invoicing'),
373 373
         'defaults'   => array(
374
-            'text'    => __( 'Select Payment Method', 'invoicing' ),
374
+            'text'    => __('Select Payment Method', 'invoicing'),
375 375
             'premade' => true,
376 376
         )
377 377
     ),
378 378
 
379 379
     array( 
380 380
         'type'       => 'total_payable',
381
-        'name'       => __( 'Total Payable', 'invoicing' ),
381
+        'name'       => __('Total Payable', 'invoicing'),
382 382
         'defaults'   => array(
383
-            'text' => __( 'Total to pay:', 'invoicing' ),
383
+            'text' => __('Total to pay:', 'invoicing'),
384 384
         )
385 385
     ),
386 386
 
387 387
     array( 
388 388
         'type'       => 'ip_address',
389
-        'name'       => __( 'IP Address', 'invoicing' ),
389
+        'name'       => __('IP Address', 'invoicing'),
390 390
         'defaults'   => array(
391
-            'text' => __( 'Your IP address is:', 'invoicing' ),
391
+            'text' => __('Your IP address is:', 'invoicing'),
392 392
         )
393 393
     )
394 394
 );
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/address.php 1 patch
Spacing   +16 added lines, -16 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
 
@@ -31,44 +31,44 @@  discard block
 block discarded – undo
31 31
 
32 32
                 <div class='form-group'>
33 33
                     <label class="d-block">
34
-                        <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span>
34
+                        <span><?php esc_html_e('Field Label', 'invoicing'); ?></span>
35 35
                         <input v-model='field.label' class='form-control' type="text"/>
36 36
                     </label>
37 37
                 </div>
38 38
 
39 39
                 <div class='form-group'>
40 40
                     <label class="d-block">
41
-                        <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span>
41
+                        <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span>
42 42
                         <input v-model='field.placeholder' class='form-control' type="text"/>
43 43
                     </label>
44 44
                 </div>
45 45
 
46 46
                 <div class='form-group'>
47 47
                     <label class="d-block">
48
-                        <span><?php esc_html_e( 'Width', 'invoicing' ) ?></span>
48
+                        <span><?php esc_html_e('Width', 'invoicing') ?></span>
49 49
                         <select class='form-control custom-select' v-model='field.grid_width'>
50
-                            <option value='full'><?php esc_html_e( 'Full Width', 'invoicing' ); ?></option>
51
-                            <option value='half'><?php esc_html_e( 'Half Width', 'invoicing' ); ?></option>
52
-                            <option value='third'><?php esc_html_e( '1/3 Width', 'invoicing' ); ?></option>
50
+                            <option value='full'><?php esc_html_e('Full Width', 'invoicing'); ?></option>
51
+                            <option value='half'><?php esc_html_e('Half Width', 'invoicing'); ?></option>
52
+                            <option value='third'><?php esc_html_e('1/3 Width', 'invoicing'); ?></option>
53 53
                         </select>
54 54
                     </label>
55 55
                 </div>
56 56
 
57 57
                 <div class='form-group'>
58 58
                     <label class="d-block">
59
-                        <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span>
60
-                        <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='field.description' class='form-control' rows='3'></textarea>
59
+                        <span><?php esc_html_e('Help Text', 'invoicing'); ?></span>
60
+                        <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='field.description' class='form-control' rows='3'></textarea>
61 61
                     </label>
62 62
                 </div>
63 63
 
64 64
                 <div class='form-group form-check'>
65 65
                     <input :id="active_form_element.id + '_edit_required' + index" v-model='field.required' type='checkbox' class='form-check-input' />
66
-                    <label class='form-check-label' :for="active_form_element.id + '_edit_required' + index"><?php esc_html_e( 'Is required', 'invoicing' ); ?></label>
66
+                    <label class='form-check-label' :for="active_form_element.id + '_edit_required' + index"><?php esc_html_e('Is required', 'invoicing'); ?></label>
67 67
                 </div>
68 68
 
69 69
                 <div class='form-group form-check'>
70 70
                     <input :id="active_form_element.id + '_edit_visible' + index" v-model='field.visible' type='checkbox' class='form-check-input' />
71
-                    <label class='form-check-label' :for="active_form_element.id + '_edit_visible' + index"><?php esc_html_e( 'Is visible', 'invoicing' ); ?></label>
71
+                    <label class='form-check-label' :for="active_form_element.id + '_edit_visible' + index"><?php esc_html_e('Is visible', 'invoicing'); ?></label>
72 72
                 </div>
73 73
 
74 74
             </div>
@@ -81,18 +81,18 @@  discard block
 block discarded – undo
81 81
 
82 82
 <div class='form-group'>
83 83
     <label class="d-block">
84
-        <span><?php esc_html_e( 'Address Type', 'invoicing' ) ?><span>
84
+        <span><?php esc_html_e('Address Type', 'invoicing') ?><span>
85 85
         <select class='form-control custom-select' v-model='active_form_element.address_type'>
86
-            <option value='billing'><?php esc_html_e( 'Billing', 'invoicing' ); ?></option>
87
-            <option value='shipping'><?php esc_html_e( 'Shipping', 'invoicing' ); ?></option>
88
-            <option value='both'><?php esc_html_e( 'Both', 'invoicing' ); ?></option>
86
+            <option value='billing'><?php esc_html_e('Billing', 'invoicing'); ?></option>
87
+            <option value='shipping'><?php esc_html_e('Shipping', 'invoicing'); ?></option>
88
+            <option value='both'><?php esc_html_e('Both', 'invoicing'); ?></option>
89 89
         </select>
90 90
     </label>
91 91
 </div>
92 92
 
93 93
 <div class='form-group' v-if="active_form_element.address_type == 'both'">
94 94
     <label class="d-block">
95
-        <span><?php esc_html_e( 'Shipping Address Toggle', 'invoicing' ) ?><span>
95
+        <span><?php esc_html_e('Shipping Address Toggle', 'invoicing') ?><span>
96 96
         <input type="text" class='form-control custom-select' v-model='active_form_element.shipping_address_toggle' >
97 97
     </label>
98 98
 </div>
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/address.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 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
 
14 14
 <div class='wpinv-address-wrapper row'>
15 15
 
16
-    <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e( 'Billing / Shipping Address', 'invoicing' ); ?></h4>
16
+    <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e('Billing / Shipping Address', 'invoicing'); ?></h4>
17 17
 
18 18
     <div class='form-group address-field-preview wpinv-payment-form-field-preview' v-for='(field, index) in visible_fields( form_element.fields )' :class='grid_class( field )' :key='field.name'>
19 19
         <label class="d-block w-100">
Please login to merge, or discard this patch.
templates/payment-forms/elements/address.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 defined( 'ABSPATH' ) || exit;
11 11
 
12 12
 if ( empty( $fields ) ) {
13
-	return;
13
+    return;
14 14
 }
15 15
 
16 16
 // A prefix for all ids (so that a form can be included in the same page multiple times).
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 	<!-- Start Billing Address -->
51 51
 	<div class="getpaid-billing-address-wrapper">
52 52
 		<?php
53
-			$field_type = 'billing';
54
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
55
-		?>
53
+            $field_type = 'billing';
54
+            include plugin_dir_path( __FILE__ ) . 'address-fields.php';
55
+        ?>
56 56
 	</div>
57 57
 	<!-- End Billing Address -->
58 58
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 
65 65
 	<?php
66 66
 		
67
-		echo aui()->input(
68
-		    array(
69
-			    'type'       => 'checkbox',
70
-			    'name'       => 'same-shipping-address',
71
-			    'id'         => "shipping-toggle$uniqid",
72
-			    'required'   => false,
73
-			    'label'      => wp_kses_post( $shipping_address_toggle ),
74
-			    'value'      => 1,
75
-			    'checked'    => true,
76
-		    )
77
-		);
67
+        echo aui()->input(
68
+            array(
69
+                'type'       => 'checkbox',
70
+                'name'       => 'same-shipping-address',
71
+                'id'         => "shipping-toggle$uniqid",
72
+                'required'   => false,
73
+                'label'      => wp_kses_post( $shipping_address_toggle ),
74
+                'value'      => 1,
75
+                'checked'    => true,
76
+            )
77
+        );
78 78
 
79
-	?>
79
+    ?>
80 80
 
81 81
 
82 82
 	<!-- Start Shipping Address Title -->
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	<!-- Start Shipping Address -->
96 96
 	<div class="getpaid-shipping-address-wrapper">
97 97
 		<?php
98
-			$field_type = 'shipping';
99
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
100
-		?>
98
+            $field_type = 'shipping';
99
+            include plugin_dir_path( __FILE__ ) . 'address-fields.php';
100
+        ?>
101 101
 	</div>
102 102
 	<!-- End Shipping Address -->
103 103
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,51 +7,51 @@  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
-if ( empty( $fields ) ) {
12
+if (empty($fields)) {
13 13
 	return;
14 14
 }
15 15
 
16 16
 // A prefix for all ids (so that a form can be included in the same page multiple times).
17
-$uniqid = uniqid( '_' );
17
+$uniqid = uniqid('_');
18 18
 
19 19
 // Prepare the user's country.
20
-$country = is_user_logged_in() ? get_user_meta( get_current_user_id(), '_wpinv_country', true ) : '';
21
-$country = empty( $country ) ? getpaid_get_ip_country() : $country;
22
-$country = empty( $country ) ? wpinv_get_default_country() : $country;
20
+$country = is_user_logged_in() ? get_user_meta(get_current_user_id(), '_wpinv_country', true) : '';
21
+$country = empty($country) ? getpaid_get_ip_country() : $country;
22
+$country = empty($country) ? wpinv_get_default_country() : $country;
23 23
 
24 24
 // A prefix for all ids (so that a form can be included in the same page multiple times).
25
-$uniqid = uniqid( '_' );
25
+$uniqid = uniqid('_');
26 26
 
27
-$address_type = empty( $address_type ) ? 'billing' : $address_type;
27
+$address_type = empty($address_type) ? 'billing' : $address_type;
28 28
 
29 29
 ?>
30 30
 
31
-<?php if ( 'both' === $address_type ) : ?>
31
+<?php if ('both' === $address_type) : ?>
32 32
 
33 33
 	<!-- Start Billing/Shipping Address Title -->
34 34
 	<h4 class="mb-3 getpaid-shipping-billing-address-title">
35
-		<?php _e( 'Billing / Shipping Address', 'invoicing' ); ?>
35
+		<?php _e('Billing / Shipping Address', 'invoicing'); ?>
36 36
 	</h4>
37 37
 	<!-- End Billing Address Title -->
38 38
 
39 39
 	<!-- Start Billing Address Title -->
40 40
 	<h4 class="mb-3 getpaid-billing-address-title">
41
-		<?php _e( 'Billing Address', 'invoicing' ); ?>
41
+		<?php _e('Billing Address', 'invoicing'); ?>
42 42
 	</h4>
43 43
 	<!-- End Billing Address Title -->
44 44
 
45 45
 <?php endif; ?>
46 46
 
47 47
 
48
-<?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?>
48
+<?php if ('both' === $address_type || 'billing' === $address_type) : ?>
49 49
 
50 50
 	<!-- Start Billing Address -->
51 51
 	<div class="getpaid-billing-address-wrapper">
52 52
 		<?php
53 53
 			$field_type = 'billing';
54
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
54
+			include plugin_dir_path(__FILE__) . 'address-fields.php';
55 55
 		?>
56 56
 	</div>
57 57
 	<!-- End Billing Address -->
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 <?php endif; ?>
60 60
 
61 61
 
62
-<?php if ( 'both' === $address_type ) : ?>
62
+<?php if ('both' === $address_type) : ?>
63 63
 
64 64
 
65 65
 	<?php
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 			    'name'       => 'same-shipping-address',
71 71
 			    'id'         => "shipping-toggle$uniqid",
72 72
 			    'required'   => false,
73
-			    'label'      => wp_kses_post( $shipping_address_toggle ),
73
+			    'label'      => wp_kses_post($shipping_address_toggle),
74 74
 			    'value'      => 1,
75 75
 			    'checked'    => true,
76 76
 		    )
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 	<!-- Start Shipping Address Title -->
83 83
 	<h4 class="mb-3 getpaid-shipping-address-title">
84
-		<?php _e( 'Shipping Address', 'invoicing' ); ?>
84
+		<?php _e('Shipping Address', 'invoicing'); ?>
85 85
 	</h4>
86 86
 	<!-- End Shipping Address Title -->
87 87
 
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 
91 91
 
92 92
 	
93
-<?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?>
93
+<?php if ('both' === $address_type || 'shipping' === $address_type) : ?>
94 94
 
95 95
 	<!-- Start Shipping Address -->
96 96
 	<div class="getpaid-shipping-address-wrapper">
97 97
 		<?php
98 98
 			$field_type = 'shipping';
99
-			include plugin_dir_path( __FILE__ ) . 'address-fields.php';
99
+			include plugin_dir_path(__FILE__) . 'address-fields.php';
100 100
 		?>
101 101
 	</div>
102 102
 	<!-- End Shipping Address -->
Please login to merge, or discard this patch.