Completed
Pull Request — master (#1147)
by Gennady
22:01 queued 16:50
created
includes/class-admin.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 
5 5
 	function __construct() {
6 6
 
7
-		if( ! is_admin() ) { return; }
7
+		if ( ! is_admin() ) { return; }
8 8
 
9 9
 		// If Gravity Forms isn't active or compatibile, stop loading
10
-		if( false === GravityView_Compatibility::is_valid() ) {
10
+		if ( false === GravityView_Compatibility::is_valid() ) {
11 11
 			return;
12 12
 		}
13 13
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
49 49
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
50 50
 
51
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
51
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
52 52
 
53 53
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
54 54
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public static function no_views_text() {
66 66
 
67
-		if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
67
+		if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) {
68 68
 			return __( 'No Views found in Trash', 'gravityview' );
69
-		} elseif( ! empty( $_GET['s'] ) ) {
69
+		} elseif ( ! empty( $_GET[ 's' ] ) ) {
70 70
 			return __( 'No Views found.', 'gravityview' );
71 71
 		}
72 72
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			$error .= ' ' . esc_html__( 'or select another form.', 'gravityview' );
111 111
 		}
112 112
 
113
-		if( $error ) {
113
+		if ( $error ) {
114 114
 			?>
115 115
 			<div class="wp-dialog notice-warning inline error wp-clearfix">
116 116
 				<?php echo gravityview_get_floaty(); ?>
@@ -129,23 +129,23 @@  discard block
 block discarded – undo
129 129
 	public function backend_actions() {
130 130
 
131 131
 		/** @define "GRAVITYVIEW_DIR" "../" */
132
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
133
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
134
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
135
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
136
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
137
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
138
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
139
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-installer.php' );
140
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
141
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
132
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
133
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
134
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
135
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
136
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
137
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
138
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
139
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-installer.php' );
140
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
141
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
142 142
 
143 143
 		/**
144 144
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
145 145
 		 *
146 146
 		 * Nice place to insert extensions' backend stuff
147 147
 		 */
148
-		do_action('gravityview_include_backend_actions');
148
+		do_action( 'gravityview_include_backend_actions' );
149 149
 	}
150 150
 
151 151
 	/**
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
 
162 162
 		$actions = array();
163 163
 
164
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
165
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
164
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
165
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
166 166
 		}
167 167
 
168
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
169
-			$actions[] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
168
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
169
+			$actions[ ] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
170 170
 		}
171 171
 
172 172
 		return array_merge( $actions, $links );
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		// By default, there will only be one item being modified.
195 195
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
196 196
 		// of modified items that will override this array.
197
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
197
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
198 198
 
199 199
 		// If we're starting fresh, a new form was created.
200 200
 		// We should let the user know this is the case.
@@ -202,60 +202,60 @@  discard block
 block discarded – undo
202 202
 
203 203
 		$new_form_text = '';
204 204
 
205
-		if( !empty( $start_fresh ) ) {
205
+		if ( ! empty( $start_fresh ) ) {
206 206
 
207 207
 			// Get the form that was created
208 208
 			$connected_form = gravityview_get_form_id( $post_id );
209 209
 
210
-			if( !empty( $connected_form ) ) {
210
+			if ( ! empty( $connected_form ) ) {
211 211
 				$form = gravityview_get_form( $connected_form );
212
-				$form_name = esc_attr( $form['title'] );
212
+				$form_name = esc_attr( $form[ 'title' ] );
213 213
 				$image = self::get_floaty();
214
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
215
-				$new_form_text .=  sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
214
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
215
+				$new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s
216 216
 
217 217
 					You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don&rsquo;t forget to %scustomize the form settings%s.
218
-					', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&amp;id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id='.$connected_form ).'">', '</a>');
218
+					', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&amp;id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=' . $connected_form ) . '">', '</a>' );
219 219
 				$new_form_text = wpautop( $new_form_text );
220 220
 
221 221
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
222 222
 			}
223 223
 		}
224 224
 
225
-		$messages['gravityview'] = array(
225
+		$messages[ 'gravityview' ] = array(
226 226
 			0  => '', // Unused. Messages start at index 1.
227 227
 			/* translators: %s and %s are HTML tags linking to the View on the website */
228
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
228
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
229 229
 			/* translators: %s and %s are HTML tags linking to the View on the website */
230
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
230
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
231 231
 			3  => __( 'View deleted.', 'gravityview' ),
232 232
 			/* translators: %s and %s are HTML tags linking to the View on the website */
233
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
233
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
234 234
 			/* translators: %s: date and time of the revision */
235
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
235
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
236 236
 			/* translators: %s and %s are HTML tags linking to the View on the website */
237
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
237
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
238 238
 			/* translators: %s and %s are HTML tags linking to the View on the website */
239
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
239
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
240 240
 			8  => __( 'View submitted.', 'gravityview' ),
241 241
 			9  => sprintf(
242 242
 		        /* translators: Date and time the View is scheduled to be published */
243 243
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
244 244
 				// translators: Publish box date format, see http://php.net/date
245
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
245
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
246 246
 			) . $new_form_text,
247 247
 			/* translators: %s and %s are HTML tags linking to the View on the website */
248
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
248
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
249 249
 
250 250
 			/**
251 251
 			 * These apply to `bulk_post_updated_messages`
252 252
 			 * @file wp-admin/edit.php
253 253
 			 */
254
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
255
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
256
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
257
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
258
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
254
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
255
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
256
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
257
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
258
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
259 259
 		);
260 260
 
261 261
 		return $messages;
Please login to merge, or discard this patch.
future/includes/class-gv-entry.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$args = array();
115 115
 
116
-		$view_id = is_null ( $view ) ? null : $view->ID;
116
+		$view_id = is_null( $view ) ? null : $view->ID;
117 117
 
118 118
 		$permalink = null;
119 119
 
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 
127 127
 				$view_collection = View_Collection::from_post( $post );
128 128
 
129
-				if( 1 < $view_collection->count() ) {
130
-					$args['gvid'] = $view_id;
129
+				if ( 1 < $view_collection->count() ) {
130
+					$args[ 'gvid' ] = $view_id;
131 131
 				}
132 132
 			}
133 133
 		}
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 			 */
157 157
 			$link_parts = explode( '?', $permalink );
158 158
 
159
-			$query = ! empty( $link_parts[1] ) ? '?' . $link_parts[1] : '';
159
+			$query = ! empty( $link_parts[ 1 ] ) ? '?' . $link_parts[ 1 ] : '';
160 160
 
161
-			$permalink = trailingslashit( $link_parts[0] ) . $entry_endpoint_name . '/'. $entry_slug .'/' . $query;
161
+			$permalink = trailingslashit( $link_parts[ 0 ] ) . $entry_endpoint_name . '/' . $entry_slug . '/' . $query;
162 162
 		} else {
163 163
 			$args[ $entry_endpoint_name ] = $entry_slug;
164 164
 		}
165 165
 
166 166
 		if ( $track_directory ) {
167
-			if ( ! empty( $_GET['pagenum'] ) ) {
168
-				$args['pagenum'] = intval( $_GET['pagenum'] );
167
+			if ( ! empty( $_GET[ 'pagenum' ] ) ) {
168
+				$args[ 'pagenum' ] = intval( $_GET[ 'pagenum' ] );
169 169
 			}
170 170
 
171 171
 			if ( $sort = Utils::_GET( 'sort' ) ) {
172
-				$args['sort'] = $sort;
173
-				$args['dir'] = Utils::_GET( 'dir' );
172
+				$args[ 'sort' ] = $sort;
173
+				$args[ 'dir' ] = Utils::_GET( 'dir' );
174 174
 			}
175 175
 		}
176 176
 
Please login to merge, or discard this patch.
includes/class-gravityview-entry-link-shortcode.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 		$atts = shortcode_atts( self::$defaults, $atts );
77 77
 
78
-		$atts['action'] = 'edit';
78
+		$atts[ 'action' ] = 'edit';
79 79
 
80 80
 		return $this->shortcode( $atts, $content, $context );
81 81
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$atts = shortcode_atts( self::$defaults, $atts );
93 93
 
94
-		$atts['action'] = 'delete';
94
+		$atts[ 'action' ] = 'delete';
95 95
 
96 96
 		return $this->shortcode( $atts, $content, $context );
97 97
 	}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		$this->settings = shortcode_atts( self::$defaults, $atts, $context );
133 133
 
134
-		$this->view_id = empty( $this->settings['view_id'] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings['view_id'] );
134
+		$this->view_id = empty( $this->settings[ 'view_id' ] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings[ 'view_id' ] );
135 135
 
136 136
 		if ( empty( $this->view_id ) ) {
137 137
 			gravityview()->log->error( 'A View ID was not defined and we are not inside a View' );
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 			return null;
140 140
 		}
141 141
 
142
-		$this->entry = $this->get_entry( $this->settings['entry_id'] );
142
+		$this->entry = $this->get_entry( $this->settings[ 'entry_id' ] );
143 143
 
144 144
 		if ( empty( $this->entry ) ) {
145
-			gravityview()->log->error( 'An Entry ID was not defined or found. Entry ID: {entry_id}', array( 'entry_id' => $this->settings['entry_id'] ) );
145
+			gravityview()->log->error( 'An Entry ID was not defined or found. Entry ID: {entry_id}', array( 'entry_id' => $this->settings[ 'entry_id' ] ) );
146 146
 
147 147
 			return null;
148 148
 		}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		gravityview()->log->debug( '{context} atts:', array( 'context' => $context, 'data' => $atts ) );
151 151
 
152 152
 		if ( ! $this->has_cap() ) {
153
-			gravityview()->log->error( 'User does not have the capability to {action} this entry: {entry_id}', array( 'action' => esc_attr( $this->settings['action'] ), 'entry_id' => $this->entry['id'] ) );
153
+			gravityview()->log->error( 'User does not have the capability to {action} this entry: {entry_id}', array( 'action' => esc_attr( $this->settings[ 'action' ] ), 'entry_id' => $this->entry[ 'id' ] ) );
154 154
 
155 155
 			return null;
156 156
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		}
165 165
 
166 166
 		// Get just the URL, not the tag
167
-		if ( 'url' === $this->settings['return'] ) {
167
+		if ( 'url' === $this->settings[ 'return' ] ) {
168 168
 			return $url;
169 169
 		}
170 170
 
@@ -185,13 +185,13 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	private function get_link_atts() {
187 187
 
188
-		wp_parse_str( $this->settings['link_atts'], $link_atts );
188
+		wp_parse_str( $this->settings[ 'link_atts' ], $link_atts );
189 189
 
190
-		if ( 'delete' === $this->settings['action'] ) {
191
-			$link_atts['onclick'] = isset( $link_atts['onclick'] ) ? $link_atts['onclick'] : GravityView_Delete_Entry::get_confirm_dialog();
190
+		if ( 'delete' === $this->settings[ 'action' ] ) {
191
+			$link_atts[ 'onclick' ] = isset( $link_atts[ 'onclick' ] ) ? $link_atts[ 'onclick' ] : GravityView_Delete_Entry::get_confirm_dialog();
192 192
 		}
193 193
 
194
-		return (array) $link_atts;
194
+		return (array)$link_atts;
195 195
 	}
196 196
 
197 197
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			return do_shortcode( $content );
212 212
 		}
213 213
 
214
-		switch ( $this->settings['action'] ) {
214
+		switch ( $this->settings[ 'action' ] ) {
215 215
 			case 'edit':
216 216
 				$anchor_text = __( 'Edit Entry', 'gravityview' );
217 217
 				break;
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 	private function get_url() {
240 240
 
241 241
 		// if post_id is not defined, default to view_id
242
-		$post_id = empty( $this->settings['post_id'] ) ? $this->view_id : $this->settings['post_id'];
242
+		$post_id = empty( $this->settings[ 'post_id' ] ) ? $this->view_id : $this->settings[ 'post_id' ];
243 243
 
244
-		switch ( $this->settings['action'] ) {
244
+		switch ( $this->settings[ 'action' ] ) {
245 245
 			case 'edit':
246 246
 				$url = GravityView_Edit_Entry::get_edit_link( $this->entry, $this->view_id, $post_id );
247 247
 				break;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	private function has_cap() {
268 268
 
269
-		switch ( $this->settings['action'] ) {
269
+		switch ( $this->settings[ 'action' ] ) {
270 270
 			case 'edit':
271 271
 				$has_cap = GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry, $this->view_id );
272 272
 				break;
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	private function maybe_add_field_values_query_args( $url ) {
333 333
 
334
-		if ( $url && ! empty( $this->settings['field_values'] ) ) {
334
+		if ( $url && ! empty( $this->settings[ 'field_values' ] ) ) {
335 335
 
336
-			wp_parse_str( $this->settings['field_values'], $field_values );
336
+			wp_parse_str( $this->settings[ 'field_values' ], $field_values );
337 337
 
338 338
 			$url = add_query_arg( $field_values, $url );
339 339
 		}
Please login to merge, or discard this patch.
includes/class-admin-views.php 1 patch
Spacing   +179 added lines, -179 removed lines patch added patch discarded remove patch
@@ -28,31 +28,31 @@  discard block
 block discarded – undo
28 28
 		add_filter( 'gravityview_blacklist_field_types', array( $this, 'default_field_blacklist' ), 10, 2 );
29 29
 
30 30
 		// Tooltips
31
-		add_filter( 'gform_tooltips', array( $this, 'tooltips') );
31
+		add_filter( 'gform_tooltips', array( $this, 'tooltips' ) );
32 32
 
33 33
 		// adding styles and scripts
34
-		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles'), 999 );
35
-		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict') );
36
-		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict') );
37
-		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict') );
38
-		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict') );
39
-
40
-		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas'), 10, 4 );
41
-		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas'), 10, 3 );
42
-		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers') );
43
-		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields'), 10, 2 );
44
-		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets') );
45
-		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas'), 10, 5 );
34
+		add_action( 'admin_enqueue_scripts', array( 'GravityView_Admin_Views', 'add_scripts_and_styles' ), 999 );
35
+		add_filter( 'gform_noconflict_styles', array( $this, 'register_no_conflict' ) );
36
+		add_filter( 'gform_noconflict_scripts', array( $this, 'register_no_conflict' ) );
37
+		add_filter( 'gravityview_noconflict_styles', array( $this, 'register_no_conflict' ) );
38
+		add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) );
39
+
40
+		add_action( 'gravityview_render_directory_active_areas', array( $this, 'render_directory_active_areas' ), 10, 4 );
41
+		add_action( 'gravityview_render_widgets_active_areas', array( $this, 'render_widgets_active_areas' ), 10, 3 );
42
+		add_action( 'gravityview_render_field_pickers', array( $this, 'render_field_pickers' ) );
43
+		add_action( 'gravityview_render_available_fields', array( $this, 'render_available_fields' ), 10, 2 );
44
+		add_action( 'gravityview_render_available_widgets', array( $this, 'render_available_widgets' ) );
45
+		add_action( 'gravityview_render_active_areas', array( $this, 'render_active_areas' ), 10, 5 );
46 46
 
47 47
 		// @todo check if this hook is needed..
48 48
 		//add_action( 'gravityview_render_field_options', array( $this, 'render_field_options'), 10, 9 );
49 49
 
50 50
 		// Add Connected Form column
51
-		add_filter('manage_gravityview_posts_columns' , array( $this, 'add_post_type_columns' ) );
51
+		add_filter( 'manage_gravityview_posts_columns', array( $this, 'add_post_type_columns' ) );
52 52
 
53 53
 		add_filter( 'gform_toolbar_menu', array( 'GravityView_Admin_Views', 'gform_toolbar_menu' ), 10, 2 );
54 54
 
55
-		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content'), 10, 2 );
55
+		add_action( 'manage_gravityview_posts_custom_column', array( $this, 'add_custom_column_content' ), 10, 2 );
56 56
 
57 57
 		add_action( 'restrict_manage_posts', array( $this, 'add_view_dropdown' ) );
58 58
 
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	function suggest_support_articles( $localization_data = array() ) {
73 73
 
74
-	    if( ! gravityview()->request->is_view() ) {
74
+	    if ( ! gravityview()->request->is_view() ) {
75 75
 	        return $localization_data;
76 76
         }
77 77
 
78
-		$localization_data['suggest'] = array(
78
+		$localization_data[ 'suggest' ] = array(
79 79
             '57ef23539033602e61d4a560',
80 80
             '54c67bb9e4b0512429885513',
81 81
             '54c67bb9e4b0512429885512',
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
 	public function filter_pre_get_posts_by_gravityview_form_id( &$query ) {
97 97
 		global $pagenow;
98 98
 
99
-		if ( !is_admin() ) {
99
+		if ( ! is_admin() ) {
100 100
 			return;
101 101
 		}
102 102
 
103
-		$form_id = isset( $_GET['gravityview_form_id'] ) ? (int) $_GET['gravityview_form_id'] : false;
103
+		$form_id = isset( $_GET[ 'gravityview_form_id' ] ) ? (int)$_GET[ 'gravityview_form_id' ] : false;
104 104
 
105
-		if( 'edit.php' !== $pagenow || ! $form_id || ! isset( $query->query_vars[ 'post_type' ] ) ) {
105
+		if ( 'edit.php' !== $pagenow || ! $form_id || ! isset( $query->query_vars[ 'post_type' ] ) ) {
106 106
 			return;
107 107
 		}
108 108
 
@@ -119,18 +119,18 @@  discard block
 block discarded – undo
119 119
 	function add_view_dropdown() {
120 120
 		$current_screen = get_current_screen();
121 121
 
122
-		if( 'gravityview' !== $current_screen->post_type ) {
122
+		if ( 'gravityview' !== $current_screen->post_type ) {
123 123
 			return;
124 124
 		}
125 125
 
126 126
 		$forms = gravityview_get_forms();
127 127
 		$current_form = \GV\Utils::_GET( 'gravityview_form_id' );
128 128
 		// If there are no forms to select, show no forms.
129
-		if( !empty( $forms ) ) { ?>
129
+		if ( ! empty( $forms ) ) { ?>
130 130
 			<select name="gravityview_form_id" id="gravityview_form_id">
131 131
 				<option value="" <?php selected( '', $current_form, true ); ?>><?php esc_html_e( 'All forms', 'gravityview' ); ?></option>
132
-				<?php foreach( $forms as $form ) { ?>
133
-					<option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option>
132
+				<?php foreach ( $forms as $form ) { ?>
133
+					<option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option>
134 134
 				<?php } ?>
135 135
 			</select>
136 136
 		<?php }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) {
145 145
 		_deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' );
146
-		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id );
146
+		GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name, $id );
147 147
 	}
148 148
 
149 149
 	/**
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$connected_views = gravityview_get_connected_views( $id, array( 'post_status' => 'any' ) );
168 168
 
169
-		if( empty( $connected_views ) ) {
169
+		if ( empty( $connected_views ) ) {
170 170
 
171
-		    $menu_items['gravityview'] = array(
171
+		    $menu_items[ 'gravityview' ] = array(
172 172
 				'label'          => esc_attr__( 'Create a View', 'gravityview' ),
173 173
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
174 174
 				'title'          => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -184,22 +184,22 @@  discard block
 block discarded – undo
184 184
 		$sub_menu_items = array();
185 185
 		foreach ( (array)$connected_views as $view ) {
186 186
 
187
-			if( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
187
+			if ( ! GVCommon::has_cap( 'edit_gravityview', $view->ID ) ) {
188 188
 				continue;
189 189
 			}
190 190
 
191
-			$label = empty( $view->post_title ) ? sprintf( __('No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
191
+			$label = empty( $view->post_title ) ? sprintf( __( 'No Title (View #%d)', 'gravityview' ), $view->ID ) : $view->post_title;
192 192
 
193
-			$sub_menu_items[] = array(
193
+			$sub_menu_items[ ] = array(
194 194
 				'label' => esc_attr( $label ),
195
-				'url' => admin_url( 'post.php?action=edit&post='.$view->ID ),
195
+				'url' => admin_url( 'post.php?action=edit&post=' . $view->ID ),
196 196
 			);
197 197
 		}
198 198
 
199 199
 		// If there were no items added, then let's create the parent menu
200
-		if( $sub_menu_items ) {
200
+		if ( $sub_menu_items ) {
201 201
 
202
-		    $sub_menu_items[] = array(
202
+		    $sub_menu_items[ ] = array(
203 203
 			    'label' => esc_attr__( 'Create a View', 'gravityview' ),
204 204
                 'link_class' => 'gv-create-view',
205 205
 			    'title' => esc_attr__( 'Create a View using this form as a data source', 'gravityview' ),
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
             );
209 209
 
210 210
 			// Make sure Gravity Forms uses the submenu; if there's only one item, it uses a link instead of a dropdown
211
-			$sub_menu_items[] = array(
211
+			$sub_menu_items[ ] = array(
212 212
 				'url' => '#',
213 213
 				'label' => '',
214 214
 				'menu_class' => 'hidden',
215 215
 				'capabilities' => '',
216 216
 			);
217 217
 
218
-			$menu_items['gravityview'] = array(
218
+			$menu_items[ 'gravityview' ] = array(
219 219
 				'label'          => __( 'Connected Views', 'gravityview' ),
220 220
 				'icon'           => '<i class="fa fa-lg gv-icon-astronaut-head gv-icon"></i>',
221 221
 				'title'          => __( 'GravityView Views using this form as a data source', 'gravityview' ),
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 		$add = array( 'captcha', 'page' );
245 245
 
246 246
 		// Don't allowing editing the following values:
247
-		if( $context === 'edit' ) {
248
-			$add[] = 'post_id';
247
+		if ( $context === 'edit' ) {
248
+			$add[ ] = 'post_id';
249 249
 		}
250 250
 
251 251
 		$return = array_merge( $array, $add );
@@ -268,32 +268,32 @@  discard block
 block discarded – undo
268 268
 		foreach ( $default_args as $key => $arg ) {
269 269
 
270 270
 			// If an arg has `tooltip` defined, but it's false, don't display a tooltip
271
-			if( isset( $arg['tooltip'] ) && empty( $arg['tooltip'] ) ) { continue; }
271
+			if ( isset( $arg[ 'tooltip' ] ) && empty( $arg[ 'tooltip' ] ) ) { continue; }
272 272
 
273 273
 			// By default, use `tooltip` if defined.
274
-			$tooltip = empty( $arg['tooltip'] ) ? NULL : $arg['tooltip'];
274
+			$tooltip = empty( $arg[ 'tooltip' ] ) ? NULL : $arg[ 'tooltip' ];
275 275
 
276 276
 			// Otherwise, use the description as a tooltip.
277
-			if( empty( $tooltip ) && !empty( $arg['desc'] ) ) {
278
-				$tooltip = $arg['desc'];
277
+			if ( empty( $tooltip ) && ! empty( $arg[ 'desc' ] ) ) {
278
+				$tooltip = $arg[ 'desc' ];
279 279
 			}
280 280
 
281 281
 			// If there's no tooltip set, continue
282
-			if( empty( $tooltip ) ) {
282
+			if ( empty( $tooltip ) ) {
283 283
 				continue;
284 284
 			}
285 285
 
286 286
 			// Add the tooltip
287
-			$gv_tooltips[ 'gv_'.$key ] = array(
288
-				'title'	=> $arg['label'],
287
+			$gv_tooltips[ 'gv_' . $key ] = array(
288
+				'title'	=> $arg[ 'label' ],
289 289
 				'value'	=> $tooltip,
290 290
 			);
291 291
 
292 292
 		}
293 293
 
294
-		$gv_tooltips['gv_css_merge_tags'] = array(
295
-			'title' => __('CSS Merge Tags', 'gravityview'),
296
-			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview'), '<code>', '</code>' )
294
+		$gv_tooltips[ 'gv_css_merge_tags' ] = array(
295
+			'title' => __( 'CSS Merge Tags', 'gravityview' ),
296
+			'value' => sprintf( __( 'Developers: The CSS classes will be sanitized using the %ssanitize_title_with_dashes()%s function.', 'gravityview' ), '<code>', '</code>' )
297 297
 		);
298 298
 
299 299
 		/**
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 
312 312
 		foreach ( $gv_tooltips as $key => $tooltip ) {
313 313
 
314
-			$title = empty( $tooltip['title'] ) ? '' : '<h6>'.esc_html( $tooltip['title'] ) .'</h6>';
314
+			$title = empty( $tooltip[ 'title' ] ) ? '' : '<h6>' . esc_html( $tooltip[ 'title' ] ) . '</h6>';
315 315
 
316
-			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip['value'] ) );
316
+			$tooltips[ $key ] = $title . wpautop( esc_html( $tooltip[ 'value' ] ) );
317 317
 		}
318 318
 
319 319
 		return $tooltips;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	 *
328 328
 	 * @return void
329 329
 	 */
330
-	public function add_custom_column_content( $column_name = NULL, $post_id )	{
330
+	public function add_custom_column_content( $column_name = NULL, $post_id ) {
331 331
 
332 332
 		$output = '';
333 333
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 				// Generate backup if label doesn't exist: `example_name` => `Example Name`
350 350
 				$template_id_pretty = ucwords( implode( ' ', explode( '_', $template_id ) ) );
351 351
 
352
-				$output = $template ? $template['label'] : $template_id_pretty;
352
+				$output = $template ? $template[ 'label' ] : $template_id_pretty;
353 353
 
354 354
 				break;
355 355
 
@@ -390,44 +390,44 @@  discard block
 block discarded – undo
390 390
 	static public function get_connected_form_links( $form, $include_form_link = true ) {
391 391
 
392 392
 		// Either the form is empty or the form ID is 0, not yet set.
393
-		if( empty( $form ) ) {
393
+		if ( empty( $form ) ) {
394 394
 			return '';
395 395
 		}
396 396
 
397 397
 		// The $form is passed as the form ID
398
-		if( !is_array( $form ) ) {
398
+		if ( ! is_array( $form ) ) {
399 399
 			$form = gravityview_get_form( $form );
400 400
 		}
401 401
 
402
-		$form_id = $form['id'];
402
+		$form_id = $form[ 'id' ];
403 403
 		$links = array();
404 404
 
405
-		if( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
405
+		if ( GVCommon::has_cap( 'gravityforms_edit_forms' ) ) {
406 406
 			$form_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;id=%d', $form_id ) );
407
-			$form_link = '<strong class="gv-form-title">'.gravityview_get_link( $form_url, $form['title'], 'class=row-title' ).'</strong>';
408
-			$links[] = '<span>'.gravityview_get_link( $form_url, __('Edit Form', 'gravityview') ).'</span>';
407
+			$form_link = '<strong class="gv-form-title">' . gravityview_get_link( $form_url, $form[ 'title' ], 'class=row-title' ) . '</strong>';
408
+			$links[ ] = '<span>' . gravityview_get_link( $form_url, __( 'Edit Form', 'gravityview' ) ) . '</span>';
409 409
 		} else {
410
-			$form_link = '<strong class="gv-form-title">'. esc_html( $form['title'] ). '</strong>';
410
+			$form_link = '<strong class="gv-form-title">' . esc_html( $form[ 'title' ] ) . '</strong>';
411 411
 		}
412 412
 
413
-		if( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
413
+		if ( GVCommon::has_cap( 'gravityforms_view_entries' ) ) {
414 414
 			$entries_url = admin_url( sprintf( 'admin.php?page=gf_entries&amp;id=%d', $form_id ) );
415
-			$links[] = '<span>'.gravityview_get_link( $entries_url, __('Entries', 'gravityview') ).'</span>';
415
+			$links[ ] = '<span>' . gravityview_get_link( $entries_url, __( 'Entries', 'gravityview' ) ) . '</span>';
416 416
 		}
417 417
 
418
-		if( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
418
+		if ( GVCommon::has_cap( array( 'gravityforms_edit_settings', 'gravityview_view_settings' ) ) ) {
419 419
 			$settings_url = admin_url( sprintf( 'admin.php?page=gf_edit_forms&amp;view=settings&amp;id=%d', $form_id ) );
420
-			$links[] = '<span>'.gravityview_get_link( $settings_url, __('Settings', 'gravityview'), 'title='.__('Edit settings for this form', 'gravityview') ).'</span>';
420
+			$links[ ] = '<span>' . gravityview_get_link( $settings_url, __( 'Settings', 'gravityview' ), 'title=' . __( 'Edit settings for this form', 'gravityview' ) ) . '</span>';
421 421
 		}
422 422
 
423
-		if( GVCommon::has_cap( array("gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms") ) ) {
423
+		if ( GVCommon::has_cap( array( "gravityforms_edit_forms", "gravityforms_create_form", "gravityforms_preview_forms" ) ) ) {
424 424
 			$preview_url = site_url( sprintf( '?gf_page=preview&amp;id=%d', $form_id ) );
425
-			$links[] = '<span>'.gravityview_get_link( $preview_url, __('Preview Form', 'gravityview'), 'title='.__('Preview this form', 'gravityview') ).'</span>';
425
+			$links[ ] = '<span>' . gravityview_get_link( $preview_url, __( 'Preview Form', 'gravityview' ), 'title=' . __( 'Preview this form', 'gravityview' ) ) . '</span>';
426 426
 		}
427 427
 
428 428
 		$output = '';
429 429
 
430
-		if( !empty( $include_form_link ) ) {
430
+		if ( ! empty( $include_form_link ) ) {
431 431
 			$output .= $form_link;
432 432
 		}
433 433
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		 */
440 440
 		$links = apply_filters( 'gravityview_connected_form_links', $links, $form );
441 441
 
442
-		$output .= '<div class="row-actions">'. implode( ' | ', $links ) .'</div>';
442
+		$output .= '<div class="row-actions">' . implode( ' | ', $links ) . '</div>';
443 443
 
444 444
 		return $output;
445 445
 	}
@@ -453,8 +453,8 @@  discard block
 block discarded – undo
453 453
 		// Get the date column and save it for later to add back in.
454 454
 		// This adds it after the Data Source column.
455 455
 		// This way, we don't need to do array_slice, array_merge, etc.
456
-		$date = $columns['date'];
457
-		unset( $columns['date'] );
456
+		$date = $columns[ 'date' ];
457
+		unset( $columns[ 'date' ] );
458 458
 
459 459
 		$data_source_required_caps = array(
460 460
 			'gravityforms_edit_forms',
@@ -465,14 +465,14 @@  discard block
 block discarded – undo
465 465
 			'gravityforms_preview_forms',
466 466
 		);
467 467
 
468
-		if( GVCommon::has_cap( $data_source_required_caps ) ) {
469
-			$columns['gv_connected_form'] = __( 'Data Source', 'gravityview' );
468
+		if ( GVCommon::has_cap( $data_source_required_caps ) ) {
469
+			$columns[ 'gv_connected_form' ] = __( 'Data Source', 'gravityview' );
470 470
 		}
471 471
 
472
-		$columns['gv_template'] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
472
+		$columns[ 'gv_template' ] = _x( 'Template', 'Column title that shows what template is being used for Views', 'gravityview' );
473 473
 
474 474
 		// Add the date back in.
475
-		$columns['date'] = $date;
475
+		$columns[ 'date' ] = $date;
476 476
 
477 477
 		return $columns;
478 478
 	}
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
 	 */
487 487
 	function save_postdata( $post_id ) {
488 488
 
489
-		if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){
489
+		if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
490 490
 			return;
491 491
 		}
492 492
 
493 493
 		// validate post_type
494
-		if ( ! isset( $_POST['post_type'] ) || 'gravityview' != $_POST['post_type'] ) {
494
+		if ( ! isset( $_POST[ 'post_type' ] ) || 'gravityview' != $_POST[ 'post_type' ] ) {
495 495
 			return;
496 496
 		}
497 497
 
@@ -506,64 +506,64 @@  discard block
 block discarded – undo
506 506
 		$statii = array();
507 507
 
508 508
 		// check if this is a start fresh View
509
-		if ( isset( $_POST['gravityview_select_form_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_form_nonce'], 'gravityview_select_form' ) ) {
509
+		if ( isset( $_POST[ 'gravityview_select_form_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_form_nonce' ], 'gravityview_select_form' ) ) {
510 510
 
511
-			$form_id = !empty( $_POST['gravityview_form_id'] ) ? $_POST['gravityview_form_id'] : '';
511
+			$form_id = ! empty( $_POST[ 'gravityview_form_id' ] ) ? $_POST[ 'gravityview_form_id' ] : '';
512 512
 			// save form id
513
-			$statii['form_id'] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
513
+			$statii[ 'form_id' ] = update_post_meta( $post_id, '_gravityview_form_id', $form_id );
514 514
 
515 515
 		}
516 516
 
517
-		if( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii['form_id'] ) ) {
517
+		if ( false === GVCommon::has_cap( 'gravityforms_create_form' ) && empty( $statii[ 'form_id' ] ) ) {
518 518
 			gravityview()->log->error( 'Current user does not have the capability to create a new Form.', array( 'data' => wp_get_current_user() ) );
519 519
 			return;
520 520
 		}
521 521
 
522 522
 		// Was this a start fresh?
523
-		if ( ! empty( $_POST['gravityview_form_id_start_fresh'] ) ) {
524
-			$statii['start_fresh'] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
523
+		if ( ! empty( $_POST[ 'gravityview_form_id_start_fresh' ] ) ) {
524
+			$statii[ 'start_fresh' ] = add_post_meta( $post_id, '_gravityview_start_fresh', 1 );
525 525
 		} else {
526
-			$statii['start_fresh'] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
526
+			$statii[ 'start_fresh' ] = delete_post_meta( $post_id, '_gravityview_start_fresh' );
527 527
 		}
528 528
 
529 529
 		// Check if we have a template id
530
-		if ( isset( $_POST['gravityview_select_template_nonce'] ) && wp_verify_nonce( $_POST['gravityview_select_template_nonce'], 'gravityview_select_template' ) ) {
530
+		if ( isset( $_POST[ 'gravityview_select_template_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_select_template_nonce' ], 'gravityview_select_template' ) ) {
531 531
 
532
-			$template_id = !empty( $_POST['gravityview_directory_template'] ) ? $_POST['gravityview_directory_template'] : '';
532
+			$template_id = ! empty( $_POST[ 'gravityview_directory_template' ] ) ? $_POST[ 'gravityview_directory_template' ] : '';
533 533
 
534 534
 			// now save template id
535
-			$statii['directory_template'] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
535
+			$statii[ 'directory_template' ] = update_post_meta( $post_id, '_gravityview_directory_template', $template_id );
536 536
 		}
537 537
 
538 538
 
539 539
 		// save View Configuration metabox
540
-		if ( isset( $_POST['gravityview_view_configuration_nonce'] ) && wp_verify_nonce( $_POST['gravityview_view_configuration_nonce'], 'gravityview_view_configuration' ) ) {
540
+		if ( isset( $_POST[ 'gravityview_view_configuration_nonce' ] ) && wp_verify_nonce( $_POST[ 'gravityview_view_configuration_nonce' ], 'gravityview_view_configuration' ) ) {
541 541
 
542 542
 			// template settings
543
-			if( empty( $_POST['template_settings'] ) ) {
544
-				$_POST['template_settings'] = array();
543
+			if ( empty( $_POST[ 'template_settings' ] ) ) {
544
+				$_POST[ 'template_settings' ] = array();
545 545
 			}
546
-			$statii['template_settings'] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST['template_settings'] );
546
+			$statii[ 'template_settings' ] = update_post_meta( $post_id, '_gravityview_template_settings', $_POST[ 'template_settings' ] );
547 547
 
548 548
 			$fields = array();
549 549
 
550 550
 			// Directory&single Visible Fields
551
-			if( !empty( $preset_fields ) ) {
551
+			if ( ! empty( $preset_fields ) ) {
552 552
 
553 553
 				$fields = $preset_fields;
554 554
 
555
-			} elseif( !empty( $_POST['gv_fields'] ) ) {
555
+			} elseif ( ! empty( $_POST[ 'gv_fields' ] ) ) {
556 556
 				$fields = _gravityview_process_posted_fields();
557 557
 			}
558 558
 
559 559
 			$fields = map_deep( $fields, 'addslashes' );
560
-			$statii['directory_fields'] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
560
+			$statii[ 'directory_fields' ] = update_post_meta( $post_id, '_gravityview_directory_fields', $fields );
561 561
 
562 562
 			// Directory Visible Widgets
563
-			if( empty( $_POST['widgets'] ) ) {
564
-				$_POST['widgets'] = array();
563
+			if ( empty( $_POST[ 'widgets' ] ) ) {
564
+				$_POST[ 'widgets' ] = array();
565 565
 			}
566
-			$statii['directory_widgets'] = gravityview_set_directory_widgets( $post_id, $_POST['widgets'] );
566
+			$statii[ 'directory_widgets' ] = gravityview_set_directory_widgets( $post_id, $_POST[ 'widgets' ] );
567 567
 
568 568
 		} // end save view configuration
569 569
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		 * @param array $statii Array of statuses of the post meta saving processes. If saving worked, each key should be mapped to a value of the post ID (`directory_widgets` => `124`). If failed (or didn't change), the value will be false.
574 574
 		 * @since 1.17.2
575 575
 		 */
576
-		do_action('gravityview_view_saved', $post_id, $statii );
576
+		do_action( 'gravityview_view_saved', $post_id, $statii );
577 577
 
578 578
 		gravityview()->log->debug( '[save_postdata] Update Post Meta Statuses (also returns false if nothing changed)', array( 'data' => array_map( 'intval', $statii ) ) );
579 579
 	}
@@ -617,20 +617,20 @@  discard block
 block discarded – undo
617 617
 
618 618
 		$output = '';
619 619
 
620
-		if( !empty( $fields ) ) {
620
+		if ( ! empty( $fields ) ) {
621 621
 
622
-			foreach( $fields as $id => $details ) {
622
+			foreach ( $fields as $id => $details ) {
623 623
 
624
-				if( in_array( $details['type'], (array) $blacklist_field_types ) ) {
624
+				if ( in_array( $details[ 'type' ], (array)$blacklist_field_types ) ) {
625 625
 					continue;
626 626
 				}
627 627
 
628 628
 				// Edit mode only allows editing the parent fields, not single inputs.
629
-				if( $context === 'edit' && !empty( $details['parent'] ) ) {
629
+				if ( $context === 'edit' && ! empty( $details[ 'parent' ] ) ) {
630 630
 					continue;
631 631
 				}
632 632
 
633
-				$output .= new GravityView_Admin_View_Field( $details['label'], $id, $details, $settings = array(), $form );
633
+				$output .= new GravityView_Admin_View_Field( $details[ 'label' ], $id, $details, $settings = array(), $form );
634 634
 
635 635
 			} // End foreach
636 636
 		}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 		echo $output;
639 639
 
640 640
 		// For the EDIT view we only want to allow the form fields.
641
-		if( $context === 'edit' ) {
641
+		if ( $context === 'edit' ) {
642 642
 			return;
643 643
 		}
644 644
 
@@ -662,16 +662,16 @@  discard block
 block discarded – undo
662 662
 		$additional_fields = apply_filters( 'gravityview_additional_fields', array(
663 663
 			array(
664 664
 				'label_text' => __( '+ Add All Fields', 'gravityview' ),
665
-				'desc' => __('Add all the available fields at once.', 'gravityview'),
665
+				'desc' => __( 'Add all the available fields at once.', 'gravityview' ),
666 666
 				'field_id' => 'all-fields',
667 667
 				'label_type' => 'field',
668 668
 				'input_type' => NULL,
669 669
 				'field_options' => NULL,
670 670
 				'settings_html'	=> NULL,
671 671
 			)
672
-		));
672
+		) );
673 673
 
674
-		if( !empty( $additional_fields )) {
674
+		if ( ! empty( $additional_fields ) ) {
675 675
 			foreach ( (array)$additional_fields as $item ) {
676 676
 
677 677
 				// Prevent items from not having index set
@@ -682,16 +682,16 @@  discard block
 block discarded – undo
682 682
 					'input_type' => NULL,
683 683
 					'field_options' => NULL,
684 684
 					'settings_html'	=> NULL,
685
-				));
685
+				) );
686 686
 
687 687
 				// Backward compat.
688
-				if( !empty( $item['field_options'] ) ) {
688
+				if ( ! empty( $item[ 'field_options' ] ) ) {
689 689
 					// Use settings_html from now on.
690
-					$item['settings_html'] = $item['field_options'];
690
+					$item[ 'settings_html' ] = $item[ 'field_options' ];
691 691
 				}
692 692
 
693 693
 				// Render a label for each of them
694
-				echo new GravityView_Admin_View_Field( $item['label_text'], $item['field_id'], $item, $settings = array(), $form );
694
+				echo new GravityView_Admin_View_Field( $item[ 'label_text' ], $item[ 'field_id' ], $item, $settings = array(), $form );
695 695
 
696 696
 			}
697 697
 		}
@@ -704,54 +704,54 @@  discard block
 block discarded – undo
704 704
 	 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
705 705
 	 * @return array
706 706
 	 */
707
-	function get_entry_default_fields($form, $zone) {
707
+	function get_entry_default_fields( $form, $zone ) {
708 708
 
709 709
 		$entry_default_fields = array();
710 710
 
711
-		if( in_array( $zone, array( 'directory', 'single' ) ) ) {
711
+		if ( in_array( $zone, array( 'directory', 'single' ) ) ) {
712 712
 
713 713
 			$entry_default_fields = array(
714 714
 				'id' => array(
715
-					'label' => __('Entry ID', 'gravityview'),
715
+					'label' => __( 'Entry ID', 'gravityview' ),
716 716
 					'type' => 'id',
717
-					'desc'	=> __('The unique ID of the entry.', 'gravityview'),
717
+					'desc'	=> __( 'The unique ID of the entry.', 'gravityview' ),
718 718
 				),
719 719
 				'date_created' => array(
720
-					'label' => __('Entry Date', 'gravityview'),
721
-					'desc'	=> __('The date the entry was created.', 'gravityview'),
720
+					'label' => __( 'Entry Date', 'gravityview' ),
721
+					'desc'	=> __( 'The date the entry was created.', 'gravityview' ),
722 722
 					'type' => 'date_created',
723 723
 				),
724 724
 				'source_url' => array(
725
-					'label' => __('Source URL', 'gravityview'),
725
+					'label' => __( 'Source URL', 'gravityview' ),
726 726
 					'type' => 'source_url',
727
-					'desc'	=> __('The URL of the page where the form was submitted.', 'gravityview'),
727
+					'desc'	=> __( 'The URL of the page where the form was submitted.', 'gravityview' ),
728 728
 				),
729 729
 				'ip' => array(
730
-					'label' => __('User IP', 'gravityview'),
730
+					'label' => __( 'User IP', 'gravityview' ),
731 731
 					'type' => 'ip',
732
-					'desc'	=> __('The IP Address of the user who created the entry.', 'gravityview'),
732
+					'desc'	=> __( 'The IP Address of the user who created the entry.', 'gravityview' ),
733 733
 				),
734 734
 				'created_by' => array(
735
-					'label' => __('User', 'gravityview'),
735
+					'label' => __( 'User', 'gravityview' ),
736 736
 					'type' => 'created_by',
737
-					'desc'	=> __('Details of the logged-in user who created the entry (if any).', 'gravityview'),
737
+					'desc'	=> __( 'Details of the logged-in user who created the entry (if any).', 'gravityview' ),
738 738
 				),
739 739
 
740 740
 				/**
741 741
 				 * @since 1.7.2
742 742
 				 */
743 743
 			    'other_entries' => array(
744
-				    'label'	=> __('Other Entries', 'gravityview'),
744
+				    'label'	=> __( 'Other Entries', 'gravityview' ),
745 745
 				    'type'	=> 'other_entries',
746
-				    'desc'	=> __('Display other entries created by the entry creator.', 'gravityview'),
746
+				    'desc'	=> __( 'Display other entries created by the entry creator.', 'gravityview' ),
747 747
 			    ),
748 748
 	        );
749 749
 
750
-			if( 'single' !== $zone) {
750
+			if ( 'single' !== $zone ) {
751 751
 
752
-				$entry_default_fields['entry_link'] = array(
753
-					'label' => __('Link to Entry', 'gravityview'),
754
-					'desc'	=> __('A dedicated link to the single entry with customizable text.', 'gravityview'),
752
+				$entry_default_fields[ 'entry_link' ] = array(
753
+					'label' => __( 'Link to Entry', 'gravityview' ),
754
+					'desc'	=> __( 'A dedicated link to the single entry with customizable text.', 'gravityview' ),
755 755
 					'type' => 'entry_link',
756 756
 				);
757 757
 			}
@@ -761,10 +761,10 @@  discard block
 block discarded – undo
761 761
 		/**
762 762
 		 * @since  1.2
763 763
 		 */
764
-		$entry_default_fields['custom']	= array(
765
-			'label'	=> __('Custom Content', 'gravityview'),
764
+		$entry_default_fields[ 'custom' ] = array(
765
+			'label'	=> __( 'Custom Content', 'gravityview' ),
766 766
 			'type'	=> 'custom',
767
-			'desc'	=> __('Insert custom text or HTML.', 'gravityview'),
767
+			'desc'	=> __( 'Insert custom text or HTML.', 'gravityview' ),
768 768
 		);
769 769
 
770 770
 		/**
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 		 * @param  string|array $form form_ID or form object
774 774
 		 * @param  string $zone   Either 'single', 'directory', 'header', 'footer'
775 775
 		 */
776
-		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone);
776
+		return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone );
777 777
 	}
778 778
 
779 779
 	/**
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 	 */
785 785
 	function get_available_fields( $form = '', $zone = NULL ) {
786 786
 
787
-		if( empty( $form ) ) {
787
+		if ( empty( $form ) ) {
788 788
 			gravityview()->log->error( '$form is empty' );
789 789
 			return array();
790 790
 		}
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
 		$fields = gravityview_get_form_fields( $form, true );
794 794
 
795 795
 		// get meta fields ( only if form was already created )
796
-		if( !is_array( $form ) ) {
796
+		if ( ! is_array( $form ) ) {
797 797
 			$meta_fields = gravityview_get_entry_meta( $form );
798 798
 		} else {
799 799
 			$meta_fields = array();
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
 		$fields = $fields + $meta_fields + $default_fields;
807 807
 
808 808
 		// Move Custom Content to top
809
-		$fields = array( 'custom' => $fields['custom'] ) + $fields;
809
+		$fields = array( 'custom' => $fields[ 'custom' ] ) + $fields;
810 810
 
811 811
 		return $fields;
812 812
 	}
@@ -820,11 +820,11 @@  discard block
 block discarded – undo
820 820
 
821 821
 		$widgets = $this->get_registered_widgets();
822 822
 
823
-		if( !empty( $widgets ) ) {
823
+		if ( ! empty( $widgets ) ) {
824 824
 
825
-			foreach( $widgets as $id => $details ) {
825
+			foreach ( $widgets as $id => $details ) {
826 826
 
827
-				echo new GravityView_Admin_View_Widget( $details['label'], $id, $details );
827
+				echo new GravityView_Admin_View_Widget( $details[ 'label' ], $id, $details );
828 828
 
829 829
 			}
830 830
 		}
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 	function render_active_areas( $template_id, $type, $zone, $rows, $values ) {
854 854
 		global $post;
855 855
 
856
-		if( $type === 'widget' ) {
856
+		if ( $type === 'widget' ) {
857 857
 			$button_label = __( 'Add Widget', 'gravityview' );
858 858
 		} else {
859 859
 			$button_label = __( 'Add Field', 'gravityview' );
@@ -865,10 +865,10 @@  discard block
 block discarded – undo
865 865
 		$form_id = null;
866 866
 
867 867
 		// if saved values, get available fields to label everyone
868
-		if( !empty( $values ) && ( !empty( $post->ID ) || !empty( $_POST['template_id'] ) ) ) {
868
+		if ( ! empty( $values ) && ( ! empty( $post->ID ) || ! empty( $_POST[ 'template_id' ] ) ) ) {
869 869
 
870
-			if( !empty( $_POST['template_id'] ) ) {
871
-				$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
870
+			if ( ! empty( $_POST[ 'template_id' ] ) ) {
871
+				$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
872 872
 			} else {
873 873
 				$form_id = $form = gravityview_get_form_id( $post->ID );
874 874
 			}
@@ -886,44 +886,44 @@  discard block
 block discarded – undo
886 886
 			}
887 887
 		}
888 888
 
889
-		foreach( $rows as $row ) :
890
-			foreach( $row as $col => $areas ) :
891
-				$column = ($col == '2-2') ? '1-2' : $col; ?>
889
+		foreach ( $rows as $row ) :
890
+			foreach ( $row as $col => $areas ) :
891
+				$column = ( $col == '2-2' ) ? '1-2' : $col; ?>
892 892
 
893 893
 				<div class="gv-grid-col-<?php echo esc_attr( $column ); ?>">
894 894
 
895
-					<?php foreach( $areas as $area ) : 	?>
895
+					<?php foreach ( $areas as $area ) : 	?>
896 896
 
897
-						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
898
-							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>">
897
+						<div class="gv-droppable-area" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>">
898
+							<div class="active-drop active-drop-<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>">
899 899
 
900 900
 								<?php // render saved fields
901 901
 
902
-								if( ! empty( $values[ $zone .'_'. $area['areaid'] ] ) ) {
902
+								if ( ! empty( $values[ $zone . '_' . $area[ 'areaid' ] ] ) ) {
903 903
 
904
-									foreach( $values[ $zone .'_'. $area['areaid'] ] as $uniqid => $field ) {
904
+									foreach ( $values[ $zone . '_' . $area[ 'areaid' ] ] as $uniqid => $field ) {
905 905
 
906 906
 										// Maybe has a form ID
907
-										$form_id = empty( $field['form_id'] ) ? $form_id : $field['form_id'];
907
+										$form_id = empty( $field[ 'form_id' ] ) ? $form_id : $field[ 'form_id' ];
908 908
 
909 909
 										$input_type = NULL;
910 910
 
911 911
 										if ( $form_id ) {
912
-											$original_item = isset( $available_items[ $form_id ] [ $field['id'] ] ) ? $available_items[ $form_id ] [ $field['id'] ] : false ;
912
+											$original_item = isset( $available_items[ $form_id ] [ $field[ 'id' ] ] ) ? $available_items[ $form_id ] [ $field[ 'id' ] ] : false;
913 913
                                         } else {
914
-											$original_item = isset( $available_items[ $field['id'] ] ) ? $available_items[ $field['id'] ] : false ;
914
+											$original_item = isset( $available_items[ $field[ 'id' ] ] ) ? $available_items[ $field[ 'id' ] ] : false;
915 915
                                         }
916 916
 
917
-										if ( !$original_item ) {
918
-											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array(' data' => array('available_items' => $available_items, 'field' => $field ) ) );
917
+										if ( ! $original_item ) {
918
+											gravityview()->log->error( 'An item was not available when rendering the output; maybe it was added by a plugin that is now de-activated.', array( ' data' => array( 'available_items' => $available_items, 'field' => $field ) ) );
919 919
 
920 920
 											$original_item = $field;
921 921
 										} else {
922
-											$input_type = isset( $original_item['type'] ) ? $original_item['type'] : NULL;
922
+											$input_type = isset( $original_item[ 'type' ] ) ? $original_item[ 'type' ] : NULL;
923 923
 										}
924 924
 
925 925
 										// Field options dialog box
926
-										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field['id'], $original_item['label'], $zone .'_'. $area['areaid'], $input_type, $uniqid, $field, $zone, $original_item );
926
+										$field_options = GravityView_Render_Settings::render_field_options( $form_id, $type, $template_id, $field[ 'id' ], $original_item[ 'label' ], $zone . '_' . $area[ 'areaid' ], $input_type, $uniqid, $field, $zone, $original_item );
927 927
 
928 928
 										$item = array(
929 929
 											'input_type' => $input_type,
@@ -936,23 +936,23 @@  discard block
 block discarded – undo
936 936
 											$item = wp_parse_args( $item, $original_item );
937 937
 										}
938 938
 
939
-										switch( $type ) {
939
+										switch ( $type ) {
940 940
 											case 'widget':
941
-												echo new GravityView_Admin_View_Widget( $item['label'], $field['id'], $item, $field );
941
+												echo new GravityView_Admin_View_Widget( $item[ 'label' ], $field[ 'id' ], $item, $field );
942 942
 												break;
943 943
 											default:
944
-												echo new GravityView_Admin_View_Field( $field['label'], $field['id'], $item, $field, $form_id );
944
+												echo new GravityView_Admin_View_Field( $field[ 'label' ], $field[ 'id' ], $item, $field, $form_id );
945 945
 										}
946 946
 									}
947 947
 
948 948
 								} // End if zone is not empty ?>
949 949
 
950
-								<span class="drop-message"><?php echo sprintf(esc_attr__('"+ %s" or drag existing %ss here.', 'gravityview'), $button_label, $type ); ?></span>
950
+								<span class="drop-message"><?php echo sprintf( esc_attr__( '"+ %s" or drag existing %ss here.', 'gravityview' ), $button_label, $type ); ?></span>
951 951
 							</div>
952 952
 							<div class="gv-droppable-area-action">
953
-								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone .'_'. $area['areaid'] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>" data-formid="<?php echo $view ? esc_attr( $view->form ? $view->form->ID : '' ) : ''; ?>"><?php echo '+ '.esc_html( $button_label ); ?></a>
953
+								<a href="#" class="gv-add-field button-secondary" title="" data-objecttype="<?php echo esc_attr( $type ); ?>" data-areaid="<?php echo esc_attr( $zone . '_' . $area[ 'areaid' ] ); ?>" data-context="<?php echo esc_attr( $zone ); ?>" data-formid="<?php echo $view ? esc_attr( $view->form ? $view->form->ID : '' ) : ''; ?>"><?php echo '+ ' . esc_html( $button_label ); ?></a>
954 954
 
955
-								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area['title'] ); ?></strong><?php if( !empty( $area['subtitle'] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area['subtitle'] ); ?></span><?php } ?></p>
955
+								<p class="gv-droppable-area-title"><strong><?php echo esc_html( $area[ 'title' ] ); ?></strong><?php if ( ! empty( $area[ 'subtitle' ] ) ) { ?><span class="gv-droppable-area-subtitle"> &ndash; <?php echo esc_html( $area[ 'subtitle' ] ); ?></span><?php } ?></p>
956 956
 							</div>
957 957
 						</div>
958 958
 
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 		$default_widget_areas = GravityView_Widget::get_default_widget_areas();
975 975
 
976 976
 		$widgets = array();
977
-		if( !empty( $post_id ) ) {
977
+		if ( ! empty( $post_id ) ) {
978 978
 			$widgets = gravityview_get_directory_widgets( $post_id );
979 979
 		}
980 980
 
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 		// list of available fields to be shown in the popup
1008 1008
 		$forms = gravityview_get_forms( 'any' );
1009 1009
 
1010
-		$form_ids = array_map( function ($form) { return $form['id']; }, $forms);
1010
+		$form_ids = array_map( function( $form ) { return $form[ 'id' ]; }, $forms );
1011 1011
 
1012 1012
 		foreach ( $form_ids as $form_id ) {
1013 1013
 			$filter_field_id = sprintf( 'gv-field-filter-%s-%d', $context, $form_id );
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
                 </div>
1021 1021
 
1022 1022
                 <div id="available-fields-<?php echo $filter_field_id; ?>" aria-live="polite" role="listbox">
1023
-                <?php do_action('gravityview_render_available_fields', $form_id, $context ); ?>
1023
+                <?php do_action( 'gravityview_render_available_fields', $form_id, $context ); ?>
1024 1024
                 </div>
1025 1025
 
1026 1026
                 <div class="gv-no-results hidden description"><?php esc_html_e( 'No fields were found matching the search.', 'gravityview' ); ?></div>
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
 	 * @return string HTML of the active areas
1040 1040
 	 */
1041 1041
 	function render_directory_active_areas( $template_id = '', $context = 'single', $post_id = '', $echo = false ) {
1042
-		if( empty( $template_id ) ) {
1042
+		if ( empty( $template_id ) ) {
1043 1043
 			gravityview()->log->debug( '[render_directory_active_areas] {template_id} is empty', array( 'template_id' => $template_id ) );
1044 1044
 			return '';
1045 1045
 		}
@@ -1053,12 +1053,12 @@  discard block
 block discarded – undo
1053 1053
 		 */
1054 1054
 		$template_areas = apply_filters( 'gravityview_template_active_areas', array(), $template_id, $context );
1055 1055
 
1056
-		if( empty( $template_areas ) ) {
1056
+		if ( empty( $template_areas ) ) {
1057 1057
 
1058 1058
 			gravityview()->log->debug( '[render_directory_active_areas] No areas defined. Maybe template {template_id} is disabled.', array( 'data' => $template_id ) );
1059 1059
 			$output = '<div>';
1060
-			$output .= '<h2 class="description" style="font-size: 16px; margin:0">'. sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>'.$template_id.'</em>' ) .'</h2>';
1061
-			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">'.esc_html__('The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview').'</p>';
1060
+			$output .= '<h2 class="description" style="font-size: 16px; margin:0">' . sprintf( esc_html__( 'This View is configured using the %s View type, which is disabled.', 'gravityview' ), '<em>' . $template_id . '</em>' ) . '</h2>';
1061
+			$output .= '<p class="description" style="font-size: 14px; margin:0 0 1em 0;padding:0">' . esc_html__( 'The data is not lost; re-activate the associated plugin and the configuration will re-appear.', 'gravityview' ) . '</p>';
1062 1062
 			$output .= '</div>';
1063 1063
 		} else {
1064 1064
 
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 
1074 1074
 		}
1075 1075
 
1076
-		if( $echo ) {
1076
+		if ( $echo ) {
1077 1077
 			echo $output;
1078 1078
 		}
1079 1079
 
@@ -1093,26 +1093,26 @@  discard block
 block discarded – undo
1093 1093
 		$is_widgets_page = ( $pagenow === 'widgets.php' );
1094 1094
 
1095 1095
 		// Add the GV font (with the Astronaut)
1096
-		wp_enqueue_style( 'gravityview_global', plugins_url('assets/css/admin-global.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
1096
+		wp_enqueue_style( 'gravityview_global', plugins_url( 'assets/css/admin-global.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
1097 1097
 
1098
-		wp_register_script( 'gravityview-jquery-cookie', plugins_url('assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version, true );
1098
+		wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1099 1099
 
1100 1100
 		// Don't process any scripts below here if it's not a GravityView page.
1101
-		if( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1101
+		if ( ! gravityview_is_admin_page( $hook, 'single' ) && ! $is_widgets_page ) {
1102 1102
 		    return;
1103 1103
 		}
1104 1104
 
1105 1105
         wp_enqueue_script( 'jquery-ui-datepicker' );
1106
-        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url('assets/css/admin-datepicker.css', GRAVITYVIEW_FILE), GravityView_Plugin::version );
1106
+        wp_enqueue_style( 'gravityview_views_datepicker', plugins_url( 'assets/css/admin-datepicker.css', GRAVITYVIEW_FILE ), GravityView_Plugin::version );
1107 1107
 
1108
-        $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
1108
+        $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1109 1109
 
1110 1110
         //enqueue scripts
1111 1111
         wp_enqueue_script( 'gravityview_views_scripts', plugins_url( 'assets/js/admin-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery-ui-tabs', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'jquery-ui-tooltip', 'jquery-ui-dialog', 'gravityview-jquery-cookie', 'jquery-ui-datepicker', 'underscore' ), GravityView_Plugin::version );
1112 1112
 
1113
-        wp_localize_script('gravityview_views_scripts', 'gvGlobals', array(
1113
+        wp_localize_script( 'gravityview_views_scripts', 'gvGlobals', array(
1114 1114
             'cookiepath' => COOKIEPATH,
1115
-            'passed_form_id' => (bool) \GV\Utils::_GET( 'form_id' ),
1115
+            'passed_form_id' => (bool)\GV\Utils::_GET( 'form_id' ),
1116 1116
             'nonce' => wp_create_nonce( 'gravityview_ajaxviews' ),
1117 1117
             'label_viewname' => __( 'Enter View name here', 'gravityview' ),
1118 1118
             'label_close' => __( 'Close', 'gravityview' ),
@@ -1124,9 +1124,9 @@  discard block
 block discarded – undo
1124 1124
             'loading_error' => esc_html__( 'There was an error loading dynamic content.', 'gravityview' ),
1125 1125
             'field_loaderror' => __( 'Error while adding the field. Please try again or contact GravityView support.', 'gravityview' ),
1126 1126
             'remove_all_fields' => __( 'Would you like to remove all fields in this zone? (You are seeing this message because you were holding down the ALT key)', 'gravityview' ),
1127
-        ));
1127
+        ) );
1128 1128
 
1129
-        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array('dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1129
+        wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons', 'wp-jquery-ui-dialog' ), GravityView_Plugin::version );
1130 1130
 
1131 1131
         // Enqueue scripts needed for merge tags
1132 1132
         self::enqueue_gravity_forms_scripts();
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 		);
1152 1152
 
1153 1153
 		if ( wp_is_mobile() ) {
1154
-		    $scripts[] = 'jquery-touch-punch';
1154
+		    $scripts[ ] = 'jquery-touch-punch';
1155 1155
 		}
1156 1156
 
1157 1157
 		wp_enqueue_script( $scripts );
Please login to merge, or discard this patch.
future/includes/class-gv-settings-addon.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @return array
103 103
 	 */
104 104
 	public function modify_app_settings_menu_title( $setting_tabs ) {
105
-		$setting_tabs[0]['label'] = __( 'GravityView Settings', 'gravityview' );
105
+		$setting_tabs[ 0 ][ 'label' ] = __( 'GravityView Settings', 'gravityview' );
106 106
 		return $setting_tabs;
107 107
 	}
108 108
 
@@ -308,15 +308,15 @@  discard block
 block discarded – undo
308 308
             </ul>
309 309
             <div class="gv-followup widefat">
310 310
                 <p><strong><label for="gv-reason-details"><?php esc_html_e( 'Comments', 'gravityview' ); ?></label></strong></p>
311
-                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview') ?>" placeholder="<?php esc_attr_e('Please share your thoughts about GravityView', 'gravityview'); ?>" class="large-text"></textarea>
311
+                <textarea id="gv-reason-details" name="reason_details" data-default="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ) ?>" placeholder="<?php esc_attr_e( 'Please share your thoughts about GravityView', 'gravityview' ); ?>" class="large-text"></textarea>
312 312
             </div>
313 313
             <div class="scale-description">
314 314
                 <p><strong><?php esc_html_e( 'How likely are you to recommend GravityView?', 'gravityview' ); ?></strong></p>
315 315
                 <ul class="inline">
316 316
 					<?php
317 317
 					$i = 0;
318
-					while( $i < 11 ) {
319
-						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_'.$i.'" value="'.$i.'" type="radio"> '.$i.'</label></li>';
318
+					while ( $i < 11 ) {
319
+						echo '<li class="inline number-scale"><label><input name="likely_to_refer" id="likely_to_refer_' . $i . '" value="' . $i . '" type="radio"> ' . $i . '</label></li>';
320 320
 						$i++;
321 321
 					}
322 322
 					?>
@@ -533,15 +533,15 @@  discard block
 block discarded – undo
533 533
 	 * @return string The HTML
534 534
 	 */
535 535
 	public function as_html( $field, $echo = true ) {
536
-		$field['type']  = ( isset( $field['type'] ) && in_array( $field['type'], array( 'submit','reset','button' ) ) ) ? $field['type'] : 'submit';
536
+		$field[ 'type' ] = ( isset( $field[ 'type' ] ) && in_array( $field[ 'type' ], array( 'submit', 'reset', 'button' ) ) ) ? $field[ 'type' ] : 'submit';
537 537
 
538 538
 		$attributes    = $this->get_field_attributes( $field );
539 539
 		$default_value = Utils::get( $field, 'value', Utils::get( $field, 'default_value' ) );
540
-		$value         = $this->get( $field['name'], $default_value );
540
+		$value         = $this->get( $field[ 'name' ], $default_value );
541 541
 
542 542
 
543
-		$attributes['class'] = isset( $attributes['class'] ) ? esc_attr( $attributes['class'] ) : 'button-primary gfbutton';
544
-		$name    = ( $field['name'] === 'gform-settings-save' ) ? $field['name'] : '_gaddon_setting_' . $field['name'];
543
+		$attributes[ 'class' ] = isset( $attributes[ 'class' ] ) ? esc_attr( $attributes[ 'class' ] ) : 'button-primary gfbutton';
544
+		$name = ( $field[ 'name' ] === 'gform-settings-save' ) ? $field[ 'name' ] : '_gaddon_setting_' . $field[ 'name' ];
545 545
 
546 546
 		if ( empty( $value ) ) {
547 547
 			$value = __( 'Update Settings', 'gravityview' );
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 		$attributes = $this->get_field_attributes( $field );
551 551
 
552 552
 		$html = '<input
553
-                    type="' . $field['type'] . '"
553
+                    type="' . $field[ 'type' ] . '"
554 554
                     name="' . esc_attr( $name ) . '"
555 555
                     value="' . $value . '" ' .
556 556
 		        implode( ' ', $attributes ) .
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 	 * @return bool
582 582
 	 */
583 583
 	public function is_save_postback() {
584
-		return isset( $_POST['gform-settings-save'] ) && isset( $_POST['_gravityview_save_settings_nonce'] );
584
+		return isset( $_POST[ 'gform-settings-save' ] ) && isset( $_POST[ '_gravityview_save_settings_nonce' ] );
585 585
 	}
586 586
 
587 587
 	/**
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 	 */
592 592
 	public function license_key_notice() {
593 593
 
594
-	    if( $this->is_save_postback() ) {
594
+	    if ( $this->is_save_postback() ) {
595 595
 		    $settings = $this->get_posted_settings();
596 596
 		    $license_key = \GV\Utils::get( $settings, 'license_key' );
597 597
 		    $license_status = \GV\Utils::get( $settings, 'license_key_status', 'inactive' );
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 		 * but didn't want to mess up the translation strings for the translators.
613 613
 		 */
614 614
 		$message = mb_substr( $message, 0, mb_strlen( $message ) - 1 );
615
-		$title = __( 'Inactive License', 'gravityview');
615
+		$title = __( 'Inactive License', 'gravityview' );
616 616
 		$status = '';
617 617
 		$update_below = false;
618 618
 		$primary_button_link = admin_url( 'edit.php?post_type=gravityview&amp;page=gravityview_settings' );
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 				$update_below = __( 'Activate your license key below.', 'gravityview' );
643 643
 				break;
644 644
 		}
645
-		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content='.$license_status.'&utm_campaign=Admin%20Notice';
645
+		$url = 'https://gravityview.co/pricing/?utm_source=admin_notice&utm_medium=admin&utm_content=' . $license_status . '&utm_campaign=Admin%20Notice';
646 646
 
647 647
 		// Show a different notice on settings page for inactive licenses (hide the buttons)
648 648
 		if ( $update_below && gravityview_is_admin_page( '', 'settings' ) ) {
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 	public function scripts() {
687 687
 		$scripts = parent::scripts();
688 688
 
689
-		$scripts[] = array(
689
+		$scripts[ ] = array(
690 690
 			'handle'  => 'gform_tooltip_init',
691 691
 			'enqueue' => array(
692 692
                 array(
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	public function styles() {
706 706
 		$styles = parent::styles();
707 707
 
708
-		$styles[] = array(
708
+		$styles[ ] = array(
709 709
 			'handle'  => 'gravityview_settings',
710 710
 			'src'     => plugins_url( 'assets/css/admin-settings.css', GRAVITYVIEW_FILE ),
711 711
 			'version' => Plugin::$version,
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 		 * If multisite and not network admin, we don't want the settings to show.
737 737
 		 * @since 1.7.6
738 738
 		 */
739
-		$show_submenu = ( ! is_multisite() ) ||  is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() );
739
+		$show_submenu = ( ! is_multisite() ) || is_main_site() || ( ! gravityview()->plugin->is_network_activated() ) || ( is_network_admin() && gravityview()->plugin->is_network_activated() );
740 740
 
741 741
 		/**
742 742
 		 * Override whether to show the Settings menu on a per-blog basis.
@@ -784,26 +784,26 @@  discard block
 block discarded – undo
784 784
 				'label' => __( 'License Key', 'gravityview' ),
785 785
 				'description' => __( 'Enter the license key that was sent to you on purchase. This enables plugin updates &amp; support.', 'gravityview' ) . $this->get_license_handler()->license_details( $this->get_app_setting( 'license_key_response' ) ),
786 786
 				'type' => 'edd_license',
787
-				'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' )  && GRAVITYVIEW_LICENSE_KEY ),
787
+				'disabled' => ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ),
788 788
 				'data-pending-text' => __( 'Verifying license&hellip;', 'gravityview' ),
789
-				'default_value' => $default_settings['license_key'],
789
+				'default_value' => $default_settings[ 'license_key' ],
790 790
 				'class' => ( '' == $this->get( 'license_key' ) ) ? 'activate code regular-text edd-license-key' : 'deactivate code regular-text edd-license-key',
791 791
 			),
792 792
 			array(
793 793
 				'name' => 'license_key_response',
794
-				'default_value' => $default_settings['license_key_response'],
794
+				'default_value' => $default_settings[ 'license_key_response' ],
795 795
 				'type' => 'hidden',
796 796
 			),
797 797
 			array(
798 798
 				'name' => 'license_key_status',
799
-				'default_value' => $default_settings['license_key_status'],
799
+				'default_value' => $default_settings[ 'license_key_status' ],
800 800
 				'type' => 'hidden',
801 801
 			),
802 802
 			array(
803 803
 				'name' => 'support-email',
804 804
 				'type' => 'text',
805 805
 				'validate' => 'email',
806
-				'default_value' => $default_settings['support-email'],
806
+				'default_value' => $default_settings[ 'support-email' ],
807 807
 				'label' => __( 'Support Email', 'gravityview' ),
808 808
 				'description' => __( 'In order to provide responses to your support requests, please provide your email address.', 'gravityview' ),
809 809
 				'class' => 'code regular-text',
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 				'name' => 'support_port',
816 816
 				'type' => 'radio',
817 817
 				'label' => __( 'Show Support Port?', 'gravityview' ),
818
-				'default_value' => $default_settings['support_port'],
818
+				'default_value' => $default_settings[ 'support_port' ],
819 819
 				'horizontal' => 1,
820 820
 				'choices' => array(
821 821
 					array(
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 				'name' => 'no-conflict-mode',
835 835
 				'type' => 'radio',
836 836
 				'label' => __( 'No-Conflict Mode', 'gravityview' ),
837
-				'default_value' => $default_settings['no-conflict-mode'],
837
+				'default_value' => $default_settings[ 'no-conflict-mode' ],
838 838
 				'horizontal' => 1,
839 839
 				'choices' => array(
840 840
 					array(
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 					'name' => 'rest_api',
857 857
 					'type' => 'radio',
858 858
 					'label' => __( 'REST API', 'gravityview' ),
859
-					'default_value' => $default_settings['rest_api'],
859
+					'default_value' => $default_settings[ 'rest_api' ],
860 860
 					'horizontal' => 1,
861 861
 					'choices' => array(
862 862
 						array(
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 				'name' => 'beta',
876 876
 				'type' => 'checkbox',
877 877
 				'label' => __( 'Become a Beta Tester', 'gravityview' ),
878
-				'default_value' => $default_settings['beta'],
878
+				'default_value' => $default_settings[ 'beta' ],
879 879
 				'horizontal' => 1,
880 880
 				'choices' => array(
881 881
 					array(
@@ -908,17 +908,17 @@  discard block
 block discarded – undo
908 908
 		 * @since 1.7.4
909 909
 		 */
910 910
 		foreach ( $fields as &$field ) {
911
-			$field['name']          = isset( $field['name'] ) ? $field['name'] : Utils::get( $field, 'id' );
912
-			$field['label']         = isset( $field['label'] ) ? $field['label'] : Utils::get( $field, 'title' );
913
-			$field['default_value'] = isset( $field['default_value'] ) ? $field['default_value'] : Utils::get( $field, 'default' );
914
-			$field['description']   = isset( $field['description'] ) ? $field['description'] : Utils::get( $field, 'subtitle' );
911
+			$field[ 'name' ]          = isset( $field[ 'name' ] ) ? $field[ 'name' ] : Utils::get( $field, 'id' );
912
+			$field[ 'label' ]         = isset( $field[ 'label' ] ) ? $field[ 'label' ] : Utils::get( $field, 'title' );
913
+			$field[ 'default_value' ] = isset( $field[ 'default_value' ] ) ? $field[ 'default_value' ] : Utils::get( $field, 'default' );
914
+			$field[ 'description' ]   = isset( $field[ 'description' ] ) ? $field[ 'description' ] : Utils::get( $field, 'subtitle' );
915 915
 
916 916
 			if ( $disabled_attribute ) {
917
-				$field['disabled']  = $disabled_attribute;
917
+				$field[ 'disabled' ] = $disabled_attribute;
918 918
 			}
919 919
 
920
-			if ( empty( $field['disabled'] ) ) {
921
-				unset( $field['disabled'] );
920
+			if ( empty( $field[ 'disabled' ] ) ) {
921
+				unset( $field[ 'disabled' ] );
922 922
             }
923 923
 		}
924 924
 
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
         );
937 937
 
938 938
 		if ( $disabled_attribute ) {
939
-			$button['disabled'] = $disabled_attribute;
939
+			$button[ 'disabled' ] = $disabled_attribute;
940 940
 		}
941 941
 
942 942
         /**
@@ -955,20 +955,20 @@  discard block
 block discarded – undo
955 955
 		// If there are extensions, add a section for them
956 956
 		if ( ! empty( $extension_sections ) ) {
957 957
 
958
-			if( $disabled_attribute ) {
958
+			if ( $disabled_attribute ) {
959 959
 				foreach ( $extension_sections as &$section ) {
960
-					foreach ( $section['fields'] as &$field ) {
961
-						$field['disabled'] = $disabled_attribute;
960
+					foreach ( $section[ 'fields' ] as &$field ) {
961
+						$field[ 'disabled' ] = $disabled_attribute;
962 962
 					}
963 963
 				}
964 964
 			}
965 965
 
966
-            $k = count( $extension_sections ) - 1 ;
967
-            $extension_sections[ $k ]['fields'][] = $button;
966
+            $k = count( $extension_sections ) - 1;
967
+            $extension_sections[ $k ][ 'fields' ][ ] = $button;
968 968
 			$sections = array_merge( $sections, $extension_sections );
969 969
 		} else {
970 970
             // add the 'update settings' button to the general section
971
-            $sections[0]['fields'][] = $button;
971
+            $sections[ 0 ][ 'fields' ][ ] = $button;
972 972
         }
973 973
 
974 974
 		return $sections;
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 	protected function settings_edd_license( $field, $echo = true ) {
1025 1025
 
1026 1026
 	    if ( defined( 'GRAVITYVIEW_LICENSE_KEY' ) && GRAVITYVIEW_LICENSE_KEY ) {
1027
-		    $field['input_type'] = 'password';
1027
+		    $field[ 'input_type' ] = 'password';
1028 1028
         }
1029 1029
 
1030 1030
 		$text = $this->settings_text( $field, false );
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 	public function single_setting_row_html( $field ) {
1074 1074
 		?>
1075 1075
 
1076
-        <tr id="gaddon-setting-row-<?php echo esc_attr( $field['name'] ); ?>">
1076
+        <tr id="gaddon-setting-row-<?php echo esc_attr( $field[ 'name' ] ); ?>">
1077 1077
             <td colspan="2">
1078 1078
 				<?php $this->single_setting( $field ); ?>
1079 1079
             </td>
@@ -1091,10 +1091,10 @@  discard block
 block discarded – undo
1091 1091
 	 * @return string
1092 1092
 	 */
1093 1093
 	public function settings_save( $field, $echo = true ) {
1094
-		$field['type']  = 'submit';
1095
-		$field['name']  = 'gform-settings-save';
1096
-		$field['class'] = isset( $field['class'] ) ? $field['class'] : 'button-primary gfbutton';
1097
-		$field['value'] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) );
1094
+		$field[ 'type' ]  = 'submit';
1095
+		$field[ 'name' ]  = 'gform-settings-save';
1096
+		$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] : 'button-primary gfbutton';
1097
+		$field[ 'value' ] = Utils::get( $field, 'value', __( 'Update Settings', 'gravityview' ) );
1098 1098
 
1099 1099
 		$output = $this->settings_submit( $field, false );
1100 1100
 
@@ -1125,8 +1125,8 @@  discard block
 block discarded – undo
1125 1125
      * @return void
1126 1126
 	 */
1127 1127
 	public function single_setting_row( $field ) {
1128
-		$field['gv_description'] = Utils::get( $field, 'description' );
1129
-		$field['description']    = Utils::get( $field, 'subtitle' );
1128
+		$field[ 'gv_description' ] = Utils::get( $field, 'description' );
1129
+		$field[ 'description' ]    = Utils::get( $field, 'subtitle' );
1130 1130
 		parent::single_setting_row( $field );
1131 1131
 	}
1132 1132
 
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 	public function single_setting_label( $field ) {
1139 1139
 		parent::single_setting_label( $field );
1140 1140
 		if ( $description = Utils::get( $field, 'gv_description' ) ) {
1141
-			echo '<span class="description">'. $description .'</span>';
1141
+			echo '<span class="description">' . $description . '</span>';
1142 1142
 		}
1143 1143
 	}
1144 1144
 
@@ -1175,9 +1175,9 @@  discard block
 block discarded – undo
1175 1175
 		// If the posted key doesn't match the activated/deactivated key (set using the Activate License button, AJAX response),
1176 1176
 		// then we assume it's changed. If it's changed, unset the status and the previous response.
1177 1177
 		if ( $local_key !== $response_key ) {
1178
-			unset( $posted_settings['license_key_response'] );
1179
-			unset( $posted_settings['license_key_status'] );
1180
-			\GFCommon::add_error_message( __('The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
1178
+			unset( $posted_settings[ 'license_key_response' ] );
1179
+			unset( $posted_settings[ 'license_key_status' ] );
1180
+			\GFCommon::add_error_message( __( 'The license key you entered has been saved, but not activated. Please activate the license.', 'gravityview' ) );
1181 1181
 		}
1182 1182
 		return $posted_settings;
1183 1183
 	}
Please login to merge, or discard this patch.
future/includes/class-gv-license-handler.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		);
101 101
 
102 102
 		if ( ! empty( $action ) ) {
103
-			$settings['edd_action'] = esc_attr( $action );
103
+			$settings[ 'edd_action' ] = esc_attr( $action );
104 104
 		}
105 105
 
106 106
 		return array_map( 'urlencode', $settings );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			'format' => 'json',
157 157
 		) );
158 158
 
159
-		if ( $is_ajax && empty( $data['license'] ) ) {
159
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
160 160
 			die( -1 );
161 161
 		}
162 162
 
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
 
185 185
 			$json = json_encode( $license_data );
186 186
 
187
-			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action');
187
+			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' );
188 188
 
189 189
 			$is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX );
190 190
 
191 191
 			if ( 'deactivate_license' === Utils::get( $data, 'edd_action' ) ) {
192
-				do_action('gravityview/admin_installer/delete_downloads_data', true );
192
+				do_action( 'gravityview/admin_installer/delete_downloads_data', true );
193 193
 			}
194 194
 
195 195
 			if ( $is_check_action_button ) {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			// most likely a mistake.
202 202
 			} else if ( $license_data->license !== 'failed' && $update_license ) {
203 203
 
204
-				if ( ! empty( $data['field_id'] ) ) {
204
+				if ( ! empty( $data[ 'field_id' ] ) ) {
205 205
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
206 206
 				}
207 207
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		if ( empty( $license_data ) ) {
229 229
 			$message = '';
230 230
 		} else {
231
-			if( ! empty( $license_data->error ) ) {
231
+			if ( ! empty( $license_data->error ) ) {
232 232
 				$class = 'error';
233 233
 				$string_key = $license_data->error;
234 234
 			} else { $class = $license_data->license;
@@ -254,17 +254,17 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function license_details( $response = array() ) {
256 256
 
257
-		$response = (array) $response;
257
+		$response = (array)$response;
258 258
 
259 259
 		$return = '';
260 260
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
261 261
 
262
-		if ( ! empty( $response['license_key'] ) ) {
262
+		if ( ! empty( $response[ 'license_key' ] ) ) {
263 263
 			$return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>';
264 264
 
265 265
 			if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
266
-				$return .= $this->strings( $response['license'], $response );
267
-			} elseif ( ! empty( $response['license_name'] ) ) {
266
+				$return .= $this->strings( $response[ 'license' ], $response );
267
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
268 268
 				$response_keys = array(
269 269
 					'license_name'   => '',
270 270
 					'license_limit'  => '',
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
 				// Make sure all the keys are set
279 279
 				$response = wp_parse_args( $response, $response_keys );
280 280
 
281
-				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
282
-				$local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
281
+				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
282
+				$local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
283 283
 				$details    = array(
284
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ),
285
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link,
286
-					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text,
287
-					'expires'     => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
288
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
284
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ),
285
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link,
286
+					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text,
287
+					'expires'     => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
288
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
289 289
 				);
290 290
 
291
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
292
-					unset( $details['upgrade'] );
293
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
291
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
292
+					unset( $details[ 'upgrade' ] );
293
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
294 294
 				}
295 295
 
296 296
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
 		if ( ! empty( $upgrades ) ) {
317 317
 
318 318
 			$locale_parts = explode( '_', get_locale() );
319
-			$is_english = ( 'en' === $locale_parts[0] );
319
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
320 320
 
321 321
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
322 322
 			$output .= '<ul class="ul-disc">';
323 323
 
324 324
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
325
-				$upgrade = (object) $upgrade;
325
+				$upgrade = (object)$upgrade;
326 326
 
327 327
 				$anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) );
328 328
 
329 329
 				if ( $is_english && isset( $upgrade->description ) ) {
330 330
 					$message = esc_html( $upgrade->description );
331 331
 				} else {
332
-					switch( $upgrade->price_id ) {
332
+					switch ( $upgrade->price_id ) {
333 333
 						// Interstellar
334 334
 						case 1:
335 335
 						default:
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
389 389
 			'missing' => esc_html__( 'Invalid license key.', 'gravityview' ),
390 390
 			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
391
-			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ),
391
+			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ),
392 392
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
393 393
 
394 394
 			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 
418 418
 		if ( ! empty( $license_data->renewal_url ) ) {
419 419
 			$renew_license_url = $license_data->renewal_url;
420
-		} elseif( ! empty( $license_data->license_key ) ) {
420
+		} elseif ( ! empty( $license_data->license_key ) ) {
421 421
 			$renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key );
422 422
 		} else {
423 423
 			$renew_license_url = 'https://gravityview.co/account/';
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 * @return array|\WP_Error
435 435
 	 */
436 436
 	private function _license_get_remote_response( $data, $license = '' ) {
437
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
437
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
438 438
 
439 439
 		$url = add_query_arg( $api_params, self::url );
440 440
 
@@ -474,9 +474,9 @@  discard block
 block discarded – undo
474 474
 	private function license_call_update_settings( $license_data, $data ) {
475 475
 		$settings = array();
476 476
 
477
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
478
-		$settings['license_key_status'] = $license_data->license;
479
-		$settings['license_key_response'] = (array)$license_data;
477
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
478
+		$settings[ 'license_key_status' ] = $license_data->license;
479
+		$settings[ 'license_key_response' ] = (array)$license_data;
480 480
 
481 481
 		$this->settings->set( $settings );
482 482
 	}
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 
492 492
 		if ( ! empty( $key ) ) {
493 493
 			$response = $this->settings->get( 'license_key_response' );
494
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
494
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
495 495
 		} else {
496 496
 			$response = array();
497 497
 		}
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 
534 534
 		$submit = '<div class="gv-edd-button-wrapper">';
535 535
 		foreach ( $fields as $field ) {
536
-			$field['type'] = 'button';
537
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
538
-			$field['style'] = 'margin-left: 10px;';
539
-			if( $disabled_attribute ) {
540
-				$field['disabled'] = $disabled_attribute;
536
+			$field[ 'type' ] = 'button';
537
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
538
+			$field[ 'style' ] = 'margin-left: 10px;';
539
+			if ( $disabled_attribute ) {
540
+				$field[ 'disabled' ] = $disabled_attribute;
541 541
 			}
542 542
 			$submit .= $this->settings->as_html( $field, $echo );
543 543
 		}
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 				    'url'        => home_url(),
617 617
 				    'site_data'  => $this->get_site_data(),
618 618
 			    ),
619
-			));
619
+			) );
620 620
 
621 621
 			// make sure the response came back okay
622 622
 			if ( is_wp_error( $response ) ) {
@@ -647,45 +647,45 @@  discard block
 block discarded – undo
647 647
 		$theme_data = wp_get_theme();
648 648
 		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
649 649
 
650
-		$data['gv_version']  = Plugin::$version;
651
-		$data['php_version']  = phpversion();
652
-		$data['wp_version']   = get_bloginfo( 'version' );
653
-		$data['gf_version']  = \GFForms::$version;
654
-		$data['server']       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
655
-		$data['multisite']    = is_multisite();
656
-		$data['theme']        = $theme;
657
-		$data['url']          = home_url();
658
-		$data['license_key']  = $this->settings->get( 'license_key' );
659
-		$data['beta']         = $this->settings->get( 'beta' );
650
+		$data[ 'gv_version' ]  = Plugin::$version;
651
+		$data[ 'php_version' ]  = phpversion();
652
+		$data[ 'wp_version' ]   = get_bloginfo( 'version' );
653
+		$data[ 'gf_version' ]  = \GFForms::$version;
654
+		$data[ 'server' ]       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
655
+		$data[ 'multisite' ]    = is_multisite();
656
+		$data[ 'theme' ]        = $theme;
657
+		$data[ 'url' ]          = home_url();
658
+		$data[ 'license_key' ]  = $this->settings->get( 'license_key' );
659
+		$data[ 'beta' ]         = $this->settings->get( 'beta' );
660 660
 
661 661
 		// View Data
662 662
 		$gravityview_posts = wp_count_posts( 'gravityview', 'readable' );
663 663
 
664
-		$data['view_count'] = null;
665
-		$data['view_first'] = null;
666
-		$data['view_latest'] = null;
664
+		$data[ 'view_count' ] = null;
665
+		$data[ 'view_first' ] = null;
666
+		$data[ 'view_latest' ] = null;
667 667
 
668 668
 		if ( $gravityview_posts->publish ) {
669
-			$data['view_count'] = $gravityview_posts->publish;
669
+			$data[ 'view_count' ] = $gravityview_posts->publish;
670 670
 
671 671
 			$first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' );
672 672
 			$latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' );
673 673
 
674 674
 			if ( $first = array_shift( $first ) ) {
675
-				$data['view_first'] = $first->post_date;
675
+				$data[ 'view_first' ] = $first->post_date;
676 676
 			}
677 677
 			if ( $latest = array_pop( $latest ) ) {
678
-				$data['view_latest'] = $latest->post_date;
678
+				$data[ 'view_latest' ] = $latest->post_date;
679 679
 			}
680 680
 		}
681 681
 
682 682
 		// Form counts
683 683
 		if ( class_exists( 'GFFormsModel' ) ) {
684 684
 			$form_data = \GFFormsModel::get_form_count();
685
-			$data['forms_total'] = Utils::get( $form_data, 'total', 0 );
686
-			$data['forms_active'] = Utils::get( $form_data, 'active', 0 );
687
-			$data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 );
688
-			$data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 );
685
+			$data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 );
686
+			$data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 );
687
+			$data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 );
688
+			$data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 );
689 689
 		}
690 690
 
691 691
 		// Retrieve current plugin information
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
 			include ABSPATH . '/wp-admin/includes/plugin.php';
694 694
 		}
695 695
 
696
-		$data['integrations']     = self::get_related_plugins_and_extensions();
697
-		$data['active_plugins']   = get_option( 'active_plugins', array() );
698
-		$data['inactive_plugins'] = array();
699
-		$data['locale']           = get_locale();
696
+		$data[ 'integrations' ]     = self::get_related_plugins_and_extensions();
697
+		$data[ 'active_plugins' ]   = get_option( 'active_plugins', array() );
698
+		$data[ 'inactive_plugins' ] = array();
699
+		$data[ 'locale' ]           = get_locale();
700 700
 
701 701
 		// Validate request on the GV server
702
-		$data['hash']             = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] );
702
+		$data[ 'hash' ]             = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] );
703 703
 
704 704
 		return $data;
705 705
 	}
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
 				$plugin_data = get_plugin_data( $active_plugin );
731 731
 
732
-				$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
732
+				$extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] );
733 733
 			}
734 734
 
735 735
 			if ( ! empty( $extensions ) ) {
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 		$format = '(?:\.(?P<format>html|json))?';
134 134
 
135
-		register_rest_route( $namespace, sprintf( '/%s/(?P<id>[\d]+)/%s/(?P<s_id>[\w-]+)%s', $base, $sub_type, $format ) , array(
135
+		register_rest_route( $namespace, sprintf( '/%s/(?P<id>[\d]+)/%s/(?P<s_id>[\w-]+)%s', $base, $sub_type, $format ), array(
136 136
 			array(
137 137
 				'methods'         => \WP_REST_Server::READABLE,
138 138
 				'callback'        => array( $this, 'get_sub_item' ),
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 * @return \WP_REST_Response
384 384
 	 */
385 385
 	protected function not_implemented(  ) {
386
-		$error = new \WP_Error( 'not-implemented-yet', __( 'Endpoint Not Yet Implemented.', 'gravityview' )  );
386
+		$error = new \WP_Error( 'not-implemented-yet', __( 'Endpoint Not Yet Implemented.', 'gravityview' ) );
387 387
 		return new \WP_REST_Response( $error, 501 );
388 388
 	}
389 389
 
Please login to merge, or discard this patch.
includes/class-gravityview-shortcode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 		gravityview()->log->debug( '$passed_atts: ', array( 'data' => $passed_atts ) );
49 49
 
50 50
 		// Get details about the current View
51
-		if( !empty( $passed_atts['detail'] ) ) {
52
-			return $this->get_view_detail( $passed_atts['detail'] );
51
+		if ( ! empty( $passed_atts[ 'detail' ] ) ) {
52
+			return $this->get_view_detail( $passed_atts[ 'detail' ] );
53 53
 		}
54 54
 
55 55
 		$atts = $this->parse_and_sanitize_atts( $passed_atts );
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
86 86
 
87 87
 		// Only keep the passed attributes after making sure that they're valid pairs
88
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
88
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
89 89
 
90 90
 		$atts = array();
91 91
 
92
-		foreach( $filtered_atts as $key => $passed_value ) {
92
+		foreach ( $filtered_atts as $key => $passed_value ) {
93 93
 
94 94
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
95 95
 			$passed_value = GravityView_Merge_Tags::replace_variables( $passed_value );
96 96
 
97
-			switch( $defaults[ $key ]['type'] ) {
97
+			switch ( $defaults[ $key ][ 'type' ] ) {
98 98
 
99 99
 				/**
100 100
 				 * Make sure number fields are numeric.
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
103 103
 				 */
104 104
 				case 'number':
105
-					if( is_numeric( $passed_value ) ) {
105
+					if ( is_numeric( $passed_value ) ) {
106 106
 						$atts[ $key ] = ( $passed_value + 0 );
107 107
 					}
108 108
 					break;
109 109
 
110 110
 				/** @since 2.1 */
111 111
 				case 'operator':
112
-					if( GFFormsModel::is_valid_operator( $passed_value ) ) {
112
+					if ( GFFormsModel::is_valid_operator( $passed_value ) ) {
113 113
 						$atts[ $key ] = $passed_value;
114 114
 					}
115 115
 					break;
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 				 */
125 125
 				case 'select':
126 126
 				case 'radio':
127
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
128
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
127
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
128
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
129 129
 						$atts[ $key ] = $passed_value;
130 130
 					}
131 131
 					break;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		$gravityview_view = GravityView_View::getInstance();
155 155
 		$return = '';
156 156
 
157
-		switch( $detail ) {
157
+		switch ( $detail ) {
158 158
 			case 'total_entries':
159 159
 				$return = number_format_i18n( $gravityview_view->getTotalEntries() );
160 160
 				break;
Please login to merge, or discard this patch.
future/includes/class-gv-template-view-list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,13 +72,13 @@
 block discarded – undo
72 72
 		$hide_empty = apply_filters( 'gravityview/render/hide-empty-zone', Utils::get( $extras, 'hide_empty', $this->view->settings->get( 'hide_empty', false ) ), $context );
73 73
 
74 74
 		if ( is_numeric( $field->ID ) ) {
75
-			$extras['field'] = $field->as_configuration();
75
+			$extras[ 'field' ] = $field->as_configuration();
76 76
 		}
77 77
 
78
-		$extras['entry'] = $entry->as_entry();
79
-		$extras['hide_empty'] = $hide_empty;
80
-		$extras['label'] = $label;
81
-		$extras['value'] = $value;
78
+		$extras[ 'entry' ] = $entry->as_entry();
79
+		$extras[ 'hide_empty' ] = $hide_empty;
80
+		$extras[ 'label' ] = $label;
81
+		$extras[ 'value' ] = $value;
82 82
 
83 83
 		return \gravityview_field_output( $extras, $context );
84 84
 	}
Please login to merge, or discard this patch.