Completed
Push — master ( 2cfa6f...8927a4 )
by Zack
10:00 queued 06:05
created
includes/class-admin.php 1 patch
Spacing   +52 added lines, -52 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
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-migrate.php' );
26 26
 
27 27
 		// Don't load tooltips if on Gravity Forms, otherwise it overrides translations
28
-		if( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && !GFForms::is_gravity_page() ) {
28
+		if ( class_exists( 'GFCommon' ) && class_exists( 'GFForms' ) && ! GFForms::is_gravity_page() ) {
29 29
 			require_once( GFCommon::get_base_path() . '/tooltips.php' );
30 30
 		}
31 31
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
54 54
 		add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) );
55 55
 
56
-		add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) );
56
+		add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) );
57 57
 
58 58
 		add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 );
59 59
 
@@ -68,22 +68,22 @@  discard block
 block discarded – undo
68 68
 	public function backend_actions() {
69 69
 
70 70
 		/** @define "GRAVITYVIEW_DIR" "../" */
71
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' );
72
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' );
73
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' );
74
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' );
75
-		include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' );
76
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' );
77
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' );
78
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' );
79
-		include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' );
71
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' );
72
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' );
73
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' );
74
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' );
75
+		include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' );
76
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' );
77
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' );
78
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' );
79
+		include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' );
80 80
 
81 81
 		/**
82 82
 		 * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded
83 83
 		 *
84 84
 		 * Nice place to insert extensions' backend stuff
85 85
 		 */
86
-		do_action('gravityview_include_backend_actions');
86
+		do_action( 'gravityview_include_backend_actions' );
87 87
 	}
88 88
 
89 89
 	/**
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$actions = array();
101 101
 
102
-		if( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
103
-			$actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
102
+		if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) {
103
+			$actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) );
104 104
 		}
105 105
 
106
-		if( GVCommon::has_cap( 'gravityview_support_port' ) ) {
107
-			$actions[] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
106
+		if ( GVCommon::has_cap( 'gravityview_support_port' ) ) {
107
+			$actions[ ] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>';
108 108
 		}
109 109
 
110 110
 		return array_merge( $actions, $links );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		// By default, there will only be one item being modified.
133 133
 		// When in the `bulk_post_updated_messages` filter, there will be passed a number
134 134
 		// of modified items that will override this array.
135
-		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
135
+		$bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts;
136 136
 
137 137
 		// If we're starting fresh, a new form was created.
138 138
 		// We should let the user know this is the case.
@@ -140,60 +140,60 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$new_form_text = '';
142 142
 
143
-		if( !empty( $start_fresh ) ) {
143
+		if ( ! empty( $start_fresh ) ) {
144 144
 
145 145
 			// Get the form that was created
146 146
 			$connected_form = gravityview_get_form_id( $post_id );
147 147
 
148
-			if( !empty( $connected_form ) ) {
148
+			if ( ! empty( $connected_form ) ) {
149 149
 				$form = gravityview_get_form( $connected_form );
150
-				$form_name = esc_attr( $form['title'] );
150
+				$form_name = esc_attr( $form[ 'title' ] );
151 151
 				$image = self::get_floaty();
152
-				$new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>';
153
-				$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
152
+				$new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>';
153
+				$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
154 154
 
155 155
 					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.
156
-					', '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>');
156
+					', '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>' );
157 157
 				$new_form_text = wpautop( $new_form_text );
158 158
 
159 159
 				delete_post_meta( $post_id, '_gravityview_start_fresh' );
160 160
 			}
161 161
 		}
162 162
 
163
-		$messages['gravityview'] = array(
163
+		$messages[ 'gravityview' ] = array(
164 164
 			0  => '', // Unused. Messages start at index 1.
165 165
 			/* translators: %s and %s are HTML tags linking to the View on the website */
166
-			1  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
166
+			1  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
167 167
 			/* translators: %s and %s are HTML tags linking to the View on the website */
168
-			2  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
168
+			2  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
169 169
 			3  => __( 'View deleted.', 'gravityview' ),
170 170
 			/* translators: %s and %s are HTML tags linking to the View on the website */
171
-			4  => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'),
171
+			4  => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ),
172 172
 			/* translators: %s: date and time of the revision */
173
-			5  => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
173
+			5  => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false,
174 174
 			/* translators: %s and %s are HTML tags linking to the View on the website */
175
-			6  => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
175
+			6  => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
176 176
 			/* translators: %s and %s are HTML tags linking to the View on the website */
177
-			7  => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
177
+			7  => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
178 178
 			8  => __( 'View submitted.', 'gravityview' ),
179 179
 			9  => sprintf(
180 180
 		        /* translators: Date and time the View is scheduled to be published */
181 181
 				__( 'View scheduled for: %1$s.', 'gravityview' ),
182 182
 				// translators: Publish box date format, see http://php.net/date
183
-				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL )  ) )
183
+				date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) )
184 184
 			) . $new_form_text,
185 185
 			/* translators: %s and %s are HTML tags linking to the View on the website */
186
-			10  => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text,
186
+			10  => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text,
187 187
 
188 188
 			/**
189 189
 			 * These apply to `bulk_post_updated_messages`
190 190
 			 * @file wp-admin/edit.php
191 191
 			 */
192
-			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ),
193
-			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ),
194
-			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ),
195
-			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ),
196
-			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ),
192
+			'updated'   => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ),
193
+			'locked'    => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ),
194
+			'deleted'   => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ),
195
+			'trashed'   => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ),
196
+			'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ),
197 197
 		);
198 198
 
199 199
 		return $messages;
@@ -253,29 +253,29 @@  discard block
 block discarded – undo
253 253
 	static function is_admin_page( $hook = '', $page = NULL ) {
254 254
 		global $current_screen, $plugin_page, $pagenow, $post;
255 255
 
256
-		if( ! is_admin() ) { return false; }
256
+		if ( ! is_admin() ) { return false; }
257 257
 
258 258
 		$is_page = false;
259 259
 
260
-		$is_gv_screen = (!empty($current_screen) && isset($current_screen->post_type) && $current_screen->post_type === 'gravityview');
260
+		$is_gv_screen = ( ! empty( $current_screen ) && isset( $current_screen->post_type ) && $current_screen->post_type === 'gravityview' );
261 261
 
262
-		$is_gv_post_type_get = (isset($_GET['post_type']) && $_GET['post_type'] === 'gravityview');
262
+		$is_gv_post_type_get = ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] === 'gravityview' );
263 263
 
