Completed
Push — master ( 7c49f4...181492 )
by Devin
20:06
created
includes/forms/widget.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-defined( 'ABSPATH' ) or exit;
13
+defined('ABSPATH') or exit;
14 14
 
15 15
 /**
16 16
  * Give Form widget
17 17
  *
18 18
  * @since 1.0
19 19
  */
20
-class Give_Forms_Widget extends WP_Widget{
20
+class Give_Forms_Widget extends WP_Widget {
21 21
 	/**
22 22
 	 * The widget class name
23 23
 	 *
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 	/**
29 29
 	 * Instantiate the class
30 30
 	 */
31
-	public function __construct(){
32
-		$this->self = get_class( $this );
31
+	public function __construct() {
32
+		$this->self = get_class($this);
33 33
 
34 34
 		parent::__construct(
35
-			strtolower( $this->self ),
36
-			esc_html__( 'Give - Donation Form', 'give' ),
35
+			strtolower($this->self),
36
+			esc_html__('Give - Donation Form', 'give'),
37 37
 			array(
38
-				'description' => esc_html__( 'Display a Give Donation Form in your theme\'s widget powered sidebar.', 'give' )
38
+				'description' => esc_html__('Display a Give Donation Form in your theme\'s widget powered sidebar.', 'give')
39 39
 			)
40 40
 		);
41 41
 
42
-		add_action( 'widgets_init',          array( $this, 'widget_init' ) );
43
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_widget_scripts' ) );
42
+		add_action('widgets_init', array($this, 'widget_init'));
43
+		add_action('admin_enqueue_scripts', array($this, 'admin_widget_scripts'));
44 44
 	}
45 45
 
46 46
 	/**
@@ -50,23 +50,23 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @return void
52 52
 	 */
53
-	public function admin_widget_scripts( $hook ){
53
+	public function admin_widget_scripts($hook) {
54 54
 		// Directories of assets
55
-		$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
56
-		$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
57
-		$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
55
+		$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
56
+		$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
57
+		$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
58 58
 
59 59
 		// Use minified libraries if SCRIPT_DEBUG is turned off
60
-		$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
60
+		$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
61 61
 
62 62
 		// Widget Script
63
-		if ( $hook == 'widgets.php' ) {
63
+		if ($hook == 'widgets.php') {
64 64
 
65
-			wp_enqueue_style( 'give-qtip-css', $css_dir . 'jquery.qtip' . $suffix . '.css' );
65
+			wp_enqueue_style('give-qtip-css', $css_dir.'jquery.qtip'.$suffix.'.css');
66 66
 
67
-			wp_enqueue_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
67
+			wp_enqueue_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION);
68 68
 
69
-			wp_enqueue_script( 'give-admin-widgets-scripts', $js_dir . 'admin-widgets' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
69
+			wp_enqueue_script('give-admin-widgets-scripts', $js_dir.'admin-widgets'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
70 70
 		}
71 71
 	}
72 72
 
@@ -77,21 +77,21 @@  discard block
 block discarded – undo
77 77
 	 *                        before_widget, and after_widget.
78 78
 	 * @param array $instance The settings for the particular instance of the widget.
79 79
 	 */
80
-	public function widget( $args, $instance ){
81
-		$title = !empty( $instance['title'] ) ? $instance['title'] : '';
82
-		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
80
+	public function widget($args, $instance) {
81
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
82
+		$title = apply_filters('widget_title', $title, $instance, $this->id_base);
83 83
 
84 84
 		echo $args['before_widget'];
85 85
 
86
-		do_action( 'give_before_forms_widget' );
86
+		do_action('give_before_forms_widget');
87 87
 
88
-		echo $title ? $args['before_title'] . $title . $args['after_title'] : '';
88
+		echo $title ? $args['before_title'].$title.$args['after_title'] : '';
89 89
 
90
-		give_get_donation_form( $instance );
90
+		give_get_donation_form($instance);
91 91
 
92 92
 		echo $args['after_widget'];
93 93
 
94
-		do_action( 'give_after_forms_widget' );
94
+		do_action('give_after_forms_widget');
95 95
 	}
96 96
 
97 97
 	/**
@@ -101,65 +101,65 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @return string
103 103
 	 */
104
-	public function form( $instance ){
104
+	public function form($instance) {
105 105
 		$defaults = array(
106 106
 			'title'        => '',
107 107
 			'id'           => '',
108 108
 			'float_labels' => '',
109 109
 		);
110 110
 
111
-		$instance = wp_parse_args( (array) $instance, $defaults );
111
+		$instance = wp_parse_args((array) $instance, $defaults);
112 112
 
113 113
 		// Query Give Forms
114 114
 		$args = array(
115 115
 			'post_type'      => 'give_forms',
116
-			'posts_per_page' => - 1,
116
+			'posts_per_page' => -1,
117 117
 			'post_status'    => 'publish',
118 118
 		);
119 119
 
120
-		$give_forms = get_posts( $args );
120
+		$give_forms = get_posts($args);
121 121
 
122 122
 		// Widget: Title
123 123
 
124 124
 		?><p>
125
-			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'give' ); ?></label>
126
-			<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php esc_attr_e( $instance['title'] ); ?>" /><br>
127
-			<small><?php esc_html_e( 'Leave blank to hide the widget title.', 'give' ); ?></small>
125
+			<label for="<?php echo $this->get_field_id('title'); ?>"><?php esc_html_e('Title:', 'give'); ?></label>
126
+			<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php esc_attr_e($instance['title']); ?>" /><br>
127
+			<small><?php esc_html_e('Leave blank to hide the widget title.', 'give'); ?></small>
128 128
 		</p><?php
129 129
 
130 130
 		// Widget: Give Form
131 131
 
132 132
 		?><p>
133
-			<label for="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>"><?php
133
+			<label for="<?php echo esc_attr($this->get_field_id('id')); ?>"><?php
134 134
 				printf(
135 135
 					/* translators: %s: form singular label */
136
-					esc_html__( 'Give %s:', 'give' ),
136
+					esc_html__('Give %s:', 'give'),
137 137
 					give_get_forms_label_singular()
138 138
 				);
139 139
 			?></label>
140
-			<select class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'id' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'id' ) ); ?>">
141
-				<option value="current"><?php esc_html_e( '— Select —', 'give' ); ?></option>
142
-				<?php foreach ( $give_forms as $give_form ) { ?>
143
-					<option <?php selected( absint( $instance['id'] ), $give_form->ID ); ?> value="<?php echo esc_attr( $give_form->ID ); ?>"><?php echo $give_form->post_title; ?></option>
140
+			<select class="widefat" name="<?php echo esc_attr($this->get_field_name('id')); ?>" id="<?php echo esc_attr($this->get_field_id('id')); ?>">
141
+				<option value="current"><?php esc_html_e('— Select —', 'give'); ?></option>
142
+				<?php foreach ($give_forms as $give_form) { ?>
143
+					<option <?php selected(absint($instance['id']), $give_form->ID); ?> value="<?php echo esc_attr($give_form->ID); ?>"><?php echo $give_form->post_title; ?></option>
144 144
 				<?php } ?>
145 145
 			</select><br>
146
-			<small><?php esc_html_e( 'Select a Give Form to embed in this widget.', 'give' ); ?></small>
146
+			<small><?php esc_html_e('Select a Give Form to embed in this widget.', 'give'); ?></small>
147 147
 		</p><?php
148 148
 
149 149
 		// Widget: Floating Labels
150 150
 
151 151
 		?><p>
152
-			<label for="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>"><?php esc_html_e( 'Floating Labels (optional):', 'give' ); ?></label>
153
-			<select class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'float_labels' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'float_labels' ) ); ?>">
154
-				<option value="" <?php selected( esc_attr( $instance['float_labels'] ), '' ) ?>><?php esc_html_e( '- Select -', 'give' ); ?></option>
155
-				<option value="enabled" <?php selected( esc_attr( $instance['float_labels'] ), 'enabled' ) ?>><?php esc_html_e( 'Enabled', 'give' ); ?></option>
156
-				<option value="disabled" <?php selected( esc_attr( $instance['float_labels'] ), 'disabled' ) ?>><?php esc_html_e( 'Disabled', 'give' ); ?></option>
152
+			<label for="<?php echo esc_attr($this->get_field_id('float_labels')); ?>"><?php esc_html_e('Floating Labels (optional):', 'give'); ?></label>
153
+			<select class="widefat" name="<?php echo esc_attr($this->get_field_name('float_labels')); ?>" id="<?php echo esc_attr($this->get_field_id('float_labels')); ?>">
154
+				<option value="" <?php selected(esc_attr($instance['float_labels']), '') ?>><?php esc_html_e('- Select -', 'give'); ?></option>
155
+				<option value="enabled" <?php selected(esc_attr($instance['float_labels']), 'enabled') ?>><?php esc_html_e('Enabled', 'give'); ?></option>
156
+				<option value="disabled" <?php selected(esc_attr($instance['float_labels']), 'disabled') ?>><?php esc_html_e('Disabled', 'give'); ?></option>
157 157
 			</select><br>
158 158
 			<small><?php
159 159
 				printf(
160 160
 					/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
161
-					__( 'Override the <a href="%s" target="_blank">floating labels</a> setting for this Give form.', 'give' ),
162
-					esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' )
161
+					__('Override the <a href="%s" target="_blank">floating labels</a> setting for this Give form.', 'give'),
162
+					esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')
163 163
 				);
164 164
 			?></small>
165 165
 		</p><?php
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return void
172 172
 	 */
173
-	function widget_init(){
174
-		register_widget( $this->self );
173
+	function widget_init() {
174
+		register_widget($this->self);
175 175
 	}
176 176
 
177 177
 	/**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 *
183 183
 	 * @return array
184 184
 	 */
185
-	public function update( $new_instance, $old_instance ){
185
+	public function update($new_instance, $old_instance) {
186 186
 		$this->flush_widget_cache();
187 187
 
188 188
 		return $new_instance;
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 *
194 194
 	 * @return void
195 195
 	 */
196
-	public function flush_widget_cache(){
197
-		wp_cache_delete( $this->self, 'widget' );
196
+	public function flush_widget_cache() {
197
+		wp_cache_delete($this->self, 'widget');
198 198
 	}
199 199
 }
200 200
 
Please login to merge, or discard this patch.
includes/admin/class-give-settings.php 1 patch
Spacing   +315 added lines, -315 removed lines patch added patch discarded remove patch
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function __construct() {
49 49
 
50
-		add_action( 'admin_init', array( $this, 'init' ) );
50
+		add_action('admin_init', array($this, 'init'));
51 51
 
52 52
 		//Customize CMB2 URL
53
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
53
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
54 54
 
55 55
 		//Custom CMB2 Settings Fields
56
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
57
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
58
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
59
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
60
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
61
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
62
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
63
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
64
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
56
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
57
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
58
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
59
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
60
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
61
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
62
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
63
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
64
+		add_action('admin_notices', array($this, 'settings_notices'));
65 65
 
66 66
 		// Include CMB CSS in the head to avoid FOUC
67
-		add_action( 'admin_print_styles-give_forms_page_give-settings', array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
67
+		add_action('admin_print_styles-give_forms_page_give-settings', array('CMB2_hookup', 'enqueue_cmb_css'));
68 68
 
69
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'give_modify_cmb2_form_output' ), 10, 3 );
69
+		add_filter('cmb2_get_metabox_form_format', array($this, 'give_modify_cmb2_form_output'), 10, 3);
70 70
 
71 71
 	}
72 72
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @since  1.0
78 78
 	 */
79 79
 	public function init() {
80
-		register_setting( $this->key, $this->key );
80
+		register_setting($this->key, $this->key);
81 81
 
82 82
 	}
83 83
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
 	 *
92 92
 	 * @return mixed
93 93
 	 */
94
-	public function give_update_cmb_meta_box_url( $url ) {
94
+	public function give_update_cmb_meta_box_url($url) {
95 95
 		//Path to Give's CMB
96
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
96
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
97 97
 	}
98 98
 
99 99
 
@@ -105,27 +105,27 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function give_get_settings_tabs() {
107 107
 
108
-		$settings = $this->give_settings( null );
108
+		$settings = $this->give_settings(null);
109 109
 
110 110
 		$tabs             = array();
111
-		$tabs['general']  = esc_html__( 'General', 'give' );
112
-		$tabs['gateways'] = esc_html__( 'Payment Gateways', 'give' );
113
-		$tabs['display']  = esc_html__( 'Display Options', 'give' );
114
-		$tabs['emails']   = esc_html__( 'Emails', 'give' );
111
+		$tabs['general']  = esc_html__('General', 'give');
112
+		$tabs['gateways'] = esc_html__('Payment Gateways', 'give');
113
+		$tabs['display']  = esc_html__('Display Options', 'give');
114
+		$tabs['emails']   = esc_html__('Emails', 'give');
115 115
 
116
-		if ( ! empty( $settings['addons']['fields'] ) ) {
117
-			$tabs['addons'] = esc_html__( 'Add-ons', 'give' );
116
+		if ( ! empty($settings['addons']['fields'])) {
117
+			$tabs['addons'] = esc_html__('Add-ons', 'give');
118 118
 		}
119 119
 
120
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
121
-			$tabs['licenses'] = esc_html__( 'Licenses', 'give' );
120
+		if ( ! empty($settings['licenses']['fields'])) {
121
+			$tabs['licenses'] = esc_html__('Licenses', 'give');
122 122
 		}
123 123
 
124
-		$tabs['advanced']    = esc_html__( 'Advanced', 'give' );
125
-		$tabs['api']         = esc_html__( 'API', 'give' );
126
-		$tabs['system_info'] = esc_html__( 'System Info', 'give' );
124
+		$tabs['advanced']    = esc_html__('Advanced', 'give');
125
+		$tabs['api']         = esc_html__('API', 'give');
126
+		$tabs['system_info'] = esc_html__('System Info', 'give');
127 127
 
128
-		return apply_filters( 'give_settings_tabs', $tabs );
128
+		return apply_filters('give_settings_tabs', $tabs);
129 129
 	}
130 130
 
131 131
 
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function admin_page_display() {
137 137
 
138
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
138
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
139 139
 
140 140
 		?>
141 141
 
142 142
 		<div class="wrap give_settings_page cmb2_options_page <?php echo $this->key; ?>">
143 143
 
144
-			<h1 class="screen-reader-text"><?php esc_html_e( 'Give Settings', 'give' ); ?></h1>
144
+			<h1 class="screen-reader-text"><?php esc_html_e('Give Settings', 'give'); ?></h1>
145 145
 
146 146
 			<h2 class="nav-tab-wrapper">
147 147
 				<?php
148
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
148
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
149 149
 
150 150
 					//Support legacy tab creation conditions based off $_GET parameter
151 151
 					//We pass the $_GET['tab'] to conditions executed later
152 152
 					$_GET['tab'] = $tab_id;
153 153
 
154
-					$tab_url = esc_url( add_query_arg( array(
154
+					$tab_url = esc_url(add_query_arg(array(
155 155
 						'settings-updated' => false,
156 156
 						'tab'              => $tab_id
157
-					) ) );
157
+					)));
158 158
 
159 159
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
160 160
 
161
-					echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '" id="tab-' . $tab_id . '">' . esc_html( $tab_name ) . '</a>';
161
+					echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'" id="tab-'.$tab_id.'">'.esc_html($tab_name).'</a>';
162 162
 
163 163
 				}
164 164
 				?>
@@ -166,20 +166,20 @@  discard block
 block discarded – undo
166 166
 
167 167
 			<?php
168 168
 			//Loop through and output settings
169
-			foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
169
+			foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
170 170
 
171 171
 				//Support legacy tab creation conditions based off $_GET parameter
172 172
 				//We 'trick' the conditions into thinking this is the tab
173 173
 				$_GET['tab'] = $tab_id;
174 174
 
175
-				$tab_settings = $this->give_settings( $tab_id );
175
+				$tab_settings = $this->give_settings($tab_id);
176 176
 
177 177
 				//Pass active tab within $tab_settings so we can hide with CSS via PHP
178
-				if ( $active_tab == $tab_id ) {
178
+				if ($active_tab == $tab_id) {
179 179
 					$tab_settings['active_tab'] = true;
180 180
 				}
181 181
 
182
-				cmb2_metabox_form( $tab_settings, $this->key );
182
+				cmb2_metabox_form($tab_settings, $this->key);
183 183
 
184 184
 			} ?>
185 185
 
@@ -197,34 +197,34 @@  discard block
 block discarded – undo
197 197
 	 * @since 1.5 Modified to CSS hide non-active tabs
198 198
 	 * @since 1.0
199 199
 	 */
200
-	function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
200
+	function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
201 201
 
202 202
 
203
-		$pagenow = isset( $_GET['page'] ) ? $_GET['page'] : '';
203
+		$pagenow = isset($_GET['page']) ? $_GET['page'] : '';
204 204
 
205 205
 		//only modify the give settings form
206
-		if ( 'give_settings' == $object_id && $pagenow == 'give-settings' ) {
206
+		if ('give_settings' == $object_id && $pagenow == 'give-settings') {
207 207
 
208 208
 			$style = '';
209
-			if ( ! isset( $cmb->meta_box['active_tab'] ) ) {
209
+			if ( ! isset($cmb->meta_box['active_tab'])) {
210 210
 				$style = 'style="display:none;"';
211 211
 			}
212 212
 
213 213
 			//Set ID based off tab name - protects backwards compatibility
214
-			$tab_id = isset( $_GET['tab'] ) ? $_GET['tab'] : $cmb->meta_box['id'];
214
+			$tab_id = isset($_GET['tab']) ? $_GET['tab'] : $cmb->meta_box['id'];
215 215
 
216
-			$save_button = apply_filters( 'give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . esc_attr__( 'Save Settings', 'give' ) . '" class="button-primary"></div>' );
216
+			$save_button = apply_filters('give_save_button_markup', '<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.esc_attr__('Save Settings', 'give').'" class="button-primary"></div>');
217 217
 
218 218
 			//Filter so some tabs won't have save settings
219
-			$no_save_button = apply_filters( 'give_settings_no_save_output', array(
219
+			$no_save_button = apply_filters('give_settings_no_save_output', array(
220 220
 				'system_info'
221
-			) );
221
+			));
222 222
 
223
-			if ( in_array( $tab_id, $no_save_button ) ) {
223
+			if (in_array($tab_id, $no_save_button)) {
224 224
 				$save_button = '';
225 225
 			}
226 226
 
227
-			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" ' . $style . ' data-tab="' . $tab_id . '"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s' . $save_button . '</form>';
227
+			$form_format = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data" '.$style.' data-tab="'.$tab_id.'"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s'.$save_button.'</form>';
228 228
 
229 229
 		}
230 230
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 *
242 242
 	 * @return array
243 243
 	 */
244
-	public function give_settings( $active_tab ) {
244
+	public function give_settings($active_tab) {
245 245
 
246 246
 		$give_settings = array(
247 247
 			/**
@@ -249,99 +249,99 @@  discard block
 block discarded – undo
249 249
 			 */
250 250
 			'general'     => array(
251 251
 				'id'         => 'general_settings',
252
-				'give_title' => esc_html__( 'General Settings', 'give' ),
253
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
254
-				'fields'     => apply_filters( 'give_settings_general', array(
252
+				'give_title' => esc_html__('General Settings', 'give'),
253
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
254
+				'fields'     => apply_filters('give_settings_general', array(
255 255
 						array(
256
-							'name' => esc_html__( 'General Settings', 'give' ),
256
+							'name' => esc_html__('General Settings', 'give'),
257 257
 							'desc' => '',
258 258
 							'type' => 'give_title',
259 259
 							'id'   => 'give_title_general_settings_1'
260 260
 						),
261 261
 						array(
262
-							'name'    => esc_html__( 'Success Page', 'give' ),
262
+							'name'    => esc_html__('Success Page', 'give'),
263 263
 							/* translators: %s: [give_receipt] */
264
-							'desc'    => sprintf( __( 'This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
264
+							'desc'    => sprintf(__('This is the page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
265 265
 							'id'      => 'success_page',
266 266
 							'type'    => 'select',
267
-							'options' => give_cmb2_get_post_options( array(
267
+							'options' => give_cmb2_get_post_options(array(
268 268
 								'post_type'   => 'page',
269
-								'numberposts' => - 1
270
-							) ),
269
+								'numberposts' => -1
270
+							)),
271 271
 						),
272 272
 						array(
273
-							'name'    => esc_html__( 'Failed Transaction Page', 'give' ),
274
-							'desc'    => esc_html__( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
273
+							'name'    => esc_html__('Failed Transaction Page', 'give'),
274
+							'desc'    => esc_html__('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
275 275
 							'id'      => 'failure_page',
276 276
 							'type'    => 'select',
277
-							'options' => give_cmb2_get_post_options( array(
277
+							'options' => give_cmb2_get_post_options(array(
278 278
 								'post_type'   => 'page',
279
-								'numberposts' => - 1
280
-							) ),
279
+								'numberposts' => -1
280
+							)),
281 281
 						),
282 282
 						array(
283
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
283
+							'name'    => esc_html__('Donation History Page', 'give'),
284 284
 							/* translators: %s: [donation_history] */
285
-							'desc'    => sprintf( __( 'This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
285
+							'desc'    => sprintf(__('This page shows a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
286 286
 							'id'      => 'history_page',
287 287
 							'type'    => 'select',
288
-							'options' => give_cmb2_get_post_options( array(
288
+							'options' => give_cmb2_get_post_options(array(
289 289
 								'post_type'   => 'page',
290
-								'numberposts' => - 1
291
-							) ),
290
+								'numberposts' => -1
291
+							)),
292 292
 						),
293 293
 						array(
294
-							'name'    => esc_html__( 'Base Country', 'give' ),
295
-							'desc'    => esc_html__( 'Where does your site operate from?', 'give' ),
294
+							'name'    => esc_html__('Base Country', 'give'),
295
+							'desc'    => esc_html__('Where does your site operate from?', 'give'),
296 296
 							'id'      => 'base_country',
297 297
 							'type'    => 'select',
298 298
 							'options' => give_get_country_list(),
299 299
 						),
300 300
 						array(
301
-							'name' => esc_html__( 'Currency Settings', 'give' ),
301
+							'name' => esc_html__('Currency Settings', 'give'),
302 302
 							'desc' => '',
303 303
 							'type' => 'give_title',
304 304
 							'id'   => 'give_title_general_settings_2'
305 305
 						),
306 306
 						array(
307
-							'name'    => esc_html__( 'Currency', 'give' ),
308
-							'desc'    => esc_html__( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'give' ),
307
+							'name'    => esc_html__('Currency', 'give'),
308
+							'desc'    => esc_html__('Choose your currency. Note that some payment gateways have currency restrictions.', 'give'),
309 309
 							'id'      => 'currency',
310 310
 							'type'    => 'select',
311 311
 							'options' => give_get_currencies(),
312 312
 							'default' => 'USD',
313 313
 						),
314 314
 						array(
315
-							'name'    => esc_html__( 'Currency Position', 'give' ),
316
-							'desc'    => esc_html__( 'Choose the position of the currency sign.', 'give' ),
315
+							'name'    => esc_html__('Currency Position', 'give'),
316
+							'desc'    => esc_html__('Choose the position of the currency sign.', 'give'),
317 317
 							'id'      => 'currency_position',
318 318
 							'type'    => 'select',
319 319
 							'options' => array(
320 320
 								/* translators: %s: currency symbol */
321
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
321
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
322 322
 								/* translators: %s: currency symbol */
323
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
323
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
324 324
 							),
325 325
 							'default' => 'before',
326 326
 						),
327 327
 						array(
328
-							'name'            => esc_html__( 'Thousands Separator', 'give' ),
329
-							'desc'            => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
328
+							'name'            => esc_html__('Thousands Separator', 'give'),
329
+							'desc'            => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
330 330
 							'id'              => 'thousands_separator',
331 331
 							'type'            => 'text_small',
332 332
 							'sanitization_cb' => 'give_sanitize_thousand_separator',
333 333
 							'default'         => ',',
334 334
 						),
335 335
 						array(
336
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
337
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
336
+							'name'    => esc_html__('Decimal Separator', 'give'),
337
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
338 338
 							'id'      => 'decimal_separator',
339 339
 							'type'    => 'text_small',
340 340
 							'default' => '.',
341 341
 						),
342 342
 						array(
343
-							'name'            => __( 'Number of Decimals', 'give' ),
344
-							'desc'            => __( 'This sets the number of decimal points shown in displayed prices.', 'give' ),
343
+							'name'            => __('Number of Decimals', 'give'),
344
+							'desc'            => __('This sets the number of decimal points shown in displayed prices.', 'give'),
345 345
 							'id'              => 'number_decimals',
346 346
 							'type'            => 'text_small',
347 347
 							'default'         => 2,
@@ -355,83 +355,83 @@  discard block
 block discarded – undo
355 355
 			 */
356 356
 			'gateways'    => array(
357 357
 				'id'         => 'payment_gateways',
358
-				'give_title' => esc_html__( 'Payment Gateways', 'give' ),
359
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
360
-				'fields'     => apply_filters( 'give_settings_gateways', array(
358
+				'give_title' => esc_html__('Payment Gateways', 'give'),
359
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
360
+				'fields'     => apply_filters('give_settings_gateways', array(
361 361
 						array(
362
-							'name' => esc_html__( 'Gateways Settings', 'give' ),
362
+							'name' => esc_html__('Gateways Settings', 'give'),
363 363
 							'desc' => '',
364 364
 							'id'   => 'give_title_gateway_settings_1',
365 365
 							'type' => 'give_title'
366 366
 						),
367 367
 						array(
368
-							'name' => esc_html__( 'Test Mode', 'give' ),
369
-							'desc' => esc_html__( 'While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
368
+							'name' => esc_html__('Test Mode', 'give'),
369
+							'desc' => esc_html__('While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
370 370
 							'id'   => 'test_mode',
371 371
 							'type' => 'checkbox'
372 372
 						),
373 373
 						array(
374
-							'name' => esc_html__( 'Enabled Gateways', 'give' ),
375
-							'desc' => esc_html__( 'Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give' ),
374
+							'name' => esc_html__('Enabled Gateways', 'give'),
375
+							'desc' => esc_html__('Choose the payment gateways you would like enabled. You can drag-and-drop payment gateways to reorder them.', 'give'),
376 376
 							'id'   => 'gateways',
377 377
 							'type' => 'enabled_gateways'
378 378
 						),
379 379
 						array(
380
-							'name' => esc_html__( 'Default Gateway', 'give' ),
381
-							'desc' => esc_html__( 'This is the gateway that will be selected by default.', 'give' ),
380
+							'name' => esc_html__('Default Gateway', 'give'),
381
+							'desc' => esc_html__('This is the gateway that will be selected by default.', 'give'),
382 382
 							'id'   => 'default_gateway',
383 383
 							'type' => 'default_gateway'
384 384
 						),
385 385
 						array(
386
-							'name' => esc_html__( 'PayPal Standard', 'give' ),
386
+							'name' => esc_html__('PayPal Standard', 'give'),
387 387
 							'desc' => '',
388 388
 							'type' => 'give_title',
389 389
 							'id'   => 'give_title_gateway_settings_2',
390 390
 						),
391 391
 						array(
392
-							'name' => esc_html__( 'PayPal Email', 'give' ),
393
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
392
+							'name' => esc_html__('PayPal Email', 'give'),
393
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
394 394
 							'id'   => 'paypal_email',
395 395
 							'type' => 'text_email',
396 396
 						),
397 397
 						array(
398
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
399
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
398
+							'name' => esc_html__('PayPal Page Style', 'give'),
399
+							'desc' => esc_html__('Enter the name of the page style to use, or leave blank to use the default.', 'give'),
400 400
 							'id'   => 'paypal_page_style',
401 401
 							'type' => 'text',
402 402
 						),
403 403
 						array(
404
-							'name'    => esc_html__( 'PayPal Transaction Type', 'give' ),
405
-							'desc'    => esc_html__( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
404
+							'name'    => esc_html__('PayPal Transaction Type', 'give'),
405
+							'desc'    => esc_html__('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
406 406
 							'id'      => 'paypal_button_type',
407 407
 							'type'    => 'radio_inline',
408 408
 							'options' => array(
409
-								'donation' => esc_html__( 'Donation', 'give' ),
410
-								'standard' => esc_html__( 'Standard Transaction', 'give' )
409
+								'donation' => esc_html__('Donation', 'give'),
410
+								'standard' => esc_html__('Standard Transaction', 'give')
411 411
 							),
412 412
 							'default' => 'donation',
413 413
 						),
414 414
 						array(
415
-							'name' => esc_html__( 'Disable PayPal IPN Verification', 'give' ),
416
-							'desc' => esc_html__( 'If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give' ),
415
+							'name' => esc_html__('Disable PayPal IPN Verification', 'give'),
416
+							'desc' => esc_html__('If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give'),
417 417
 							'id'   => 'disable_paypal_verification',
418 418
 							'type' => 'checkbox'
419 419
 						),
420 420
 						array(
421
-							'name' => esc_html__( 'Offline Donations', 'give' ),
421
+							'name' => esc_html__('Offline Donations', 'give'),
422 422
 							'desc' => '',
423 423
 							'type' => 'give_title',
424 424
 							'id'   => 'give_title_gateway_settings_3',
425 425
 						),
426 426
 						array(
427
-							'name' => esc_html__( 'Collect Billing Details', 'give' ),
428
-							'desc' => esc_html__( 'This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give' ),
427
+							'name' => esc_html__('Collect Billing Details', 'give'),
428
+							'desc' => esc_html__('This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give'),
429 429
 							'id'   => 'give_offline_donation_enable_billing_fields',
430 430
 							'type' => 'checkbox'
431 431
 						),
432 432
 						array(
433
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
434
-							'desc'    => esc_html__( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
433
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
434
+							'desc'    => esc_html__('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
435 435
 							'id'      => 'global_offline_donation_content',
436 436
 							'default' => give_get_default_offline_donation_content(),
437 437
 							'type'    => 'wysiwyg',
@@ -440,15 +440,15 @@  discard block
 block discarded – undo
440 440
 							)
441 441
 						),
442 442
 						array(
443
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
444
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
443
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
444
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
445 445
 							'id'      => 'offline_donation_subject',
446
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
446
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
447 447
 							'type'    => 'text'
448 448
 						),
449 449
 						array(
450
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
451
-							'desc'    => esc_html__( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
450
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
451
+							'desc'    => esc_html__('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
452 452
 							'id'      => 'global_offline_donation_email',
453 453
 							'default' => give_get_default_offline_donation_email_content(),
454 454
 							'type'    => 'wysiwyg',
@@ -462,95 +462,95 @@  discard block
 block discarded – undo
462 462
 			/** Display Settings */
463 463
 			'display'     => array(
464 464
 				'id'         => 'display_settings',
465
-				'give_title' => esc_html__( 'Display Settings', 'give' ),
466
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
467
-				'fields'     => apply_filters( 'give_settings_display', array(
465
+				'give_title' => esc_html__('Display Settings', 'give'),
466
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
467
+				'fields'     => apply_filters('give_settings_display', array(
468 468
 						array(
469
-							'name' => esc_html__( 'Display Settings', 'give' ),
469
+							'name' => esc_html__('Display Settings', 'give'),
470 470
 							'desc' => '',
471 471
 							'id'   => 'give_title_display_settings_1',
472 472
 							'type' => 'give_title'
473 473
 						),
474 474
 						array(
475
-							'name' => esc_html__( 'Disable CSS', 'give' ),
476
-							'desc' => esc_html__( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
475
+							'name' => esc_html__('Disable CSS', 'give'),
476
+							'desc' => esc_html__('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
477 477
 							'id'   => 'disable_css',
478 478
 							'type' => 'checkbox'
479 479
 						),
480 480
 						array(
481
-							'name' => esc_html__( 'Enable Floating Labels', 'give' ),
481
+							'name' => esc_html__('Enable Floating Labels', 'give'),
482 482
 							/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
483
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. <br />Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
483
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms. <br />Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array()))), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
484 484
 							'id'   => 'enable_floatlabels',
485 485
 							'type' => 'checkbox'
486 486
 						),
487 487
 						array(
488
-							'name' => esc_html__( 'Disable Welcome Screen', 'give' ),
488
+							'name' => esc_html__('Disable Welcome Screen', 'give'),
489 489
 							/* translators: %s: about page URL */
490
-							'desc' => sprintf( wp_kses( __( 'Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the <a href="%s">Welcome Screen</a> if you want in the future.', 'give' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
490
+							'desc' => sprintf(wp_kses(__('Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the <a href="%s">Welcome Screen</a> if you want in the future.', 'give'), array('a' => array('href' => array()))), esc_url(admin_url('index.php?page=give-about'))),
491 491
 							'id'   => 'disable_welcome',
492 492
 							'type' => 'checkbox'
493 493
 						),
494 494
 						array(
495
-							'name' => esc_html__( 'Post Types', 'give' ),
495
+							'name' => esc_html__('Post Types', 'give'),
496 496
 							'desc' => '',
497 497
 							'id'   => 'give_title_display_settings_2',
498 498
 							'type' => 'give_title'
499 499
 						),
500 500
 						array(
501
-							'name' => esc_html__( 'Disable Form Single Views', 'give' ),
502
-							'desc' => esc_html__( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
501
+							'name' => esc_html__('Disable Form Single Views', 'give'),
502
+							'desc' => esc_html__('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
503 503
 							'id'   => 'disable_forms_singular',
504 504
 							'type' => 'checkbox'
505 505
 						),
506 506
 						array(
507
-							'name' => esc_html__( 'Disable Form Archives', 'give' ),
508
-							'desc' => esc_html__( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
507
+							'name' => esc_html__('Disable Form Archives', 'give'),
508
+							'desc' => esc_html__('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
509 509
 							'id'   => 'disable_forms_archives',
510 510
 							'type' => 'checkbox'
511 511
 						),
512 512
 						array(
513
-							'name' => esc_html__( 'Disable Form Excerpts', 'give' ),
514
-							'desc' => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
513
+							'name' => esc_html__('Disable Form Excerpts', 'give'),
514
+							'desc' => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
515 515
 							'id'   => 'disable_forms_excerpt',
516 516
 							'type' => 'checkbox'
517 517
 						),
518 518
 
519 519
 						array(
520
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
521
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give' ),
520
+							'name'    => esc_html__('Featured Image Size', 'give'),
521
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give'),
522 522
 							'id'      => 'featured_image_size',
523 523
 							'type'    => 'select',
524 524
 							'default' => 'large',
525 525
 							'options' => give_get_featured_image_sizes()
526 526
 						),
527 527
 						array(
528
-							'name' => esc_html__( 'Disable Form Featured Image', 'give' ),
529
-							'desc' => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
528
+							'name' => esc_html__('Disable Form Featured Image', 'give'),
529
+							'desc' => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
530 530
 							'id'   => 'disable_form_featured_img',
531 531
 							'type' => 'checkbox'
532 532
 						),
533 533
 						array(
534
-							'name' => esc_html__( 'Disable Single Form Sidebar', 'give' ),
535
-							'desc' => esc_html__( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
534
+							'name' => esc_html__('Disable Single Form Sidebar', 'give'),
535
+							'desc' => esc_html__('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
536 536
 							'id'   => 'disable_form_sidebar',
537 537
 							'type' => 'checkbox'
538 538
 						),
539 539
 						array(
540
-							'name' => esc_html__( 'Taxonomies', 'give' ),
540
+							'name' => esc_html__('Taxonomies', 'give'),
541 541
 							'desc' => '',
542 542
 							'id'   => 'give_title_display_settings_3',
543 543
 							'type' => 'give_title'
544 544
 						),
545 545
 						array(
546
-							'name' => esc_html__( 'Enable Form Categories', 'give' ),
547
-							'desc' => esc_html__( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
546
+							'name' => esc_html__('Enable Form Categories', 'give'),
547
+							'desc' => esc_html__('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
548 548
 							'id'   => 'enable_categories',
549 549
 							'type' => 'checkbox'
550 550
 						),
551 551
 						array(
552
-							'name' => esc_html__( 'Enable Form Tags', 'give' ),
553
-							'desc' => esc_html__( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
552
+							'name' => esc_html__('Enable Form Tags', 'give'),
553
+							'desc' => esc_html__('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
554 554
 							'id'   => 'enable_tags',
555 555
 							'type' => 'checkbox'
556 556
 						),
@@ -563,95 +563,95 @@  discard block
 block discarded – undo
563 563
 			 */
564 564
 			'emails'      => array(
565 565
 				'id'         => 'email_settings',
566
-				'give_title' => esc_html__( 'Email Settings', 'give' ),
567
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
568
-				'fields'     => apply_filters( 'give_settings_emails', array(
566
+				'give_title' => esc_html__('Email Settings', 'give'),
567
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
568
+				'fields'     => apply_filters('give_settings_emails', array(
569 569
 						array(
570
-							'name' => esc_html__( 'Email Settings', 'give' ),
570
+							'name' => esc_html__('Email Settings', 'give'),
571 571
 							'desc' => '',
572 572
 							'id'   => 'give_title_email_settings_1',
573 573
 							'type' => 'give_title'
574 574
 						),
575 575
 						array(
576 576
 							'id'      => 'email_template',
577
-							'name'    => esc_html__( 'Email Template', 'give' ),
578
-							'desc'    => esc_html__( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
577
+							'name'    => esc_html__('Email Template', 'give'),
578
+							'desc'    => esc_html__('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
579 579
 							'type'    => 'select',
580 580
 							'options' => give_get_email_templates()
581 581
 						),
582 582
 						array(
583 583
 							'id'   => 'email_logo',
584
-							'name' => esc_html__( 'Logo', 'give' ),
585
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
584
+							'name' => esc_html__('Logo', 'give'),
585
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
586 586
 							'type' => 'file'
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'from_name',
590
-							'name'    => esc_html__( 'From Name', 'give' ),
591
-							'desc'    => esc_html__( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ),
592
-							'default' => get_bloginfo( 'name' ),
590
+							'name'    => esc_html__('From Name', 'give'),
591
+							'desc'    => esc_html__('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'),
592
+							'default' => get_bloginfo('name'),
593 593
 							'type'    => 'text'
594 594
 						),
595 595
 						array(
596 596
 							'id'      => 'from_email',
597
-							'name'    => esc_html__( 'From Email', 'give' ),
598
-							'desc'    => esc_html__( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
599
-							'default' => get_bloginfo( 'admin_email' ),
597
+							'name'    => esc_html__('From Email', 'give'),
598
+							'desc'    => esc_html__('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
599
+							'default' => get_bloginfo('admin_email'),
600 600
 							'type'    => 'text'
601 601
 						),
602 602
 						array(
603
-							'name' => esc_html__( 'Donation Receipt', 'give' ),
603
+							'name' => esc_html__('Donation Receipt', 'give'),
604 604
 							'desc' => '',
605 605
 							'id'   => 'give_title_email_settings_2',
606 606
 							'type' => 'give_title'
607 607
 						),
608 608
 						array(
609 609
 							'id'      => 'donation_subject',
610
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
611
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
612
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
610
+							'name'    => esc_html__('Donation Email Subject', 'give'),
611
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
612
+							'default' => esc_attr__('Donation Receipt', 'give'),
613 613
 							'type'    => 'text'
614 614
 						),
615 615
 						array(
616 616
 							'id'      => 'donation_receipt',
617
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
617
+							'name'    => esc_html__('Donation Receipt', 'give'),
618 618
 							/* translators: %s: emails tags list */
619
-							'desc'    => sprintf( __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ) . '<br/>',
619
+							'desc'    => sprintf(__('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()).'<br/>',
620 620
 							'type'    => 'wysiwyg',
621 621
 							'default' => give_get_default_donation_receipt_email()
622 622
 						),
623 623
 						array(
624
-							'name' => esc_html__( 'New Donation Notification', 'give' ),
624
+							'name' => esc_html__('New Donation Notification', 'give'),
625 625
 							'desc' => '',
626 626
 							'id'   => 'give_title_email_settings_3',
627 627
 							'type' => 'give_title'
628 628
 						),
629 629
 						array(
630 630
 							'id'      => 'donation_notification_subject',
631
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
632
-							'desc'    => esc_html__( 'Enter the subject line for the donation notification email.', 'give' ),
631
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
632
+							'desc'    => esc_html__('Enter the subject line for the donation notification email.', 'give'),
633 633
 							'type'    => 'text',
634
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
634
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
635 635
 						),
636 636
 						array(
637 637
 							'id'      => 'donation_notification',
638
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
638
+							'name'    => esc_html__('Donation Notification', 'give'),
639 639
 							/* translators: %s: emails tags list */
640
-							'desc'    => sprintf( __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give' ), give_get_emails_tags_list() ) . '<br/>',
640
+							'desc'    => sprintf(__('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags: %s', 'give'), give_get_emails_tags_list()).'<br/>',
641 641
 							'type'    => 'wysiwyg',
642 642
 							'default' => give_get_default_donation_notification_email()
643 643
 						),
644 644
 						array(
645 645
 							'id'      => 'admin_notice_emails',
646
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
647
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
646
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
647
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
648 648
 							'type'    => 'textarea',
649
-							'default' => get_bloginfo( 'admin_email' )
649
+							'default' => get_bloginfo('admin_email')
650 650
 						),
651 651
 						array(
652 652
 							'id'   => 'disable_admin_notices',
653
-							'name' => esc_html__( 'Disable Admin Notifications', 'give' ),
654
-							'desc' => esc_html__( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
653
+							'name' => esc_html__('Disable Admin Notifications', 'give'),
654
+							'desc' => esc_html__('Check this box if you do not want to receive emails when new donations are made.', 'give'),
655 655
 							'type' => 'checkbox'
656 656
 						)
657 657
 					)
@@ -660,99 +660,99 @@  discard block
 block discarded – undo
660 660
 			/** Extension Settings */
661 661
 			'addons'      => array(
662 662
 				'id'         => 'addons',
663
-				'give_title' => esc_html__( 'Give Add-ons Settings', 'give' ),
664
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
665
-				'fields'     => apply_filters( 'give_settings_addons', array()
663
+				'give_title' => esc_html__('Give Add-ons Settings', 'give'),
664
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
665
+				'fields'     => apply_filters('give_settings_addons', array()
666 666
 				)
667 667
 			),
668 668
 			/** Licenses Settings */
669 669
 			'licenses'    => array(
670 670
 				'id'         => 'licenses',
671
-				'give_title' => esc_html__( 'Give Licenses', 'give' ),
672
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
673
-				'fields'     => apply_filters( 'give_settings_licenses', array()
671
+				'give_title' => esc_html__('Give Licenses', 'give'),
672
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
673
+				'fields'     => apply_filters('give_settings_licenses', array()
674 674
 				)
675 675
 			),
676 676
 			/** Advanced Options */
677 677
 			'advanced'    => array(
678 678
 				'id'         => 'advanced_options',
679
-				'give_title' => esc_html__( 'Advanced Options', 'give' ),
680
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
681
-				'fields'     => apply_filters( 'give_settings_advanced', array(
679
+				'give_title' => esc_html__('Advanced Options', 'give'),
680
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
681
+				'fields'     => apply_filters('give_settings_advanced', array(
682 682
 						array(
683
-							'name' => esc_html__( 'Access Control', 'give' ),
683
+							'name' => esc_html__('Access Control', 'give'),
684 684
 							'desc' => '',
685 685
 							'id'   => 'give_title_session_control_1',
686 686
 							'type' => 'give_title'
687 687
 						),
688 688
 						array(
689 689
 							'id'      => 'session_lifetime',
690
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
691
-							'desc'    => esc_html__( 'Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in as long as they are using the same browser they used when donating.', 'give' ),
690
+							'name'    => esc_html__('Session Lifetime', 'give'),
691
+							'desc'    => esc_html__('Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in as long as they are using the same browser they used when donating.', 'give'),
692 692
 							'type'    => 'select',
693 693
 							'options' => array(
694
-								'86400'  => esc_html__( '24 Hours', 'give' ),
695
-								'172800' => esc_html__( '48 Hours', 'give' ),
696
-								'259200' => esc_html__( '72 Hours', 'give' ),
697
-								'604800' => esc_html__( '1 Week', 'give' ),
694
+								'86400'  => esc_html__('24 Hours', 'give'),
695
+								'172800' => esc_html__('48 Hours', 'give'),
696
+								'259200' => esc_html__('72 Hours', 'give'),
697
+								'604800' => esc_html__('1 Week', 'give'),
698 698
 							)
699 699
 						),
700 700
 						array(
701
-							'name' => esc_html__( 'Email Access', 'give' ),
702
-							'desc' => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
701
+							'name' => esc_html__('Email Access', 'give'),
702
+							'desc' => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
703 703
 							'id'   => 'email_access',
704 704
 							'type' => 'checkbox',
705 705
 						),
706 706
 						array(
707 707
 							'id'      => 'recaptcha_key',
708
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
708
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
709 709
 							/* translators: %s: https://www.google.com/recaptcha/ */
710
-							'desc'    => sprintf( __( 'If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'https://www.google.com/recaptcha/' ) ),
710
+							'desc'    => sprintf(__('If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('https://www.google.com/recaptcha/')),
711 711
 							'default' => '',
712 712
 							'type'    => 'text'
713 713
 						),
714 714
 						array(
715 715
 							'id'      => 'recaptcha_secret',
716
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
717
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give' ),
716
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
717
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your manage reCAPTCHA API Keys panel.', 'give'),
718 718
 							'default' => '',
719 719
 							'type'    => 'text'
720 720
 						),
721 721
 						array(
722
-							'name' => esc_html__( 'Data Control', 'give' ),
722
+							'name' => esc_html__('Data Control', 'give'),
723 723
 							'desc' => '',
724 724
 							'id'   => 'give_title_data_control_2',
725 725
 							'type' => 'give_title'
726 726
 						),
727 727
 						array(
728
-							'name' => esc_html__( 'Remove All Data on Uninstall?', 'give' ),
729
-							'desc' => esc_html__( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
728
+							'name' => esc_html__('Remove All Data on Uninstall?', 'give'),
729
+							'desc' => esc_html__('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
730 730
 							'id'   => 'uninstall_on_delete',
731 731
 							'type' => 'checkbox'
732 732
 						),
733 733
 						array(
734
-							'name' => esc_html__( 'Filter Control', 'give' ),
734
+							'name' => esc_html__('Filter Control', 'give'),
735 735
 							'desc' => '',
736 736
 							'id'   => 'give_title_filter_control',
737 737
 							'type' => 'give_title'
738 738
 						),
739 739
 						array(
740 740
 							/* translators: %s: the_content */
741
-							'name' => sprintf( __( 'Disable %s filter', 'give' ), '<code>the_content</code>' ),
741
+							'name' => sprintf(__('Disable %s filter', 'give'), '<code>the_content</code>'),
742 742
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
743
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
743
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
744 744
 							'id'   => 'disable_the_content_filter',
745 745
 							'type' => 'checkbox'
746 746
 						),
747 747
 						array(
748
-							'name' => esc_html__( 'Script Loading', 'give' ),
748
+							'name' => esc_html__('Script Loading', 'give'),
749 749
 							'desc' => '',
750 750
 							'id'   => 'give_title_script_control',
751 751
 							'type' => 'give_title'
752 752
 						),
753 753
 						array(
754
-							'name' => esc_html__( 'Load Scripts in Footer?', 'give' ),
755
-							'desc' => esc_html__( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
754
+							'name' => esc_html__('Load Scripts in Footer?', 'give'),
755
+							'desc' => esc_html__('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
756 756
 							'id'   => 'scripts_footer',
757 757
 							'type' => 'checkbox'
758 758
 						)
@@ -762,13 +762,13 @@  discard block
 block discarded – undo
762 762
 			/** API Settings */
763 763
 			'api'         => array(
764 764
 				'id'         => 'api',
765
-				'give_title' => esc_html__( 'API', 'give' ),
766
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
765
+				'give_title' => esc_html__('API', 'give'),
766
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
767 767
 				'show_names' => false, // Hide field names on the left
768
-				'fields'     => apply_filters( 'give_settings_system', array(
768
+				'fields'     => apply_filters('give_settings_system', array(
769 769
 						array(
770 770
 							'id'   => 'api',
771
-							'name' => esc_html__( 'API', 'give' ),
771
+							'name' => esc_html__('API', 'give'),
772 772
 							'type' => 'api'
773 773
 						)
774 774
 					)
@@ -777,13 +777,13 @@  discard block
 block discarded – undo
777 777
 			/** Licenses Settings */
778 778
 			'system_info' => array(
779 779
 				'id'         => 'system_info',
780
-				'give_title' => esc_html__( 'System Info', 'give' ),
781
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
782
-				'fields'     => apply_filters( 'give_settings_system', array(
780
+				'give_title' => esc_html__('System Info', 'give'),
781
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
782
+				'fields'     => apply_filters('give_settings_system', array(
783 783
 						array(
784 784
 							'id'   => 'system_info',
785
-							'name' => esc_html__( 'System Info', 'give' ),
786
-							'desc' => esc_html__( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
785
+							'name' => esc_html__('System Info', 'give'),
786
+							'desc' => esc_html__('Please copy and paste this information in your ticket when contacting support.', 'give'),
787 787
 							'type' => 'system_info'
788 788
 						)
789 789
 					)
@@ -792,15 +792,15 @@  discard block
 block discarded – undo
792 792
 		);
793 793
 
794 794
 		//Return all settings array if no active tab
795
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
795
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
796 796
 
797
-			return apply_filters( 'give_registered_settings', $give_settings );
797
+			return apply_filters('give_registered_settings', $give_settings);
798 798
 
799 799
 		}
800 800
 
801 801
 
802 802
 		// Add other tabs and settings fields as needed
803
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
803
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
804 804
 
805 805
 	}
806 806
 
@@ -809,11 +809,11 @@  discard block
 block discarded – undo
809 809
 	 */
810 810
 	public function settings_notices() {
811 811
 
812
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
812
+		if ( ! isset($_POST['give_settings_saved'])) {
813 813
 			return;
814 814
 		}
815 815
 
816
-		add_settings_error( 'give-notices', 'global-settings-updated', esc_html__( 'Settings updated.', 'give' ), 'updated' );
816
+		add_settings_error('give-notices', 'global-settings-updated', esc_html__('Settings updated.', 'give'), 'updated');
817 817
 
818 818
 	}
819 819
 
@@ -827,17 +827,17 @@  discard block
 block discarded – undo
827 827
 	 *
828 828
 	 * @return mixed          Field value or exception is thrown
829 829
 	 */
830
-	public function __get( $field ) {
830
+	public function __get($field) {
831 831
 
832 832
 		// Allowed fields to retrieve
833
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
833
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
834 834
 			return $this->{$field};
835 835
 		}
836
-		if ( 'option_metabox' === $field ) {
836
+		if ('option_metabox' === $field) {
837 837
 			return $this->option_metabox();
838 838
 		}
839 839
 
840
-		throw new Exception( 'Invalid property: ' . $field );
840
+		throw new Exception('Invalid property: '.$field);
841 841
 	}
842 842
 
843 843
 
@@ -854,12 +854,12 @@  discard block
 block discarded – undo
854 854
  *
855 855
  * @return mixed        Option value
856 856
  */
857
-function give_get_option( $key = '', $default = false ) {
857
+function give_get_option($key = '', $default = false) {
858 858
 	global $give_options;
859
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
860
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
859
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
860
+	$value = apply_filters('give_get_option', $value, $key, $default);
861 861
 
862
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
862
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
863 863
 }
864 864
 
865 865
 
@@ -877,33 +877,33 @@  discard block
 block discarded – undo
877 877
  *
878 878
  * @return boolean True if updated, false if not.
879 879
  */
880
-function give_update_option( $key = '', $value = false ) {
880
+function give_update_option($key = '', $value = false) {
881 881
 
882 882
 	// If no key, exit
883
-	if ( empty( $key ) ) {
883
+	if (empty($key)) {
884 884
 		return false;
885 885
 	}
886 886
 
887
-	if ( empty( $value ) ) {
888
-		$remove_option = give_delete_option( $key );
887
+	if (empty($value)) {
888
+		$remove_option = give_delete_option($key);
889 889
 
890 890
 		return $remove_option;
891 891
 	}
892 892
 
893 893
 	// First let's grab the current settings
894
-	$options = get_option( 'give_settings' );
894
+	$options = get_option('give_settings');
895 895
 
896 896
 	// Let's let devs alter that value coming in
897
-	$value = apply_filters( 'give_update_option', $value, $key );
897
+	$value = apply_filters('give_update_option', $value, $key);
898 898
 
899 899
 	// Next let's try to update the value
900
-	$options[ $key ] = $value;
901
-	$did_update      = update_option( 'give_settings', $options );
900
+	$options[$key] = $value;
901
+	$did_update      = update_option('give_settings', $options);
902 902
 
903 903
 	// If it updated, let's update the global variable
904
-	if ( $did_update ) {
904
+	if ($did_update) {
905 905
 		global $give_options;
906
-		$give_options[ $key ] = $value;
906
+		$give_options[$key] = $value;
907 907
 	}
908 908
 
909 909
 	return $did_update;
@@ -920,27 +920,27 @@  discard block
 block discarded – undo
920 920
  *
921 921
  * @return boolean True if updated, false if not.
922 922
  */
923
-function give_delete_option( $key = '' ) {
923
+function give_delete_option($key = '') {
924 924
 
925 925
 	// If no key, exit
926
-	if ( empty( $key ) ) {
926
+	if (empty($key)) {
927 927
 		return false;
928 928
 	}
929 929
 
930 930
 	// First let's grab the current settings
931
-	$options = get_option( 'give_settings' );
931
+	$options = get_option('give_settings');
932 932
 
933 933
 	// Next let's try to update the value
934
-	if ( isset( $options[ $key ] ) ) {
934
+	if (isset($options[$key])) {
935 935
 
936
-		unset( $options[ $key ] );
936
+		unset($options[$key]);
937 937
 
938 938
 	}
939 939
 
940
-	$did_update = update_option( 'give_settings', $options );
940
+	$did_update = update_option('give_settings', $options);
941 941
 
942 942
 	// If it updated, let's update the global variable
943
-	if ( $did_update ) {
943
+	if ($did_update) {
944 944
 		global $give_options;
945 945
 		$give_options = $options;
946 946
 	}
@@ -959,9 +959,9 @@  discard block
 block discarded – undo
959 959
  */
960 960
 function give_get_settings() {
961 961
 
962
-	$settings = get_option( 'give_settings' );
962
+	$settings = get_option('give_settings');
963 963
 
964
-	return (array) apply_filters( 'give_get_settings', $settings );
964
+	return (array) apply_filters('give_get_settings', $settings);
965 965
 
966 966
 }
967 967
 
@@ -979,25 +979,25 @@  discard block
 block discarded – undo
979 979
  *
980 980
  * @return array
981 981
  */
982
-function give_settings_array_insert( $array, $position, $insert ) {
983
-	if ( is_int( $position ) ) {
984
-		array_splice( $array, $position, 0, $insert );
982
+function give_settings_array_insert($array, $position, $insert) {
983
+	if (is_int($position)) {
984
+		array_splice($array, $position, 0, $insert);
985 985
 	} else {
986 986
 
987
-		foreach ( $array as $index => $subarray ) {
988
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
987
+		foreach ($array as $index => $subarray) {
988
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
989 989
 				$pos = $index;
990 990
 			}
991 991
 		}
992 992
 
993
-		if ( ! isset( $pos ) ) {
993
+		if ( ! isset($pos)) {
994 994
 			return $array;
995 995
 		}
996 996
 
997 997
 		$array = array_merge(
998
-			array_slice( $array, 0, $pos ),
998
+			array_slice($array, 0, $pos),
999 999
 			$insert,
1000
-			array_slice( $array, $pos )
1000
+			array_slice($array, $pos)
1001 1001
 		);
1002 1002
 	}
1003 1003
 
@@ -1020,31 +1020,31 @@  discard block
 block discarded – undo
1020 1020
  *
1021 1021
  * @return void
1022 1022
  */
1023
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1023
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1024 1024
 
1025 1025
 	$id                = $field_type_object->field->args['id'];
1026 1026
 	$field_description = $field_type_object->field->args['desc'];
1027
-	$gateways          = give_get_ordered_payment_gateways( give_get_payment_gateways() );
1027
+	$gateways          = give_get_ordered_payment_gateways(give_get_payment_gateways());
1028 1028
 
1029 1029
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
1030 1030
 
1031
-	foreach ( $gateways as $key => $option ) :
1031
+	foreach ($gateways as $key => $option) :
1032 1032
 
1033
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
1033
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
1034 1034
 			$enabled = '1';
1035 1035
 		} else {
1036 1036
 			$enabled = null;
1037 1037
 		}
1038 1038
 
1039
-		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
1040
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
1039
+		echo '<li><span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
1040
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
1041 1041
 
1042 1042
 	endforeach;
1043 1043
 
1044 1044
 	echo '</ul>';
1045 1045
 
1046
-	if ( $field_description ) {
1047
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1046
+	if ($field_description) {
1047
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1048 1048
 	}
1049 1049
 
1050 1050
 }
@@ -1060,31 +1060,31 @@  discard block
 block discarded – undo
1060 1060
  *
1061 1061
  * @return void
1062 1062
  */
1063
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1063
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1064 1064
 
1065 1065
 	$id                = $field_type_object->field->args['id'];
1066 1066
 	$field_description = $field_type_object->field->args['desc'];
1067 1067
 	$gateways          = give_get_enabled_payment_gateways();
1068 1068
 
1069
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
1069
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
1070 1070
 
1071 1071
 	//Add a field to the Give Form admin single post view of this field
1072
-	if ( $field_type_object->field->object_type === 'post' ) {
1073
-		echo '<option value="global">' . esc_html__( 'Global Default', 'give' ) . '</option>';
1072
+	if ($field_type_object->field->object_type === 'post') {
1073
+		echo '<option value="global">'.esc_html__('Global Default', 'give').'</option>';
1074 1074
 	}
1075 1075
 
1076
-	foreach ( $gateways as $key => $option ) :
1076
+	foreach ($gateways as $key => $option) :
1077 1077
 
1078
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
1078
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
1079 1079
 
1080 1080
 
1081
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
1081
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
1082 1082
 
1083 1083
 	endforeach;
1084 1084
 
1085 1085
 	echo '</select>';
1086 1086
 
1087
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
1087
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
1088 1088
 
1089 1089
 }
1090 1090
 
@@ -1099,13 +1099,13 @@  discard block
 block discarded – undo
1099 1099
  *
1100 1100
  * @return void
1101 1101
  */
1102
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1102
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1103 1103
 
1104 1104
 	$id                = $field_type_object->field->args['id'];
1105 1105
 	$title             = $field_type_object->field->args['name'];
1106 1106
 	$field_description = $field_type_object->field->args['desc'];
1107 1107
 
1108
-	echo '<hr>' . $field_description;
1108
+	echo '<hr>'.$field_description;
1109 1109
 
1110 1110
 }
1111 1111
 
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
  *
1121 1121
  * @return void
1122 1122
  */
1123
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1123
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1124 1124
 
1125 1125
 	$id                = $field_type_object->field->args['id'];
1126 1126
 	$title             = $field_type_object->field->args['name'];
@@ -1140,25 +1140,25 @@  discard block
 block discarded – undo
1140 1140
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1141 1141
  * @return array An array of options that matches the CMB2 options array
1142 1142
  */
1143
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1143
+function give_cmb2_get_post_options($query_args, $force = false) {
1144 1144
 
1145
-	$post_options = array( '' => '' ); // Blank option
1145
+	$post_options = array('' => ''); // Blank option
1146 1146
 
1147
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1147
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1148 1148
 		return $post_options;
1149 1149
 	}
1150 1150
 
1151
-	$args = wp_parse_args( $query_args, array(
1151
+	$args = wp_parse_args($query_args, array(
1152 1152
 		'post_type'   => 'page',
1153 1153
 		'numberposts' => 10,
1154
-	) );
1154
+	));
1155 1155
 
1156
-	$posts = get_posts( $args );
1156
+	$posts = get_posts($args);
1157 1157
 
1158
-	if ( $posts ) {
1159
-		foreach ( $posts as $post ) {
1158
+	if ($posts) {
1159
+		foreach ($posts as $post) {
1160 1160
 
1161
-			$post_options[ $post->ID ] = $post->post_title;
1161
+			$post_options[$post->ID] = $post->post_title;
1162 1162
 
1163 1163
 		}
1164 1164
 	}
@@ -1178,17 +1178,17 @@  discard block
 block discarded – undo
1178 1178
 	global $_wp_additional_image_sizes;
1179 1179
 	$sizes = array();
1180 1180
 
1181
-	foreach ( get_intermediate_image_sizes() as $_size ) {
1181
+	foreach (get_intermediate_image_sizes() as $_size) {
1182 1182
 
1183
-		if ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
1184
-			$sizes[ $_size ] = $_size . ' - ' . get_option( "{$_size}_size_w" ) . 'x' . get_option( "{$_size}_size_h" );
1185
-		} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
1186
-			$sizes[ $_size ] = $_size . ' - ' . $_wp_additional_image_sizes[ $_size ]['width'] . 'x' . $_wp_additional_image_sizes[ $_size ]['height'];
1183
+		if (in_array($_size, array('thumbnail', 'medium', 'medium_large', 'large'))) {
1184
+			$sizes[$_size] = $_size.' - '.get_option("{$_size}_size_w").'x'.get_option("{$_size}_size_h");
1185
+		} elseif (isset($_wp_additional_image_sizes[$_size])) {
1186
+			$sizes[$_size] = $_size.' - '.$_wp_additional_image_sizes[$_size]['width'].'x'.$_wp_additional_image_sizes[$_size]['height'];
1187 1187
 		}
1188 1188
 
1189 1189
 	}
1190 1190
 
1191
-	return apply_filters( 'give_get_featured_image_sizes', $sizes );
1191
+	return apply_filters('give_get_featured_image_sizes', $sizes);
1192 1192
 }
1193 1193
 
1194 1194
 
@@ -1203,34 +1203,34 @@  discard block
 block discarded – undo
1203 1203
  *
1204 1204
  * @return void
1205 1205
  */
1206
-function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1206
+function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1207 1207
 
1208 1208
 	$id                = $field_type_object->field->args['id'];
1209 1209
 	$field_description = $field_type_object->field->args['desc'];
1210
-	$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1210
+	$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1211 1211
 	$field_classes     = 'regular-text give-license-field';
1212
-	$type              = empty( $escaped_value ) ? 'text' : 'password';
1212
+	$type              = empty($escaped_value) ? 'text' : 'password';
1213 1213
 
1214
-	if ( $license_status === 'valid' ) {
1214
+	if ($license_status === 'valid') {
1215 1215
 		$field_classes .= ' give-license-active';
1216 1216
 	}
1217 1217
 
1218
-	$html = $field_type_object->input( array(
1218
+	$html = $field_type_object->input(array(
1219 1219
 		'class' => $field_classes,
1220 1220
 		'type'  => $type
1221
-	) );
1221
+	));
1222 1222
 
1223 1223
 	//License is active so show deactivate button
1224
-	if ( $license_status === 'valid' ) {
1225
-		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'give' ) . '"/>';
1224
+	if ($license_status === 'valid') {
1225
+		$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.esc_attr__('Deactivate License', 'give').'"/>';
1226 1226
 	} else {
1227 1227
 		//This license is not valid so delete it
1228
-		give_delete_option( $id );
1228
+		give_delete_option($id);
1229 1229
 	}
1230 1230
 
1231
-	$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1231
+	$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1232 1232
 
1233
-	wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1233
+	wp_nonce_field($id.'-nonce', $id.'-nonce');
1234 1234
 
1235 1235
 	echo $html;
1236 1236
 }
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
  */
1245 1245
 function give_api_callback() {
1246 1246
 
1247
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1247
+	if ( ! current_user_can('manage_give_settings')) {
1248 1248
 		return;
1249 1249
 	}
1250 1250
 
@@ -1253,9 +1253,9 @@  discard block
 block discarded – undo
1253 1253
 	 *
1254 1254
 	 * @since 1.0
1255 1255
 	 */
1256
-	do_action( 'give_tools_api_keys_before' );
1256
+	do_action('give_tools_api_keys_before');
1257 1257
 
1258
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1258
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1259 1259
 
1260 1260
 	$api_keys_table = new Give_API_Keys_Table();
1261 1261
 	$api_keys_table->prepare_items();
@@ -1264,9 +1264,9 @@  discard block
 block discarded – undo
1264 1264
 	<span class="cmb2-metabox-description api-description">
1265 1265
 		<?php echo sprintf(
1266 1266
 		/* translators: 1: https://givewp.com/documentation/give-api-reference/ 2: https://givewp.com/addons/zapier/ */
1267
-			__( 'You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give' ),
1268
-			esc_url( 'https://givewp.com/documentation/give-api-reference/' ),
1269
-			esc_url( 'https://givewp.com/addons/zapier/' )
1267
+			__('You can create API keys for individual users within their profile edit screen. API keys allow users to use the <a href="%1$s" target="_blank">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%2$s" target="_blank">Zapier</a>.', 'give'),
1268
+			esc_url('https://givewp.com/documentation/give-api-reference/'),
1269
+			esc_url('https://givewp.com/addons/zapier/')
1270 1270
 		); ?>
1271 1271
 	</span>
1272 1272
 	<?php
@@ -1276,10 +1276,10 @@  discard block
 block discarded – undo
1276 1276
 	 *
1277 1277
 	 * @since 1.0
1278 1278
 	 */
1279
-	do_action( 'give_tools_api_keys_after' );
1279
+	do_action('give_tools_api_keys_after');
1280 1280
 }
1281 1281
 
1282
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1282
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1283 1283
 
1284 1284
 /**
1285 1285
  * Hook Callback
@@ -1292,8 +1292,8 @@  discard block
 block discarded – undo
1292 1292
  *
1293 1293
  * @return void
1294 1294
  */
1295
-function give_hook_callback( $args ) {
1296
-	do_action( 'give_' . $args['id'] );
1295
+function give_hook_callback($args) {
1296
+	do_action('give_'.$args['id']);
1297 1297
 }
1298 1298
 
1299 1299
 /**
@@ -1304,10 +1304,10 @@  discard block
 block discarded – undo
1304 1304
  * This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin.
1305 1305
  */
1306 1306
 
1307
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1308
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1309
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1310
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1311
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1312
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1307
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1308
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1309
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1310
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1311
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1312
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1313 1313
 }
1314 1314
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/forms/metabox.php 1 patch
Spacing   +189 added lines, -189 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-add_filter( 'cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes' );
17
+add_filter('cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes');
18 18
 
19 19
 /**
20 20
  * Define the metabox and field configurations.
@@ -23,23 +23,23 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array
25 25
  */
26
-function give_single_forms_cmb2_metaboxes( array $meta_boxes ) {
26
+function give_single_forms_cmb2_metaboxes(array $meta_boxes) {
27 27
 
28 28
 	$post_id               = give_get_admin_post_id();
29
-	$price                 = give_get_form_price( $post_id );
30
-	$custom_amount_minimum = give_get_form_minimum_price( $post_id );
31
-	$goal                  = give_get_form_goal( $post_id );
32
-	$variable_pricing      = give_has_variable_prices( $post_id );
33
-	$prices                = give_get_variable_prices( $post_id );
29
+	$price                 = give_get_form_price($post_id);
30
+	$custom_amount_minimum = give_get_form_minimum_price($post_id);
31
+	$goal                  = give_get_form_goal($post_id);
32
+	$variable_pricing      = give_has_variable_prices($post_id);
33
+	$prices                = give_get_variable_prices($post_id);
34 34
 
35 35
 	//No empty prices - min. 1.00 for new forms
36
-	if ( empty( $price ) && is_null( $post_id ) ) {
37
-		$price = esc_attr( give_format_amount( '1.00' ) );
36
+	if (empty($price) && is_null($post_id)) {
37
+		$price = esc_attr(give_format_amount('1.00'));
38 38
 	}
39 39
 
40 40
 	//Min. $1.00 for new forms
41
-	if ( empty( $custom_amount_minimum ) ) {
42
-		$custom_amount_minimum = esc_attr( give_format_amount( '1.00' ) );
41
+	if (empty($custom_amount_minimum)) {
42
+		$custom_amount_minimum = esc_attr(give_format_amount('1.00'));
43 43
 	}
44 44
 
45 45
 	// Start with an underscore to hide fields from custom fields list
@@ -48,330 +48,330 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * Repeatable Field Groups
50 50
 	 */
51
-	$meta_boxes['form_field_options'] = apply_filters( 'give_forms_field_options', array(
51
+	$meta_boxes['form_field_options'] = apply_filters('give_forms_field_options', array(
52 52
 		'id'           => 'form_field_options',
53
-		'title'        => esc_html__( 'Donation Options', 'give' ),
54
-		'object_types' => array( 'give_forms' ),
53
+		'title'        => esc_html__('Donation Options', 'give'),
54
+		'object_types' => array('give_forms'),
55 55
 		'context'      => 'normal',
56 56
 		'priority'     => 'high', //Show above Content WYSIWYG
57
-		'fields'       => apply_filters( 'give_forms_donation_form_metabox_fields', array(
57
+		'fields'       => apply_filters('give_forms_donation_form_metabox_fields', array(
58 58
 				//Donation Option
59 59
 				array(
60
-					'name'        => esc_html__( 'Donation Option', 'give' ),
61
-					'description' => esc_html__( 'Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ),
62
-					'id'          => $prefix . 'price_option',
60
+					'name'        => esc_html__('Donation Option', 'give'),
61
+					'description' => esc_html__('Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
62
+					'id'          => $prefix.'price_option',
63 63
 					'type'        => 'radio_inline',
64 64
 					'default'     => 'set',
65
-					'options'     => apply_filters( 'give_forms_price_options', array(
66
-						'set'   => esc_html__( 'Set Donation', 'give' ),
67
-						'multi' => esc_html__( 'Multi-level Donation', 'give' ),
68
-					) ),
65
+					'options'     => apply_filters('give_forms_price_options', array(
66
+						'set'   => esc_html__('Set Donation', 'give'),
67
+						'multi' => esc_html__('Multi-level Donation', 'give'),
68
+					)),
69 69
 				),
70 70
 				array(
71
-					'name'         => esc_html__( 'Set Donation', 'give' ),
72
-					'description'  => esc_html__( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ),
73
-					'id'           => $prefix . 'set_price',
71
+					'name'         => esc_html__('Set Donation', 'give'),
72
+					'description'  => esc_html__('This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give'),
73
+					'id'           => $prefix.'set_price',
74 74
 					'type'         => 'text_small',
75 75
 					'row_classes'  => 'give-subfield',
76
-					'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
77
-					'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
76
+					'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
77
+					'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
78 78
                     'sanitization_cb'   => 'give_sanitize_price_field_value',
79 79
                     'attributes'   => array(
80
-						'placeholder' => give_format_decimal( '1.00' ),
81
-						'value'       => give_format_decimal( $price ),
80
+						'placeholder' => give_format_decimal('1.00'),
81
+						'value'       => give_format_decimal($price),
82 82
 						'class'       => 'cmb-type-text-small give-money-field',
83 83
 					),
84 84
 				),
85 85
 				//Donation levels: Header
86 86
 				array(
87
-					'id'   => $prefix . 'levels_header',
87
+					'id'   => $prefix.'levels_header',
88 88
 					'type' => 'levels_repeater_header',
89 89
 				),
90 90
 				//Donation Levels: Repeatable CMB2 Group
91 91
 				array(
92
-					'id'          => $prefix . 'donation_levels',
92
+					'id'          => $prefix.'donation_levels',
93 93
 					'type'        => 'group',
94 94
 					'row_classes' => 'give-subfield',
95 95
 					'options'     => array(
96
-						'add_button'    => esc_html__( 'Add Level', 'give' ),
96
+						'add_button'    => esc_html__('Add Level', 'give'),
97 97
 						'remove_button' => '<span class="dashicons dashicons-no"></span>',
98 98
 						'sortable'      => true, // beta
99 99
 					),
100 100
 					// Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.
101
-					'fields'      => apply_filters( 'give_donation_levels_table_row', array(
101
+					'fields'      => apply_filters('give_donation_levels_table_row', array(
102 102
 						array(
103
-							'name' => esc_html__( 'ID', 'give' ),
104
-							'id'   => $prefix . 'id',
103
+							'name' => esc_html__('ID', 'give'),
104
+							'id'   => $prefix.'id',
105 105
 							'type' => 'levels_id',
106 106
 						),
107 107
 						array(
108
-							'name'              => esc_html__( 'Amount', 'give' ),
109
-							'id'                => $prefix . 'amount',
108
+							'name'              => esc_html__('Amount', 'give'),
109
+							'id'                => $prefix.'amount',
110 110
 							'type'              => 'text_small',
111
-							'before_field'      => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol  give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
112
-							'after_field'       => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol  give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
111
+							'before_field'      => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol  give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
112
+							'after_field'       => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol  give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
113 113
 							'sanitization_cb'   => 'give_sanitize_price_field_value',
114 114
                             'attributes'        => array(
115
-								'placeholder' => give_format_decimal( '1.00' ),
115
+								'placeholder' => give_format_decimal('1.00'),
116 116
 								'class'       => 'cmb-type-text-small give-money-field',
117 117
 							),
118 118
 							'before'       => 'give_format_admin_multilevel_amount',
119 119
 						),
120 120
 						array(
121
-							'name'       => esc_html__( 'Text', 'give' ),
122
-							'id'         => $prefix . 'text',
121
+							'name'       => esc_html__('Text', 'give'),
122
+							'id'         => $prefix.'text',
123 123
 							'type'       => 'text',
124 124
 							'attributes' => array(
125
-								'placeholder' => esc_html__( 'Donation Level', 'give' ),
125
+								'placeholder' => esc_html__('Donation Level', 'give'),
126 126
 								'class'       => 'give-multilevel-text-field',
127 127
 							),
128 128
 						),
129 129
 						array(
130
-							'name' => esc_html__( 'Default', 'give' ),
131
-							'id'   => $prefix . 'default',
130
+							'name' => esc_html__('Default', 'give'),
131
+							'id'   => $prefix.'default',
132 132
 							'type' => 'give_default_radio_inline'
133 133
 						),
134
-					) ),
134
+					)),
135 135
 				),
136 136
 				//Display Style
137 137
 				array(
138
-					'name'        => esc_html__( 'Display Style', 'give' ),
139
-					'description' => esc_html__( 'Set how the donations levels will display on the form.', 'give' ),
140
-					'id'          => $prefix . 'display_style',
138
+					'name'        => esc_html__('Display Style', 'give'),
139
+					'description' => esc_html__('Set how the donations levels will display on the form.', 'give'),
140
+					'id'          => $prefix.'display_style',
141 141
 					'type'        => 'radio_inline',
142 142
 					'default'     => 'buttons',
143 143
 					'options'     => array(
144
-						'buttons'  => esc_html__( 'Buttons', 'give' ),
145
-						'radios'   => esc_html__( 'Radios', 'give' ),
146
-						'dropdown' => esc_html__( 'Dropdown', 'give' ),
144
+						'buttons'  => esc_html__('Buttons', 'give'),
145
+						'radios'   => esc_html__('Radios', 'give'),
146
+						'dropdown' => esc_html__('Dropdown', 'give'),
147 147
 					),
148 148
 				),
149 149
 				//Custom Amount
150 150
 				array(
151
-					'name'        => esc_html__( 'Custom Amount', 'give' ),
152
-					'description' => esc_html__( 'Do you want the user to be able to input their own donation amount?', 'give' ),
153
-					'id'          => $prefix . 'custom_amount',
151
+					'name'        => esc_html__('Custom Amount', 'give'),
152
+					'description' => esc_html__('Do you want the user to be able to input their own donation amount?', 'give'),
153
+					'id'          => $prefix.'custom_amount',
154 154
 					'type'        => 'radio_inline',
155 155
 					'default'     => 'no',
156 156
 					'options'     => array(
157
-						'yes' => esc_html__( 'Yes', 'give' ),
158
-						'no'  => esc_html__( 'No', 'give' ),
157
+						'yes' => esc_html__('Yes', 'give'),
158
+						'no'  => esc_html__('No', 'give'),
159 159
 					),
160 160
 				),
161 161
 				array(
162
-					'name'         => esc_html__( 'Custom Amount Minimum', 'give' ),
163
-					'description'  => esc_html__( 'If you would like to set a minimum custom donation amount please enter it here.', 'give' ),
164
-					'id'           => $prefix . 'custom_amount_minimum',
162
+					'name'         => esc_html__('Custom Amount Minimum', 'give'),
163
+					'description'  => esc_html__('If you would like to set a minimum custom donation amount please enter it here.', 'give'),
164
+					'id'           => $prefix.'custom_amount_minimum',
165 165
 					'type'         => 'text_small',
166 166
 					'row_classes'  => 'give-subfield',
167
-					'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
168
-					'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
167
+					'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
168
+					'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
169 169
                     'sanitization_cb'   => 'give_sanitize_price_field_value',
170 170
                     'attributes'   => array(
171 171
 						'placeholder' => give_format_decimal('1.00'),
172
-						'value'       => give_format_decimal( $custom_amount_minimum ),
172
+						'value'       => give_format_decimal($custom_amount_minimum),
173 173
 						'class'       => 'cmb-type-text-small give-money-field',
174 174
 					)
175 175
 				),
176 176
 				array(
177
-					'name'        => esc_html__( 'Custom Amount Text', 'give' ),
178
-					'description' => esc_html__( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ),
179
-					'id'          => $prefix . 'custom_amount_text',
177
+					'name'        => esc_html__('Custom Amount Text', 'give'),
178
+					'description' => esc_html__('This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give'),
179
+					'id'          => $prefix.'custom_amount_text',
180 180
 					'type'        => 'text',
181 181
 					'row_classes' => 'give-subfield',
182 182
 					'attributes'  => array(
183 183
 						'rows'        => 3,
184
-						'placeholder' => esc_attr__( 'Give a Custom Amount', 'give' ),
184
+						'placeholder' => esc_attr__('Give a Custom Amount', 'give'),
185 185
 					),
186 186
 				),
187 187
 				//Goals
188 188
 				array(
189
-					'name'        => esc_html__( 'Goal', 'give' ),
190
-					'description' => esc_html__( 'Do you want to set a donation goal for this form?', 'give' ),
191
-					'id'          => $prefix . 'goal_option',
189
+					'name'        => esc_html__('Goal', 'give'),
190
+					'description' => esc_html__('Do you want to set a donation goal for this form?', 'give'),
191
+					'id'          => $prefix.'goal_option',
192 192
 					'type'        => 'radio_inline',
193 193
 					'default'     => 'no',
194 194
 					'options'     => array(
195
-						'yes' => esc_html__( 'Yes', 'give' ),
196
-						'no'  => esc_html__( 'No', 'give' ),
195
+						'yes' => esc_html__('Yes', 'give'),
196
+						'no'  => esc_html__('No', 'give'),
197 197
 					),
198 198
 				),
199 199
 				array(
200
-					'name'              => esc_html__( 'Goal Amount', 'give' ),
201
-					'description'       => esc_html__( 'This is the monetary goal amount you want to reach for this donation form.', 'give' ),
202
-					'id'                => $prefix . 'set_goal',
200
+					'name'              => esc_html__('Goal Amount', 'give'),
201
+					'description'       => esc_html__('This is the monetary goal amount you want to reach for this donation form.', 'give'),
202
+					'id'                => $prefix.'set_goal',
203 203
 					'type'              => 'text_small',
204 204
 					'row_classes'       => 'give-subfield',
205
-					'before_field'      => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
206
-					'after_field'       => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
205
+					'before_field'      => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
206
+					'after_field'       => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
207 207
 					'sanitization_cb'   => 'give_sanitize_price_field_value',
208 208
 					'attributes'        => array(
209
-						'placeholder' => give_format_decimal( '0.00' ),
210
-						'value'       => give_format_decimal( $goal ),
209
+						'placeholder' => give_format_decimal('0.00'),
210
+						'value'       => give_format_decimal($goal),
211 211
 						'class'       => 'cmb-type-text-small give-money-field',
212 212
 					),
213 213
 				),
214 214
 
215 215
 				array(
216
-					'name'        => esc_html__( 'Goal Format', 'give' ),
217
-					'description' => esc_html__( 'Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ),
218
-					'id'          => $prefix . 'goal_format',
216
+					'name'        => esc_html__('Goal Format', 'give'),
217
+					'description' => esc_html__('Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give'),
218
+					'id'          => $prefix.'goal_format',
219 219
 					'type'        => 'radio_inline',
220 220
 					'default'     => 'amount',
221 221
 					'row_classes' => 'give-subfield',
222 222
 					'options'     => array(
223
-						'amount'     => esc_html__( 'Amount ', 'give' ),
224
-						'percentage' => esc_html__( 'Percentage', 'give' ),
223
+						'amount'     => esc_html__('Amount ', 'give'),
224
+						'percentage' => esc_html__('Percentage', 'give'),
225 225
 					),
226 226
 				),
227 227
 				array(
228
-					'name'        => esc_html__( 'Goal Progress Bar Color', 'give' ),
229
-					'id'          => $prefix . 'goal_color',
228
+					'name'        => esc_html__('Goal Progress Bar Color', 'give'),
229
+					'id'          => $prefix.'goal_color',
230 230
 					'type'        => 'colorpicker',
231 231
 					'row_classes' => 'give-subfield',
232 232
 					'default'     => '#2bc253',
233 233
 				),
234 234
 
235 235
 				array(
236
-					'name'        => esc_html__( 'Close Form when Goal Achieved', 'give' ),
237
-					'desc'        => esc_html__( 'Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
238
-					'id'          => $prefix . 'close_form_when_goal_achieved',
236
+					'name'        => esc_html__('Close Form when Goal Achieved', 'give'),
237
+					'desc'        => esc_html__('Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
238
+					'id'          => $prefix.'close_form_when_goal_achieved',
239 239
 					'type'        => 'radio_inline',
240 240
 					'row_classes' => 'give-subfield',
241 241
 					'options'     => array(
242
-						'yes' => esc_html__( 'Yes', 'give' ),
243
-						'no'  => esc_html__( 'No', 'give' ),
242
+						'yes' => esc_html__('Yes', 'give'),
243
+						'no'  => esc_html__('No', 'give'),
244 244
 					),
245 245
 					'default'     => 'no',
246 246
 				),
247 247
 				array(
248
-					'name'        => esc_html__( 'Goal Achieved Message', 'give' ),
249
-					'desc'        => esc_html__( 'Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ),
250
-					'id'          => $prefix . 'form_goal_achieved_message',
248
+					'name'        => esc_html__('Goal Achieved Message', 'give'),
249
+					'desc'        => esc_html__('Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give'),
250
+					'id'          => $prefix.'form_goal_achieved_message',
251 251
 					'type'        => 'textarea',
252 252
 					'row_classes' => 'give-subfield',
253 253
 					'attributes'  => array(
254
-						'placeholder' => esc_attr__( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
254
+						'placeholder' => esc_attr__('Thank you to all our donors, we have met our fundraising goal.', 'give'),
255 255
 					),
256 256
 				)
257 257
 			)
258 258
 		)
259
-	) );
259
+	));
260 260
 
261 261
 
262 262
 	/**
263 263
 	 * Content Field
264 264
 	 */
265
-	$meta_boxes['form_content_options'] = apply_filters( 'give_forms_content_options', array(
265
+	$meta_boxes['form_content_options'] = apply_filters('give_forms_content_options', array(
266 266
 		'id'           => 'form_content_options',
267
-		'title'        => esc_html__( 'Form Content', 'give' ),
268
-		'object_types' => array( 'give_forms' ),
267
+		'title'        => esc_html__('Form Content', 'give'),
268
+		'object_types' => array('give_forms'),
269 269
 		'context'      => 'normal',
270 270
 		'priority'     => 'high', //Show above Content WYSIWYG
271
-		'fields'       => apply_filters( 'give_forms_content_options_metabox_fields', array(
271
+		'fields'       => apply_filters('give_forms_content_options_metabox_fields', array(
272 272
 				//Donation Option
273 273
 				array(
274
-					'name'        => esc_html__( 'Display Content', 'give' ),
275
-					'description' => esc_html__( 'Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give' ),
276
-					'id'          => $prefix . 'content_option',
274
+					'name'        => esc_html__('Display Content', 'give'),
275
+					'description' => esc_html__('Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give'),
276
+					'id'          => $prefix.'content_option',
277 277
 					'type'        => 'select',
278
-					'options'     => apply_filters( 'give_forms_content_options_select', array(
279
-							'none'           => esc_html__( 'No content', 'give' ),
280
-							'give_pre_form'  => esc_html__( 'Yes, display content ABOVE the form fields', 'give' ),
281
-							'give_post_form' => esc_html__( 'Yes, display content BELOW the form fields', 'give' ),
278
+					'options'     => apply_filters('give_forms_content_options_select', array(
279
+							'none'           => esc_html__('No content', 'give'),
280
+							'give_pre_form'  => esc_html__('Yes, display content ABOVE the form fields', 'give'),
281
+							'give_post_form' => esc_html__('Yes, display content BELOW the form fields', 'give'),
282 282
 						)
283 283
 					),
284 284
 					'default'     => 'none',
285 285
 				),
286 286
 				array(
287
-					'name'        => esc_html__( 'Content', 'give' ),
288
-					'description' => esc_html__( 'This content will display on the single give form page.', 'give' ),
289
-					'id'          => $prefix . 'form_content',
287
+					'name'        => esc_html__('Content', 'give'),
288
+					'description' => esc_html__('This content will display on the single give form page.', 'give'),
289
+					'id'          => $prefix.'form_content',
290 290
 					'row_classes' => 'give-subfield',
291 291
 					'type'        => 'wysiwyg'
292 292
 				),
293 293
 			)
294 294
 		)
295
-	) );
295
+	));
296 296
 
297 297
 
298 298
 	/**
299 299
 	 * Display Options
300 300
 	 */
301
-	$meta_boxes['form_display_options'] = apply_filters( 'give_form_display_options', array(
301
+	$meta_boxes['form_display_options'] = apply_filters('give_form_display_options', array(
302 302
 			'id'           => 'form_display_options',
303
-			'title'        => esc_html__( 'Form Display Options', 'give' ),
304
-			'object_types' => array( 'give_forms' ),
303
+			'title'        => esc_html__('Form Display Options', 'give'),
304
+			'object_types' => array('give_forms'),
305 305
 			'context'      => 'normal', //  'normal', 'advanced', or 'side'
306 306
 			'priority'     => 'high', //Show above Content WYSIWYG
307 307
 			'show_names'   => true, // Show field names on the left
308
-			'fields'       => apply_filters( 'give_forms_display_options_metabox_fields', array(
308
+			'fields'       => apply_filters('give_forms_display_options_metabox_fields', array(
309 309
 					array(
310
-						'name'    => esc_html__( 'Payment Fields', 'give' ),
311
-						'desc'    => esc_html__( 'How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give' ),
312
-						'id'      => $prefix . 'payment_display',
310
+						'name'    => esc_html__('Payment Fields', 'give'),
311
+						'desc'    => esc_html__('How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give'),
312
+						'id'      => $prefix.'payment_display',
313 313
 						'type'    => 'select',
314 314
 						'options' => array(
315
-							'onpage' => esc_html__( 'Show on Page', 'give' ),
316
-							'reveal' => esc_html__( 'Reveal Upon Click', 'give' ),
317
-							'modal'  => esc_html__( 'Modal Window Upon Click', 'give' ),
315
+							'onpage' => esc_html__('Show on Page', 'give'),
316
+							'reveal' => esc_html__('Reveal Upon Click', 'give'),
317
+							'modal'  => esc_html__('Modal Window Upon Click', 'give'),
318 318
 						),
319 319
 						'default' => 'onpage',
320 320
 					),
321 321
 					array(
322
-						'id'          => $prefix . 'reveal_label',
323
-						'name'        => esc_html__( 'Reveal / Modal Open Text', 'give' ),
324
-						'desc'        => esc_html__( 'The button label for completing the donation.', 'give' ),
322
+						'id'          => $prefix.'reveal_label',
323
+						'name'        => esc_html__('Reveal / Modal Open Text', 'give'),
324
+						'desc'        => esc_html__('The button label for completing the donation.', 'give'),
325 325
 						'type'        => 'text_small',
326 326
 						'row_classes' => 'give-subfield',
327 327
 						'attributes'  => array(
328
-							'placeholder' => esc_attr__( 'Donate Now', 'give' ),
328
+							'placeholder' => esc_attr__('Donate Now', 'give'),
329 329
 						),
330 330
 					),
331 331
 					array(
332
-						'id'         => $prefix . 'checkout_label',
333
-						'name'       => esc_html__( 'Complete Donation Text', 'give' ),
334
-						'desc'       => esc_html__( 'The button label for completing a donation.', 'give' ),
332
+						'id'         => $prefix.'checkout_label',
333
+						'name'       => esc_html__('Complete Donation Text', 'give'),
334
+						'desc'       => esc_html__('The button label for completing a donation.', 'give'),
335 335
 						'type'       => 'text_small',
336 336
 						'attributes' => array(
337
-							'placeholder' => esc_html__( 'Donate Now', 'give' ),
337
+							'placeholder' => esc_html__('Donate Now', 'give'),
338 338
 						),
339 339
 					),
340 340
 					array(
341
-						'name' => esc_html__( 'Default Gateway', 'give' ),
342
-						'desc' => esc_html__( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ),
343
-						'id'   => $prefix . 'default_gateway',
341
+						'name' => esc_html__('Default Gateway', 'give'),
342
+						'desc' => esc_html__('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'),
343
+						'id'   => $prefix.'default_gateway',
344 344
 						'type' => 'default_gateway'
345 345
 					),
346 346
 					array(
347
-						'name' => esc_html__( 'Disable Guest Donations', 'give' ),
348
-						'desc' => esc_html__( 'Do you want to require users be logged-in to make donations?', 'give' ),
349
-						'id'   => $prefix . 'logged_in_only',
347
+						'name' => esc_html__('Disable Guest Donations', 'give'),
348
+						'desc' => esc_html__('Do you want to require users be logged-in to make donations?', 'give'),
349
+						'id'   => $prefix.'logged_in_only',
350 350
 						'type' => 'checkbox'
351 351
 					),
352 352
 					array(
353
-						'name'    => esc_html__( 'Register / Login Form', 'give' ),
354
-						'desc'    => esc_html__( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ),
355
-						'id'      => $prefix . 'show_register_form',
353
+						'name'    => esc_html__('Register / Login Form', 'give'),
354
+						'desc'    => esc_html__('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
355
+						'id'      => $prefix.'show_register_form',
356 356
 						'type'    => 'select',
357 357
 						'options' => array(
358
-							'both'         => esc_html__( 'Registration and Login Forms', 'give' ),
359
-							'registration' => esc_html__( 'Registration Form Only', 'give' ),
360
-							'login'        => esc_html__( 'Login Form Only', 'give' ),
361
-							'none'         => esc_html__( 'None', 'give' ),
358
+							'both'         => esc_html__('Registration and Login Forms', 'give'),
359
+							'registration' => esc_html__('Registration Form Only', 'give'),
360
+							'login'        => esc_html__('Login Form Only', 'give'),
361
+							'none'         => esc_html__('None', 'give'),
362 362
 						),
363 363
 						'default' => 'none',
364 364
 					),
365 365
 					array(
366
-						'name'    => esc_html__( 'Floating Labels', 'give' ),
366
+						'name'    => esc_html__('Floating Labels', 'give'),
367 367
 						/* translators: %s: forms https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
368
-						'desc'    => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
369
-						'id'      => $prefix . 'form_floating_labels',
368
+						'desc'    => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
369
+						'id'      => $prefix.'form_floating_labels',
370 370
 						'type'    => 'select',
371 371
 						'options' => array(
372
-							''         => esc_html__( 'Use the global setting', 'give' ),
373
-							'enabled'  => esc_html__( 'Enabled', 'give' ),
374
-							'disabled' => esc_html__( 'Disabled', 'give' ),
372
+							''         => esc_html__('Use the global setting', 'give'),
373
+							'enabled'  => esc_html__('Enabled', 'give'),
374
+							'disabled' => esc_html__('Disabled', 'give'),
375 375
 						),
376 376
 						'default' => 'none',
377 377
 					)
@@ -383,47 +383,47 @@  discard block
 block discarded – undo
383 383
 	/**
384 384
 	 * Terms & Conditions
385 385
 	 */
386
-	$meta_boxes['form_terms_options'] = apply_filters( 'give_forms_terms_options', array(
386
+	$meta_boxes['form_terms_options'] = apply_filters('give_forms_terms_options', array(
387 387
 		'id'           => 'form_terms_options',
388
-		'title'        => esc_html__( 'Terms and Conditions', 'give' ),
389
-		'object_types' => array( 'give_forms' ),
388
+		'title'        => esc_html__('Terms and Conditions', 'give'),
389
+		'object_types' => array('give_forms'),
390 390
 		'context'      => 'normal',
391 391
 		'priority'     => 'high', //Show above Content WYSIWYG
392
-		'fields'       => apply_filters( 'give_forms_terms_options_metabox_fields', array(
392
+		'fields'       => apply_filters('give_forms_terms_options_metabox_fields', array(
393 393
 				//Donation Option
394 394
 				array(
395
-					'name'        => esc_html__( 'Terms and Conditions', 'give' ),
396
-					'description' => esc_html__( 'Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give' ),
397
-					'id'          => $prefix . 'terms_option',
395
+					'name'        => esc_html__('Terms and Conditions', 'give'),
396
+					'description' => esc_html__('Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give'),
397
+					'id'          => $prefix.'terms_option',
398 398
 					'type'        => 'select',
399
-					'options'     => apply_filters( 'give_forms_content_options_select', array(
400
-							'none' => esc_html__( 'No', 'give' ),
401
-							'yes'  => esc_html__( 'Yes', 'give' ),
399
+					'options'     => apply_filters('give_forms_content_options_select', array(
400
+							'none' => esc_html__('No', 'give'),
401
+							'yes'  => esc_html__('Yes', 'give'),
402 402
 						)
403 403
 					),
404 404
 					'default'     => 'none',
405 405
 				),
406 406
 				array(
407
-					'id'          => $prefix . 'agree_label',
408
-					'name'        => esc_html__( 'Agree to Terms Label', 'give' ),
409
-					'desc'        => esc_html__( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ),
407
+					'id'          => $prefix.'agree_label',
408
+					'name'        => esc_html__('Agree to Terms Label', 'give'),
409
+					'desc'        => esc_html__('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'),
410 410
 					'type'        => 'text',
411 411
 					'row_classes' => 'give-subfield',
412 412
 					'size'        => 'regular',
413 413
 					'attributes'  => array(
414
-						'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
414
+						'placeholder' => esc_attr__('Agree to Terms?', 'give'),
415 415
 					),
416 416
 				),
417 417
 				array(
418
-					'id'          => $prefix . 'agree_text',
418
+					'id'          => $prefix.'agree_text',
419 419
 					'row_classes' => 'give-subfield',
420
-					'name'        => esc_html__( 'Agreement Text', 'give' ),
421
-					'desc'        => esc_html__( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ),
420
+					'name'        => esc_html__('Agreement Text', 'give'),
421
+					'desc'        => esc_html__('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
422 422
 					'type'        => 'wysiwyg'
423 423
 				),
424 424
 			)
425 425
 		)
426
-	) );
426
+	));
427 427
 
428 428
 	return $meta_boxes;
429 429
 
@@ -437,9 +437,9 @@  discard block
 block discarded – undo
437 437
 
438 438
 	<div class="table-container">
439 439
 		<div class="table-row">
440
-			<div class="table-cell col-amount"><?php esc_html_e( 'Amount', 'give' ); ?></div>
441
-			<div class="table-cell col-text"><?php esc_html_e( 'Text', 'give' ); ?></div>
442
-			<div class="table-cell col-default"><?php esc_html_e( 'Default', 'give' ); ?></div>
440
+			<div class="table-cell col-amount"><?php esc_html_e('Amount', 'give'); ?></div>
441
+			<div class="table-cell col-text"><?php esc_html_e('Text', 'give'); ?></div>
442
+			<div class="table-cell col-default"><?php esc_html_e('Default', 'give'); ?></div>
443 443
 			<?php
444 444
 			/**
445 445
 			 * Fires in repeatable donation levels table head.
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
 			 *
452 452
 			 * @since 1.0
453 453
 			 */
454
-			do_action( 'give_donation_levels_table_head' );
454
+			do_action('give_donation_levels_table_head');
455 455
 			?>
456
-			<div class="table-cell col-sort"><?php esc_html_e( 'Sort', 'give' ); ?></div>
456
+			<div class="table-cell col-sort"><?php esc_html_e('Sort', 'give'); ?></div>
457 457
 
458 458
 		</div>
459 459
 	</div>
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	<?php
462 462
 }
463 463
 
464
-add_action( 'cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10 );
464
+add_action('cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10);
465 465
 
466 466
 
467 467
 /**
@@ -478,25 +478,25 @@  discard block
 block discarded – undo
478 478
  * @param $object_type
479 479
  * @param $field_type_object
480 480
  */
481
-function give_cmb_render_levels_id( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
481
+function give_cmb_render_levels_id($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
482 482
 
483
-	$escaped_value = ( isset( $escaped_value['level_id'] ) ? $escaped_value['level_id'] : '' );
483
+	$escaped_value = (isset($escaped_value['level_id']) ? $escaped_value['level_id'] : '');
484 484
 
485 485
 	$field_options_array = array(
486 486
 		'class' => 'give-hidden give-level-id-input',
487
-		'name'  => $field_type_object->_name( '[level_id]' ),
488
-		'id'    => $field_type_object->_id( '_level_id' ),
487
+		'name'  => $field_type_object->_name('[level_id]'),
488
+		'id'    => $field_type_object->_id('_level_id'),
489 489
 		'value' => $escaped_value,
490 490
 		'type'  => 'number',
491 491
 		'desc'  => '',
492 492
 	);
493 493
 
494
-	echo '<p class="give-level-id">' . $escaped_value . '</p>';
495
-	echo $field_type_object->input( $field_options_array );
494
+	echo '<p class="give-level-id">'.$escaped_value.'</p>';
495
+	echo $field_type_object->input($field_options_array);
496 496
 
497 497
 }
498 498
 
499
-add_action( 'cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5 );
499
+add_action('cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5);
500 500
 
501 501
 
502 502
 /**
@@ -508,13 +508,13 @@  discard block
 block discarded – undo
508 508
  * @param $object_type
509 509
  * @param $field_type_object
510 510
  */
511
-function give_cmb_give_default_radio_inline( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
512
-	echo '<input type="radio" class="cmb2-option donation-level-radio" name="' . $field_object->args['_name'] . '" id="' . $field_object->args['id'] . '" value="default" ' . checked( 'default', $escaped_value, false ) . '>';
513
-	echo '<label for="' . $field_object->args['id'] . '">Default</label>';
511
+function give_cmb_give_default_radio_inline($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
512
+	echo '<input type="radio" class="cmb2-option donation-level-radio" name="'.$field_object->args['_name'].'" id="'.$field_object->args['id'].'" value="default" '.checked('default', $escaped_value, false).'>';
513
+	echo '<label for="'.$field_object->args['id'].'">Default</label>';
514 514
 
515 515
 }
516 516
 
517
-add_action( 'cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5 );
517
+add_action('cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5);
518 518
 
519 519
 
520 520
 /**
@@ -524,20 +524,20 @@  discard block
 block discarded – undo
524 524
  */
525 525
 function give_add_shortcode_to_publish_metabox() {
526 526
 
527
-	if ( 'give_forms' !== get_post_type() ) {
527
+	if ('give_forms' !== get_post_type()) {
528 528
 		return false;
529 529
 	}
530 530
 
531 531
 	global $post;
532 532
 
533 533
 	//Only enqueue scripts for CPT on post type screen
534
-	if ( 'give_forms' === $post->post_type ) {
534
+	if ('give_forms' === $post->post_type) {
535 535
 		//Shortcode column with select all input
536
-		$shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' );
537
-		echo '<div class="shortcode-wrap box-sizing"><label>' . esc_html__( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '"></div>';
536
+		$shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
537
+		echo '<div class="shortcode-wrap box-sizing"><label>'.esc_html__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
538 538
 
539 539
 	}
540 540
 
541 541
 }
542 542
 
543
-add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' );
543
+add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
Please login to merge, or discard this patch.