Completed
Pull Request — master (#798)
by Zack
06:40 queued 03:29
created
includes/extensions/edit-entry/class-edit-entry-user-registration.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -171,11 +171,13 @@
 block discarded – undo
171 171
         $public_display['nickname']  = $profileuser->nickname;
172 172
         $public_display['username']  = $profileuser->user_login;
173 173
 
174
-        if ( !empty($profileuser->first_name) )
175
-            $public_display['firstname'] = $profileuser->first_name;
174
+        if ( !empty($profileuser->first_name) ) {
175
+                    $public_display['firstname'] = $profileuser->first_name;
176
+        }
176 177
 
177
-        if ( !empty($profileuser->last_name) )
178
-            $public_display['lastname'] = $profileuser->last_name;
178
+        if ( !empty($profileuser->last_name) ) {
179
+                    $public_display['lastname'] = $profileuser->last_name;
180
+        }
179 181
 
180 182
         if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) {
181 183
             $public_display['firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	     * @since 1.11
53 53
 	     * @param boolean $boolean Whether to trigger update on user registration (default: true)
54 54
 	     */
55
-	    if( apply_filters( 'gravityview/edit_entry/user_registration/trigger_update', true ) ) {
55
+	    if ( apply_filters( 'gravityview/edit_entry/user_registration/trigger_update', true ) ) {
56 56
 
57
-	    	add_action( 'gravityview/edit_entry/after_update' , array( $this, 'update_user' ), 10, 2 );
57
+	    	add_action( 'gravityview/edit_entry/after_update', array( $this, 'update_user' ), 10, 2 );
58 58
 
59 59
 		    // last resort in case the current user display name don't match any of the defaults
60 60
 		    add_action( 'gform_user_updated', array( $this, 'restore_display_name' ), 10, 4 );
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function update_user( $form = array(), $entry_id = 0 ) {
74 74
 
75
-        if( ! class_exists( 'GFAPI' ) || ! class_exists( 'GF_User_Registration' ) || empty( $entry_id ) ) {
75
+        if ( ! class_exists( 'GFAPI' ) || ! class_exists( 'GF_User_Registration' ) || empty( $entry_id ) ) {
76 76
             return;
77 77
         }
78 78
 
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
          */
102 102
         $preserve_role = apply_filters( 'gravityview/edit_entry/user_registration/preserve_role', true, $config, $form, $entry );
103 103
 
104
-        if( $preserve_role ) {
105
-            $config['meta']['role'] = 'gfur_preserve_role';
104
+        if ( $preserve_role ) {
105
+            $config[ 'meta' ][ 'role' ] = 'gfur_preserve_role';
106 106
         }
107 107
 
108 108
         /**
109 109
          * Make sure the current display name is not changed with the update user method.
110 110
          * @since 1.15
111 111
          */
112
-        $config['meta']['displayname'] = $this->match_current_display_name( $entry['created_by'] );
112
+        $config[ 'meta' ][ 'displayname' ] = $this->match_current_display_name( $entry[ 'created_by' ] );
113 113
 
114 114
 
115 115
         /**
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 	    }
129 129
 
130 130
 	    // If an Update feed, make sure the conditions are met.
131
-	    if( rgars( $config, 'meta/feedType' ) === 'update' ) {
132
-	    	if( ! $gf_user_registration->is_feed_condition_met( $config, $form, $entry ) ) {
131
+	    if ( rgars( $config, 'meta/feedType' ) === 'update' ) {
132
+	    	if ( ! $gf_user_registration->is_feed_condition_met( $config, $form, $entry ) ) {
133 133
 			    return;
134 134
 		    }
135 135
 	    }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
         // In case we can't find the current display name format, or it is the 'nickname' format (which Gravity Forms doesn't support)
166 166
         //   trigger last resort method at the 'gform_user_updated' hook
167
-        if( false === $format || 'nickname' === $format ) {
167
+        if ( false === $format || 'nickname' === $format ) {
168 168
             $this->_user_before_update = $user;
169 169
             $format = 'nickname';
170 170
         }
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
     public function generate_display_names( $profileuser ) {
185 185
 
186 186
         $public_display = array();
187
-        $public_display['nickname']  = $profileuser->nickname;
188
-        $public_display['username']  = $profileuser->user_login;
187
+        $public_display[ 'nickname' ]  = $profileuser->nickname;
188
+        $public_display[ 'username' ]  = $profileuser->user_login;
189 189
 
190
-        if ( !empty($profileuser->first_name) )
191
-            $public_display['firstname'] = $profileuser->first_name;
190
+        if ( ! empty( $profileuser->first_name ) )
191
+            $public_display[ 'firstname' ] = $profileuser->first_name;
192 192
 
193
-        if ( !empty($profileuser->last_name) )
194
-            $public_display['lastname'] = $profileuser->last_name;
193
+        if ( ! empty( $profileuser->last_name ) )
194
+            $public_display[ 'lastname' ] = $profileuser->last_name;
195 195
 
196
-        if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) {
197
-            $public_display['firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name;
198
-            $public_display['lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name;
196
+        if ( ! empty( $profileuser->first_name ) && ! empty( $profileuser->last_name ) ) {
197
+            $public_display[ 'firstlast' ] = $profileuser->first_name . ' ' . $profileuser->last_name;
198
+            $public_display[ 'lastfirst' ] = $profileuser->last_name . ' ' . $profileuser->first_name;
199 199
         }
200 200
 
201 201
         $public_display = array_map( 'trim', $public_display );
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
          */
226 226
         $restore_display_name = apply_filters( 'gravityview/edit_entry/restore_display_name', true );
227 227
 
228
-        $is_update_feed = ( $config && rgars( $config, 'meta/feed_type') === 'update' );
228
+        $is_update_feed = ( $config && rgars( $config, 'meta/feed_type' ) === 'update' );
229 229
 
230 230
         /**
231 231
          * Don't restore display name:
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
          *   - or we don't need as we found the correct format before updating user.
235 235
          * @since 1.14.4
236 236
          */
237
-        if( ! $restore_display_name || $is_update_feed || is_null( $this->_user_before_update ) ) {
237
+        if ( ! $restore_display_name || $is_update_feed || is_null( $this->_user_before_update ) ) {
238 238
             return;
239 239
         }
240 240
 
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 
261 261
         $updated = wp_update_user( $restored_user );
262 262
 
263
-        if( is_wp_error( $updated ) ) {
264
-            do_action('gravityview_log_error', __METHOD__ . sprintf( ' - There was an error updating user #%d details', $user_id ), $updated );
263
+        if ( is_wp_error( $updated ) ) {
264
+            do_action( 'gravityview_log_error', __METHOD__ . sprintf( ' - There was an error updating user #%d details', $user_id ), $updated );
265 265
         } else {
266
-            do_action('gravityview_log_debug', __METHOD__ . sprintf( ' - User #%d details restored', $user_id ) );
266
+            do_action( 'gravityview_log_debug', __METHOD__ . sprintf( ' - User #%d details restored', $user_id ) );
267 267
         }
268 268
 
269 269
         $this->_user_before_update = null;
Please login to merge, or discard this patch.
includes/class-admin-welcome.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 //set_site_transient( 'update_plugins', null );
5 5
 
6 6
 // Exit if accessed directly
7
-if ( ! defined( 'ABSPATH' ) ) exit;
7
+if ( ! defined( 'ABSPATH' ) ) {
8
+	exit;
9
+}
8 10
 
9 11
 /**
10 12
  * Allows plugins to use their own update API.
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	 * @since 1.0
35 35
 	 */
36 36
 	public function __construct() {
37
-		add_action( 'admin_menu', array( $this, 'admin_menus'), 200 );
37
+		add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 );
38 38
 		add_action( 'admin_head', array( $this, 'admin_head' ) );
39
-		add_action( 'admin_init', array( $this, 'welcome'    ) );
40
-		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 );
39
+		add_action( 'admin_init', array( $this, 'welcome' ) );
40
+		add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 );
41 41
 	}
42 42
 
43 43
 	/**
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 		// Add help page to GravityView menu
54 54
 		add_submenu_page(
55 55
 			'edit.php?post_type=gravityview',
56
-			__('GravityView: Getting Started', 'gravityview'),
57
-			__('Getting Started', 'gravityview'),
56
+			__( 'GravityView: Getting Started', 'gravityview' ),
57
+			__( 'Getting Started', 'gravityview' ),
58 58
 			$this->minimum_capability,
59 59
 			'gv-getting-started',
60 60
 			array( $this, 'getting_started_screen' )
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return boolean  $is_page   True: yep; false: nope
89 89
 	 */
90
-	public function is_dashboard_page($is_page = false, $hook = NULL) {
90
+	public function is_dashboard_page( $is_page = false, $hook = NULL ) {
91 91
 		global $plugin_page;
92 92
 
93
-		if($is_page) { return $is_page; }
93
+		if ( $is_page ) { return $is_page; }
94 94
 
95 95
 		return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) );
96 96
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' );
109 109
 		remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' );
110 110
 
111
-		if( !$this->is_dashboard_page() ) { return; }
111
+		if ( ! $this->is_dashboard_page() ) { return; }
112 112
 
113 113
 		?>
114 114
 		<style type="text/css" media="screen">
@@ -141,20 +141,20 @@  discard block
 block discarded – undo
141 141
 		// Don't fetch -beta, etc.
142 142
 		list( $display_version ) = explode( '-', GravityView_Plugin::version );
143 143
 
144
-		$selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
144
+		$selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started';
145 145
 		?>
146 146
 
147 147
 		<h1><img class="alignleft" src="<?php echo plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ); ?>" width="100" height="132" /><?php printf( esc_html__( 'Welcome to GravityView %s', 'gravityview' ), $display_version ); ?></h1>
148 148
 		<div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div>
149 149
 
150 150
 		<h2 class="nav-tab-wrapper clear">
151
-			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
151
+			<a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
152 152
 				<?php _e( "Getting Started", 'gravityview' ); ?>
153 153
 			</a>
154
-			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
154
+			<a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
155 155
 				<?php _e( "List of Changes", 'gravityview' ); ?>
156 156
 			</a>
157
-			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>">
157
+			<a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>">
158 158
 				<?php _e( 'Credits', 'gravityview' ); ?>
159 159
 			</a>
160 160
 		</h2>
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 					<h2>Create a View</h2>
191 191
 
192 192
 					<ol class="ol-decimal">
193
-						<li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views &gt; New View</a></li>
193
+						<li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views &gt; New View</a></li>
194 194
 						<li>If you want to <strong>create a new form</strong>, click the "Start Fresh" button</li>
195 195
 						<li>If you want to <strong>use an existing form&rsquo;s entries</strong>, select from the dropdown.</li>
196 196
 						<li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>.
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 					</ul>
526 526
 
527 527
 					<h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4>
528
-					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
528
+					<p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p>
529 529
 				</div>
530 530
 			</div>
531 531
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		global $plugin_page;
566 566
 
567 567
 		// Bail if we're just editing the plugin
568
-		if( $plugin_page === 'plugin-editor.php' ) { return; }
568
+		if ( $plugin_page === 'plugin-editor.php' ) { return; }
569 569
 
570 570
 		// Bail if no activation redirect
571 571
 		if ( ! get_transient( '_gv_activation_redirect' ) ) { return; }
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 		$upgrade = get_option( 'gv_version_upgraded_from' );
577 577
 
578 578
 		// Don't do anything if they've already seen the new version info
579
-		if( $upgrade === GravityView_Plugin::version ) {
579
+		if ( $upgrade === GravityView_Plugin::version ) {
580 580
 			return;
581 581
 		}
582 582
 
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
 		update_option( 'gv_version_upgraded_from', GravityView_Plugin::version );
585 585
 
586 586
 		// Bail if activating from network, or bulk
587
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
587
+		if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; }
588 588
 
589 589
 		// First time install
590
-		if( ! $upgrade ) {
590
+		if ( ! $upgrade ) {
591 591
 			wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit;
592 592
 		}
593 593
 		// Update
Please login to merge, or discard this patch.
gravityview.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      * @param mixed $data Additional data to display
352 352
      * @return void
353 353
      */
354
-    public static function log_debug( $message, $data = null ){
354
+    public static function log_debug( $message, $data = null ) {
355 355
 	    /**
356 356
 	     * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
357 357
 	     * @param string $message Message to display
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
      * @param  string $message log message
366 366
      * @return void
367 367
      */
368
-    public static function log_error( $message, $data = null ){
368
+    public static function log_error( $message, $data = null ) {
369 369
 	    /**
370 370
 	     * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output
371 371
 	     * @param string $message Error message to display
Please login to merge, or discard this 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-ajax.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		 * Don't exit if we're running test suite.
37 37
 		 * @since 1.15
38 38
 		 */
39
-		if( defined( 'DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) {
39
+		if ( defined( 'DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) {
40 40
 			return $mixed;
41 41
 		}
42 42
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * @return void
51 51
 	 */
52 52
 	function check_ajax_nonce() {
53
-		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxviews' ) ) {
53
+		if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxviews' ) ) {
54 54
 			$this->_exit( false );
55 55
 		}
56 56
 	}
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 		//check nonce
68 68
 		$this->check_ajax_nonce();
69 69
 
70
-		$context = isset($_POST['context']) ? esc_attr( $_POST['context'] ) : 'directory';
70
+		$context = isset( $_POST[ 'context' ] ) ? esc_attr( $_POST[ 'context' ] ) : 'directory';
71 71
 
72 72
 		// If Form was changed, JS sends form ID, if start fresh, JS sends template_id
73
-		if( !empty( $_POST['form_id'] ) ) {
74
-			do_action( 'gravityview_render_available_fields', (int) $_POST['form_id'], $context );
73
+		if ( ! empty( $_POST[ 'form_id' ] ) ) {
74
+			do_action( 'gravityview_render_available_fields', (int)$_POST[ 'form_id' ], $context );
75 75
 			$this->_exit();
76
-		} elseif( !empty( $_POST['template_id'] ) ) {
77
-			$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
76
+		} elseif ( ! empty( $_POST[ 'template_id' ] ) ) {
77
+			$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
78 78
 			do_action( 'gravityview_render_available_fields', $form, $context );
79 79
 			$this->_exit();
80 80
 		}
@@ -94,17 +94,17 @@  discard block
 block discarded – undo
94 94
 	function get_active_areas() {
95 95
 		$this->check_ajax_nonce();
96 96
 
97
-		if( empty( $_POST['template_id'] ) ) {
97
+		if ( empty( $_POST[ 'template_id' ] ) ) {
98 98
 			$this->_exit( false );
99 99
 		}
100 100
 
101 101
 		ob_start();
102
-		do_action( 'gravityview_render_directory_active_areas', $_POST['template_id'], 'directory', '', true );
103
-		$response['directory'] = ob_get_clean();
102
+		do_action( 'gravityview_render_directory_active_areas', $_POST[ 'template_id' ], 'directory', '', true );
103
+		$response[ 'directory' ] = ob_get_clean();
104 104
 
105 105
 		ob_start();
106
-		do_action( 'gravityview_render_directory_active_areas',  $_POST['template_id'], 'single', '', true );
107
-		$response['single'] = ob_get_clean();
106
+		do_action( 'gravityview_render_directory_active_areas', $_POST[ 'template_id' ], 'single', '', true );
107
+		$response[ 'single' ] = ob_get_clean();
108 108
 
109 109
 		$response = array_map( 'gravityview_strip_whitespace', $response );
110 110
 
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
 
120 120
 		$this->check_ajax_nonce();
121 121
 
122
-		if( empty( $_POST['template_id'] ) ) {
122
+		if ( empty( $_POST[ 'template_id' ] ) ) {
123 123
 			$this->_exit( false );
124 124
 		}
125 125
 
126 126
 		// get the fields xml config file for this specific preset
127
-		$preset_fields_path = apply_filters( 'gravityview_template_fieldsxml', array(), $_POST['template_id'] );
127
+		$preset_fields_path = apply_filters( 'gravityview_template_fieldsxml', array(), $_POST[ 'template_id' ] );
128 128
 		// import fields
129
-		if( !empty( $preset_fields_path ) ) {
129
+		if ( ! empty( $preset_fields_path ) ) {
130 130
 			$presets = $this->import_fields( $preset_fields_path );
131 131
 		} else {
132 132
 			$presets = array( 'widgets' => array(), 'fields' => array() );
133 133
 		}
134 134
 
135
-		$template_id = esc_attr( $_POST['template_id'] );
135
+		$template_id = esc_attr( $_POST[ 'template_id' ] );
136 136
 
137 137
 		// template areas
138 138
 		$template_areas_directory = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'directory' );
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 		$default_widget_areas = GravityView_Plugin::get_default_widget_areas();
143 143
 
144 144
 		ob_start();
145
-		do_action('gravityview_render_active_areas', $template_id, 'widget', 'header', $default_widget_areas, $presets['widgets'] );
146
-		$response['header'] = ob_get_clean();
145
+		do_action( 'gravityview_render_active_areas', $template_id, 'widget', 'header', $default_widget_areas, $presets[ 'widgets' ] );
146
+		$response[ 'header' ] = ob_get_clean();
147 147
 
148 148
 		ob_start();
149
-		do_action('gravityview_render_active_areas', $template_id, 'widget', 'footer', $default_widget_areas, $presets['widgets'] );
150
-		$response['footer'] = ob_get_clean();
149
+		do_action( 'gravityview_render_active_areas', $template_id, 'widget', 'footer', $default_widget_areas, $presets[ 'widgets' ] );
150
+		$response[ 'footer' ] = ob_get_clean();
151 151
 
152 152
 		ob_start();
153
-		do_action('gravityview_render_active_areas', $template_id, 'field', 'directory', $template_areas_directory, $presets['fields'] );
154
-		$response['directory'] = ob_get_clean();
153
+		do_action( 'gravityview_render_active_areas', $template_id, 'field', 'directory', $template_areas_directory, $presets[ 'fields' ] );
154
+		$response[ 'directory' ] = ob_get_clean();
155 155
 
156 156
 		ob_start();
157
-		do_action('gravityview_render_active_areas', $template_id, 'field', 'single', $template_areas_single, $presets['fields'] );
158
-		$response['single'] = ob_get_clean();
157
+		do_action( 'gravityview_render_active_areas', $template_id, 'field', 'single', $template_areas_single, $presets[ 'fields' ] );
158
+		$response[ 'single' ] = ob_get_clean();
159 159
 
160 160
 		$response = array_map( 'gravityview_strip_whitespace', $response );
161 161
 
@@ -173,26 +173,26 @@  discard block
 block discarded – undo
173 173
 
174 174
 		$this->check_ajax_nonce();
175 175
 
176
-		if( empty( $_POST['template_id'] ) ) {
176
+		if ( empty( $_POST[ 'template_id' ] ) ) {
177 177
 			do_action( 'gravityview_log_error', '[create_preset_form] Cannot create preset form; the template_id is empty.' );
178 178
 			$this->_exit( false );
179 179
 		}
180 180
 
181 181
 		// get the xml for this specific template_id
182
-		$preset_form_xml_path = apply_filters( 'gravityview_template_formxml', '', $_POST['template_id'] );
182
+		$preset_form_xml_path = apply_filters( 'gravityview_template_formxml', '', $_POST[ 'template_id' ] );
183 183
 
184 184
 		// import form
185 185
 		$form = $this->import_form( $preset_form_xml_path );
186 186
 
187 187
 		// get the form ID
188
-		if( false === $form ) {
188
+		if ( false === $form ) {
189 189
 			// send error to user
190
-			do_action( 'gravityview_log_error', '[create_preset_form] Error importing form for template id: ' . (int) $_POST['template_id'] );
190
+			do_action( 'gravityview_log_error', '[create_preset_form] Error importing form for template id: ' . (int)$_POST[ 'template_id' ] );
191 191
 
192 192
 			$this->_exit( false );
193 193
 		}
194 194
 
195
-		$this->_exit( '<option value="'.esc_attr( $form['id'] ).'" selected="selected">'.esc_html( $form['title'] ).'</option>' );
195
+		$this->_exit( '<option value="' . esc_attr( $form[ 'id' ] ) . '" selected="selected">' . esc_html( $form[ 'title' ] ) . '</option>' );
196 196
 
197 197
 	}
198 198
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
 		do_action( 'gravityview_log_debug', '[import_form] Import Preset Form. (File)', $xml_or_json_path );
208 208
 
209
-		if( empty( $xml_or_json_path ) || !class_exists('GFExport') || !file_exists( $xml_or_json_path ) ) {
209
+		if ( empty( $xml_or_json_path ) || ! class_exists( 'GFExport' ) || ! file_exists( $xml_or_json_path ) ) {
210 210
 			do_action( 'gravityview_log_error', '[import_form] Class GFExport or file not found. file: ', $xml_or_json_path );
211 211
 			return false;
212 212
 		}
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
 		do_action( 'gravityview_log_debug', '[import_form] Importing form (Result)', $count );
219 219
 		do_action( 'gravityview_log_debug', '[import_form] Importing form (Form) ', $forms );
220 220
 
221
-		if( $count != 1 || empty( $forms[0]['id'] ) ) {
221
+		if ( $count != 1 || empty( $forms[ 0 ][ 'id' ] ) ) {
222 222
 			do_action( 'gravityview_log_error', '[import_form] Form Import Failed!' );
223 223
 			return false;
224 224
 		}
225 225
 
226 226
 		// import success - return form id
227
-		return $forms[0];
227
+		return $forms[ 0 ];
228 228
 	}
229 229
 
230 230
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	function get_field_options() {
239 239
 		$this->check_ajax_nonce();
240 240
 
241
-		if( empty( $_POST['template'] ) || empty( $_POST['area'] ) || empty( $_POST['field_id'] ) || empty( $_POST['field_type'] ) ) {
241
+		if ( empty( $_POST[ 'template' ] ) || empty( $_POST[ 'area' ] ) || empty( $_POST[ 'field_id' ] ) || empty( $_POST[ 'field_type' ] ) ) {
242 242
 			do_action( 'gravityview_log_error', '[get_field_options] Required fields were not set in the $_POST request. ' );
243 243
 			$this->_exit( false );
244 244
 		}
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
 		$_post = array_map( 'esc_attr', $_post );
251 251
 
252 252
 		// The GF type of field: `product`, `name`, `creditcard`, `id`, `text`
253
-		$input_type = isset($_post['input_type']) ? esc_attr( $_post['input_type'] ) : NULL;
254
-		$context = isset($_post['context']) ? esc_attr( $_post['context'] ) : NULL;
253
+		$input_type = isset( $_post[ 'input_type' ] ) ? esc_attr( $_post[ 'input_type' ] ) : NULL;
254
+		$context = isset( $_post[ 'context' ] ) ? esc_attr( $_post[ 'context' ] ) : NULL;
255 255
 
256
-		$response = GravityView_Render_Settings::render_field_options( $_post['field_type'], $_post['template'], $_post['field_id'], $_post['field_label'], $_post['area'], $input_type, '', '', $context  );
256
+		$response = GravityView_Render_Settings::render_field_options( $_post[ 'field_type' ], $_post[ 'template' ], $_post[ 'field_id' ], $_post[ 'field_label' ], $_post[ 'area' ], $input_type, '', '', $context );
257 257
 
258 258
 		$response = gravityview_strip_whitespace( $response );
259 259
 
@@ -274,15 +274,15 @@  discard block
 block discarded – undo
274 274
 		$form = '';
275 275
 
276 276
 		// if form id is set, use it, else, get form from preset
277
-		if( !empty( $_POST['form_id'] ) ) {
277
+		if ( ! empty( $_POST[ 'form_id' ] ) ) {
278 278
 
279
-			$form = (int) $_POST['form_id'];
279
+			$form = (int)$_POST[ 'form_id' ];
280 280
 
281 281
 		}
282 282
 		// get form from preset
283
-		elseif( !empty( $_POST['template_id'] ) ) {
283
+		elseif ( ! empty( $_POST[ 'template_id' ] ) ) {
284 284
 
285
-			$form = GravityView_Ajax::pre_get_form_fields( $_POST['template_id'] );
285
+			$form = GravityView_Ajax::pre_get_form_fields( $_POST[ 'template_id' ] );
286 286
 
287 287
 		}
288 288
 
@@ -298,27 +298,27 @@  discard block
 block discarded – undo
298 298
 	 * @param  string $template_id Preset template
299 299
 	 *
300 300
 	 */
301
-	static function pre_get_form_fields( $template_id = '') {
301
+	static function pre_get_form_fields( $template_id = '' ) {
302 302
 
303
-		if( empty( $template_id ) ) {
303
+		if ( empty( $template_id ) ) {
304 304
 			do_action( 'gravityview_log_error', __METHOD__ . ' - Template ID not set.' );
305 305
 			return false;
306 306
 		} else {
307 307
 			$form_file = apply_filters( 'gravityview_template_formxml', '', $template_id );
308
-			if( !file_exists( $form_file )  ) {
309
-				do_action( 'gravityview_log_error', __METHOD__ . ' - Importing Form Fields for preset ['. $template_id .']. File not found. file: ' . $form_file );
308
+			if ( ! file_exists( $form_file ) ) {
309
+				do_action( 'gravityview_log_error', __METHOD__ . ' - Importing Form Fields for preset [' . $template_id . ']. File not found. file: ' . $form_file );
310 310
 				return false;
311 311
 			}
312 312
 		}
313 313
 
314 314
 		// Load xml parser (from GravityForms)
315
-		if( class_exists( 'GFCommon' ) ) {
315
+		if ( class_exists( 'GFCommon' ) ) {
316 316
 			$xml_parser = GFCommon::get_base_path() . '/xml.php';
317 317
 		} else {
318 318
 			$xml_parser = trailingslashit( WP_PLUGIN_DIR ) . 'gravityforms/xml.php';
319 319
 		}
320 320
 
321
-		if( file_exists( $xml_parser ) ) {
321
+		if ( file_exists( $xml_parser ) ) {
322 322
 			require_once( $xml_parser );
323 323
 		} else {
324 324
 			do_action( 'gravityview_log_debug', __METHOD__ . ' - Gravity Forms XML Parser not found.', $xml_parser );
@@ -329,37 +329,37 @@  discard block
 block discarded – undo
329 329
 		$xmlstr = file_get_contents( $form_file );
330 330
 
331 331
         $options = array(
332
-            "page" => array("unserialize_as_array" => true),
333
-            "form"=> array("unserialize_as_array" => true),
334
-            "field"=> array("unserialize_as_array" => true),
335
-            "rule"=> array("unserialize_as_array" => true),
336
-            "choice"=> array("unserialize_as_array" => true),
337
-            "input"=> array("unserialize_as_array" => true),
338
-            "routing_item"=> array("unserialize_as_array" => true),
339
-            "creditCard"=> array("unserialize_as_array" => true),
340
-            "routin"=> array("unserialize_as_array" => true),
341
-            "confirmation" => array("unserialize_as_array" => true),
342
-            "notification" => array("unserialize_as_array" => true)
332
+            "page" => array( "unserialize_as_array" => true ),
333
+            "form"=> array( "unserialize_as_array" => true ),
334
+            "field"=> array( "unserialize_as_array" => true ),
335
+            "rule"=> array( "unserialize_as_array" => true ),
336
+            "choice"=> array( "unserialize_as_array" => true ),
337
+            "input"=> array( "unserialize_as_array" => true ),
338
+            "routing_item"=> array( "unserialize_as_array" => true ),
339
+            "creditCard"=> array( "unserialize_as_array" => true ),
340
+            "routin"=> array( "unserialize_as_array" => true ),
341
+            "confirmation" => array( "unserialize_as_array" => true ),
342
+            "notification" => array( "unserialize_as_array" => true )
343 343
         );
344 344
 
345
-		$xml = new RGXML($options);
346
-        $forms = $xml->unserialize($xmlstr);
345
+		$xml = new RGXML( $options );
346
+        $forms = $xml->unserialize( $xmlstr );
347 347
 
348
-        if( !$forms ) {
349
-        	do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. Error importing file. (File)', $form_file );
348
+        if ( ! $forms ) {
349
+        	do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset [' . $template_id . ']. Error importing file. (File)', $form_file );
350 350
         	return false;
351 351
         }
352 352
 
353
-        if( !empty( $forms[0] ) && is_array( $forms[0] ) ) {
354
-        	$form = $forms[0];
353
+        if ( ! empty( $forms[ 0 ] ) && is_array( $forms[ 0 ] ) ) {
354
+        	$form = $forms[ 0 ];
355 355
         }
356 356
 
357
-        if( empty( $form ) ) {
357
+        if ( empty( $form ) ) {
358 358
         	do_action( 'gravityview_log_error', '[pre_get_available_fields] $form not set.', $forms );
359 359
         	return false;
360 360
         }
361 361
 
362
-        do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. (Form)', $form );
362
+        do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset [' . $template_id . ']. (Form)', $form );
363 363
 
364 364
         return $form;
365 365
 
@@ -373,38 +373,38 @@  discard block
 block discarded – undo
373 373
 	 */
374 374
 	function import_fields( $file ) {
375 375
 
376
-		if( empty( $file ) || !file_exists(  $file ) ) {
376
+		if ( empty( $file ) || ! file_exists( $file ) ) {
377 377
 			do_action( 'gravityview_log_error', '[import_fields] Importing Preset Fields. File not found. (File)', $file );
378 378
 			return false;
379 379
 		}
380 380
 
381
-		if( !class_exists('WXR_Parser') ) {
381
+		if ( ! class_exists( 'WXR_Parser' ) ) {
382 382
 			include_once GRAVITYVIEW_DIR . 'includes/lib/xml-parsers/parsers.php';
383 383
 		}
384 384
 
385 385
 		$parser = new WXR_Parser();
386 386
 		$presets = $parser->parse( $file );
387 387
 
388
-		if(is_wp_error( $presets )) {
388
+		if ( is_wp_error( $presets ) ) {
389 389
 			do_action( 'gravityview_log_error', '[import_fields] Importing Preset Fields failed. Threw WP_Error.', $presets );
390 390
 			return false;
391 391
 		}
392 392
 
393
-		if( empty( $presets['posts'][0]['postmeta'] ) && !is_array( $presets['posts'][0]['postmeta'] ) ) {
393
+		if ( empty( $presets[ 'posts' ][ 0 ][ 'postmeta' ] ) && ! is_array( $presets[ 'posts' ][ 0 ][ 'postmeta' ] ) ) {
394 394
 			do_action( 'gravityview_log_error', '[import_fields] Importing Preset Fields failed. Meta not found in file.', $file );
395 395
 			return false;
396 396
 		}
397 397
 
398
-		do_action( 'gravityview_log_debug', '[import_fields] postmeta', $presets['posts'][0]['postmeta'] );
398
+		do_action( 'gravityview_log_debug', '[import_fields] postmeta', $presets[ 'posts' ][ 0 ][ 'postmeta' ] );
399 399
 
400 400
 		$fields = $widgets = array();
401
-		foreach( $presets['posts'][0]['postmeta'] as $meta ) {
402
-			switch ($meta['key']) {
401
+		foreach ( $presets[ 'posts' ][ 0 ][ 'postmeta' ] as $meta ) {
402
+			switch ( $meta[ 'key' ] ) {
403 403
 				case '_gravityview_directory_fields':
404
-					$fields = maybe_unserialize( $meta['value'] );
404
+					$fields = maybe_unserialize( $meta[ 'value' ] );
405 405
 					break;
406 406
 				case '_gravityview_directory_widgets':
407
-					$widgets = maybe_unserialize( $meta['value'] );
407
+					$widgets = maybe_unserialize( $meta[ 'value' ] );
408 408
 					break;
409 409
 			}
410 410
 		}
Please login to merge, or discard this patch.
includes/class-frontend-views.php 2 patches
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 			 */
242 242
 			$this->context_view_id = $_GET['gvid'];
243 243
 
244
-		} elseif ( ! $this->getGvOutputData()->has_multiple_views() )  {
244
+		} elseif ( ! $this->getGvOutputData()->has_multiple_views() ) {
245 245
 			$array_keys = array_keys( $this->getGvOutputData()->get_views() );
246 246
 			$this->context_view_id = array_pop( $array_keys );
247 247
 			unset( $array_keys );
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		global $post;
270 270
 
271 271
 		// If in admin and NOT AJAX request, get outta here.
272
-		if ( GravityView_Plugin::is_admin() )  {
272
+		if ( GravityView_Plugin::is_admin() ) {
273 273
 			return;
274 274
 		}
275 275
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 		}
373 373
 
374 374
 		// User reported WooCommerce doesn't pass two args.
375
-		if ( empty( $passed_post_id ) )  {
375
+		if ( empty( $passed_post_id ) ) {
376 376
 			return $title;
377 377
 		}
378 378
 
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
 					 */
1109 1109
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1110 1110
 
1111
-					switch( strtolower( $address_part ) ){
1111
+					switch( strtolower( $address_part ) ) {
1112 1112
 						case 'street':
1113 1113
 							$sort_field_id .= '.1';
1114 1114
 							break;
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 		 */
1189 1189
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1190 1190
 
1191
-		if ( empty( $single_entry ) ){
1191
+		if ( empty( $single_entry ) ) {
1192 1192
 			return false;
1193 1193
 		} else {
1194 1194
 			return $single_entry;
Please login to merge, or discard this patch.
Spacing   +109 added lines, -109 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
 		}
@@ -910,19 +910,19 @@  discard block
 block discarded – undo
910 910
 	public static function process_search_only_approved( $args, $search_criteria ) {
911 911
 
912 912
 		/** @since 1.19 */
913
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
913
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
914 914
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries; showing all approval statuses' );
915 915
 			return $search_criteria;
916 916
 		}
917 917
 
918
-		if ( ! empty( $args['show_only_approved'] ) ) {
918
+		if ( ! empty( $args[ 'show_only_approved' ] ) ) {
919 919
 
920
-			$search_criteria['field_filters'][] = array(
920
+			$search_criteria[ 'field_filters' ][ ] = array(
921 921
 				'key' => GravityView_Entry_Approval::meta_key,
922 922
 				'value' => GravityView_Entry_Approval_Status::APPROVED
923 923
 			);
924 924
 
925
-			$search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met
925
+			$search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met
926 926
 
927 927
 			do_action( 'gravityview_log_debug', '[process_search_only_approved] Search Criteria if show only approved: ', $search_criteria );
928 928
 		}
@@ -949,18 +949,18 @@  discard block
 block discarded – undo
949 949
 	 */
950 950
 	public static function is_entry_approved( $entry, $args = array() ) {
951 951
 
952
-		if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) {
952
+		if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) {
953 953
 			// is implicitly approved if entry is null or View settings doesn't require to check for approval
954 954
 			return true;
955 955
 		}
956 956
 
957 957
 		/** @since 1.19 */
958
-		if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) {
958
+		if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) {
959 959
 			do_action( 'gravityview_log_debug', __METHOD__ . ': User can moderate entries, so entry is approved for viewing' );
960 960
 			return true;
961 961
 		}
962 962
 
963
-		$is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key );
963
+		$is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key );
964 964
 
965 965
 		return GravityView_Entry_Approval_Status::is_approved( $is_approved );
966 966
 	}
@@ -994,26 +994,26 @@  discard block
 block discarded – undo
994 994
 		do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', $search_criteria );
995 995
 
996 996
 		// implicity search
997
-		if ( ! empty( $args['search_value'] ) ) {
997
+		if ( ! empty( $args[ 'search_value' ] ) ) {
998 998
 
999 999
 			// Search operator options. Options: `is` or `contains`
1000
-			$operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains';
1000
+			$operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains';
1001 1001
 
1002
-			$search_criteria['field_filters'][] = array(
1002
+			$search_criteria[ 'field_filters' ][ ] = array(
1003 1003
 				'key' => rgget( 'search_field', $args ), // The field ID to search
1004
-				'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes.
1004
+				'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes.
1005 1005
 				'operator' => $operator,
1006 1006
 			);
1007 1007
 		}
1008 1008
 
1009
-		if( $search_criteria !== $original_search_criteria ) {
1009
+		if ( $search_criteria !== $original_search_criteria ) {
1010 1010
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after implicity search: ', $search_criteria );
1011 1011
 		}
1012 1012
 
1013 1013
 		// Handle setting date range
1014 1014
 		$search_criteria = self::process_search_dates( $args, $search_criteria );
1015 1015
 
1016
-		if( $search_criteria !== $original_search_criteria ) {
1016
+		if ( $search_criteria !== $original_search_criteria ) {
1017 1017
 			do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after date params: ', $search_criteria );
1018 1018
 		}
1019 1019
 
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 		 * @filter `gravityview_status` Modify entry status requirements to be included in search results.
1025 1025
 		 * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash`
1026 1026
 		 */
1027
-		$search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args );
1027
+		$search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args );
1028 1028
 
1029 1029
 		return $search_criteria;
1030 1030
 	}
@@ -1070,16 +1070,16 @@  discard block
 block discarded – undo
1070 1070
 		$search_criteria = self::get_search_criteria( $args, $form_id );
1071 1071
 
1072 1072
 		// Paging & offset
1073
-		$page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : apply_filters( 'gravityview_default_page_size', 25 );
1073
+		$page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : apply_filters( 'gravityview_default_page_size', 25 );
1074 1074
 
1075 1075
 		if ( -1 === $page_size ) {
1076 1076
 			$page_size = PHP_INT_MAX;
1077 1077
 		}
1078 1078
 
1079
-		if ( isset( $args['offset'] ) ) {
1080
-			$offset = intval( $args['offset'] );
1079
+		if ( isset( $args[ 'offset' ] ) ) {
1080
+			$offset = intval( $args[ 'offset' ] );
1081 1081
 		} else {
1082
-			$curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] );
1082
+			$curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] );
1083 1083
 			$offset = ( $curr_page - 1 ) * $page_size;
1084 1084
 		}
1085 1085
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 			'search_criteria' => $search_criteria,
1098 1098
 			'sorting' => $sorting,
1099 1099
 			'paging' => $paging,
1100
-			'cache' => isset( $args['cache'] ) ? $args['cache'] : true,
1100
+			'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true,
1101 1101
 		);
1102 1102
 
1103 1103
 		/**
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
 		 * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys.
1123 1123
 		 * @param array $args View configuration args.
1124 1124
 		 */
1125
-		$parameters = apply_filters( 'gravityview_get_entries_'.$args['id'], $parameters, $args, $form_id );
1125
+		$parameters = apply_filters( 'gravityview_get_entries_' . $args[ 'id' ], $parameters, $args, $form_id );
1126 1126
 
1127 1127
 		do_action( 'gravityview_log_debug', __METHOD__ . ': $parameters passed to gravityview_get_entries(): ', $parameters );
1128 1128
 
@@ -1162,8 +1162,8 @@  discard block
 block discarded – undo
1162 1162
 	 */
1163 1163
 	public static function updateViewSorting( $args, $form_id ) {
1164 1164
 		$sorting = array();
1165
-		$sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : rgar( $args, 'sort_field' );
1166
-		$sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : rgar( $args, 'sort_direction' );
1165
+		$sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : rgar( $args, 'sort_field' );
1166
+		$sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : rgar( $args, 'sort_direction' );
1167 1167
 
1168 1168
 		$sort_field_id = self::_override_sorting_id_by_field_type( $sort_field_id, $form_id );
1169 1169
 
@@ -1203,11 +1203,11 @@  discard block
 block discarded – undo
1203 1203
 
1204 1204
 		$sort_field = GFFormsModel::get_field( $form, $sort_field_id );
1205 1205
 
1206
-		if( ! $sort_field ) {
1206
+		if ( ! $sort_field ) {
1207 1207
 			return $sort_field_id;
1208 1208
 		}
1209 1209
 
1210
-		switch ( $sort_field['type'] ) {
1210
+		switch ( $sort_field[ 'type' ] ) {
1211 1211
 
1212 1212
 			case 'address':
1213 1213
 				// Sorting by full address
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
 					 */
1225 1225
 					$address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id );
1226 1226
 
1227
-					switch( strtolower( $address_part ) ){
1227
+					switch ( strtolower( $address_part ) ) {
1228 1228
 						case 'street':
1229 1229
 							$sort_field_id .= '.1';
1230 1230
 							break;
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
 		 */
1305 1305
 		$single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry );
1306 1306
 
1307
-		if ( empty( $single_entry ) ){
1307
+		if ( empty( $single_entry ) ) {
1308 1308
 			return false;
1309 1309
 		} else {
1310 1310
 			return $single_entry;
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 				 * Don't enqueue the scripts or styles if it's not going to be displayed.
1332 1332
 				 * @since 1.15
1333 1333
 				 */
1334
-				if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1334
+				if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) {
1335 1335
 					continue;
1336 1336
 				}
1337 1337
 
@@ -1340,19 +1340,19 @@  discard block
 block discarded – undo
1340 1340
 				$css_dependencies = array();
1341 1341
 
1342 1342
 				// If the thickbox is enqueued, add dependencies
1343
-				if ( ! empty( $data['atts']['lightbox'] ) ) {
1343
+				if ( ! empty( $data[ 'atts' ][ 'lightbox' ] ) ) {
1344 1344
 
1345 1345
 					/**
1346 1346
 					 * @filter `gravity_view_lightbox_script` Override the lightbox script to enqueue. Default: `thickbox`
1347 1347
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of it here.
1348 1348
 					 */
1349
-					$js_dependencies[] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1349
+					$js_dependencies[ ] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' );
1350 1350
 
1351 1351
 					/**
1352 1352
 					 * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox`
1353 1353
 					 * @param string $script_slug If you want to use a different lightbox script, return the name of its CSS file here.
1354 1354
 					 */
1355
-					$css_dependencies[] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1355
+					$css_dependencies[ ] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' );
1356 1356
 				}
1357 1357
 
1358 1358
 				/**
@@ -1360,25 +1360,25 @@  discard block
 block discarded – undo
1360 1360
 				 * @see https://github.com/katzwebservices/GravityView/issues/536
1361 1361
 				 * @since 1.15
1362 1362
 				 */
1363
-				if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) {
1364
-					$css_dependencies[] = 'dashicons';
1363
+				if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) {
1364
+					$css_dependencies[ ] = 'dashicons';
1365 1365
 				}
1366 1366
 
1367 1367
 				wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true );
1368 1368
 
1369 1369
 				$script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
1370 1370
 
1371
-				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 );
1371
+				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 );
1372 1372
 
1373 1373
 				wp_enqueue_script( 'gravityview-fe-view' );
1374 1374
 
1375
-				if ( ! empty( $data['atts']['sort_columns'] ) ) {
1375
+				if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) {
1376 1376
 					wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' );
1377 1377
 				}
1378 1378
 
1379 1379
 				$this->enqueue_default_style( $css_dependencies );
1380 1380
 
1381
-				self::add_style( $data['template_id'] );
1381
+				self::add_style( $data[ 'template_id' ] );
1382 1382
 			}
1383 1383
 
1384 1384
 			if ( 'wp_print_footer_scripts' === current_filter() ) {
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 		} elseif ( empty( $template_id ) ) {
1441 1441
 			do_action( 'gravityview_log_error', '[add_style] Cannot add template style; template_id is empty' );
1442 1442
 		} else {
1443
-			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_'.$template_id ) );
1443
+			do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_' . $template_id ) );
1444 1444
 		}
1445 1445
 
1446 1446
 	}
@@ -1465,11 +1465,11 @@  discard block
 block discarded – undo
1465 1465
 		 * Not a table-based template; don't add sort icons
1466 1466
 		 * @since 1.12
1467 1467
 		 */
1468
-		if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1468
+		if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) {
1469 1469
 			return $label;
1470 1470
 		}
1471 1471
 
1472
-		if ( ! $this->is_field_sortable( $field['id'], $form ) ) {
1472
+		if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) {
1473 1473
 			return $label;
1474 1474
 		}
1475 1475
 
@@ -1477,29 +1477,29 @@  discard block
 block discarded – undo
1477 1477
 
1478 1478
 		$class = 'gv-sort';
1479 1479
 
1480
-		$sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] );
1480
+		$sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] );
1481 1481
 
1482 1482
 		$sort_args = array(
1483
-			'sort' => $field['id'],
1483
+			'sort' => $field[ 'id' ],
1484 1484
 			'dir' => 'asc',
1485 1485
 		);
1486 1486
 
1487
-		if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) {
1487
+		if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) {
1488 1488
 			//toggle sorting direction.
1489
-			if ( 'asc' === $sorting['direction'] ) {
1490
-				$sort_args['dir'] = 'desc';
1489
+			if ( 'asc' === $sorting[ 'direction' ] ) {
1490
+				$sort_args[ 'dir' ] = 'desc';
1491 1491
 				$class .= ' gv-icon-sort-desc';
1492 1492
 			} else {
1493
-				$sort_args['dir'] = 'asc';
1493
+				$sort_args[ 'dir' ] = 'asc';
1494 1494
 				$class .= ' gv-icon-sort-asc';
1495 1495
 			}
1496 1496
 		} else {
1497 1497
 			$class .= ' gv-icon-caret-up-down';
1498 1498
 		}
1499 1499
 
1500
-		$url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) );
1500
+		$url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) );
1501 1501
 
1502
-		return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a>&nbsp;'. $label;
1502
+		return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a>&nbsp;' . $label;
1503 1503
 
1504 1504
 	}
1505 1505
 
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
 
1518 1518
 		$field_type = $field_id;
1519 1519
 
1520
-		if( is_numeric( $field_id ) ) {
1520
+		if ( is_numeric( $field_id ) ) {
1521 1521
 			$field = GFFormsModel::get_field( $form, $field_id );
1522 1522
 			$field_type = $field->type;
1523 1523
 		}
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 			return false;
1541 1541
 		}
1542 1542
 
1543
-		return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1543
+		return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) );
1544 1544
 
1545 1545
 	}
1546 1546
 
Please login to merge, or discard this patch.
includes/class-gv-license-handler.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -295,7 +295,8 @@  discard block
 block discarded – undo
295 295
 			if ( empty( $license_data ) ) {
296 296
 				if ( $is_ajax ) {
297 297
 					exit( json_encode( array() ) );
298
-				} else { // Non-ajax call
298
+				} else {
299
+// Non-ajax call
299 300
 					return json_encode( array() );
300 301
 				}
301 302
 			}
@@ -325,7 +326,8 @@  discard block
 block discarded – undo
325 326
 
326 327
 		if ( $is_ajax ) {
327 328
 			exit( $json );
328
-		} else { // Non-ajax call
329
+		} else {
330
+// Non-ajax call
329 331
 			return ( rgget('format', $data ) === 'object' ) ? $license_data : $json;
330 332
 		}
331 333
 	}
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @return GV_License_Handler
41 41
 	 */
42 42
 	public static function get_instance( GravityView_Settings $GFAddOn ) {
43
-		if( empty( self::$instance ) ) {
43
+		if ( empty( self::$instance ) ) {
44 44
 			self::$instance = new self( $GFAddOn );
45 45
 		}
46 46
 		return self::$instance;
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 	public function refresh_license_status() {
71 71
 
72 72
 		// Only perform on GravityView pages
73
-		if( ! gravityview_is_admin_page() ) {
73
+		if ( ! gravityview_is_admin_page() ) {
74 74
 			return;
75 75
 		}
76 76
 
77 77
 		// The transient is fresh; don't fetch.
78
-		if( $status = get_transient( self::status_transient_key ) ) {
78
+		if ( $status = get_transient( self::status_transient_key ) ) {
79 79
 			return;
80 80
 		}
81 81
 
@@ -101,37 +101,37 @@  discard block
 block discarded – undo
101 101
 		$status = trim( $this->Addon->get_app_setting( 'license_key_status' ) );
102 102
 		$key = trim( $this->Addon->get_app_setting( 'license_key' ) );
103 103
 
104
-		if( !empty( $key ) ) {
104
+		if ( ! empty( $key ) ) {
105 105
 			$response = $this->Addon->get_app_setting( 'license_key_response' );
106
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
106
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
107 107
 		} else {
108 108
 			$response = array();
109 109
 		}
110 110
 
111 111
 		wp_localize_script( 'gv-admin-edd-license', 'GVGlobals', array(
112 112
 			'license_box' => $this->get_license_message( $response )
113
-		));
113
+		) );
114 114
 
115 115
 
116 116
 		$fields = array(
117 117
 			array(
118 118
 				'name'  => 'edd-activate',
119
-				'value' => __('Activate License', 'gravityview'),
120
-				'data-pending_text' => __('Verifying license&hellip;', 'gravityview'),
119
+				'value' => __( 'Activate License', 'gravityview' ),
120
+				'data-pending_text' => __( 'Verifying license&hellip;', 'gravityview' ),
121 121
 				'data-edd_action' => 'activate_license',
122 122
 				'class' => 'button-primary',
123 123
 			),
124 124
 			array(
125 125
 				'name'  => 'edd-deactivate',
126
-				'value' => __('Deactivate License', 'gravityview'),
127
-				'data-pending_text' => __('Deactivating license&hellip;', 'gravityview'),
126
+				'value' => __( 'Deactivate License', 'gravityview' ),
127
+				'data-pending_text' => __( 'Deactivating license&hellip;', 'gravityview' ),
128 128
 				'data-edd_action' => 'deactivate_license',
129 129
 				'class' => ( empty( $status ) ? 'button-primary hide' : 'button-primary' ),
130 130
 			),
131 131
 			array(
132 132
 				'name'  => 'edd-check',
133
-				'value' => __('Check License', 'gravityview'),
134
-				'data-pending_text' => __('Verifying license&hellip;', 'gravityview'),
133
+				'value' => __( 'Check License', 'gravityview' ),
134
+				'data-pending_text' => __( 'Verifying license&hellip;', 'gravityview' ),
135 135
 				'title' => 'Check the license before saving it',
136 136
 				'data-edd_action' => 'check_license',
137 137
 				'class' => 'button-secondary',
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 
142 142
 		$class = 'button gv-edd-action';
143 143
 
144
-		$class .= ( !empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
144
+		$class .= ( ! empty( $key ) && $status !== 'valid' ) ? '' : ' hide';
145 145
 
146 146
 		$disabled_attribute = GVCommon::has_cap( 'gravityview_edit_settings' ) ? false : 'disabled';
147 147
 
148 148
 		$submit = '<div class="gv-edd-button-wrapper">';
149 149
 		foreach ( $fields as $field ) {
150
-			$field['type'] = 'button';
151
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
152
-			$field['style'] = 'margin-left: 10px;';
153
-			if( $disabled_attribute ) {
154
-				$field['disabled'] = $disabled_attribute;
150
+			$field[ 'type' ] = 'button';
151
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
152
+			$field[ 'style' ] = 'margin-left: 10px;';
153
+			if ( $disabled_attribute ) {
154
+				$field[ 'disabled' ] = $disabled_attribute;
155 155
 			}
156 156
 			$submit .= $this->Addon->settings_submit( $field, $echo );
157 157
 		}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	private function setup_edd() {
169 169
 
170
-		if( !class_exists('EDD_SL_Plugin_Updater') ) {
171
-			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php');
170
+		if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
171
+			require_once( GRAVITYVIEW_DIR . 'includes/lib/EDD_SL_Plugin_Updater.php' );
172 172
 		}
173 173
 
174 174
 		// setup the updater
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 			'url'       => home_url(),
206 206
 		);
207 207
 
208
-		if( !empty( $action ) ) {
209
-			$settings['edd_action'] = esc_attr( $action );
208
+		if ( ! empty( $action ) ) {
209
+			$settings[ 'edd_action' ] = esc_attr( $action );
210 210
 		}
211 211
 
212 212
 		$settings = array_map( 'urlencode', $settings );
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	private function _license_get_remote_response( $data, $license = '' ) {
222 222
 
223
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
223
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
224 224
 
225 225
 		$url = add_query_arg( $api_params, self::url );
226 226
 
227 227
 		$response = wp_remote_get( $url, array(
228 228
 			'timeout'   => 15,
229 229
 			'sslverify' => false,
230
-		));
230
+		) );
231 231
 
232 232
 		if ( is_wp_error( $response ) ) {
233 233
 			return array();
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
 	 */
261 261
 	function get_license_message( $license_data ) {
262 262
 
263
-		if( empty( $license_data ) ) {
263
+		if ( empty( $license_data ) ) {
264 264
 			$message = '';
265 265
 		} else {
266 266
 
267
-			if( ! empty( $license_data->error ) ) {
267
+			if ( ! empty( $license_data->error ) ) {
268 268
 				$class = 'error';
269 269
 				$string_key = $license_data->error;
270 270
 			} else {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 				$string_key = $license_data->license;
273 273
 			}
274 274
 
275
-			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings('status'), $this->strings( $string_key, $license_data ) );
275
+			$message = sprintf( '<p><strong>%s: %s</strong></p>', $this->strings( 'status' ), $this->strings( $string_key, $license_data ) );
276 276
 
277 277
 			$message = $this->generate_license_box( $message, $class );
278 278
 		}
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	public function license_details( $response = array() ) {
311 311
 
312
-		$response = (array) $response;
312
+		$response = (array)$response;
313 313
 
314 314
 		$return = '';
315 315
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
316 316
 
317
-		if( ! empty( $response['license_key'] ) ) {
317
+		if ( ! empty( $response[ 'license_key' ] ) ) {
318 318
 
319 319
 			$return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>';
320 320
 
321 321
 			if ( in_array( rgar( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
322
-				$return .= $this->strings( $response['license'], $response );
323
-			} elseif ( ! empty( $response['license_name'] ) ) {
322
+				$return .= $this->strings( $response[ 'license' ], $response );
323
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
324 324
 
325 325
 				$response_keys = array(
326 326
 					'license_name'   => '',
@@ -335,19 +335,19 @@  discard block
 block discarded – undo
335 335
 				// Make sure all the keys are set
336 336
 				$response = wp_parse_args( $response, $response_keys );
337 337
 
338
-				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
339
-				$local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
338
+				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
339
+				$local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
340 340
 				$details    = array(
341
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ),
342
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link,
343
-					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text,
344
-					'expires'     => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
345
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
341
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ),
342
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link,
343
+					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text,
344
+					'expires'     => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
345
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
346 346
 				);
347 347
 
348
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
349
-					unset( $details['upgrade'] );
350
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
348
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
349
+					unset( $details[ 'upgrade' ] );
350
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
351 351
 				}
352 352
 
353 353
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
 
371 371
 		$output = '';
372 372
 
373
-		if( ! empty( $upgrades ) ) {
373
+		if ( ! empty( $upgrades ) ) {
374 374
 
375 375
 			$locale_parts = explode( '_', get_locale() );
376 376
 
377
-			$is_english = ( 'en' === $locale_parts[0] );
377
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
378 378
 
379 379
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
380 380
 
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 
383 383
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
384 384
 
385
-				$upgrade = (object) $upgrade;
385
+				$upgrade = (object)$upgrade;
386 386
 
387 387
 				$anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) );
388 388
 
389
-				if( $is_english && isset( $upgrade->description ) ) {
389
+				if ( $is_english && isset( $upgrade->description ) ) {
390 390
 					$message = esc_html( $upgrade->description );
391 391
 				} else {
392
-					switch( $upgrade->price_id ) {
392
+					switch ( $upgrade->price_id ) {
393 393
 						// Interstellar
394 394
 						case 1:
395 395
 						default:
@@ -427,16 +427,16 @@  discard block
 block discarded – undo
427 427
 	 */
428 428
 	public function license_call( $array = array() ) {
429 429
 
430
-		$is_ajax = ( defined('DOING_AJAX') && DOING_AJAX );
431
-		$data = empty( $array ) ? $_POST['data'] : $array;
430
+		$is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
431
+		$data = empty( $array ) ? $_POST[ 'data' ] : $array;
432 432
 		$has_cap = GVCommon::has_cap( 'gravityview_edit_settings' );
433 433
 
434
-		if ( $is_ajax && empty( $data['license'] ) ) {
435
-			die( - 1 );
434
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
435
+			die( -1 );
436 436
 		}
437 437
 
438 438
 		// If the user isn't allowed to edit settings, show an error message
439
-		if( ! $has_cap ) {
439
+		if ( ! $has_cap ) {
440 440
 			$license_data = new stdClass();
441 441
 			$license_data->error = 'capability';
442 442
 			$license_data->message = $this->get_license_message( $license_data );
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 
461 461
 			$json = json_encode( $license_data );
462 462
 
463
-			$update_license = ( ! isset( $data['update'] ) || ! empty( $data['update'] ) );
463
+			$update_license = ( ! isset( $data[ 'update' ] ) || ! empty( $data[ 'update' ] ) );
464 464
 
465
-			$is_check_action_button = ( 'check_license' === $data['edd_action'] && defined( 'DOING_AJAX' ) && DOING_AJAX );
465
+			$is_check_action_button = ( 'check_license' === $data[ 'edd_action' ] && defined( 'DOING_AJAX' ) && DOING_AJAX );
466 466
 
467 467
 			// Failed is the response from trying to de-activate a license and it didn't work.
468 468
 			// This likely happened because people entered in a different key and clicked "Deactivate",
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 			// most likely a mistake.
471 471
 			if ( $license_data->license !== 'failed' && ! $is_check_action_button && $update_license ) {
472 472
 
473
-				if ( ! empty( $data['field_id'] ) ) {
473
+				if ( ! empty( $data[ 'field_id' ] ) ) {
474 474
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
475 475
 				}
476 476
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		if ( $is_ajax ) {
482 482
 			exit( $json );
483 483
 		} else { // Non-ajax call
484
-			return ( rgget('format', $data ) === 'object' ) ? $license_data : $json;
484
+			return ( rgget( 'format', $data ) === 'object' ) ? $license_data : $json;
485 485
 		}
486 486
 	}
487 487
 
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
 		// Update option with passed data license
496 496
 		$settings = $this->Addon->get_app_settings();
497 497
 
498
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
499
-		$settings['license_key_status'] = $license_data->license;
500
-		$settings['license_key_response'] = (array)$license_data;
498
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
499
+		$settings[ 'license_key_status' ] = $license_data->license;
500
+		$settings[ 'license_key_response' ] = (array)$license_data;
501 501
 
502 502
 		$this->Addon->update_app_settings( $settings );
503 503
 	}
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 	 */
511 511
 	private function get_license_renewal_url( $license_data ) {
512 512
 		$license_data = is_array( $license_data ) ? (object)$license_data : $license_data;
513
-		$renew_license_url = ( ! empty( $license_data ) && !empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/';
513
+		$renew_license_url = ( ! empty( $license_data ) && ! empty( $license_data->license_key ) ) ? sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s&utm_source=admin_notice&utm_medium=admin&utm_content=expired&utm_campaign=Activation&force_login=1', $license_data->license_key ) : 'https://gravityview.co/account/';
514 514
 		return $renew_license_url;
515 515
 	}
516 516
 
@@ -525,31 +525,31 @@  discard block
 block discarded – undo
525 525
 
526 526
 
527 527
 		$strings = array(
528
-			'status' => esc_html__('Status', 'gravityview'),
529
-			'error' => esc_html__('There was an error processing the request.', 'gravityview'),
530
-			'failed'  => esc_html__('Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview'),
531
-			'site_inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'),
532
-			'inactive' => esc_html__('The license key is valid, but it has not been activated for this site.', 'gravityview'),
533
-			'no_activations_left' => esc_html__('Invalid: this license has reached its activation limit.', 'gravityview') . ' ' . sprintf( esc_html__('You can manage license activations %son your GravityView account page%s.', 'gravityview'), '<a href="https://gravityview.co/account/#licenses">', '</a>' ),
534
-			'deactivated' => esc_html__('The license has been deactivated.', 'gravityview'),
535
-			'valid' => esc_html__('The license key is valid and active.', 'gravityview'),
536
-			'invalid' => esc_html__('The license key entered is invalid.', 'gravityview'),
537
-			'missing' => esc_html__('Invalid license key.', 'gravityview'),
538
-			'revoked' => esc_html__('This license key has been revoked.', 'gravityview'),
539
-			'expired' => sprintf( esc_html__('This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview'), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ),
528
+			'status' => esc_html__( 'Status', 'gravityview' ),
529
+			'error' => esc_html__( 'There was an error processing the request.', 'gravityview' ),
530
+			'failed'  => esc_html__( 'Could not deactivate the license. The license key you attempted to deactivate may not be active or valid.', 'gravityview' ),
531
+			'site_inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ),
532
+			'inactive' => esc_html__( 'The license key is valid, but it has not been activated for this site.', 'gravityview' ),
533
+			'no_activations_left' => esc_html__( 'Invalid: this license has reached its activation limit.', 'gravityview' ) . ' ' . sprintf( esc_html__( 'You can manage license activations %son your GravityView account page%s.', 'gravityview' ), '<a href="https://gravityview.co/account/#licenses">', '</a>' ),
534
+			'deactivated' => esc_html__( 'The license has been deactivated.', 'gravityview' ),
535
+			'valid' => esc_html__( 'The license key is valid and active.', 'gravityview' ),
536
+			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
537
+			'missing' => esc_html__( 'Invalid license key.', 'gravityview' ),
538
+			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
539
+			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ),
540 540
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
541 541
 
542
-			'verifying_license' => esc_html__('Verifying license&hellip;', 'gravityview'),
543
-			'activate_license' => esc_html__('Activate License', 'gravityview'),
544
-			'deactivate_license' => esc_html__('Deactivate License', 'gravityview'),
545
-			'check_license' => esc_html__('Verify License', 'gravityview'),
542
+			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
543
+			'activate_license' => esc_html__( 'Activate License', 'gravityview' ),
544
+			'deactivate_license' => esc_html__( 'Deactivate License', 'gravityview' ),
545
+			'check_license' => esc_html__( 'Verify License', 'gravityview' ),
546 546
 		);
547 547
 
548
-		if( empty( $status ) ) {
548
+		if ( empty( $status ) ) {
549 549
 			return $strings;
550 550
 		}
551 551
 
552
-		if( isset( $strings[ $status ] ) ) {
552
+		if ( isset( $strings[ $status ] ) ) {
553 553
 			return $strings[ $status ];
554 554
 		}
555 555
 
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-yoast-seo.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 		parent::add_hooks();
58 58
 
59
-		if( gravityview_is_admin_page() ) {
59
+		if ( gravityview_is_admin_page() ) {
60 60
 
61 61
 				// Make Yoast metabox go down to the bottom please.
62 62
 			add_filter( 'wpseo_metabox_prio', array( $this, '__return_low' ) );
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 		global $pagenow;
84 84
 
85 85
 		// New View page
86
-		if( $pagenow === 'post-new.php' ) {
87
-			$options['hideeditbox-gravityview'] = true;
86
+		if ( $pagenow === 'post-new.php' ) {
87
+			$options[ 'hideeditbox-gravityview' ] = true;
88 88
 		}
89 89
 
90 90
 		return $options;
Please login to merge, or discard this patch.
includes/plugin-and-theme-hooks/class-gravityview-theme-hooks-woothemes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 		$gv_page = gravityview_is_admin_page( '', 'single' );
79 79
 
80 80
 		// New View or Edit View page
81
-		if( $gv_page && $pagenow === 'post-new.php' ) {
81
+		if ( $gv_page && $pagenow === 'post-new.php' ) {
82 82
 			remove_meta_box( 'woothemes-settings', 'gravityview', 'normal' );
83 83
 		}
84 84
 	}
Please login to merge, or discard this patch.
includes/class-gravityview-template.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
 	 * @return string                Path to XML file
194 194
 	 */
195 195
 	public function assign_form_xml( $xml = '', $template = '' ) {
196
-		if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_form'] ) && $this->template_id === $template ) {
197
-			return $this->settings['preset_form'];
196
+		if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_form' ] ) && $this->template_id === $template ) {
197
+			return $this->settings[ 'preset_form' ];
198 198
 		}
199 199
 
200 200
 		return $xml;
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 	 * @return string                Path to XML file
208 208
 	 */
209 209
 	public function assign_fields_xml( $xml = '', $template = '' ) {
210
-		if ( $this->settings['type'] === 'preset' && ! empty( $this->settings['preset_fields'] ) && $this->template_id === $template ) {
211
-			return $this->settings['preset_fields'];
210
+		if ( $this->settings[ 'type' ] === 'preset' && ! empty( $this->settings[ 'preset_fields' ] ) && $this->template_id === $template ) {
211
+			return $this->settings[ 'preset_fields' ];
212 212
 		}
213 213
 
214 214
 		return $xml;
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function assign_view_slug( $default, $context ) {
228 228
 
229
-		if ( ! empty( $this->settings['slug'] ) ) {
230
-			return $this->settings['slug'];
229
+		if ( ! empty( $this->settings[ 'slug' ] ) ) {
230
+			return $this->settings[ 'slug' ];
231 231
 		}
232 232
 		if ( ! empty( $default ) ) {
233 233
 			return $default;
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
 	 * @return void
245 245
 	 */
246 246
 	public function register_styles() {
247
-		if ( ! empty( $this->settings['css_source'] ) ) {
248
-			wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings['css_source'], array(), GravityView_Plugin::version, 'all' );
247
+		if ( ! empty( $this->settings[ 'css_source' ] ) ) {
248
+			wp_register_style( 'gravityview_style_' . $this->template_id, $this->settings[ 'css_source' ], array(), GravityView_Plugin::version, 'all' );
249 249
 		}
250 250
 	}
251 251
 
Please login to merge, or discard this patch.