264
-		$is_gv_settings_get = isset( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings';
264
+		$is_gv_settings_get = isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings';
265 265
 
266
-		if( empty( $post ) && $pagenow === 'post.php' && !empty( $_GET['post'] ) ) {
267
-			$gv_post = get_post( intval( $_GET['post'] ) );
268
-			$is_gv_post_type = (!empty($gv_post) && !empty($gv_post->post_type) && $gv_post->post_type === 'gravityview');
266
+		if ( empty( $post ) && $pagenow === 'post.php' && ! empty( $_GET[ 'post' ] ) ) {
267
+			$gv_post = get_post( intval( $_GET[ 'post' ] ) );
268
+			$is_gv_post_type = ( ! empty( $gv_post ) && ! empty( $gv_post->post_type ) && $gv_post->post_type === 'gravityview' );
269 269
 		} else {
270
-			$is_gv_post_type = (!empty($post) && !empty($post->post_type) && $post->post_type === 'gravityview');
270
+			$is_gv_post_type = ( ! empty( $post ) && ! empty( $post->post_type ) && $post->post_type === 'gravityview' );
271 271
 		}
272 272
 
273
-		if( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
273
+		if ( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) {
274 274
 
275 275
 			// $_GET `post_type` variable
276
-			if(in_array($pagenow, array( 'post.php' , 'post-new.php' )) ) {
276
+			if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
277 277
 				$is_page = 'single';
278
-			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( !empty( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings' ) ) {
278
+			} else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings' ) ) {
279 279
 				$is_page = 'settings';
280 280
 			} else {
281 281
 				$is_page = 'views';
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 		$is_page = apply_filters( 'gravityview_is_admin_page', $is_page, $hook );
291 291
 
292 292
 		// If the current page is the same as the compared page
293
-		if( !empty( $page ) ) {
293
+		if ( ! empty( $page ) ) {
294 294
 			return $is_page === $page;
295 295
 		}
296 296
 
@@ -311,6 +311,6 @@  discard block
 block discarded – undo
311 311
  *
312 312
  * @return bool|string|void If `false`, not a GravityView page. `true` if $page is passed and is the same as current page. Otherwise, the name of the page (`single`, `settings`, or `views`)
313 313
  */
314
-function gravityview_is_admin_page($hook = '', $page = NULL) {
314
+function gravityview_is_admin_page( $hook = '', $page = NULL ) {
315 315
 	return GravityView_Admin::is_admin_page( $hook, $page );
316 316
 }
Please login to merge, or discard this patch.
includes/class-frontend-views.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	private function __construct() {}
86 86
 
87 87
 	private function initialize() {
88
-		add_action( 'wp', array( $this, 'parse_content'), 11 );
88
+		add_action( 'wp', array( $this, 'parse_content' ), 11 );
89 89
 		add_filter( 'parse_query', array( $this, 'parse_query_fix_frontpage' ), 10 );
90
-		add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 );
90
+		add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 );
91 91
 
92 92
 		// Enqueue scripts and styles after GravityView_Template::register_styles()
93 93
 		add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 );
@@ -234,15 +234,15 @@  discard block
 block discarded – undo
234 234
 
235 235
 			$this->context_view_id = $view_id;
236 236
 
237
-		} elseif ( isset( $_GET['gvid'] ) && $this->getGvOutputData()->has_multiple_views() ) {
237
+		} elseif ( isset( $_GET[ 'gvid' ] ) && $this->getGvOutputData()->has_multiple_views() ) {
238 238
 			/**
239 239
 			 * used on a has_multiple_views context
240 240
 			 * @see GravityView_API::entry_link
241 241
 			 * @see GravityView_View_Data::getInstance()->has_multiple_views()
242 242
 			 */
243
-			$this->context_view_id = $_GET['gvid'];
243
+			$this->context_view_id = $_GET[ 'gvid' ];
244 244
 
245
-		} elseif ( ! $this->getGvOutputData()->has_multiple_views() )  {
245
+		} elseif ( ! $this->getGvOutputData()->has_multiple_views() ) {
246 246
 			$array_keys = array_keys( $this->getGvOutputData()->get_views() );
247 247
 			$this->context_view_id = array_pop( $array_keys );
248 248
 			unset( $array_keys );
@@ -277,24 +277,24 @@  discard block
 block discarded – undo
277 277
 		global $wp_rewrite;
278 278
 
279 279
 		$is_front_page = ( $query->is_home || $query->is_page );
280
-		$show_on_front = ( 'page' === get_option('show_on_front') );
281
-		$front_page_id = get_option('page_on_front');
280
+		$show_on_front = ( 'page' === get_option( 'show_on_front' ) );
281
+		$front_page_id = get_option( 'page_on_front' );
282 282
 
283
-		if (  $is_front_page && $show_on_front && $front_page_id ) {
283
+		if ( $is_front_page && $show_on_front && $front_page_id ) {
284 284
 
285 285
 			// Force to be an array, potentially a query string ( entry=16 )
286 286
 			$_query = wp_parse_args( $query->query );
287 287
 
288 288
 			// pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
289
-			if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) {
290
-				unset( $_query['pagename'] );
289
+			if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) {
290
+				unset( $_query[ 'pagename' ] );
291 291
 			}
292 292
 
293 293
 			// this is where will break from core wordpress
294 294
 			$ignore = array( 'preview', 'page', 'paged', 'cpage' );
295 295
 			$endpoints = rgobj( $wp_rewrite, 'endpoints' );
296
-			foreach ( (array) $endpoints as $endpoint ) {
297
-				$ignore[] = $endpoint[1];
296
+			foreach ( (array)$endpoints as $endpoint ) {
297
+				$ignore[ ] = $endpoint[ 1 ];
298 298
 			}
299 299
 			unset( $endpoints );
300 300
 
@@ -304,21 +304,21 @@  discard block
 block discarded – undo
304 304
 			// - The query includes keys that are associated with registered endpoints. `entry`, for example.
305 305
 			if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) {
306 306
 
307
-				$qv =& $query->query_vars;
307
+				$qv = & $query->query_vars;
308 308
 
309 309
 				// Prevent redirect when on the single entry endpoint
310
-				if( self::is_single_entry() ) {
310
+				if ( self::is_single_entry() ) {
311 311
 					add_filter( 'redirect_canonical', '__return_false' );
312 312
 				}
313 313
 
314 314
 				$query->is_page = true;
315 315
 				$query->is_home = false;
316
-				$qv['page_id']  = $front_page_id;
316
+				$qv[ 'page_id' ]  = $front_page_id;
317 317
 
318 318
 				// Correct <!--nextpage--> for page_on_front
319
-				if ( ! empty( $qv['paged'] ) ) {
320
-					$qv['page'] = $qv['paged'];
321
-					unset( $qv['paged'] );
319
+				if ( ! empty( $qv[ 'paged' ] ) ) {
320
+					$qv[ 'page' ] = $qv[ 'paged' ];
321
+					unset( $qv[ 'paged' ] );
322 322
 				}
323 323
 			}
324 324
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		global $post;
337 337
 
338 338
 		// If in admin and NOT AJAX request, get outta here.
339
-		if ( GravityView_Plugin::is_admin() )  {
339
+		if ( GravityView_Plugin::is_admin() ) {
340 340
 			return;
341 341
 		}
342 342
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 
349 349
 		$this->setIsGravityviewPostType( get_post_type( $post ) === 'gravityview' );
350 350
 
351
-		$post_id = $this->getPostId() ? $this->getPostId() : (isset( $post ) ? $post->ID : null );
351
+		$post_id = $this->getPostId() ? $this->getPostId() : ( isset( $post ) ? $post->ID : null );
352 352
 		$this->setPostId( $post_id );
353 353
 		$post_has_shortcode = ! empty( $post->post_content ) ? gravityview_has_shortcode_r( $post->post_content, 'gravityview' ) : false;
354 354
 		$this->setPostHasShortcode( $this->isGravityviewPostType() ? null : ! empty( $post_has_shortcode ) );
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 		$search_method = GravityView_Widget_Search::getInstance()->get_search_method();
386 386
 
387
-		if( 'post' === $search_method ) {
387
+		if ( 'post' === $search_method ) {
388 388
 			$get = $_POST;
389 389
 		} else {
390 390
 			$get = $_GET;
@@ -440,20 +440,20 @@  discard block
 block discarded – undo
440 440
 		 * @param boolean $in_the_loop Whether to apply the filter to the menu title and the meta tag <title> - outside the loop
441 441
 		 * @param array $entry Current entry
442 442
 		 */
443
-		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop' , in_the_loop(), $entry );
443
+		$apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop', in_the_loop(), $entry );
444 444
 
445 445
 		if ( ! $apply_outside_loop ) {
446 446
 			return $title;
447 447
 		}
448 448
 
449 449
 		// User reported WooCommerce doesn't pass two args.
450
-		if ( empty( $passed_post_id ) )  {
450
+		if ( empty( $passed_post_id ) ) {
451 451
 			return $title;
452 452
 		}
453 453
 
454 454
 		// Don't modify the title for anything other than the current view/post.
455 455
 		// This is true for embedded shortcodes and Views.
456
-		if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) {
456
+		if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) {
457 457
 			return $title;
458 458
 		}
459 459
 
@@ -463,19 +463,19 @@  discard block
 block discarded – undo
463 463
 			$view_meta = $this->getGvOutputData()->get_view( $context_view_id );
464 464
 		} else {
465 465
 			foreach ( $this->getGvOutputData()->get_views() as $view_id => $view_data ) {
466
-				if ( intval( $view_data['form_id'] ) === intval( $entry['form_id'] ) ) {
466
+				if ( intval( $view_data[ 'form_id' ] ) === intval( $entry[ 'form_id' ] ) ) {
467 467
 					$view_meta = $view_data;
468 468
 					break;
469 469
 				}
470 470
 			}
471 471
 		}
472 472
 
473
-		if ( ! empty( $view_meta['atts']['single_title'] ) ) {
473
+		if ( ! empty( $view_meta[ 'atts' ][ 'single_title' ] ) ) {
474 474
 
475
-			$title = $view_meta['atts']['single_title'];
475
+			$title = $view_meta[ 'atts' ][ 'single_title' ];
476 476
 
477 477
 			// We are allowing HTML in the fields, so no escaping the output
478
-			$title = GravityView_API::replace_variables( $title, $view_meta['form'], $entry );
478
+			$title = GravityView_API::replace_variables( $title, $view_meta[ 'form' ], $entry );
479 479
 
480 480
 			$title = do_shortcode( $title );
481 481
 		}
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 	public function render_view( $passed_args ) {
577 577
 
578 578
 		// validate attributes
579
-		if ( empty( $passed_args['id'] ) ) {
579
+		if ( empty( $passed_args[ 'id' ] ) ) {
580 580
 			do_action( 'gravityview_log_error', '[render_view] Returning; no ID defined.', $passed_args );
581 581
 			return null;
582 582
 		}
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 			return null;
599 599
 		}
600 600
 
601
-		$view_id = $passed_args['id'];
601
+		$view_id = $passed_args[ 'id' ];
602 602
 
603 603
 		$view_data = $this->getGvOutputData()->get_view( $view_id, $passed_args );
604 604
 
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 		$passed_args = array_filter( $passed_args, 'strlen' );
612 612
 
613 613
 		//Override shortcode args over View template settings
614
-		$atts = wp_parse_args( $passed_args, $view_data['atts'] );
614
+		$atts = wp_parse_args( $passed_args, $view_data[ 'atts' ] );
615 615
 
616 616
 		do_action( 'gravityview_log_debug', '[render_view] Arguments after merging with View settings: ', $atts );
617 617
 
@@ -634,14 +634,14 @@  discard block
 block discarded – undo
634 634
 		 * @since 1.15
635 635
 		 * @since 1.17.2 Added check for if a user has no caps but is logged in (member of multisite, but not any site). Treat as if logged-out.
636 636
 		 */
637
-		if( is_user_logged_in() && ! ( empty( wp_get_current_user()->caps ) && empty( wp_get_current_user()->roles ) ) && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
637
+		if ( is_user_logged_in() && ! ( empty( wp_get_current_user()->caps ) && empty( wp_get_current_user()->roles ) ) && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
638 638
 
639 639
 			do_action( 'gravityview_log_debug', sprintf( '%s Returning: View %d is not visible by current user.', __METHOD__, $view_id ) );
640 640
 
641 641
 			return null;
642 642
 		}
643 643
 
644
-		if( $this->isGravityviewPostType() ) {
644
+		if ( $this->isGravityviewPostType() ) {
645 645
 
646 646
 			/**
647 647
 			 * @filter `gravityview_direct_access` Should Views be directly accessible, or only visible using the shortcode?
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
 			 */
654 654
 			$direct_access = apply_filters( 'gravityview_direct_access', true, $view_id );
655 655
 
656
-			$embed_only = ! empty( $atts['embed_only'] );
656
+			$embed_only = ! empty( $atts[ 'embed_only' ] );
657 657
 
658
-			if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
658
+			if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) {
659 659
 				return __( 'You are not allowed to view this content.', 'gravityview' );
660 660
 			}
661 661
 		}
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 
671 671
 		$gravityview_view = new GravityView_View( $view_data );
672 672
 
673
-		$post_id = ! empty( $atts['post_id'] ) ? intval( $atts['post_id'] ) : $this->getPostId();
673
+		$post_id = ! empty( $atts[ 'post_id' ] ) ? intval( $atts[ 'post_id' ] ) : $this->getPostId();
674 674
 
675 675
 		$gravityview_view->setPostId( $post_id );
676 676
 
@@ -680,20 +680,20 @@  discard block
 block discarded – undo
680 680
 			do_action( 'gravityview_log_debug', '[render_view] Executing Directory View' );
681 681
 
682 682
 			//fetch template and slug
683
-			$view_slug = apply_filters( 'gravityview_template_slug_'. $view_data['template_id'], 'table', 'directory' );
683
+			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'directory' );
684 684
 
685 685
 			do_action( 'gravityview_log_debug', '[render_view] View template slug: ', $view_slug );
686 686
 
687 687
 			/**
688 688
 			 * Disable fetching initial entries for views that don't need it (DataTables)
689 689
 			 */
690
-			$get_entries = apply_filters( 'gravityview_get_view_entries_'.$view_slug, true );
690
+			$get_entries = apply_filters( 'gravityview_get_view_entries_' . $view_slug, true );
691 691
 
692 692
 			/**
693 693
 			 * Hide View data until search is performed
694 694
 			 * @since 1.5.4
695 695
 			 */
696
-			if ( ! empty( $atts['hide_until_searched'] ) && ! $this->isSearch() ) {
696
+			if ( ! empty( $atts[ 'hide_until_searched' ] ) && ! $this->isSearch() ) {
697 697
 				$gravityview_view->setHideUntilSearched( true );
698 698
 				$get_entries = false;
699 699
 			}
@@ -701,23 +701,23 @@  discard block
 block discarded – undo
701 701
 
702 702
 			if ( $get_entries ) {
703 703
 
704
-				if ( ! empty( $atts['sort_columns'] ) ) {
704
+				if ( ! empty( $atts[ 'sort_columns' ] ) ) {
705 705
 					// add filter to enable column sorting
706
-					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ) , 100, 3 );
706
+					add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ), 100, 3 );
707 707
 				}
708 708
 
709
-				$view_entries = self::get_view_entries( $atts, $view_data['form_id'] );
709
+				$view_entries = self::get_view_entries( $atts, $view_data[ 'form_id' ] );
710 710
 
711
-				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries['count'], sizeof( $view_entries['entries'] ) ) );
711
+				do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries[ 'count' ], sizeof( $view_entries[ 'entries' ] ) ) );
712 712
 
713 713
 			} else {
714 714
 
715 715
 				$view_entries = array( 'count' => null, 'entries' => null, 'paging' => null );
716 716
 
717
-				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_'.$view_slug.'` is false' );
717
+				do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_' . $view_slug . '` is false' );
718 718
 			}
719 719
 
720
-			$gravityview_view->setPaging( $view_entries['paging'] );
720
+			$gravityview_view->setPaging( $view_entries[ 'paging' ] );
721 721
 			$gravityview_view->setContext( 'directory' );
722 722
 			$sections = array( 'header', 'body', 'footer' );
723 723
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 			 * @action `gravityview_render_entry_{View ID}` Before rendering a single entry for a specific View ID
732 732
 			 * @since 1.17
733 733
 			 */
734
-			do_action( 'gravityview_render_entry_'.$view_data['id'] );
734
+			do_action( 'gravityview_render_entry_' . $view_data[ 'id' ] );
735 735
 
736 736
 			$entry = $this->getEntry();
737 737
 
@@ -758,20 +758,20 @@  discard block
 block discarded – undo
758 758
 			// We're in single view, but the view being processed is not the same view the single entry belongs to.
759 759
 			// important: do not remove this as it prevents fake attempts of displaying entries from other views/forms
760 760
 			if ( $this->getGvOutputData()->has_multiple_views() && $view_id != $this->get_context_view_id() ) {
761
-				do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: '. $view_id );
761
+				do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: ' . $view_id );
762 762
 				return null;
763 763
 			}
764 764
 
765 765
 			//fetch template and slug
766
-			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data['template_id'], 'table', 'single' );
766
+			$view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'single' );
767 767
 			do_action( 'gravityview_log_debug', '[render_view] View single template slug: ', $view_slug );
768 768
 
769 769
 			//fetch entry detail
770
-			$view_entries['count'] = 1;
771
-			$view_entries['entries'][] = $entry;
772
-			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries['entries'] );
770
+			$view_entries[ 'count' ] = 1;
771
+			$view_entries[ 'entries' ][ ] = $entry;
772
+			do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries[ 'entries' ] );
773 773
 
774
-			$back_link_label = isset( $atts['back_link_label'] ) ? $atts['back_link_label'] : null;
774
+			$back_link_label = isset( $atts[ 'back_link_label' ] ) ? $atts[ 'back_link_label' ] : null;
775 775
 
776 776
 			// set back link label
777 777
 			$gravityview_view->setBackLinkLabel( $back_link_label );
@@ -781,11 +781,11 @@  discard block
 block discarded – undo
781 781
 		}
782 782
 
783 783
 		// add template style
784
-		self::add_style( $view_data['template_id'] );
784
+		self::add_style( $view_data[ 'template_id' ] );
785 785
 
786 786
 		// Prepare to render view and set vars
787
-		$gravityview_view->setEntries( $view_entries['entries'] );
788
-		$gravityview_view->setTotalEntries( $view_entries['count'] );
787
+		$gravityview_view->setEntries( $view_entries[ 'entries' ] );
788
+		$gravityview_view->setTotalEntries( $view_entries[ 'count' ] );
789 789
 
790 790
 		// If Edit
791 791
 		if ( 'edit' === gravityview_get_context() ) {
@@ -798,11 +798,11 @@  discard block
 block discarded – undo
798 798
 
799 799
 		} else {
800 800
 			// finaly we'll render some html
801
-			$sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data['template_id'] );
801
+			$sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data[ 'template_id' ] );
802 802
 
803 803
 			do_action( 'gravityview_log_debug', '[render_view] Sections to render: ', $sections );
804 804
 			foreach ( $sections as $section ) {
805
-				do_action( 'gravityview_log_debug', '[render_view] Rendering '. $section . ' section.' );
805
+				do_action( 'gravityview_log_debug', '[render_view] Rendering ' . $section . ' section.' );
806 806
 				$gravityview_view->render( $view_slug, $section, false );
807 807
 			}
808 808
 		}
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 				$datetime_format = 'Y-m-d H:i:s';
857 857
 				$search_is_outside_view_bounds = false;
858 858
 
859
-				if( ! empty( $search_criteria[ $key ] ) ) {
859
+				if ( ! empty( $search_criteria[ $key ] ) ) {
860 860
 
861 861
 					$search_date = strtotime( $search_criteria[ $key ] );
862 862
 
@@ -884,14 +884,14 @@  discard block
 block discarded – undo
884 884
 				if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) {
885 885
 
886 886
 					// Then we override the search and re-set the start date
887
-					$return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true );
887
+					$return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true );
888 888
 				}
889 889
 			}
890 890
 		}
891 891
 
892
-		if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) {
892
+		if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) {
893 893
 			// The start date is AFTER the end date. This will result in no results, but let's not force the issue.
894
-			if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) {
894
+			if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) {
895 895
 				do_action( 'gravityview_log_error', __METHOD__ . ' Invalid search: the start date is after the end date.', $return_search_criteria );
896 896
 			}
897 897
 		}
@@ -909,14 +909,14 @@  discard block
 block discarded – undo
909 909
 	 */
910 910
 	public static function process_search_only_approved( $args, $search_criteria ) {
911 911
 
912
-		if ( ! empty( $args['show_only_approved'] ) ) {
912
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
913 913
 
914
-			$search_criteria['field_filters'][] = array(
914
+			$search_criteria[ 'field_filters' ][ ] = array(
915 915
 				'key' => GravityView_Entry_Approval::meta_key,
916 916
 				'value' => GravityView_Entry_Approval_Status::Approved
917 917
 			);
918 918
 
919
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
919
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
920 920
 
921 921
 			do_action( 'gravityview_log_debug', '[process_search_only_approved] Search Criteria if show only approved: ', $search_criteria );
922 922
 		}
@@ -943,12 +943,12 @@  discard block
 block discarded – undo
943 943
 	 */
944 944
 	public static function is_entry_approved( $entry, $args = array() ) {
945 945
 
946
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
946
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
947 947
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
948 948
 			return true;
949 949
 		}
950 950
 
951
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
951
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
952 952
 
953 953
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
954 954
 	}
@@ -982,26 +982,26 @@  discard block
 block discarded – undo
982 982
 		do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', $search_criteria );
983 983
 
984 984
 		// implicity search
985
-		if ( ! empty( $args['search_value'] ) ) {
985
+		if ( ! empty( $args[ 'search_value' ] ) ) {
986 986
 
987 987
 			// Search operator options. Options: `is` or `contains`
988
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
988
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
989 989
 
990
-			$search_criteria['field_filters'][] = array(
990
+			$search_criteria[ 'field_filters' ][ ] = array(
991 991
 				'key' => rgget( 'search_field', $args ), // The field ID to search
992
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
992
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
993 993
 				'operator' => $operator,
994 994
 			);
995 995
 		}
996 996
 
997
-		if( $search_criteria !== $original_search_criteria ) {
997
+		if ( $search_criteria !== $original_search_criteria ) {
998 998
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after implicity search: ', $search_criteria );
999 999
 		}
1000 1000
 
1001 1001
 		// Handle setting date range
1002 1002
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
1003 1003
 
1004
-		if( $search_criteria !== $original_search_criteria ) {
1004
+		if ( $search_criteria !== $original_search_criteria ) {
1005 1005
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after date params: ', $search_criteria );
1006 1006
 		}
1007 1007
 
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
1013 1013
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
1014 1014
 		 */
1015
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
1015
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
1016 1016
 
1017 1017
 		return $search_criteria;
1018 1018
 	}
@@ -1058,16 +1058,16 @@  discard block
 block discarded – undo
1058 1058
 		$search_criteria = self::get_search_criteria( $args, $form_id );
1059 1059
 
1060 1060
 		// Paging & offset
1061
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : apply_filters( 'gravityview_default_page_size', 25 );
1061
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : apply_filters( 'gravityview_default_page_size', 25 );
1062 1062
 
1063 1063
 		if ( -1 === $page_size ) {
1064 1064
 			$page_size = PHP_INT_MAX;
1065 1065
 		}
1066 1066
 
1067
-		if ( isset( $args['offset'] ) ) {
1068
-			$offset = intval( $args['offset'] );
1067
+		if ( isset( $args[ 'offset' ] ) ) {
1068
+			$offset = intval( $args[ 'offset' ] );
1069 1069
 		} else {
1070
-			$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1070
+			$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1071 1071
 			$offset = ( $curr_page - 1 ) * $page_size;
1072 1072
 		}
1073 1073
 
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
 			'search_criteria' => $search_criteria,
1086 1086
 			'sorting' => $sorting,
1087 1087
 			'paging' => $paging,
1088
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1088
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1089 1089
 		);
1090 1090
 
1091 1091
 		/**
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1111 1111
 		 * @param array $args View configuration args.
1112 1112
 		 */
1113
-		$parameters = apply_filters( 'gravityview_get_entries_'.$args['id'], $parameters, $args, $form_id );
1113
+		$parameters = apply_filters( 'gravityview_get_entries_' . $args[ 'id' ], $parameters, $args, $form_id );
1114 1114
 
1115 1115
 		do_action( 'gravityview_log_debug', __METHOD__ . ': $parameters passed to gravityview_get_entries(): ', $parameters );
1116 1116
 
@@ -1150,8 +1150,8 @@  discard block
 block discarded – undo
1150 1150
 	 */
1151 1151
 	public static function updateViewSorting( $args, $form_id ) {
1152 1152
 		$sorting = array();
1153
-		$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : rgar( $args, 'sort_field' );
1154
-		$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : rgar( $args, 'sort_direction' );
1153
+		$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : rgar( $args, 'sort_field' );
1154
+		$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : rgar( $args, 'sort_direction' );
1155 1155
 
1156 1156
 		$sort_field_id = self::_override_sorting_id_by_field_type( $sort_field_id, $form_id );
1157 1157
 
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1193 1193
 
1194
-		switch ( $sort_field['type'] ) {
1194
+		switch ( $sort_field[ 'type' ] ) {
1195 1195
 
1196 1196
 			case 'address':
1197 1197
 				// Sorting by full address
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 					 */
1209 1209
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1210 1210
 
1211
-					switch( strtolower( $address_part ) ){
1211
+					switch ( strtolower( $address_part ) ) {
1212 1212
 						case 'street':
1213 1213
 							$sort_field_id .= '.1';
1214 1214
 							break;
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 		 */
1289 1289
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1290 1290
 
1291
-		if ( empty( $single_entry ) ){
1291
+		if ( empty( $single_entry ) ) {
1292 1292
 			return false;
1293 1293
 		} else {
1294 1294
 			return $single_entry;
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1316 1316
 				 * @since 1.15
1317 1317
 				 */
1318
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1318
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1319 1319
 					continue;
1320 1320
 				}
1321 1321
 
@@ -1324,19 +1324,19 @@  discard block
 block discarded – undo
1324 1324
 				$css_dependencies = array();
1325 1325
 
1326 1326
 				// If the thickbox is enqueued, add dependencies
1327
-				if ( ! empty( $data['atts']['lightbox'] ) ) {
1327
+				if ( ! empty( $data[ 'atts' ][ 'lightbox' ] ) ) {
1328 1328
 
1329 1329
 					/**
1330 1330
 					 * @filter `gravity_view_lightbox_script` Override the lightbox script to enqueue. Default: `thickbox`
1331 1331
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of it here.
1332 1332
 					 */
1333
-					$js_dependencies[] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1333
+					$js_dependencies[ ] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1334 1334
 
1335 1335
 					/**
1336 1336
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
1337 1337
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of its CSS file here.
1338 1338
 					 */
1339
-					$css_dependencies[] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1339
+					$css_dependencies[ ] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1340 1340
 				}
1341 1341
 
1342 1342
 				/**
@@ -1344,25 +1344,25 @@  discard block
 block discarded – undo
1344 1344
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1345 1345
 				 * @since 1.15
1346 1346
 				 */
1347
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1348
-					$css_dependencies[] = 'dashicons';
1347
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1348
+					$css_dependencies[ ] = 'dashicons';
1349 1349
 				}
1350 1350
 
1351 1351
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1352 1352
 
1353 1353
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1354 1354
 
1355
-				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ) , GravityView_Plugin::version, true );
1355
+				wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ), GravityView_Plugin::version, true );
1356 1356
 
1357 1357
 				wp_enqueue_script( 'gravityview-fe-view' );
1358 1358
 
1359
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1359
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1360 1360
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1361 1361
 				}
1362 1362
 
1363 1363
 				$this->enqueue_default_style( $css_dependencies );
1364 1364
 
1365
-				self::add_style( $data['template_id'] );
1365
+				self::add_style( $data[ 'template_id' ] );
1366 1366
 			}
1367 1367
 
1368 1368
 			if ( 'wp_print_footer_scripts' === current_filter() ) {
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 		} elseif ( empty( $template_id ) ) {
1425 1425
 			do_action( 'gravityview_log_error', '[add_style] Cannot add template style; template_id is empty' );
1426 1426
 		} else {
1427
-			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_'.$template_id ) );
1427
+			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_' . $template_id ) );
1428 1428
 		}
1429 1429
 
1430 1430
 	}
@@ -1449,11 +1449,11 @@  discard block
 block discarded – undo
1449 1449
 		 * Not a table-based template; don't add sort icons
1450 1450
 		 * @since 1.12
1451 1451
 		 */
1452
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1452
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1453 1453
 			return $label;
1454 1454
 		}
1455 1455
 
1456
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1456
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1457 1457
 			return $label;
1458 1458
 		}
1459 1459
 
@@ -1461,29 +1461,29 @@  discard block
 block discarded – undo
1461 1461
 
1462 1462
 		$class = 'gv-sort';
1463 1463
 
1464
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1464
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1465 1465
 
1466 1466
 		$sort_args = array(
1467
-			'sort' => $field['id'],
1467
+			'sort' => $field[ 'id' ],
1468 1468
 			'dir' => 'asc',
1469 1469
 		);
1470 1470
 
1471
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1471
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1472 1472
 			//toggle sorting direction.
1473
-			if ( 'asc' === $sorting['direction'] ) {
1474
-				$sort_args['dir'] = 'desc';
1473
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1474
+				$sort_args[ 'dir' ] = 'desc';
1475 1475
 				$class .= ' gv-icon-sort-desc';
1476 1476
 			} else {
1477
-				$sort_args['dir'] = 'asc';
1477
+				$sort_args[ 'dir' ] = 'asc';
1478 1478
 				$class .= ' gv-icon-sort-asc';
1479 1479
 			}
1480 1480
 		} else {
1481 1481
 			$class .= ' gv-icon-caret-up-down';
1482 1482
 		}
1483 1483
 
1484
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1484
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1485 1485
 
1486
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1486
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1487 1487
 
1488 1488
 	}
1489 1489
 
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 
1502 1502
 		$field_type = $field_id;
1503 1503
 
1504
-		if( is_numeric( $field_id ) ) {
1504
+		if ( is_numeric( $field_id ) ) {
1505 1505
 			$field = GFFormsModel::get_field( $form, $field_id );
1506 1506
 			$field_type = $field->type;
1507 1507
 		}
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 			return false;
1525 1525
 		}
1526 1526
 
1527
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1527
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1528 1528
 
1529 1529
 	}
1530 1530
 
Please login to merge, or discard this patch.
includes/class-gravityview-migrate.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 		$disapproved_result = $wpdb->query( $wpdb->prepare( $sql, GravityView_Entry_Approval_Status::DISAPPROVED, '0' ) );
65 65
 
66
-		if( false === $approved_result || false === $disapproved_result ) {
66
+		if ( false === $approved_result || false === $disapproved_result ) {
67 67
 			do_action( 'gravityview_log_error', __METHOD__ . ': There was an error processing the query.', $wpdb->last_error );
68 68
 		} else {
69 69
 			// All done: Meta values are migrated
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 		$redux_settings = $this->get_redux_settings();
97 97
 
98 98
 		// No need to process
99
-		if( false === $redux_settings ) {
99
+		if ( false === $redux_settings ) {
100 100
 			return;
101 101
 		}
102 102
 
103
-		if( empty(  $redux_settings['license_key_status'] ) ) {
103
+		if ( empty( $redux_settings[ 'license_key_status' ] ) ) {
104 104
 			$redux_settings = $this->get_redux_license_status( $redux_settings );
105 105
 		}
106 106
 
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 		GravityView_Settings::get_instance()->update_app_settings( $updated_settings );
115 115
 
116 116
 		// And now remove the previous option, so this is a one-time thing.
117
-		delete_option('gravityview_settings');
118
-		delete_option('gravityview_settings-transients');
117
+		delete_option( 'gravityview_settings' );
118
+		delete_option( 'gravityview_settings-transients' );
119 119
 	}
120 120
 
121 121
 	/**
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 
132 132
 		$data = array(
133 133
 			'edd_action' => 'check_license',
134
-			'license' => rgget('license_key', $redux_settings ),
134
+			'license' => rgget( 'license_key', $redux_settings ),
135 135
 			'update' => false,
136 136
 			'format' => 'object',
137 137
 		);
138 138
 
139 139
 		$license_call = GravityView_Settings::get_instance()->get_license_handler()->license_call( $data );
140 140
 
141
-		if( is_object( $license_call ) && isset( $license_call->license ) ) {
142
-			$redux_settings['license_key_status'] = $license_call->license;
143
-			$redux_settings['license_key_response'] = json_encode( $license_call );
141
+		if ( is_object( $license_call ) && isset( $license_call->license ) ) {
142
+			$redux_settings[ 'license_key_status' ] = $license_call->license;
143
+			$redux_settings[ 'license_key_response' ] = json_encode( $license_call );
144 144
 		}
145 145
 
146 146
 		return $redux_settings;
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
 	function get_redux_settings() {
155 155
 
156 156
 		// Previous settings set by Redux
157
-		$redux_option = get_option('gravityview_settings');
157
+		$redux_option = get_option( 'gravityview_settings' );
158 158
 
159 159
 		// No Redux settings? Don't proceed.
160
-		if( false === $redux_option ) {
160
+		if ( false === $redux_option ) {
161 161
 			return false;
162 162
 		}
163 163
 
@@ -167,21 +167,21 @@  discard block
 block discarded – undo
167 167
 			'no-conflict-mode' => ( rgget( 'no-conflict-mode', $redux_option ) ? '1' : '0' ),
168 168
 		);
169 169
 
170
-		if( $license_array = rgget( 'license', $redux_option ) ) {
170
+		if ( $license_array = rgget( 'license', $redux_option ) ) {
171 171
 
172
-			$redux_settings['license_key'] = $license_key = rgget( 'license', $license_array );
172
+			$redux_settings[ 'license_key' ] = $license_key = rgget( 'license', $license_array );
173 173
 
174
-			$redux_last_changed_values = get_option('gravityview_settings-transients');
174
+			$redux_last_changed_values = get_option( 'gravityview_settings-transients' );
175 175
 
176 176
 			// This contains the last response for license validation
177
-			if( !empty( $redux_last_changed_values ) && $saved_values = rgget( 'changed_values', $redux_last_changed_values ) ) {
177
+			if ( ! empty( $redux_last_changed_values ) && $saved_values = rgget( 'changed_values', $redux_last_changed_values ) ) {
178 178
 
179
-				$saved_license = rgget('license', $saved_values );
179
+				$saved_license = rgget( 'license', $saved_values );
180 180
 
181 181
 				// Only use the last-saved values if they are for the same license
182
-				if( $saved_license && rgget( 'license', $saved_license ) === $license_key ) {
183
-					$redux_settings['license_key_status'] = rgget( 'status', $saved_license );
184
-					$redux_settings['license_key_response'] = rgget( 'response', $saved_license );
182
+				if ( $saved_license && rgget( 'license', $saved_license ) === $license_key ) {
183
+					$redux_settings[ 'license_key_status' ] = rgget( 'status', $saved_license );
184
+					$redux_settings[ 'license_key_response' ] = rgget( 'response', $saved_license );
185 185
 				}
186 186
 			}
187 187
 		}
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	/** ----  Migrate from old search widget to new search widget  ---- */
194 194
 	function update_search_on_views() {
195 195
 
196
-		if( !class_exists('GravityView_Widget_Search') ) {
197
-			include_once( GRAVITYVIEW_DIR .'includes/extensions/search-widget/class-search-widget.php' );
196
+		if ( ! class_exists( 'GravityView_Widget_Search' ) ) {
197
+			include_once( GRAVITYVIEW_DIR . 'includes/extensions/search-widget/class-search-widget.php' );
198 198
 		}
199 199
 
200 200
 		// Loop through all the views
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
 
207 207
 		$views = get_posts( $query_args );
208 208
 
209
-		foreach( $views as $view ) {
209
+		foreach ( $views as $view ) {
210 210
 
211 211
 			$widgets = gravityview_get_directory_widgets( $view->ID );
212 212
 			$search_fields = null;
213 213
 
214
-			if( empty( $widgets ) || !is_array( $widgets ) ) { continue; }
214
+			if ( empty( $widgets ) || ! is_array( $widgets ) ) { continue; }
215 215
 
216 216
 			do_action( 'gravityview_log_debug', '[GravityView_Migrate/update_search_on_views] Loading View ID: ', $view->ID );
217 217
 
218
-			foreach( $widgets as $area => $ws ) {
219
-				foreach( $ws as $k => $widget ) {
220
-					if( $widget['id'] !== 'search_bar' ) { continue; }
218
+			foreach ( $widgets as $area => $ws ) {
219
+				foreach ( $ws as $k => $widget ) {
220
+					if ( $widget[ 'id' ] !== 'search_bar' ) { continue; }
221 221
 
222
-					if( is_null( $search_fields ) ) {
222
+					if ( is_null( $search_fields ) ) {
223 223
 						$search_fields = $this->get_search_fields( $view->ID );
224 224
 					}
225 225
 
@@ -227,24 +227,24 @@  discard block
 block discarded – undo
227 227
 					//  [search_free] => 1
228 228
 			        //  [search_date] => 1
229 229
 			        $search_generic = array();
230
-					if( !empty( $widget['search_free'] ) ) {
231
-						$search_generic[] = array( 'field' => 'search_all', 'input' => 'input_text' );
230
+					if ( ! empty( $widget[ 'search_free' ] ) ) {
231
+						$search_generic[ ] = array( 'field' => 'search_all', 'input' => 'input_text' );
232 232
 					}
233
-					if( !empty( $widget['search_date'] ) ) {
234
-						$search_generic[] = array( 'field' => 'entry_date', 'input' => 'date' );
233
+					if ( ! empty( $widget[ 'search_date' ] ) ) {
234
+						$search_generic[ ] = array( 'field' => 'entry_date', 'input' => 'date' );
235 235
 					}
236 236
 
237 237
 					$search_config = array_merge( $search_generic, $search_fields );
238 238
 
239 239
 					// don't throw '[]' when json_encode an empty array
240
-					if( empty( $search_config ) ) {
240
+					if ( empty( $search_config ) ) {
241 241
 						$search_config = '';
242 242
 					} else {
243 243
 						$search_config = json_encode( $search_config );
244 244
 					}
245 245
 
246
-					$widgets[ $area ][ $k ]['search_fields'] = $search_config;
247
-					$widgets[ $area ][ $k ]['search_layout'] = 'horizontal';
246
+					$widgets[ $area ][ $k ][ 'search_fields' ] = $search_config;
247
+					$widgets[ $area ][ $k ][ 'search_layout' ] = 'horizontal';
248 248
 
249 249
 					do_action( 'gravityview_log_debug', '[GravityView_Migrate/update_search_on_views] Updated Widget: ', $widgets[ $area ][ $k ] );
250 250
 				}
@@ -272,26 +272,26 @@  discard block
 block discarded – undo
272 272
 		// check view fields' settings
273 273
 		$fields = gravityview_get_directory_fields( $view_id, false );
274 274
 
275
-		if( !empty( $fields ) && is_array( $fields ) ) {
275
+		if ( ! empty( $fields ) && is_array( $fields ) ) {
276 276
 
277
-			foreach( $fields as $t => $fs ) {
277
+			foreach ( $fields as $t => $fs ) {
278 278
 
279
-				foreach( $fs as $k => $field ) {
279
+				foreach ( $fs as $k => $field ) {
280 280
 					// is field a search_filter ?
281
-					if( empty( $field['search_filter'] ) ) { continue; }
281
+					if ( empty( $field[ 'search_filter' ] ) ) { continue; }
282 282
 
283 283
 					// get field type & calculate the input type (by default)
284
-					$form_field = gravityview_get_field( $form, $field['id'] );
284
+					$form_field = gravityview_get_field( $form, $field[ 'id' ] );
285 285
 
286
-					if( empty( $form_field['type'] ) ) {
286
+					if ( empty( $form_field[ 'type' ] ) ) {
287 287
 						continue;
288 288
 					}
289 289
 
290 290
 					// depending on the field type assign a group of possible search field types
291
-					$type = GravityView_Widget_Search::get_search_input_types( $field['id'], $form_field['type'] );
291
+					$type = GravityView_Widget_Search::get_search_input_types( $field[ 'id' ], $form_field[ 'type' ] );
292 292
 
293 293
 					// add field to config
294
-					$search_fields[] = array( 'field' => $field['id'], 'input' => $type );
294
+					$search_fields[ ] = array( 'field' => $field[ 'id' ], 'input' => $type );
295 295
 
296 296
 				}
297 297
 			}
Please login to merge, or discard this patch.
gravityview.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public static function getInstance() {
74 74
 
75
-		if( empty( self::$instance ) ) {
75
+		if ( empty( self::$instance ) ) {
76 76
 			self::$instance = new self;
77 77
 		}
78 78
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 		self::require_files();
85 85
 
86
-		if( ! GravityView_Compatibility::is_valid() ) {
86
+		if ( ! GravityView_Compatibility::is_valid() ) {
87 87
 			return;
88 88
 		}
89 89
 
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	private static function require_files() {
100 100
 		require_once( GRAVITYVIEW_DIR . 'includes/helper-functions.php' );
101
-		require_once( GRAVITYVIEW_DIR . 'includes/class-common.php');
102
-		require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php');
101
+		require_once( GRAVITYVIEW_DIR . 'includes/class-common.php' );
102
+		require_once( GRAVITYVIEW_DIR . 'includes/connector-functions.php' );
103 103
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-compatibility.php' );
104 104
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-roles-capabilities.php' );
105 105
 		require_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-notices.php' );
106
-		require_once( GRAVITYVIEW_DIR .'includes/class-admin.php' );
107
-		require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php');
108
-		require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php');
106
+		require_once( GRAVITYVIEW_DIR . 'includes/class-admin.php' );
107
+		require_once( GRAVITYVIEW_DIR . 'includes/class-post-types.php' );
108
+		require_once( GRAVITYVIEW_DIR . 'includes/class-cache.php' );
109 109
 	}
110 110
 
111 111
 	/**
@@ -138,22 +138,22 @@  discard block
 block discarded – undo
138 138
 		}
139 139
 
140 140
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-approval-status.php' );
141
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-approval.php' );
141
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-approval.php' );
142 142
 
143
-		include_once( GRAVITYVIEW_DIR .'includes/class-gravityview-entry-notes.php' );
144
-		include_once( GRAVITYVIEW_DIR .'includes/load-plugin-and-theme-hooks.php' );
143
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-notes.php' );
144
+		include_once( GRAVITYVIEW_DIR . 'includes/load-plugin-and-theme-hooks.php' );
145 145
 
146 146
 		// Load Extensions
147 147
 		// @todo: Convert to a scan of the directory or a method where this all lives
148
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/edit-entry/class-edit-entry.php' );
149
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/delete-entry/class-delete-entry.php' );
150
-		include_once( GRAVITYVIEW_DIR .'includes/extensions/entry-notes/class-gravityview-field-notes.php' );
148
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/edit-entry/class-edit-entry.php' );
149
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/delete-entry/class-delete-entry.php' );
150
+		include_once( GRAVITYVIEW_DIR . 'includes/extensions/entry-notes/class-gravityview-field-notes.php' );
151 151
 
152 152
 		// Load WordPress Widgets
153
-		include_once( GRAVITYVIEW_DIR .'includes/wordpress-widgets/register-wordpress-widgets.php' );
153
+		include_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/register-wordpress-widgets.php' );
154 154
 
155 155
 		// Load GravityView Widgets
156
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/register-gravityview-widgets.php' );
156
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/register-gravityview-widgets.php' );
157 157
 
158 158
 		// Add oEmbed
159 159
 		include_once( GRAVITYVIEW_DIR . 'includes/class-oembed.php' );
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
167 167
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-admin-bar.php' );
168 168
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-list.php' );
169
-		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php'); /** @since 1.8.4 */
169
+		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-merge-tags.php' ); /** @since 1.8.4 */
170 170
 		include_once( GRAVITYVIEW_DIR . 'includes/class-data.php' );
171 171
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-shortcode.php' );
172 172
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-entry-link-shortcode.php' );
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 * @return bool
182 182
 	 */
183 183
 	public static function is_network_activated() {
184
-		return is_multisite() && ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
184
+		return is_multisite() && ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( 'gravityview/gravityview.php' ) );
185 185
 	}
186 186
 
187 187
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	 * @since 1.7.5.1
247 247
 	 */
248 248
 	public static function include_widget_class() {
249
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
249
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
250 250
 	}
251 251
 
252 252
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		}
269 269
 		if ( ! $loaded ) {
270 270
 			$locale = apply_filters( 'plugin_locale', get_locale(), 'gravityview' );
271
-			$mofile = dirname( __FILE__ ) . '/languages/gravityview-'. $locale .'.mo';
271
+			$mofile = dirname( __FILE__ ) . '/languages/gravityview-' . $locale . '.mo';
272 272
 			load_textdomain( 'gravityview', $mofile );
273 273
 		}
274 274
 
@@ -299,12 +299,12 @@  discard block
 block discarded – undo
299 299
 	 */
300 300
 	public function frontend_actions( $force = false ) {
301 301
 
302
-		if( self::is_admin() && ! $force ) { return; }
302
+		if ( self::is_admin() && ! $force ) { return; }
303 303
 
304 304
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-image.php' );
305
-		include_once( GRAVITYVIEW_DIR .'includes/class-template.php' );
306
-		include_once( GRAVITYVIEW_DIR .'includes/class-api.php' );
307
-		include_once( GRAVITYVIEW_DIR .'includes/class-frontend-views.php' );
305
+		include_once( GRAVITYVIEW_DIR . 'includes/class-template.php' );
306
+		include_once( GRAVITYVIEW_DIR . 'includes/class-api.php' );
307
+		include_once( GRAVITYVIEW_DIR . 'includes/class-frontend-views.php' );
308 308
 		include_once( GRAVITYVIEW_DIR . 'includes/class-gravityview-change-entry-creator.php' );
309 309
 
310 310
 
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
 	 */
330 330
 	public static function get_default_widget_areas() {
331 331
 		$default_areas = array(
332
-			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __('Top', 'gravityview' ) , 'subtitle' => '' ) ) ),
333
-			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __('Left', 'gravityview') , 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __('Right', 'gravityview') , 'subtitle' => '' ) ) ),
332
+			array( '1-1' => array( array( 'areaid' => 'top', 'title' => __( 'Top', 'gravityview' ), 'subtitle' => '' ) ) ),
333
+			array( '1-2' => array( array( 'areaid' => 'left', 'title' => __( 'Left', 'gravityview' ), 'subtitle' => '' ) ), '2-2' => array( array( 'areaid' => 'right', 'title' => __( 'Right', 'gravityview' ), 'subtitle' => '' ) ) ),
334 334
 		);
335 335
 
336 336
 		/**
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      * @param mixed $data Additional data to display
349 349
      * @return void
350 350
      */
351
-    public static function log_debug( $message, $data = null ){
351
+    public static function log_debug( $message, $data = null ) {
352 352
 	    /**
353 353
 	     * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
354 354
 	     * @param string $message Message to display
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
      * @param  string $message log message
363 363
      * @return void
364 364
      */
365
-    public static function log_error( $message, $data = null ){
365
+    public static function log_error( $message, $data = null ) {
366 366
 	    /**
367 367
 	     * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
368 368
 	     * @param string $message Error message to display
@@ -373,4 +373,4 @@  discard block
 block discarded – undo
373 373
 
374 374
 } // end class GravityView_Plugin
375 375
 
376
-add_action('plugins_loaded', array('GravityView_Plugin', 'getInstance'), 1);
376
+add_action( 'plugins_loaded', array( 'GravityView_Plugin', 'getInstance' ), 1 );
Please login to merge, or discard this patch.
includes/class-admin-add-shortcode.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 
21 21
 	function __construct() {
22 22
 
23
-			add_action( 'media_buttons', array( $this, 'add_shortcode_button'), 30);
23
+			add_action( 'media_buttons', array( $this, 'add_shortcode_button' ), 30 );
24 24
 
25
-			add_action( 'admin_footer',	array( $this, 'add_shortcode_popup') );
25
+			add_action( 'admin_footer', array( $this, 'add_shortcode_popup' ) );
26 26
 
27 27
 			// adding styles and scripts
28
-			add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
28
+			add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) );
29 29
 
30 30
 			// ajax - populate sort fields based on the selected view
31 31
 			add_action( 'wp_ajax_gv_sortable_fields', array( $this, 'get_sortable_fields' ) );
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	function is_post_editor_screen() {
42 42
 		global $current_screen, $pagenow;
43
-		return !empty( $current_screen->post_type ) && 'gravityview' != $current_screen->post_type && in_array( $pagenow , array( 'post.php' , 'post-new.php' ) );
43
+		return ! empty( $current_screen->post_type ) && 'gravityview' != $current_screen->post_type && in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
44 44
 	}
45 45
 
46 46
 
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 		/**
56 56
 		 * @since 1.15.3
57 57
 		 */
58
-		if( ! GVCommon::has_cap( array( 'publish_gravityviews' ) ) ) {
58
+		if ( ! GVCommon::has_cap( array( 'publish_gravityviews' ) ) ) {
59 59
 			return;
60 60
 		}
61 61
 
62
-		if( !$this->is_post_editor_screen() ) {
62
+		if ( ! $this->is_post_editor_screen() ) {
63 63
 			return;
64 64
 		}
65 65
 		?>
66
-		<a href="#TB_inline?width=600&amp;height=800&amp;inlineId=select_gravityview_view" class="thickbox hide-if-no-js button gform_media_link" id="add_gravityview" title="<?php esc_attr_e("Insert View", 'gravityview'); ?>"><span class="icon gv-icon-astronaut-head"></span><?php esc_html_e( 'Add View', 'gravityview' ); ?></a>
66
+		<a href="#TB_inline?width=600&amp;height=800&amp;inlineId=select_gravityview_view" class="thickbox hide-if-no-js button gform_media_link" id="add_gravityview" title="<?php esc_attr_e( "Insert View", 'gravityview' ); ?>"><span class="icon gv-icon-astronaut-head"></span><?php esc_html_e( 'Add View', 'gravityview' ); ?></a>
67 67
 		<?php
68 68
 
69 69
 	}
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 	function add_shortcode_popup() {
80 80
 		global $post;
81 81
 
82
-		if( !$this->is_post_editor_screen() ) {
82
+		if ( ! $this->is_post_editor_screen() ) {
83 83
 			return;
84 84
 		}
85 85
 
86
-		$post_type = get_post_type_object($post->post_type);
86
+		$post_type = get_post_type_object( $post->post_type );
87 87
 
88
-		$views = get_posts( array('post_type' => 'gravityview', 'posts_per_page' => -1 ) );
88
+		$views = get_posts( array( 'post_type' => 'gravityview', 'posts_per_page' => -1 ) );
89 89
 
90 90
 		// If there are no views set up yet, we get outta here.
91
-		if( empty( $views ) ) {
91
+		if ( empty( $views ) ) {
92 92
 			echo '<div id="select_gravityview_view"><div class="wrap">' . GravityView_Admin::no_views_text() . '</div></div>';
93 93
 			return;
94 94
 		}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				<div class="wrap">
100 100
 
101 101
 					<h2 class=""><?php esc_html_e( 'Embed a View', 'gravityview' ); ?></h2>
102
-					<p class="subtitle"><?php printf( esc_attr ( __( 'Use this form to embed a View into this %s. %sLearn more about using shortcodes.%s', 'gravityview') ), $post_type->labels->singular_name, '<a href="http://docs.gravityview.co/article/73-using-the-shortcode" target="_blank" rel="noopener noreferrer">', '</a>' ); ?></p>
102
+					<p class="subtitle"><?php printf( esc_attr( __( 'Use this form to embed a View into this %s. %sLearn more about using shortcodes.%s', 'gravityview' ) ), $post_type->labels->singular_name, '<a href="http://docs.gravityview.co/article/73-using-the-shortcode" target="_blank" rel="noopener noreferrer">', '</a>' ); ?></p>
103 103
 
104 104
 					<div>
105 105
 						<h3><label for="gravityview_id"><?php esc_html_e( 'Select a View', 'gravityview' ); ?></label></h3>
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 						<select name="gravityview_id" id="gravityview_id">
108 108
 							<option value=""><?php esc_html_e( '&mdash; Select a View to Insert &mdash;', 'gravityview' ); ?></option>
109 109
 							<?php
110
-							foreach( $views as $view ) {
111
-								$title = empty( $view->post_title ) ? __('(no title)', 'gravityview') : $view->post_title;
112
-								echo '<option value="'. $view->ID .'">'. esc_html( sprintf('%s #%d', $title, $view->ID ) ) .'</option>';
110
+							foreach ( $views as $view ) {
111
+								$title = empty( $view->post_title ) ? __( '(no title)', 'gravityview' ) : $view->post_title;
112
+								echo '<option value="' . $view->ID . '">' . esc_html( sprintf( '%s #%d', $title, $view->ID ) ) . '</option>';
113 113
 							}
114 114
 							?>
115 115
 						</select>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 						foreach ( $settings as $key => $setting ) {
127 127
 
128
-							if( empty( $setting['show_in_shortcode'] ) ) { continue; }
128
+							if ( empty( $setting[ 'show_in_shortcode' ] ) ) { continue; }
129 129
 
130 130
 							GravityView_Render_Settings::render_setting_row( $key, array(), NULL, 'gravityview_%s', 'gravityview_%s' );
131 131
 						}
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
 					</table>
135 135
 
136 136
 					<div class="submit">
137
-						<input type="submit" class="button button-primary button-large alignleft hide-if-js" value="<?php esc_attr_e('Insert View', 'gravityview' ); ?>" id="insert_gravityview_view" />
138
-						<input class="button button-secondary alignright" type="submit" onclick="tb_remove(); return false;" value="<?php esc_attr_e("Cancel", 'gravityview'); ?>" />
137
+						<input type="submit" class="button button-primary button-large alignleft hide-if-js" value="<?php esc_attr_e( 'Insert View', 'gravityview' ); ?>" id="insert_gravityview_view" />
138
+						<input class="button button-secondary alignright" type="submit" onclick="tb_remove(); return false;" value="<?php esc_attr_e( "Cancel", 'gravityview' ); ?>" />
139 139
 					</div>
140 140
 
141 141
 				</div>
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	function add_scripts_and_styles() {
158 158
 
159
-		if( ! $this->is_post_editor_screen() ) {
159
+		if ( ! $this->is_post_editor_screen() ) {
160 160
 			return;
161 161
 		}
162 162
 
@@ -167,22 +167,22 @@  discard block
 block discarded – undo
167 167
 
168 168
 		$protocol = is_ssl() ? 'https://' : 'http://';
169 169
 
170
-		wp_enqueue_style( 'jquery-ui-datepicker', $protocol.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css', array(), GravityView_Plugin::version );
170
+		wp_enqueue_style( 'jquery-ui-datepicker', $protocol . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css', array(), GravityView_Plugin::version );
171 171
 
172 172
 		//enqueue styles
173
-		wp_register_style( 'gravityview_postedit_styles', plugins_url('assets/css/admin-post-edit.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
173
+		wp_register_style( 'gravityview_postedit_styles', plugins_url( 'assets/css/admin-post-edit.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
174 174
 		wp_enqueue_style( 'gravityview_postedit_styles' );
175 175
 
176
-		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
176
+		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
177 177
 
178 178
 		// custom js
179
-		wp_register_script( 'gravityview_postedit_scripts',  plugins_url('assets/js/admin-post-edit'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery', 'jquery-ui-datepicker' ), GravityView_Plugin::version );
179
+		wp_register_script( 'gravityview_postedit_scripts', plugins_url( 'assets/js/admin-post-edit' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery', 'jquery-ui-datepicker' ), GravityView_Plugin::version );
180 180
 		wp_enqueue_script( 'gravityview_postedit_scripts' );
181
-		wp_localize_script('gravityview_postedit_scripts', 'gvGlobals', array(
182
-			'nonce' => wp_create_nonce( 'gravityview_ajaxaddshortcode'),
181
+		wp_localize_script( 'gravityview_postedit_scripts', 'gvGlobals', array(
182
+			'nonce' => wp_create_nonce( 'gravityview_ajaxaddshortcode' ),
183 183
 			'loading_text' => esc_html__( 'Loading&hellip;', 'gravityview' ),
184
-			'alert_1' => esc_html__( 'Please select a View', 'gravityview'),
185
-		));
184
+			'alert_1' => esc_html__( 'Please select a View', 'gravityview' ),
185
+		) );
186 186
 
187 187
 	}
188 188
 
@@ -198,16 +198,16 @@  discard block
 block discarded – undo
198 198
 	function get_sortable_fields() {
199 199
 
200 200
 		// Not properly formatted request
201
-		if ( empty( $_POST['viewid'] ) || !is_numeric( $_POST['viewid'] ) ) {
201
+		if ( empty( $_POST[ 'viewid' ] ) || ! is_numeric( $_POST[ 'viewid' ] ) ) {
202 202
 			exit( false );
203 203
 		}
204 204
 
205 205
 		// Not valid request
206
-		if( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxaddshortcode' ) ) {
206
+		if ( empty( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxaddshortcode' ) ) {
207 207
 			exit( false );
208 208
 		}
209 209
 
210
-		$viewid = (int)$_POST['viewid'];
210
+		$viewid = (int)$_POST[ 'viewid' ];
211 211
 
212 212
 		// fetch form id assigned to the view
213 213
 		$formid = gravityview_get_form_id( $viewid );
Please login to merge, or discard this patch.
includes/class-admin-approve-entries.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		/** gf_entries page - entries table screen */
45 45
 
46 46
 		// capture bulk actions
47
-		add_action( 'gform_loaded', array( $this, 'process_bulk_action') );
47
+		add_action( 'gform_loaded', array( $this, 'process_bulk_action' ) );
48 48
 
49 49
 		// add hidden field with approve status
50 50
 		add_action( 'gform_entries_first_column_actions', array( $this, 'add_entry_approved_hidden_input' ), 1, 5 );
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) );
53 53
 
54 54
 		// adding styles and scripts
55
-		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') );
55
+		add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) );
56 56
 		// bypass Gravity Forms no-conflict mode
57 57
 		add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict_script' ) );
58 58
 		add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict_style' ) );
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		 * @param bool $show_filter_links True: show the "approved"/"disapproved" filter links. False: hide them.
82 82
 		 * @param array $form GF Form object of current form
83 83
 		 */
84
-		if( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
84
+		if ( false === apply_filters( 'gravityview/approve_entries/show_filter_links_entry_list', true, $form ) ) {
85 85
 			return $filter_links;
86 86
 		}
87 87
 
@@ -102,19 +102,19 @@  discard block
 block discarded – undo
102 102
 		$approved_count = $disapproved_count = 0;
103 103
 
104 104
 		// Only count if necessary
105
-		if( $include_counts ) {
106
-			$approved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
107
-			$disapproved_count = count( gravityview_get_entry_ids( $form['id'], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
105
+		if ( $include_counts ) {
106
+			$approved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_approved ) ) );
107
+			$disapproved_count = count( gravityview_get_entry_ids( $form[ 'id' ], array( 'status' => 'active', 'field_filters' => $field_filters_disapproved ) ) );
108 108
 		}
109 109
 
110
-		$filter_links[] = array(
110
+		$filter_links[ ] = array(
111 111
 			'id'            => 'gv_approved',
112 112
 			'field_filters' => $field_filters_approved,
113 113
 			'count'         => $approved_count,
114 114
 			'label'         => GravityView_Entry_Approval_Status::get_label( GravityView_Entry_Approval_Status::APPROVED ),
115 115
 		);
116 116
 
117
-		$filter_links[] = array(
117
+		$filter_links[ ] = array(
118 118
 			'id'            => 'gv_disapproved',
119 119
 			'field_filters' => $field_filters_disapproved,
120 120
 			'count'         => $disapproved_count,
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	function tooltips( $tooltips ) {
135 135
 
136
-		$tooltips['form_gravityview_fields'] = array(
137
-			'title' => __('GravityView Fields', 'gravityview'),
138
-			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview'),
136
+		$tooltips[ 'form_gravityview_fields' ] = array(
137
+			'title' => __( 'GravityView Fields', 'gravityview' ),
138
+			'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview' ),
139 139
 		);
140 140
 
141 141
 		return $tooltips;
@@ -246,15 +246,15 @@  discard block
 block discarded – undo
246 246
 
247 247
 		$gv_bulk_action = false;
248 248
 
249
-		if( version_compare( GFForms::$version, '2.0', '>=' ) ) {
250
-			$bulk_action = ( '-1' !== rgpost('action') ) ? rgpost('action') : rgpost('action2');
249
+		if ( version_compare( GFForms::$version, '2.0', '>=' ) ) {
250
+			$bulk_action = ( '-1' !== rgpost( 'action' ) ) ? rgpost( 'action' ) : rgpost( 'action2' );
251 251
 		} else {
252 252
 			// GF 1.9.x - Bulk action 2 is the bottom bulk action select form.
253
-			$bulk_action = rgpost('bulk_action') ? rgpost('bulk_action') : rgpost('bulk_action2');
253
+			$bulk_action = rgpost( 'bulk_action' ) ? rgpost( 'bulk_action' ) : rgpost( 'bulk_action2' );
254 254
 		}
255 255
 
256 256
 		// Check the $bulk_action value against GV actions, see if they're the same. I hate strpos().
257
-		if( ! empty( $bulk_action ) && preg_match( '/^('. implode( '|', $this->bulk_action_prefixes ) .')/ism', $bulk_action ) ) {
257
+		if ( ! empty( $bulk_action ) && preg_match( '/^(' . implode( '|', $this->bulk_action_prefixes ) . ')/ism', $bulk_action ) ) {
258 258
 			$gv_bulk_action = $bulk_action;
259 259
 		}
260 260
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		
280 280
 		// gforms_entry_list is the nonce that confirms we're on the right page
281 281
 		// gforms_update_note is sent when bulk editing entry notes. We don't want to process then.
282
-		if ( $bulk_action && rgpost('gforms_entry_list') && empty( $_POST['gforms_update_note'] ) ) {
282
+		if ( $bulk_action && rgpost( 'gforms_entry_list' ) && empty( $_POST[ 'gforms_update_note' ] ) ) {
283 283
 
284 284
 			check_admin_referer( 'gforms_entry_list', 'gforms_entry_list' );
285 285
 
@@ -297,13 +297,13 @@  discard block
 block discarded – undo
297 297
 			}
298 298
 
299 299
 			// All entries are set to be updated, not just the visible ones
300
-			if ( ! empty( $_POST['all_entries'] ) ) {
300
+			if ( ! empty( $_POST[ 'all_entries' ] ) ) {
301 301
 
302 302
 				// Convert the current entry search into GF-formatted search criteria
303 303
 				$search = array(
304
-					'search_field' => isset( $_POST['f'] ) ? $_POST['f'][0] : 0,
305
-					'search_value' => isset( $_POST['v'][0] ) ? $_POST['v'][0] : '',
306
-					'search_operator' => isset( $_POST['o'][0] ) ? $_POST['o'][0] : 'contains',
304
+					'search_field' => isset( $_POST[ 'f' ] ) ? $_POST[ 'f' ][ 0 ] : 0,
305
+					'search_value' => isset( $_POST[ 'v' ][ 0 ] ) ? $_POST[ 'v' ][ 0 ] : '',
306
+					'search_operator' => isset( $_POST[ 'o' ][ 0 ] ) ? $_POST[ 'o' ][ 0 ] : 'contains',
307 307
 				);
308 308
 
309 309
 				$search_criteria = GravityView_frontend::get_search_criteria( $search, $form_id );
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 			} else {
315 315
 
316 316
 				// Changed from 'lead' to 'entry' in 2.0
317
-				$entries = isset( $_POST['lead'] ) ? $_POST['lead'] : $_POST['entry'];
317
+				$entries = isset( $_POST[ 'lead' ] ) ? $_POST[ 'lead' ] : $_POST[ 'entry' ];
318 318
 
319 319
 			}
320 320
 
@@ -326,15 +326,15 @@  discard block
 block discarded – undo
326 326
 			$entry_count = count( $entries ) > 1 ? sprintf( __( '%d entries', 'gravityview' ), count( $entries ) ) : __( '1 entry', 'gravityview' );
327 327
 
328 328
 			switch ( $approved_status ) {
329
-				case $this->bulk_action_prefixes['approve']:
329
+				case $this->bulk_action_prefixes[ 'approve' ]:
330 330
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::APPROVED, $form_id );
331 331
 					$this->bulk_update_message = sprintf( __( '%s approved.', 'gravityview' ), $entry_count );
332 332
 					break;
333
-				case $this->bulk_action_prefixes['unapprove']:
333
+				case $this->bulk_action_prefixes[ 'unapprove' ]:
334 334
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::UNAPPROVED, $form_id );
335 335
 					$this->bulk_update_message = sprintf( __( '%s unapproved.', 'gravityview' ), $entry_count );
336 336
 					break;
337
-				case $this->bulk_action_prefixes['disapprove']:
337
+				case $this->bulk_action_prefixes[ 'disapprove' ]:
338 338
 					GravityView_Entry_Approval::update_bulk( $entries, GravityView_Entry_Approval_Status::DISAPPROVED, $form_id );
339 339
 					$this->bulk_update_message = sprintf( __( '%s disapproved.', 'gravityview' ), $entry_count );
340 340
 					break;
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      *
357 357
 	 * @return boolean True: It worked; False: it failed
358 358
 	 */
359
-	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) {
359
+	public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0 ) {
360 360
 		return GravityView_Entry_Approval::update_approved( $entry_id, $approved, $form_id, $approvedcolumn );
361 361
 	}
362 362
 
@@ -386,20 +386,20 @@  discard block
 block discarded – undo
386 386
 	 *
387 387
 	 * @return void
388 388
 	 */
389
-	static public function add_entry_approved_hidden_input(  $form_id, $field_id, $value, $entry, $query_string ) {
389
+	static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) {
390 390
 
391
-		if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry['id'] ) ) {
391
+		if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry[ 'id' ] ) ) {
392 392
 			return;
393 393
 		}
394 394
 
395
-		if( empty( $entry['id'] ) ) {
395
+		if ( empty( $entry[ 'id' ] ) ) {
396 396
 			return;
397 397
 		}
398 398
 
399 399
 		$status_value = GravityView_Entry_Approval::get_entry_status( $entry, 'value' );
400 400
 
401
-		if( $status_value ) {
402
-			echo '<input type="hidden" class="entry_approval" id="entry_approved_'. $entry['id'] .'" value="' . esc_attr( $status_value ) . '" />';
401
+		if ( $status_value ) {
402
+			echo '<input type="hidden" class="entry_approval" id="entry_approved_' . $entry[ 'id' ] . '" value="' . esc_attr( $status_value ) . '" />';
403 403
 		}
404 404
 	}
405 405
 
@@ -412,10 +412,10 @@  discard block
 block discarded – undo
412 412
 	 */
413 413
 	private function get_form_id() {
414 414
 
415
-		$form_id = GFForms::get('id');
415
+		$form_id = GFForms::get( 'id' );
416 416
 
417 417
 		// If there are no forms identified, use the first form. That's how GF does it.
418
-		if( empty( $form_id ) && class_exists('RGFormsModel') ) {
418
+		if ( empty( $form_id ) && class_exists( 'RGFormsModel' ) ) {
419 419
 			$form_id = $this->get_first_form_id();
420 420
 		}
421 421
 
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
 
436 436
 		$forms = RGFormsModel::get_forms( null, 'title' );
437 437
 
438
-		if( ! isset( $forms[0] ) ) {
438
+		if ( ! isset( $forms[ 0 ] ) ) {
439 439
 			do_action( 'gravityview_log_error', __METHOD__ . ': No forms were found' );
440 440
 			return 0;
441 441
 		}
442 442
 
443
-		$first_form = $forms[0];
443
+		$first_form = $forms[ 0 ];
444 444
 
445
-		$form_id = is_object( $forms[0] ) ? $first_form->id : $first_form['id'];
445
+		$form_id = is_object( $forms[ 0 ] ) ? $first_form->id : $first_form[ 'id' ];
446 446
 
447 447
 		return intval( $form_id );
448 448
 	}
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 
451 451
 	function add_scripts_and_styles( $hook ) {
452 452
 
453
-		if( ! class_exists( 'RGForms' ) ) {
453
+		if ( ! class_exists( 'RGForms' ) ) {
454 454
 
455 455
 			do_action( 'gravityview_log_error', 'GravityView_Admin_ApproveEntries[add_scripts_and_styles] RGForms does not exist.' );
456 456
 
@@ -459,25 +459,25 @@  discard block
 block discarded – undo
459 459
 
460 460
 		// enqueue styles & scripts gf_entries
461 461
 		// But only if we're on the main Entries page, not on reports pages
462
-		if( GFForms::get_page() !== 'entry_list' ) {
462
+		if ( GFForms::get_page() !== 'entry_list' ) {
463 463
 			return;
464 464
 		}
465 465
 
466 466
 		$form_id = $this->get_form_id();
467 467
 
468 468
 		// Things are broken; no forms were found
469
-		if( empty( $form_id ) ) {
469
+		if ( empty( $form_id ) ) {
470 470
 			return;
471 471
 		}
472 472
 
473
-		wp_enqueue_style( 'gravityview_entries_list', plugins_url('assets/css/admin-entries-list.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version );
473
+		wp_enqueue_style( 'gravityview_entries_list', plugins_url( 'assets/css/admin-entries-list.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version );
474 474
 
475
-		$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
475
+		$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
476 476
 
477
-		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url('assets/js/admin-entries-list'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version );
477
+		wp_enqueue_script( 'gravityview_gf_entries_scripts', plugins_url( 'assets/js/admin-entries-list' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version );
478 478
 
479 479
 		wp_localize_script( 'gravityview_gf_entries_scripts', 'gvGlobals', array(
480
-			'nonce' => wp_create_nonce( 'gravityview_entry_approval'),
480
+			'nonce' => wp_create_nonce( 'gravityview_entry_approval' ),
481 481
 			'form_id' => $form_id,
482 482
 			'show_column' => (int)$this->show_approve_entry_column( $form_id ),
483 483
 			'add_bulk_action' => (int)GVCommon::has_cap( 'gravityview_moderate_entries' ),
@@ -486,10 +486,10 @@  discard block
 block discarded – undo
486 486
 			'status_unapproved' => GravityView_Entry_Approval_Status::UNAPPROVED,
487 487
 			'bulk_actions' => $this->get_bulk_actions( $form_id ),
488 488
 			'bulk_message' => $this->bulk_update_message,
489
-			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('unapproved'),
490
-            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr('disapproved'),
491
-			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr('approved'),
492
-			'column_title' => __( 'Show entry in directory view?', 'gravityview'),
489
+			'unapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'unapproved' ),
490
+            'approve_title' => GravityView_Entry_Approval_Status::get_title_attr( 'disapproved' ),
491
+			'disapprove_title' => GravityView_Entry_Approval_Status::get_title_attr( 'approved' ),
492
+			'column_title' => __( 'Show entry in directory view?', 'gravityview' ),
493 493
 			'column_link' => esc_url( $this->get_sort_link( $form_id ) ),
494 494
 		) );
495 495
 
@@ -509,11 +509,11 @@  discard block
 block discarded – undo
509 509
 
510 510
 		$approved_column_id = self::get_approved_column( $form_id );
511 511
 
512
-		if( ! $approved_column_id ) {
512
+		if ( ! $approved_column_id ) {
513 513
 		    return '';
514 514
         }
515 515
 
516
-	    $order = ( 'desc' === rgget('order') ) ? 'asc' : 'desc';
516
+	    $order = ( 'desc' === rgget( 'order' ) ) ? 'asc' : 'desc';
517 517
 
518 518
 	    $args = array(
519 519
 		    'orderby' => $approved_column_id,
@@ -539,16 +539,16 @@  discard block
 block discarded – undo
539 539
 		$bulk_actions = array(
540 540
 			'GravityView' => array(
541 541
 				array(
542
-					'label' => GravityView_Entry_Approval_Status::get_string('approved', 'action'),
543
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['approve'], $form_id ),
542
+					'label' => GravityView_Entry_Approval_Status::get_string( 'approved', 'action' ),
543
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'approve' ], $form_id ),
544 544
 				),
545 545
 				array(
546
-					'label' => GravityView_Entry_Approval_Status::get_string('disapproved', 'action'),
547
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['disapprove'], $form_id ),
546
+					'label' => GravityView_Entry_Approval_Status::get_string( 'disapproved', 'action' ),
547
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'disapprove' ], $form_id ),
548 548
 				),
549 549
 				array(
550
-					'label' => GravityView_Entry_Approval_Status::get_string('unapproved', 'action'),
551
-					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes['unapprove'], $form_id ),
550
+					'label' => GravityView_Entry_Approval_Status::get_string( 'unapproved', 'action' ),
551
+					'value' => sprintf( '%s-%d', $this->bulk_action_prefixes[ 'unapprove' ], $form_id ),
552 552
 				),
553 553
 			),
554 554
 		);
@@ -565,8 +565,8 @@  discard block
 block discarded – undo
565 565
 		// Sanitize the values, just to be sure.
566 566
 		foreach ( $bulk_actions as $key => $group ) {
567 567
 			foreach ( $group as $i => $action ) {
568
-				$bulk_actions[ $key ][ $i ]['label'] = esc_html( $bulk_actions[ $key ][ $i ]['label'] );
569
-				$bulk_actions[ $key ][ $i ]['value'] = esc_attr( $bulk_actions[ $key ][ $i ]['value'] );
568
+				$bulk_actions[ $key ][ $i ][ 'label' ] = esc_html( $bulk_actions[ $key ][ $i ][ 'label' ] );
569
+				$bulk_actions[ $key ][ $i ][ 'value' ] = esc_attr( $bulk_actions[ $key ][ $i ][ 'value' ] );
570 570
 			}
571 571
 		}
572 572
 
@@ -591,13 +591,13 @@  discard block
 block discarded – undo
591 591
 		 * @since 1.7.2
592 592
 		 * @param boolean $hide_if_no_connections
593 593
 		 */
594
-		$hide_if_no_connections = apply_filters('gravityview/approve_entries/hide-if-no-connections', false );
594
+		$hide_if_no_connections = apply_filters( 'gravityview/approve_entries/hide-if-no-connections', false );
595 595
 
596
-		if( $hide_if_no_connections ) {
596
+		if ( $hide_if_no_connections ) {
597 597
 
598 598
 			$connected_views = gravityview_get_connected_views( $form_id );
599 599
 
600
-			if( empty( $connected_views ) ) {
600
+			if ( empty( $connected_views ) ) {
601 601
 				$show_approve_column = false;
602 602
 			}
603 603
 		}
@@ -607,18 +607,18 @@  discard block
 block discarded – undo
607 607
 		 * @param boolean $show_approve_column Whether the column will be shown
608 608
 		 * @param int $form_id The ID of the Gravity Forms form for which entries are being shown
609 609
 		 */
610
-		$show_approve_column = apply_filters('gravityview/approve_entries/show-column', $show_approve_column, $form_id );
610
+		$show_approve_column = apply_filters( 'gravityview/approve_entries/show-column', $show_approve_column, $form_id );
611 611
 
612 612
 		return $show_approve_column;
613 613
 	}
614 614
 
615 615
 	function register_gform_noconflict_script( $scripts ) {
616
-		$scripts[] = 'gravityview_gf_entries_scripts';
616
+		$scripts[ ] = 'gravityview_gf_entries_scripts';
617 617
 		return $scripts;
618 618
 	}
619 619
 
620 620
 	function register_gform_noconflict_style( $styles ) {
621
-		$styles[] = 'gravityview_entries_list';
621
+		$styles[ ] = 'gravityview_entries_list';
622 622
 		return $styles;
623 623
 	}
624 624
 
Please login to merge, or discard this patch.
includes/wordpress-widgets/class-gravityview-recent-entries-widget.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	function __construct( ) {
14 14
 
15
-		$name = __('GravityView Recent Entries', 'gravityview');
15
+		$name = __( 'GravityView Recent Entries', 'gravityview' );
16 16
 
17 17
 		$widget_options = array(
18 18
 			'description' => __( 'Display the most recent entries for a View', 'gravityview' ),
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 	private function initialize() {
27 27
 
28
-		add_action('admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts') );
28
+		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
29 29
 
30 30
 		add_action( 'wp_ajax_gv_get_view_merge_tag_data', array( $this, 'ajax_get_view_merge_tag_data' ) );
31 31
 
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	function ajax_get_view_merge_tag_data() {
40 40
 
41
-		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajax_widget' ) ) {
41
+		if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajax_widget' ) ) {
42 42
 			exit( false );
43 43
 		}
44 44
 
45
-		$form_id  = gravityview_get_form_id( $_POST['view_id'] );
45
+		$form_id = gravityview_get_form_id( $_POST[ 'view_id' ] );
46 46
 
47 47
 		$form = RGFormsModel::get_form_meta( $form_id );
48 48
 
49 49
 		$output = array(
50 50
 			'form' => array(
51
-				'id' => $form['id'],
52
-				'title' => $form['title'],
53
-				'fields' => $form['fields'],
51
+				'id' => $form[ 'id' ],
52
+				'title' => $form[ 'title' ],
53
+				'fields' => $form[ 'fields' ],
54 54
 			),
55
-			'mergeTags' => GFCommon::get_merge_tags( $form['fields'], '', false ),
55
+			'mergeTags' => GFCommon::get_merge_tags( $form[ 'fields' ], '', false ),
56 56
 		);
57 57
 
58 58
 		echo json_encode( $output );
@@ -68,19 +68,19 @@  discard block
 block discarded – undo
68 68
 	function admin_enqueue_scripts() {
69 69
 		global $pagenow;
70 70
 
71
-		if( $pagenow === 'widgets.php' ) {
71
+		if ( $pagenow === 'widgets.php' ) {
72 72
 
73
-			$script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
73
+			$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
74 74
 
75 75
 			GravityView_Admin_Views::enqueue_gravity_forms_scripts();
76 76
 
77
-			wp_enqueue_script( 'gravityview_widgets', plugins_url('assets/js/admin-widgets'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery', 'gform_gravityforms' ), GravityView_Plugin::version );
77
+			wp_enqueue_script( 'gravityview_widgets', plugins_url( 'assets/js/admin-widgets' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery', 'gform_gravityforms' ), GravityView_Plugin::version );
78 78
 
79 79
 			wp_localize_script( 'gravityview_widgets', 'GVWidgets', array(
80 80
 				'nonce' => wp_create_nonce( 'gravityview_ajax_widget' )
81
-			));
81
+			) );
82 82
 
83
-			wp_enqueue_style( 'gravityview_views_styles', plugins_url('assets/css/admin-views.css', GRAVITYVIEW_FILE), array('dashicons' ), GravityView_Plugin::version );
83
+			wp_enqueue_style( 'gravityview_views_styles', plugins_url( 'assets/css/admin-views.css', GRAVITYVIEW_FILE ), array( 'dashicons' ), GravityView_Plugin::version );
84 84
 		}
85 85
 
86 86
 	}
@@ -95,19 +95,19 @@  discard block
 block discarded – undo
95 95
 	function widget( $args, $instance ) {
96 96
 
97 97
 		// Don't have the Customizer render too soon.
98
-		if( empty( $instance['view_id'] ) ) {
98
+		if ( empty( $instance[ 'view_id' ] ) ) {
99 99
 			return;
100 100
 		}
101 101
 
102
-		$args['id']        = ( isset( $args['id'] ) ) ? $args['id'] : 'gv_recent_entries';
103
-		$instance['title'] = ( isset( $instance['title'] ) ) ? $instance['title'] : '';
102
+		$args[ 'id' ]        = ( isset( $args[ 'id' ] ) ) ? $args[ 'id' ] : 'gv_recent_entries';
103
+		$instance[ 'title' ] = ( isset( $instance[ 'title' ] ) ) ? $instance[ 'title' ] : '';
104 104
 
105
-		$title = apply_filters( 'widget_title', $instance[ 'title' ], $instance, $args['id'] );
105
+		$title = apply_filters( 'widget_title', $instance[ 'title' ], $instance, $args[ 'id' ] );
106 106
 
107
-		echo $args['before_widget'];
107
+		echo $args[ 'before_widget' ];
108 108
 
109
-		if ( !empty( $title ) ) {
110
-			echo $args['before_title'] . $title . $args['after_title'];
109
+		if ( ! empty( $title ) ) {
110
+			echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
111 111
 		}
112 112
 
113 113
 		/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		 */
128 128
 		do_action( 'gravityview/widget/recent-entries/after_widget', $args, $instance );
129 129
 
130
-		echo $args['after_widget'];
130
+		echo $args[ 'after_widget' ];
131 131
 	}
132 132
 
133 133
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	private function get_output( $instance ) {
143 143
 
144
-		$form_id = gravityview_get_form_id( $instance['view_id'] );
144
+		$form_id = gravityview_get_form_id( $instance[ 'view_id' ] );
145 145
 
146 146
 		$form = gravityview_get_form( $form_id );
147 147
 
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
 		 * @since 1.6.1
152 152
 		 * @var int $entry_link_post_id The ID to use as the parent post for the entry
153 153
 		 */
154
-		$entry_link_post_id = ( empty( $instance['error_post_id'] ) && !empty( $instance['post_id'] ) ) ? $instance['post_id'] : $instance['view_id'];
154
+		$entry_link_post_id = ( empty( $instance[ 'error_post_id' ] ) && ! empty( $instance[ 'post_id' ] ) ) ? $instance[ 'post_id' ] : $instance[ 'view_id' ];
155 155
 
156 156
 		/**
157 157
 		 * Generate list output
158 158
 		 * @since 1.7.2
159 159
 		 */
160
-		$List = new GravityView_Entry_List( $entries, $entry_link_post_id, $form, $instance['link_format'], $instance['after_link'], 'recent-entries-widget' );
160
+		$List = new GravityView_Entry_List( $entries, $entry_link_post_id, $form, $instance[ 'link_format' ], $instance[ 'after_link' ], 'recent-entries-widget' );
161 161
 
162 162
 		$output = $List->get_output();
163 163
 
@@ -182,30 +182,30 @@  discard block
 block discarded – undo
182 182
 	private function get_entries( $instance, $form_id ) {
183 183
 
184 184
 		// Get the settings for the View ID
185
-		$view_settings = gravityview_get_template_settings( $instance['view_id'] );
185
+		$view_settings = gravityview_get_template_settings( $instance[ 'view_id' ] );
186 186
 
187 187
         // Set the context view ID to avoid conflicts with the Advanced Filter extension.
188
-        $criteria['context_view_id'] = $instance['view_id'];
188
+        $criteria[ 'context_view_id' ] = $instance[ 'view_id' ];
189 189
 
190
-		$instance['limit'] = isset( $instance['limit'] ) ? $instance['limit'] : 10;
191
-		$view_settings['id'] = $instance['view_id'];
192
-		$view_settings['page_size'] = $instance['limit'];
190
+		$instance[ 'limit' ] = isset( $instance[ 'limit' ] ) ? $instance[ 'limit' ] : 10;
191
+		$view_settings[ 'id' ] = $instance[ 'view_id' ];
192
+		$view_settings[ 'page_size' ] = $instance[ 'limit' ];
193 193
 
194 194
 		// Prepare paging criteria
195
-		$criteria['paging'] = array(
195
+		$criteria[ 'paging' ] = array(
196 196
 			'offset' => 0,
197
-			'page_size' => $instance['limit']
197
+			'page_size' => $instance[ 'limit' ]
198 198
 		);
199 199
 
200 200
 		// Prepare Search Criteria
201
-		$criteria['search_criteria'] = array( 'field_filters' => array() );
202
-		$criteria['search_criteria'] = GravityView_frontend::process_search_only_approved( $view_settings, $criteria['search_criteria']);
203
-		$criteria['search_criteria']['status'] = apply_filters( 'gravityview_status', 'active', $view_settings );
201
+		$criteria[ 'search_criteria' ] = array( 'field_filters' => array() );
202
+		$criteria[ 'search_criteria' ] = GravityView_frontend::process_search_only_approved( $view_settings, $criteria[ 'search_criteria' ] );
203
+		$criteria[ 'search_criteria' ][ 'status' ] = apply_filters( 'gravityview_status', 'active', $view_settings );
204 204
 
205 205
 		/**
206 206
 		 * Modify the search parameters before the entries are fetched
207 207
 		 */
208
-		$criteria = apply_filters('gravityview/widget/recent-entries/criteria', $criteria, $instance, $form_id );
208
+		$criteria = apply_filters( 'gravityview/widget/recent-entries/criteria', $criteria, $instance, $form_id );
209 209
 
210 210
 		$results = GVCommon::get_entries( $form_id, $criteria );
211 211
 
@@ -226,23 +226,23 @@  discard block
 block discarded – undo
226 226
 		$instance = $new_instance;
227 227
 
228 228
 		// Force positive number
229
-		$instance['limit'] = empty( $instance['limit'] ) ? 10 : absint( $instance['limit'] );
229
+		$instance[ 'limit' ] = empty( $instance[ 'limit' ] ) ? 10 : absint( $instance[ 'limit' ] );
230 230
 
231
-		$instance['view_id'] = intval( $instance['view_id'] );
231
+		$instance[ 'view_id' ] = intval( $instance[ 'view_id' ] );
232 232
 
233
-		$instance['link_format'] = trim( rtrim( $instance['link_format'] ) );
233
+		$instance[ 'link_format' ] = trim( rtrim( $instance[ 'link_format' ] ) );
234 234
 
235
-		$instance['link_format'] = empty( $instance['link_format'] ) ? $old_instance['link_format'] : $instance['link_format'];
235
+		$instance[ 'link_format' ] = empty( $instance[ 'link_format' ] ) ? $old_instance[ 'link_format' ] : $instance[ 'link_format' ];
236 236
 
237
-		$instance['post_id'] = empty( $instance['post_id'] ) ? '' : intval( $instance['post_id'] );
237
+		$instance[ 'post_id' ] = empty( $instance[ 'post_id' ] ) ? '' : intval( $instance[ 'post_id' ] );
238 238
 
239
-		$is_valid_embed_id = GravityView_View_Data::is_valid_embed_id( $instance['post_id'], $instance['view_id'] );
239
+		$is_valid_embed_id = GravityView_View_Data::is_valid_embed_id( $instance[ 'post_id' ], $instance[ 'view_id' ] );
240 240
 
241 241
 		//check if post_id is a valid post with embedded View
242
-		$instance['error_post_id'] = is_wp_error( $is_valid_embed_id ) ? $is_valid_embed_id->get_error_message() : NULL;
242
+		$instance[ 'error_post_id' ] = is_wp_error( $is_valid_embed_id ) ? $is_valid_embed_id->get_error_message() : NULL;
243 243
 
244 244
 		// Share that the widget isn't brand new
245
-		$instance['updated']  = 1;
245
+		$instance[ 'updated' ] = 1;
246 246
 
247 247
 		/**
248 248
 		 * Modify the updated instance. This will allow for validating any added instance settings externally.
@@ -264,22 +264,22 @@  discard block
 block discarded – undo
264 264
 
265 265
 		// Set up some default widget settings.
266 266
 		$defaults = array(
267
-			'title' 			=> __('Recent Entries', 'gravityview'),
267
+			'title' 			=> __( 'Recent Entries', 'gravityview' ),
268 268
 			'view_id'           => NULL,
269 269
 			'post_id'           => NULL,
270 270
 			'limit'            => 10,
271
-			'link_format'       => __('Entry #{entry_id}', 'gravityview'),
271
+			'link_format'       => __( 'Entry #{entry_id}', 'gravityview' ),
272 272
 			'after_link'        => ''
273 273
 		);
274 274
 
275
-		$instance = wp_parse_args( (array) $instance, $defaults );
275
+		$instance = wp_parse_args( (array)$instance, $defaults );
276 276
 
277 277
 		?>
278 278
 
279 279
 		<!-- Title -->
280 280
 		<p>
281 281
 			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'gravityview' ) ?></label>
282
-			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
282
+			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance[ 'title' ] ); ?>" />
283 283
 		</p>
284 284
 
285 285
 		<!-- Download -->
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 		$views = get_posts( $args );
293 293
 
294 294
 		// If there are no views set up yet, we get outta here.
295
-		if( empty( $views ) ) {
295
+		if ( empty( $views ) ) {
296 296
 			echo '<div id="select_gravityview_view"><div class="wrap">' . GravityView_Admin::no_views_text() . '</div></div>';
297 297
 			return;
298 298
 		}
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
 		 * Display errors generated for invalid embed IDs
305 305
 		 * @see GravityView_View_Data::is_valid_embed_id
306 306
 		 */
307
-		if( isset( $instance['updated'] ) && empty( $instance['view_id'] ) ) {
307
+		if ( isset( $instance[ 'updated' ] ) && empty( $instance[ 'view_id' ] ) ) {
308 308
 			?>
309 309
 			<div class="error inline hide-on-view-change">
310
-				<p><?php esc_html_e('Please select a View to search.', 'gravityview'); ?></p>
310
+				<p><?php esc_html_e( 'Please select a View to search.', 'gravityview' ); ?></p>
311 311
 			</div>
312 312
 			<?php
313 313
 			unset ( $error );
@@ -315,14 +315,14 @@  discard block
 block discarded – undo
315 315
 		?>
316 316
 
317 317
 		<p>
318
-			<label for="<?php echo esc_attr( $this->get_field_id( 'view_id' ) ); ?>"><?php esc_html_e('Select a View', 'gravityview'); ?></label>
318
+			<label for="<?php echo esc_attr( $this->get_field_id( 'view_id' ) ); ?>"><?php esc_html_e( 'Select a View', 'gravityview' ); ?></label>
319 319
 			<select class="widefat gv-recent-entries-select-view" name="<?php echo esc_attr( $this->get_field_name( 'view_id' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'view_id' ) ); ?>">
320 320
 				<option value=""><?php esc_html_e( '&mdash; Select a View as Entries Source &mdash;', 'gravityview' ); ?></option>
321 321
 				<?php
322 322
 
323
-				foreach( $views as $view ) {
324
-					$title = empty( $view->post_title ) ? __('(no title)', 'gravityview') : $view->post_title;
325
-					echo '<option value="'. $view->ID .'"'.selected( absint( $instance['view_id'] ), $view->ID ).'>'. esc_html( sprintf('%s #%d', $title, $view->ID ) ) .'</option>';
323
+				foreach ( $views as $view ) {
324
+					$title = empty( $view->post_title ) ? __( '(no title)', 'gravityview' ) : $view->post_title;
325
+					echo '<option value="' . $view->ID . '"' . selected( absint( $instance[ 'view_id' ] ), $view->ID ) . '>' . esc_html( sprintf( '%s #%d', $title, $view->ID ) ) . '</option>';
326 326
 				}
327 327
 
328 328
 				?>
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
 		 * Display errors generated for invalid embed IDs
335 335
 		 * @see GravityView_View_Data::is_valid_embed_id
336 336
 		 */
337
-		if( !empty( $instance['error_post_id'] ) ) {
337
+		if ( ! empty( $instance[ 'error_post_id' ] ) ) {
338 338
 			?>
339 339
 			<div class="error inline">
340
-				<p><?php echo $instance['error_post_id']; ?></p>
340
+				<p><?php echo $instance[ 'error_post_id' ]; ?></p>
341 341
 			</div>
342 342
 			<?php
343 343
 			unset ( $error );
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
 		?>
346 346
 
347 347
 		<p>
348
-			<label for="<?php echo $this->get_field_id('post_id'); ?>"><?php esc_html_e( 'If Embedded, Page ID:', 'gravityview' ); ?></label>
349
-			<input class="code" size="3" id="<?php echo $this->get_field_id('post_id'); ?>" name="<?php echo $this->get_field_name('post_id'); ?>" type="text" value="<?php echo esc_attr( $instance['post_id'] ); ?>" />
348
+			<label for="<?php echo $this->get_field_id( 'post_id' ); ?>"><?php esc_html_e( 'If Embedded, Page ID:', 'gravityview' ); ?></label>
349
+			<input class="code" size="3" id="<?php echo $this->get_field_id( 'post_id' ); ?>" name="<?php echo $this->get_field_name( 'post_id' ); ?>" type="text" value="<?php echo esc_attr( $instance[ 'post_id' ] ); ?>" />
350 350
 			<span class="howto"><?php
351
-				esc_html_e('To have a search performed on an embedded View, enter the ID of the post or page where the View is embedded.', 'gravityview' );
352
-				echo ' '.gravityview_get_link('http://docs.gravityview.co/article/222-the-search-widget', __('Learn more&hellip;', 'gravityview' ), 'target=_blank' );
351
+				esc_html_e( 'To have a search performed on an embedded View, enter the ID of the post or page where the View is embedded.', 'gravityview' );
352
+				echo ' ' . gravityview_get_link( 'http://docs.gravityview.co/article/222-the-search-widget', __( 'Learn more&hellip;', 'gravityview' ), 'target=_blank' );
353 353
 				?></span>
354 354
 		</p>
355 355
 
@@ -357,21 +357,21 @@  discard block
 block discarded – undo
357 357
 			<label for="<?php echo $this->get_field_id( 'limit' ); ?>">
358 358
 				<span><?php _e( 'Number of entries to show:', 'gravityview' ); ?></span>
359 359
 			</label>
360
-			<input class="code" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="number" value="<?php echo intval( $instance['limit'] ); ?>" size="3" />
360
+			<input class="code" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="number" value="<?php echo intval( $instance[ 'limit' ] ); ?>" size="3" />
361 361
 		</p>
362 362
 
363 363
 		<p>
364 364
 			<label for="<?php echo $this->get_field_id( 'link_format' ); ?>">
365 365
 				<span><?php _e( 'Entry link text (required)', 'gravityview' ); ?></span>
366 366
 			</label>
367
-			<input id="<?php echo $this->get_field_id( 'link_format' ); ?>" name="<?php echo $this->get_field_name( 'link_format' ); ?>" type="text" value="<?php echo esc_attr( $instance['link_format'] ); ?>" class="widefat merge-tag-support mt-position-right mt-hide_all_fields" />
367
+			<input id="<?php echo $this->get_field_id( 'link_format' ); ?>" name="<?php echo $this->get_field_name( 'link_format' ); ?>" type="text" value="<?php echo esc_attr( $instance[ 'link_format' ] ); ?>" class="widefat merge-tag-support mt-position-right mt-hide_all_fields" />
368 368
 		</p>
369 369
 
370 370
 		<p>
371 371
 			<label for="<?php echo $this->get_field_id( 'after_link' ); ?>">
372 372
 				<span><?php _e( 'Text or HTML to display after the link (optional)', 'gravityview' ); ?></span>
373 373
 			</label>
374
-			<textarea id="<?php echo $this->get_field_id( 'after_link' ); ?>" name="<?php echo $this->get_field_name( 'after_link' ); ?>" rows="5" class="widefat code merge-tag-support mt-position-right mt-hide_all_fields"><?php echo esc_textarea( $instance['after_link'] ); ?></textarea>
374
+			<textarea id="<?php echo $this->get_field_id( 'after_link' ); ?>" name="<?php echo $this->get_field_name( 'after_link' ); ?>" rows="5" class="widefat code merge-tag-support mt-position-right mt-hide_all_fields"><?php echo esc_textarea( $instance[ 'after_link' ] ); ?></textarea>
375 375
 		</p>
376 376
 
377 377
 		<?php
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 		 * @param GravityView_Recent_Entries_Widget $this WP_Widget object
382 382
 		 * @param array $instance Current widget instance
383 383
 		 */
384
-		do_action( 'gravityview_recent_entries_widget_form' , $this, $instance );
384
+		do_action( 'gravityview_recent_entries_widget_form', $this, $instance );
385 385
 
386 386
 		?>
387 387
 
Please login to merge, or discard this patch.
includes/class-gravityview-entry-approval-status.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
 		$new_value = $old_value;
114 114
 
115 115
 		// Meta value does not exist yet
116
-		if( false === $old_value ) {
116
+		if ( false === $old_value ) {
117 117
 			return self::UNAPPROVED;
118 118
 		}
119 119
 
120 120
 		// Meta value does not exist yet
121
-		if( true === $old_value ) {
121
+		if ( true === $old_value ) {
122 122
 			return self::APPROVED;
123 123
 		}
124 124
 
125
-		switch ( (string) $old_value ) {
125
+		switch ( (string)$old_value ) {
126 126
 
127 127
 			// Approved values
128 128
 			case 'Approved':
@@ -247,9 +247,9 @@  discard block
 block discarded – undo
247 247
 		foreach ( $choices as $key => $choice ) {
248 248
 
249 249
 			// Is the passed status value the same as the choice value or key?
250
-			if ( $status === $choice['value'] || $status === $key ) {
250
+			if ( $status === $choice[ 'value' ] || $status === $key ) {
251 251
 
252
-				if( 'key' === $attr_key ) {
252
+				if ( 'key' === $attr_key ) {
253 253
 					return $key;
254 254
 				} else {
255 255
 					return rgar( $choice, $attr_key, false );
Please login to merge, or discard this patch.
includes/class-post-types.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		// Load even when invalid to allow for export
20 20
 		add_action( 'init', array( 'GravityView_Post_Types', 'init_post_types' ) );
21 21
 
22
-		if( GravityView_Compatibility::is_valid() ) {
22
+		if ( GravityView_Compatibility::is_valid() ) {
23 23
 			add_action( 'init', array( 'GravityView_Post_Types', 'init_rewrite' ) );
24 24
 		}
25 25
 	}
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 
44 44
 		$supports = array( 'title', 'revisions' );
45 45
 
46
-		if( $is_hierarchical ) {
47
-			$supports[] = 'page-attributes';
46
+		if ( $is_hierarchical ) {
47
+			$supports[ ] = 'page-attributes';
48 48
 		}
49 49
 
50 50
 		/**
Please login to merge, or discard this patch.