Completed
Pull Request — master (#798)
by Zack
06:40 queued 03:29
created
includes/admin/field-types/type_html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 * @return string
22 22
 	 */
23 23
 	function get_field_desc() {
24
-		return !empty( $this->field['desc'] ) ? $this->field['desc'] : '';
24
+		return ! empty( $this->field[ 'desc' ] ) ? $this->field[ 'desc' ] : '';
25 25
 	}
26 26
 
27 27
 }
Please login to merge, or discard this patch.
includes/admin/field-types/type_checkboxes.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	}
23 23
 
24 24
 	function render_input( $override_input = null ) {
25
-		if( isset( $override_input ) ) {
25
+		if ( isset( $override_input ) ) {
26 26
 			echo $override_input;
27 27
 			return;
28 28
 		}
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 		?>
31 31
 		<ul class="gv-setting-list">
32 32
 		<?php
33
-		foreach( $this->field['options'] as $value => $label ) { ?>
34
-			<li <?php if( isset( $label['requires'] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label['requires'] ); } ?>>
33
+		foreach ( $this->field[ 'options' ] as $value => $label ) { ?>
34
+			<li <?php if ( isset( $label[ 'requires' ] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label[ 'requires' ] ); } ?>>
35 35
 				<label>
36 36
 				<input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" type="hidden"
37 37
 				       value="0"/>
38 38
 				<input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>"
39 39
 				       id="<?php echo $this->get_field_id(); ?>" type="checkbox"
40 40
 				       value="1" <?php checked( ! empty( $this->value[ $value ] ) ); ?> />
41
-				<?php echo esc_html( $label['label'] ); ?>
41
+				<?php echo esc_html( $label[ 'label' ] ); ?>
42 42
 				</label>
43
-				<?php if( ! empty( $label['desc'] ) ) {
44
-					printf( '<span class="howto">%s</span>', $label['desc'] );
43
+				<?php if ( ! empty( $label[ 'desc' ] ) ) {
44
+					printf( '<span class="howto">%s</span>', $label[ 'desc' ] );
45 45
 				}
46 46
 				?>
47 47
 			</li>
Please login to merge, or discard this patch.
includes/extensions/entry-notes/fields/notes.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11 11
 $visibility_settings = $gravityview_view->getCurrentFieldSetting( 'notes' );
12
-$show_notes_logged_out = ( ! empty( $visibility_settings['view'] ) && ! empty( $visibility_settings['view_loggedout'] ) );
12
+$show_notes_logged_out = ( ! empty( $visibility_settings[ 'view' ] ) && ! empty( $visibility_settings[ 'view_loggedout' ] ) );
13 13
 
14
-if(	! GVCommon::has_cap( array( 'gravityview_view_entry_notes', 'gravityview_add_entry_notes', 'gravityview_delete_entry_notes' ) ) && ! $show_notes_logged_out ) {
14
+if ( ! GVCommon::has_cap( array( 'gravityview_view_entry_notes', 'gravityview_add_entry_notes', 'gravityview_delete_entry_notes' ) ) && ! $show_notes_logged_out ) {
15 15
 	return;
16 16
 }
17 17
 
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
25 25
 do_action( 'gravityview/field/notes/scripts' );
26 26
 
27 27
 $entry = $gravityview_view->getCurrentEntry();
28
-$notes = GravityView_Entry_Notes::get_notes( $entry['id'] );
28
+$notes = GravityView_Entry_Notes::get_notes( $entry[ 'id' ] );
29 29
 $strings = GravityView_Field_Notes::strings();
30
-$entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry );
30
+$entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry );
31 31
 
32
-$show_add = ! empty( $visibility_settings['add'] );
33
-$show_delete = ( ! empty( $visibility_settings['delete'] ) && GVCommon::has_cap( 'gravityview_delete_entry_notes' ) );
34
-$show_notes = $show_notes_logged_out || ( ! empty( $visibility_settings['view'] ) && GVCommon::has_cap( 'gravityview_view_entry_notes' ) );
32
+$show_add = ! empty( $visibility_settings[ 'add' ] );
33
+$show_delete = ( ! empty( $visibility_settings[ 'delete' ] ) && GVCommon::has_cap( 'gravityview_delete_entry_notes' ) );
34
+$show_notes = $show_notes_logged_out || ( ! empty( $visibility_settings[ 'view' ] ) && GVCommon::has_cap( 'gravityview_view_entry_notes' ) );
35 35
 
36 36
 $container_class = ( sizeof( $notes ) > 0 ? 'gv-has-notes' : 'gv-no-notes' );
37 37
 $container_class .= $show_notes ? ' gv-show-notes' : ' gv-hide-notes';
38 38
 ?>
39 39
 <div class="gv-notes <?php echo $container_class; ?>">
40 40
 <?php
41
-	if( $show_notes ) {
41
+	if ( $show_notes ) {
42 42
 ?>
43 43
 	<form method="post" class="gv-notes-list">
44 44
 		<?php if ( $show_delete ) { wp_nonce_field( 'gv_delete_notes_' . $entry_slug, 'gv_delete_notes' ); } ?>
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
 			<input type="hidden" name="action" value="gv_delete_notes" />
47 47
 			<input type="hidden" name="entry-slug" value="<?php echo esc_attr( $entry_slug ); ?>" />
48 48
 			<table>
49
-				<caption><?php echo $strings['caption']; ?></caption>
49
+				<caption><?php echo $strings[ 'caption' ]; ?></caption>
50 50
 				<?php
51 51
 				if ( $show_delete ) {
52 52
 				?>
53 53
 				<thead>
54 54
 					<tr>
55 55
 						<th colspan="2">
56
-							<label><input type="checkbox" value="" class="gv-notes-toggle" title="<?php echo $strings['toggle-notes']; ?>"><span class="screen-reader-text"><?php echo $strings['toggle-notes']; ?></span></label>
57
-							<button type="submit" class="button button-small gv-notes-delete"><?php echo $strings['delete']; ?></button>
56
+							<label><input type="checkbox" value="" class="gv-notes-toggle" title="<?php echo $strings[ 'toggle-notes' ]; ?>"><span class="screen-reader-text"><?php echo $strings[ 'toggle-notes' ]; ?></span></label>
57
+							<button type="submit" class="button button-small gv-notes-delete"><?php echo $strings[ 'delete' ]; ?></button>
58 58
 						</th>
59 59
 					</tr>
60 60
 				</thead>
61 61
 				<?php } ?>
62 62
 				<tbody>
63
-					<tr class="gv-notes-no-notes"><td colspan="2"><?php echo $strings['no-notes']; ?></td></tr>
63
+					<tr class="gv-notes-no-notes"><td colspan="2"><?php echo $strings[ 'no-notes' ]; ?></td></tr>
64 64
 					<?php
65 65
 						foreach ( $notes as $note ) {
66 66
 							echo GravityView_Field_Notes::display_note( $note, $show_delete );
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 <?php
74 74
 	} // End if can view notes
75 75
 
76
-	if( $show_add ) {
76
+	if ( $show_add ) {
77 77
 		echo do_shortcode( '[gv_note_add]' );
78 78
 	}
79 79
 ?>
Please login to merge, or discard this patch.
includes/class-gvlogic-shortcode.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public static function get_instance() {
87 87
 
88
-		if( empty( self::$instance ) ) {
88
+		if ( empty( self::$instance ) ) {
89 89
 			self::$instance = new self;
90 90
 		}
91 91
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
 		$operators = array_merge( self::$SUPPORTED_ARRAY_OPERATORS, self::$SUPPORTED_NUMERIC_OPERATORS, self::$SUPPORTED_SCALAR_OPERATORS, self::$SUPPORTED_CUSTOM_OPERATORS );
120 120
 
121
-		if( $with_values ) {
121
+		if ( $with_values ) {
122 122
 			$operators_with_values = array();
123
-			foreach( $operators as $key ) {
123
+			foreach ( $operators as $key ) {
124 124
 				$operators_with_values[ $key ] = '';
125 125
 			}
126 126
 			return $operators_with_values;
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	function set_operation( $operation = '' ) {
139 139
 
140
-		if( empty( $operation ) ) {
140
+		if ( empty( $operation ) ) {
141 141
 			return false;
142 142
 		}
143 143
 
144 144
 		$operators = $this->get_operators( false );
145 145
 
146
-		if( !in_array( $operation, $operators ) ) {
147
-			do_action( 'gravityview_log_debug', __METHOD__ .' Attempted to add invalid operation type.', $operation );
146
+		if ( ! in_array( $operation, $operators ) ) {
147
+			do_action( 'gravityview_log_debug', __METHOD__ . ' Attempted to add invalid operation type.', $operation );
148 148
 			return false;
149 149
 		}
150 150
 
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	private function setup_operation_and_comparison() {
166 166
 
167
-		foreach( $this->atts as $key => $value ) {
167
+		foreach ( $this->atts as $key => $value ) {
168 168
 
169 169
 			$valid = $this->set_operation( $key );
170 170
 
171
-			if( $valid ) {
171
+			if ( $valid ) {
172 172
 				$this->comparison = $value;
173 173
 				return true;
174 174
 			}
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 			return null;
192 192
 		}
193 193
 
194
-		if( empty( $atts ) ) {
195
-			do_action( 'gravityview_log_error', __METHOD__.' $atts are empty.', $atts );
194
+		if ( empty( $atts ) ) {
195
+			do_action( 'gravityview_log_error', __METHOD__ . ' $atts are empty.', $atts );
196 196
 			return null;
197 197
 		}
198 198
 
@@ -203,16 +203,16 @@  discard block
 block discarded – undo
203 203
 		$this->parse_atts();
204 204
 
205 205
 		// We need an "if"
206
-		if( false === $this->if ) {
207
-			do_action( 'gravityview_log_error', __METHOD__.' $atts->if is empty.', $this->passed_atts );
206
+		if ( false === $this->if ) {
207
+			do_action( 'gravityview_log_error', __METHOD__ . ' $atts->if is empty.', $this->passed_atts );
208 208
 			return null;
209 209
 		}
210 210
 
211 211
 		$setup = $this->setup_operation_and_comparison();
212 212
 
213 213
 		// We need an operation and comparison value
214
-		if( ! $setup ) {
215
-			do_action( 'gravityview_log_error', __METHOD__.' No valid operators were passed.', $this->atts );
214
+		if ( ! $setup ) {
215
+			do_action( 'gravityview_log_error', __METHOD__ . ' No valid operators were passed.', $this->atts );
216 216
 			return null;
217 217
 		}
218 218
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	private function get_output() {
247 247
 
248
-		if( $this->is_match ) {
248
+		if ( $this->is_match ) {
249 249
 			$output = $this->content;
250 250
 		} else {
251 251
 			$output = $this->else_content;
@@ -259,9 +259,9 @@  discard block
 block discarded – undo
259 259
 		 * @param string $output HTML/text output
260 260
 		 * @param GVLogic_Shortcode $this This class
261 261
 		 */
262
-		$output = apply_filters('gravityview/gvlogic/output', $output, $this );
262
+		$output = apply_filters( 'gravityview/gvlogic/output', $output, $this );
263 263
 
264
-		do_action( 'gravityview_log_debug', __METHOD__ .' Output: ', $output );
264
+		do_action( 'gravityview_log_debug', __METHOD__ . ' Output: ', $output );
265 265
 
266 266
 		return $output;
267 267
 	}
@@ -277,11 +277,11 @@  discard block
 block discarded – undo
277 277
 
278 278
 		$content = explode( '[else]', $this->passed_content );
279 279
 
280
-		$this->content = $content[0];
280
+		$this->content = $content[ 0 ];
281 281
 
282
-		$else_attr = isset( $this->atts['else'] ) ? $this->atts['else'] : NULL;
282
+		$else_attr = isset( $this->atts[ 'else' ] ) ? $this->atts[ 'else' ] : NULL;
283 283
 
284
-		$this->else_content = isset( $content[1] ) ? $content[1] : $else_attr;
284
+		$this->else_content = isset( $content[ 1 ] ) ? $content[ 1 ] : $else_attr;
285 285
 	}
286 286
 
287 287
 	/**
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
 		$this->atts = function_exists( 'array_intersect_key' ) ? array_intersect_key( $this->passed_atts, $this->atts ) : $this->atts;
305 305
 
306 306
 		// Strip whitespace if it's not default false
307
-		$this->if = is_string( $this->atts['if'] ) ? trim( $this->atts['if'] ) : false;
307
+		$this->if = is_string( $this->atts[ 'if' ] ) ? trim( $this->atts[ 'if' ] ) : false;
308 308
 
309 309
 		// Make sure the "if" isn't processed in self::setup_operation_and_comparison()
310
-		unset( $this->atts['if'] );
310
+		unset( $this->atts[ 'if' ] );
311 311
 	}
312 312
 }
313 313
 
Please login to merge, or discard this patch.
includes/extensions/delete-entry/class-delete-entry.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
 		add_action( 'wp', array( $this, 'process_delete' ), 10000 );
44 44
 
45
-		add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field'), 10, 3 );
45
+		add_filter( 'gravityview_entry_default_fields', array( $this, 'add_default_field' ), 10, 3 );
46 46
 
47 47
 		add_action( 'gravityview_before', array( $this, 'display_message' ) );
48 48
 
49 49
 		// For the Delete Entry Link, you don't want visible to all users.
50
-		add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps'), 10, 5 );
50
+		add_filter( 'gravityview_field_visibility_caps', array( $this, 'modify_visibility_caps' ), 10, 5 );
51 51
 
52 52
 		// Modify the field options based on the name of the field type
53 53
 		add_filter( 'gravityview_template_delete_link_options', array( $this, 'delete_link_field_options' ), 10, 5 );
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		// add template path to check for field
56 56
 		add_filter( 'gravityview_template_paths', array( $this, 'add_template_path' ) );
57 57
 
58
-		add_action( 'gravityview/edit-entry/publishing-action/after', array( $this, 'add_delete_button'), 10, 3 );
58
+		add_action( 'gravityview/edit-entry/publishing-action/after', array( $this, 'add_delete_button' ), 10, 3 );
59 59
 
60
-		add_action ( 'gravityview/delete-entry/deleted', array( $this, 'process_connected_posts' ), 10, 2 );
61
-		add_action ( 'gravityview/delete-entry/trashed', array( $this, 'process_connected_posts' ), 10, 2 );
60
+		add_action( 'gravityview/delete-entry/deleted', array( $this, 'process_connected_posts' ), 10, 2 );
61
+		add_action( 'gravityview/delete-entry/trashed', array( $this, 'process_connected_posts' ), 10, 2 );
62 62
 	}
63 63
 
64 64
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	static function getInstance() {
71 71
 
72
-		if( empty( self::$instance ) ) {
72
+		if ( empty( self::$instance ) ) {
73 73
 			self::$instance = new self;
74 74
 		}
75 75
 
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
 	function delete_link_field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
106 106
 
107 107
 		// Always a link, never a filter
108
-		unset( $field_options['show_as_link'], $field_options['search_filter'] );
108
+		unset( $field_options[ 'show_as_link' ], $field_options[ 'search_filter' ] );
109 109
 
110 110
 		// Delete Entry link should only appear to visitors capable of editing entries
111
-		unset( $field_options['only_loggedin'], $field_options['only_loggedin_cap'] );
111
+		unset( $field_options[ 'only_loggedin' ], $field_options[ 'only_loggedin_cap' ] );
112 112
 
113
-		$add_option['delete_link'] = array(
113
+		$add_option[ 'delete_link' ] = array(
114 114
 			'type' => 'text',
115 115
 			'label' => __( 'Delete Link Text', 'gravityview' ),
116 116
 			'desc' => NULL,
117
-			'value' => __('Delete Entry', 'gravityview'),
117
+			'value' => __( 'Delete Entry', 'gravityview' ),
118 118
 			'merge_tags' => true,
119 119
 		);
120 120
 
121
-		$field_options['allow_edit_cap'] = array(
121
+		$field_options[ 'allow_edit_cap' ] = array(
122 122
 			'type' => 'select',
123 123
 			'label' => __( 'Allow the following users to delete the entry:', 'gravityview' ),
124 124
 			'choices' => GravityView_Render_Settings::get_cap_choices( $template_id, $field_id, $context, $input_type ),
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	function add_default_field( $entry_default_fields, $form = array(), $zone = '' ) {
144 144
 
145
-		$entry_default_fields['delete_link'] = array(
146
-			'label' => __('Delete Entry', 'gravityview'),
145
+		$entry_default_fields[ 'delete_link' ] = array(
146
+			'label' => __( 'Delete Entry', 'gravityview' ),
147 147
 			'type' => 'delete_link',
148
-			'desc'	=> __('A link to delete the entry. Respects the Delete Entry permissions.', 'gravityview'),
148
+			'desc'	=> __( 'A link to delete the entry. Respects the Delete Entry permissions.', 'gravityview' ),
149 149
 		);
150 150
 
151 151
 		return $entry_default_fields;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 */
159 159
 	function add_available_field( $available_fields = array() ) {
160 160
 
161
-		$available_fields['delete_link'] = array(
161
+		$available_fields[ 'delete_link' ] = array(
162 162
 			'label_text' => __( 'Delete Entry', 'gravityview' ),
163 163
 			'field_id' => 'delete_link',
164 164
 			'label_type' => 'field',
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
 		$caps = $visibility_caps;
187 187
 
188 188
 		// If we're configuring fields in the edit context, we want a limited selection
189
-		if( $field_id === 'delete_link' ) {
189
+		if ( $field_id === 'delete_link' ) {
190 190
 
191 191
 			// Remove other built-in caps.
192
-			unset( $caps['publish_posts'], $caps['gravityforms_view_entries'], $caps['delete_others_posts'] );
192
+			unset( $caps[ 'publish_posts' ], $caps[ 'gravityforms_view_entries' ], $caps[ 'delete_others_posts' ] );
193 193
 
194
-			$caps['read'] = _x('Entry Creator', 'User capability', 'gravityview');
194
+			$caps[ 'read' ] = _x( 'Entry Creator', 'User capability', 'gravityview' );
195 195
 		}
196 196
 
197 197
 		return $caps;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 * @param [type] $entry [description]
205 205
 	 */
206 206
 	function set_entry( $entry = null ) {
207
-		$this->entry = empty( $entry ) ? GravityView_View::getInstance()->entries[0] : $entry;
207
+		$this->entry = empty( $entry ) ? GravityView_View::getInstance()->entries[ 0 ] : $entry;
208 208
 	}
209 209
 
210 210
 	/**
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
 
235 235
         $base = GravityView_API::directory_link( $post_id, true );
236 236
 
237
-		if( empty( $base ) ) {
238
-			do_action( 'gravityview_log_error', __METHOD__ . ' - Post ID does not exist: '.$post_id );
237
+		if ( empty( $base ) ) {
238
+			do_action( 'gravityview_log_error', __METHOD__ . ' - Post ID does not exist: ' . $post_id );
239 239
 			return NULL;
240 240
 		}
241 241
 
242 242
 		// Use the slug instead of the ID for consistent security
243
-		$entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry );
243
+		$entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry );
244 244
 
245 245
         $view_id = empty( $view_id ) ? gravityview_get_view_id() : $view_id;
246 246
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             'view_id' => $view_id,
252 252
 		), $base );
253 253
 
254
-		$url = wp_nonce_url( $actionurl, 'delete_'.$entry_slug, 'delete' );
254
+		$url = wp_nonce_url( $actionurl, 'delete_' . $entry_slug, 'delete' );
255 255
 
256 256
 		return $url;
257 257
 	}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	function add_delete_button( $form = array(), $entry = array(), $view_id = NULL ) {
269 269
 
270 270
 		// Only show the link to those who are allowed to see it.
271
-		if( !self::check_user_cap_delete_entry( $entry ) ) {
271
+		if ( ! self::check_user_cap_delete_entry( $entry ) ) {
272 272
 			return;
273 273
 		}
274 274
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		$show_delete_button = apply_filters( 'gravityview/delete-entry/show-delete-button', true );
280 280
 
281 281
 		// If the button is hidden by the filter, don't show.
282
-		if( !$show_delete_button ) {
282
+		if ( ! $show_delete_button ) {
283 283
 			return;
284 284
 		}
285 285
 
@@ -309,27 +309,27 @@  discard block
 block discarded – undo
309 309
 	function process_delete() {
310 310
 
311 311
 		// If the form is submitted
312
-		if( isset( $_GET['action'] ) && 'delete' === $_GET['action'] && isset( $_GET['entry_id'] ) ) {
312
+		if ( isset( $_GET[ 'action' ] ) && 'delete' === $_GET[ 'action' ] && isset( $_GET[ 'entry_id' ] ) ) {
313 313
 
314 314
 			// Make sure it's a GravityView request
315
-			$valid_nonce_key = wp_verify_nonce( $_GET['delete'], self::get_nonce_key( $_GET['entry_id'] ) );
315
+			$valid_nonce_key = wp_verify_nonce( $_GET[ 'delete' ], self::get_nonce_key( $_GET[ 'entry_id' ] ) );
316 316
 
317
-			if( ! $valid_nonce_key ) {
318
-				do_action('gravityview_log_debug', __METHOD__ . ' Delete entry not processed: nonce validation failed.' );
317
+			if ( ! $valid_nonce_key ) {
318
+				do_action( 'gravityview_log_debug', __METHOD__ . ' Delete entry not processed: nonce validation failed.' );
319 319
 				return;
320 320
 			}
321 321
 
322 322
 			// Get the entry slug
323
-			$entry_slug = esc_attr( $_GET['entry_id'] );
323
+			$entry_slug = esc_attr( $_GET[ 'entry_id' ] );
324 324
 
325 325
 			// See if there's an entry there
326 326
 			$entry = gravityview_get_entry( $entry_slug );
327 327
 
328
-			if( $entry ) {
328
+			if ( $entry ) {
329 329
 
330 330
 				$has_permission = $this->user_can_delete_entry( $entry );
331 331
 
332
-				if( is_wp_error( $has_permission ) ) {
332
+				if ( is_wp_error( $has_permission ) ) {
333 333
 
334 334
 					$messages = array(
335 335
 						'message' => urlencode( $has_permission->get_error_message() ),
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 					// Delete the entry
342 342
 					$delete_response = $this->delete_or_trash_entry( $entry );
343 343
 
344
-					if( is_wp_error( $delete_response ) ) {
344
+					if ( is_wp_error( $delete_response ) ) {
345 345
 
346 346
 						$messages = array(
347 347
 							'message' => urlencode( $delete_response->get_error_message() ),
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 
361 361
 			} else {
362 362
 
363
-				do_action('gravityview_log_debug', __METHOD__ . ' Delete entry failed: there was no entry with the entry slug '. $entry_slug );
363
+				do_action( 'gravityview_log_debug', __METHOD__ . ' Delete entry failed: there was no entry with the entry slug ' . $entry_slug );
364 364
 
365 365
 				$messages = array(
366
-					'message' => urlencode( __('The entry does not exist.', 'gravityview') ),
366
+					'message' => urlencode( __( 'The entry does not exist.', 'gravityview' ) ),
367 367
 					'status' => 'error',
368 368
 				);
369 369
 			}
@@ -403,18 +403,18 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	private function delete_or_trash_entry( $entry ) {
405 405
 
406
-		$entry_id = $entry['id'];
406
+		$entry_id = $entry[ 'id' ];
407 407
 		
408 408
 		$mode = $this->get_delete_mode();
409 409
 
410
-		if( 'delete' === $mode ) {
410
+		if ( 'delete' === $mode ) {
411 411
 
412 412
 			do_action( 'gravityview_log_debug', __METHOD__ . ' Starting delete entry: ', $entry_id );
413 413
 
414 414
 			// Delete the entry
415 415
 			$delete_response = GFAPI::delete_entry( $entry_id );
416 416
 
417
-			if( ! is_wp_error( $delete_response ) ) {
417
+			if ( ! is_wp_error( $delete_response ) ) {
418 418
 				$delete_response = 'deleted';
419 419
 
420 420
 				/**
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
 			$trashed = GFAPI::update_entry_property( $entry_id, 'status', 'trash' );
436 436
 			new GravityView_Cache;
437 437
 
438
-			if( ! $trashed ) {
439
-				$delete_response = new WP_Error( 'trash_entry_failed', __('Moving the entry to the trash failed.', 'gravityview' ) );
438
+			if ( ! $trashed ) {
439
+				$delete_response = new WP_Error( 'trash_entry_failed', __( 'Moving the entry to the trash failed.', 'gravityview' ) );
440 440
 			} else {
441 441
 
442 442
 				/**
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 	public function process_connected_posts( $entry_id = 0, $entry = array() ) {
468 468
 
469 469
 		// The entry had no connected post
470
-		if( empty( $entry['post_id'] ) ) {
470
+		if ( empty( $entry[ 'post_id' ] ) ) {
471 471
 			return;
472 472
 		}
473 473
 
@@ -478,22 +478,22 @@  discard block
 block discarded – undo
478 478
 		 */
479 479
 		$delete_post = apply_filters( 'gravityview/delete-entry/delete-connected-post', true );
480 480
 		
481
-		if( false === $delete_post ) {
481
+		if ( false === $delete_post ) {
482 482
 			return;
483 483
 		}
484 484
 
485 485
 		$action = current_action();
486 486
 
487
-		if( 'gravityview/delete-entry/deleted' === $action ) {
488
-			$result = wp_delete_post( $entry['post_id'], true );
487
+		if ( 'gravityview/delete-entry/deleted' === $action ) {
488
+			$result = wp_delete_post( $entry[ 'post_id' ], true );
489 489
 		} else {
490
-			$result = wp_trash_post( $entry['post_id'] );
490
+			$result = wp_trash_post( $entry[ 'post_id' ] );
491 491
 		}
492 492
 
493
-		if( false === $result ) {
494
-			do_action( 'gravityview_log_error', __METHOD__ . ' (called by '.$action.'): Error processing the Post connected to the entry.', $entry );
493
+		if ( false === $result ) {
494
+			do_action( 'gravityview_log_error', __METHOD__ . ' (called by ' . $action . '): Error processing the Post connected to the entry.', $entry );
495 495
 		} else {
496
-			do_action( 'gravityview_log_debug', __METHOD__ . ' (called by '.$action.'): Successfully processed Post connected to the entry.', $entry );
496
+			do_action( 'gravityview_log_debug', __METHOD__ . ' (called by ' . $action . '): Successfully processed Post connected to the entry.', $entry );
497 497
 		}
498 498
 	}
499 499
 
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
 	public function verify_nonce() {
507 507
 
508 508
 		// No delete entry request was made
509
-		if( empty( $_GET['entry_id'] ) || empty( $_GET['delete'] ) ) {
509
+		if ( empty( $_GET[ 'entry_id' ] ) || empty( $_GET[ 'delete' ] ) ) {
510 510
 			return false;
511 511
 		}
512 512
 
513
-		$nonce_key = self::get_nonce_key( $_GET['entry_id'] );
513
+		$nonce_key = self::get_nonce_key( $_GET[ 'entry_id' ] );
514 514
 
515
-		$valid = wp_verify_nonce( $_GET['delete'], $nonce_key );
515
+		$valid = wp_verify_nonce( $_GET[ 'delete' ], $nonce_key );
516 516
 
517 517
 		/**
518 518
 		 * @filter `gravityview/delete-entry/verify_nonce` Override Delete Entry nonce validation. Return true to declare nonce valid.
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	 */
535 535
 	public static function get_confirm_dialog() {
536 536
 
537
-		$confirm = __('Are you sure you want to delete this entry? This cannot be undone.', 'gravityview');
537
+		$confirm = __( 'Are you sure you want to delete this entry? This cannot be undone.', 'gravityview' );
538 538
 
539 539
 		/**
540 540
 		 * @filter `gravityview/delete-entry/confirm-text` Modify the Delete Entry Javascript confirmation text
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 		 */
543 543
 		$confirm = apply_filters( 'gravityview/delete-entry/confirm-text', $confirm );
544 544
 
545
-		return 'return window.confirm(\''. esc_js( $confirm ) .'\');';
545
+		return 'return window.confirm(\'' . esc_js( $confirm ) . '\');';
546 546
 	}
547 547
 
548 548
 	/**
@@ -560,16 +560,16 @@  discard block
 block discarded – undo
560 560
 
561 561
 		$error = NULL;
562 562
 
563
-		if( ! $this->verify_nonce() ) {
564
-			$error = __( 'The link to delete this entry is not valid; it may have expired.', 'gravityview');
563
+		if ( ! $this->verify_nonce() ) {
564
+			$error = __( 'The link to delete this entry is not valid; it may have expired.', 'gravityview' );
565 565
 		}
566 566
 
567
-		if( ! self::check_user_cap_delete_entry( $entry ) ) {
568
-			$error = __( 'You do not have permission to delete this entry.', 'gravityview');
567
+		if ( ! self::check_user_cap_delete_entry( $entry ) ) {
568
+			$error = __( 'You do not have permission to delete this entry.', 'gravityview' );
569 569
 		}
570 570
 
571
-		if( $entry['status'] === 'trash' ) {
572
-			if( 'trash' === $this->get_delete_mode() ) {
571
+		if ( $entry[ 'status' ] === 'trash' ) {
572
+			if ( 'trash' === $this->get_delete_mode() ) {
573 573
 				$error = __( 'The entry is already in the trash.', 'gravityview' );
574 574
 			} else {
575 575
 				$error = __( 'You cannot delete the entry; it is already in the trash.', 'gravityview' );
@@ -577,11 +577,11 @@  discard block
 block discarded – undo
577 577
 		}
578 578
 
579 579
 		// No errors; everything's fine here!
580
-		if( empty( $error ) ) {
580
+		if ( empty( $error ) ) {
581 581
 			return true;
582 582
 		}
583 583
 
584
-		do_action('gravityview_log_error', 'GravityView_Delete_Entry[user_can_delete_entry]' . $error );
584
+		do_action( 'gravityview_log_error', 'GravityView_Delete_Entry[user_can_delete_entry]' . $error );
585 585
 
586 586
 		return new WP_Error( 'gravityview-delete-entry-permissions', $error );
587 587
 	}
@@ -603,32 +603,32 @@  discard block
 block discarded – undo
603 603
 
604 604
 		$current_user = wp_get_current_user();
605 605
 
606
-		$entry_id = isset( $entry['id'] ) ? $entry['id'] : NULL;
606
+		$entry_id = isset( $entry[ 'id' ] ) ? $entry[ 'id' ] : NULL;
607 607
 
608 608
 		// Or if they can delete any entries (as defined in Gravity Forms), we're good.
609
-		if( GVCommon::has_cap( array( 'gravityforms_delete_entries', 'gravityview_delete_others_entries' ), $entry_id ) ) {
609
+		if ( GVCommon::has_cap( array( 'gravityforms_delete_entries', 'gravityview_delete_others_entries' ), $entry_id ) ) {
610 610
 
611
-			do_action('gravityview_log_debug', 'GravityView_Delete_Entry[check_user_cap_delete_entry] Current user has `gravityforms_delete_entries` or `gravityview_delete_others_entries` capability.' );
611
+			do_action( 'gravityview_log_debug', 'GravityView_Delete_Entry[check_user_cap_delete_entry] Current user has `gravityforms_delete_entries` or `gravityview_delete_others_entries` capability.' );
612 612
 
613 613
 			return true;
614 614
 		}
615 615
 
616 616
 
617 617
 		// If field options are passed, check if current user can view the link
618
-		if( !empty( $field ) ) {
618
+		if ( ! empty( $field ) ) {
619 619
 
620 620
 			// If capability is not defined, something is not right!
621
-			if( empty( $field['allow_edit_cap'] ) ) {
621
+			if ( empty( $field[ 'allow_edit_cap' ] ) ) {
622 622
 
623 623
 				do_action( 'gravityview_log_error', 'GravityView_Delete_Entry[check_user_cap_delete_entry] Cannot read delete entry field caps', $field );
624 624
 
625 625
 				return false;
626 626
 			}
627 627
 
628
-			if( GVCommon::has_cap( $field['allow_edit_cap'] ) ) {
628
+			if ( GVCommon::has_cap( $field[ 'allow_edit_cap' ] ) ) {
629 629
 
630 630
 				// Do not return true if cap is read, as we need to check if the current user created the entry
631
-				if( $field['allow_edit_cap'] !== 'read' ) {
631
+				if ( $field[ 'allow_edit_cap' ] !== 'read' ) {
632 632
 					return true;
633 633
 				}
634 634
 
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
 
642 642
 		}
643 643
 
644
-		if( !isset( $entry['created_by'] ) ) {
644
+		if ( ! isset( $entry[ 'created_by' ] ) ) {
645 645
 
646
-			do_action('gravityview_log_error', 'GravityView_Delete_Entry[check_user_cap_delete_entry] Entry `created_by` doesn\'t exist.');
646
+			do_action( 'gravityview_log_error', 'GravityView_Delete_Entry[check_user_cap_delete_entry] Entry `created_by` doesn\'t exist.' );
647 647
 
648 648
 			return false;
649 649
 		}
@@ -651,24 +651,24 @@  discard block
 block discarded – undo
651 651
 		$view_id = empty( $view_id ) ? $gravityview_view->getViewId() : $view_id;
652 652
 
653 653
 		// Only checks user_delete view option if view is already set
654
-		if( $view_id ) {
654
+		if ( $view_id ) {
655 655
 
656 656
 			$current_view = gravityview_get_current_view_data( $view_id );
657 657
 
658
-			$user_delete = isset( $current_view['atts']['user_delete'] ) ? $current_view['atts']['user_delete'] : false;
658
+			$user_delete = isset( $current_view[ 'atts' ][ 'user_delete' ] ) ? $current_view[ 'atts' ][ 'user_delete' ] : false;
659 659
 
660
-			if( empty( $user_delete ) ) {
660
+			if ( empty( $user_delete ) ) {
661 661
 
662
-				do_action('gravityview_log_debug', 'GravityView_Delete_Entry[check_user_cap_delete_entry] User Delete is disabled. Returning false.' );
662
+				do_action( 'gravityview_log_debug', 'GravityView_Delete_Entry[check_user_cap_delete_entry] User Delete is disabled. Returning false.' );
663 663
 
664 664
 				return false;
665 665
 			}
666 666
 		}
667 667
 
668 668
 		// If the logged-in user is the same as the user who created the entry, we're good.
669
-		if( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry['created_by'] ) ) {
669
+		if ( is_user_logged_in() && intval( $current_user->ID ) === intval( $entry[ 'created_by' ] ) ) {
670 670
 
671
-			do_action('gravityview_log_debug', sprintf( 'GravityView_Delete_Entry[check_user_cap_delete_entry] User %s created the entry.', $current_user->ID ) );
671
+			do_action( 'gravityview_log_debug', sprintf( 'GravityView_Delete_Entry[check_user_cap_delete_entry] User %s created the entry.', $current_user->ID ) );
672 672
 
673 673
 			return true;
674 674
 		}
@@ -691,31 +691,31 @@  discard block
 block discarded – undo
691 691
 	 */
692 692
 	public function display_message( $current_view_id = 0 ) {
693 693
 
694
-		if( empty( $_GET['status'] ) || ! self::verify_nonce() ) {
694
+		if ( empty( $_GET[ 'status' ] ) || ! self::verify_nonce() ) {
695 695
 			return;
696 696
 		}
697 697
 
698 698
 		// Entry wasn't deleted from current View
699
-		if( intval( $_GET['gvid'] ) !== intval( $current_view_id ) ) {
699
+		if ( intval( $_GET[ 'gvid' ] ) !== intval( $current_view_id ) ) {
700 700
 			return;
701 701
 		}
702 702
 
703
-		$status = esc_attr( $_GET['status'] );
704
-		$message_from_url = rgget('message');
703
+		$status = esc_attr( $_GET[ 'status' ] );
704
+		$message_from_url = rgget( 'message' );
705 705
 		$message_from_url = urldecode( stripslashes_deep( $message_from_url ) );
706 706
 		$class = '';
707 707
 
708 708
 		switch ( $status ) {
709 709
 			case 'error':
710 710
 				$class = ' gv-error error';
711
-				$error_message = __('There was an error deleting the entry: %s', 'gravityview');
711
+				$error_message = __( 'There was an error deleting the entry: %s', 'gravityview' );
712 712
 				$message = sprintf( $error_message, $message_from_url );
713 713
 				break;
714 714
 			case 'trashed':
715
-				$message = __('The entry was successfully moved to the trash.', 'gravityview');
715
+				$message = __( 'The entry was successfully moved to the trash.', 'gravityview' );
716 716
 				break;
717 717
 			default:
718
-				$message = __('The entry was successfully deleted.', 'gravityview');
718
+				$message = __( 'The entry was successfully deleted.', 'gravityview' );
719 719
 				break;
720 720
 		}
721 721
 
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 		$message = apply_filters( 'gravityview/delete-entry/message', esc_attr( $message ), $status, $message_from_url );
730 730
 
731 731
 		// DISPLAY ERROR/SUCCESS MESSAGE
732
-		echo '<div class="gv-notice' . esc_attr( $class ) .'">'. $message .'</div>';
732
+		echo '<div class="gv-notice' . esc_attr( $class ) . '">' . $message . '</div>';
733 733
 	}
734 734
 
735 735
 
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-signature.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		$signature_fields = GFAPI::get_fields_by_type( $form, 'signature' );
54 54
 
55 55
 		foreach ( $signature_fields as $field ) {
56
-			unset( $_POST["input_{$field->id}"] );
56
+			unset( $_POST[ "input_{$field->id}" ] );
57 57
 		}
58 58
 	}
59 59
 
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	function edit_entry_field_input( $field_content = '', $field, $value = '', $lead_id = 0, $form_id = 0 ) {
74 74
 
75
-		$context = function_exists('gravityview_get_context') ? gravityview_get_context() : '';
75
+		$context = function_exists( 'gravityview_get_context' ) ? gravityview_get_context() : '';
76 76
 
77
-		if( 'signature' !== $field->type || 'edit' !== $context ) {
77
+		if ( 'signature' !== $field->type || 'edit' !== $context ) {
78 78
 			return $field_content;
79 79
 		}
80 80
 
81 81
 		// We need to fetch a fresh version of the entry, since the saved entry hasn't refreshed in GV yet.
82 82
 		$entry = GravityView_View::getInstance()->getCurrentEntry();
83
-		$entry = GFAPI::get_entry( $entry['id'] );
83
+		$entry = GFAPI::get_entry( $entry[ 'id' ] );
84 84
 		$entry_value = rgar( $entry, $field->id );
85 85
 
86
-		$_POST["input_{$field->id}"] = $entry_value; // Used when Edit Entry form *is* submitted
87
-		$_POST["input_{$form_id}_{$field->id}_signature_filename"] = $entry_value; // Used when Edit Entry form *is not* submitted
86
+		$_POST[ "input_{$field->id}" ] = $entry_value; // Used when Edit Entry form *is* submitted
87
+		$_POST[ "input_{$form_id}_{$field->id}_signature_filename" ] = $entry_value; // Used when Edit Entry form *is not* submitted
88 88
 
89 89
 		return ''; // Return empty string to force using $_POST values instead
90 90
 	}
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-theme-hooks-church-themes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	 */
51 51
 	public function if_gravityview_return_true( $has_content = false ) {
52 52
 
53
-		if( ! class_exists( 'GravityView_frontend' ) ) {
53
+		if ( ! class_exists( 'GravityView_frontend' ) ) {
54 54
 			return $has_content;
55 55
 		}
56 56
 
Please login to merge, or discard this patch.
includes/class-gravityview-merge-tags.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	public static function process_modifiers( $value, $merge_tag, $modifier, $field, $raw_value ) {
46 46
 
47 47
 		// No modifier was set or the raw value was empty
48
-		if( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) {
48
+		if ( 'all_fields' === $merge_tag || '' === $modifier || ! is_string( $raw_value ) || '' === $raw_value ) {
49 49
 			return $value;
50 50
 		}
51 51
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 		foreach ( $gv_modifiers as $gv_modifier => $method ) {
62 62
 
63 63
 			// Only match the regex if it's the first modifer; this allows us to enforce our own modifier structure
64
-			preg_match( '/^' . $gv_modifier .'/ism', $modifier, $matches );
64
+			preg_match( '/^' . $gv_modifier . '/ism', $modifier, $matches );
65 65
 
66
-			if( ! empty( $matches ) ) {
66
+			if ( ! empty( $matches ) ) {
67 67
 				// The called method is passed the raw value and the full matches array
68 68
 				$return = self::$method( $raw_value, $matches );
69 69
 				break;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	private static function modifier_timestamp( $raw_value, $matches ) {
89 89
 
90
-		if( empty( $matches[0] ) ) {
90
+		if ( empty( $matches[ 0 ] ) ) {
91 91
 			return $raw_value;
92 92
 		}
93 93
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	private static function modifier_wpautop( $raw_value, $matches ) {
113 113
 
114
-		if( empty( $matches[0] ) || ! function_exists( 'wpautop' ) ) {
114
+		if ( empty( $matches[ 0 ] ) || ! function_exists( 'wpautop' ) ) {
115 115
 			return $raw_value;
116 116
 		}
117 117
 
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	private static function modifier_maxwords( $raw_value, $matches ) {
137 137
 
138
-		if( ! is_string( $raw_value ) || empty( $matches[1] ) || ! function_exists( 'wp_trim_words' ) ) {
138
+		if ( ! is_string( $raw_value ) || empty( $matches[ 1 ] ) || ! function_exists( 'wp_trim_words' ) ) {
139 139
 			return $raw_value;
140 140
 		}
141 141
 
142
-		$max = intval( $matches[1] );
142
+		$max = intval( $matches[ 1 ] );
143 143
 
144 144
 		$more_placeholder = '[GVMORE]';
145 145
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @param  bool       $esc_html     Pass return value through `esc_html()`
172 172
 	 * @return string                  Text with variables maybe replaced
173 173
 	 */
174
-	public static function replace_variables($text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) {
174
+	public static function replace_variables( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = true ) {
175 175
 
176 176
 		/**
177 177
 		 * @filter `gravityview_do_replace_variables` Turn off merge tag variable replacements.\n
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 		 * @internal Reported to GF Support on 12/3
196 196
 		 * @internal Fixed in Gravity Forms
197 197
 		 */
198
-		$form['title']  = isset( $form['title'] ) ? $form['title'] : '';
199
-		$form['id']     = isset( $form['id'] ) ? $form['id'] : '';
200
-		$form['fields'] = isset( $form['fields'] ) ? $form['fields'] : array();
198
+		$form[ 'title' ]  = isset( $form[ 'title' ] ) ? $form[ 'title' ] : '';
199
+		$form[ 'id' ]     = isset( $form[ 'id' ] ) ? $form[ 'id' ] : '';
200
+		$form[ 'fields' ] = isset( $form[ 'fields' ] ) ? $form[ 'fields' ] : array();
201 201
 
202 202
 		return GFCommon::replace_variables( $text, $form, $entry, $url_encode, $esc_html );
203 203
 	}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 *
218 218
 	 * @return mixed
219 219
 	 */
220
-	public static function replace_gv_merge_tags(  $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
220
+	public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
221 221
 
222 222
 		/**
223 223
 		 * This prevents the gform_replace_merge_tags filter from being called twice, as defined in:
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		 * @see GFCommon::replace_variables_prepopulate()
226 226
 		 * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14
227 227
 		 */
228
-		if( false === $form ) {
228
+		if ( false === $form ) {
229 229
 			return $text;
230 230
 		}
231 231
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			'diff' => in_array( 'diff', $exploded ), // {date_created:diff}
258 258
 			'raw' => in_array( 'raw', $exploded ), // {date_created:raw}
259 259
 			'timestamp' => in_array( 'timestamp', $exploded ), // {date_created:timestamp}
260
-			'time' => in_array( 'time', $exploded ),  // {date_created:time}
260
+			'time' => in_array( 'time', $exploded ), // {date_created:time}
261 261
 		);
262 262
 
263 263
 		$formatted_date = GVCommon::format_date( $date_created, $atts );
@@ -320,14 +320,14 @@  discard block
 block discarded – undo
320 320
 		preg_match_all( "/{get:(.*?)}/ism", $text, $matches, PREG_SET_ORDER );
321 321
 
322 322
 		// If there are no matches OR the Entry `created_by` isn't set or is 0 (no user)
323
-		if( empty( $matches ) ) {
323
+		if ( empty( $matches ) ) {
324 324
 			return $text;
325 325
 		}
326 326
 
327 327
 		foreach ( $matches as $match ) {
328 328
 
329
-			$full_tag = $match[0];
330
-			$property = $match[1];
329
+			$full_tag = $match[ 0 ];
330
+			$property = $match[ 1 ];
331 331
 
332 332
 			$value = stripslashes_deep( rgget( $property ) );
333 333
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 			 * @since 1.15
352 352
 			 * @param bool $esc_html Whether to esc_html() the value. Default: `true`
353 353
 			 */
354
-			$esc_html = apply_filters('gravityview/merge_tags/get/esc_html/' . $property, true );
354
+			$esc_html = apply_filters( 'gravityview/merge_tags/get/esc_html/' . $property, true );
355 355
 
356 356
 			$value = $esc_html ? esc_html( $value ) : $value;
357 357
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 			 * @param[in] array $form Gravity Forms form array
363 363
 			 * @param[in] array $entry Entry array
364 364
 			 */
365
-			$value = apply_filters('gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry );
365
+			$value = apply_filters( 'gravityview/merge_tags/get/value/' . $property, $value, $text, $form, $entry );
366 366
 
367 367
 			$text = str_replace( $full_tag, $value, $text );
368 368
 		}
Please login to merge, or discard this patch.
includes/admin/class-gravityview-admin-no-conflict.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		if( ! is_admin() ) { return; }
21
+		if ( ! is_admin() ) { return; }
22 22
 		
23 23
 		$this->add_hooks();
24 24
 	}
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	private function add_hooks() {
34 34
 		//Hooks for no-conflict functionality
35
-		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000);
36
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9);
35
+		add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 );
36
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 );
37 37
 
38
-		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000);
39
-		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11);
40
-		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1);
41
-		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1);
38
+		add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 );
39
+		add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 );
40
+		add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 );
41
+		add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 );
42 42
 	}
43 43
 
44 44
 	/**
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	function no_conflict_scripts() {
52 52
 		global $wp_scripts;
53 53
 
54
-		if( ! gravityview_is_admin_page() ) {
54
+		if ( ! gravityview_is_admin_page() ) {
55 55
 			return;
56 56
 		}
57 57
 
58
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
58
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
59 59
 
60
-		if( empty( $no_conflict_mode ) ) {
60
+		if ( empty( $no_conflict_mode ) ) {
61 61
 			return;
62 62
 		}
63 63
 
@@ -110,24 +110,24 @@  discard block
 block discarded – undo
110 110
 	function no_conflict_styles() {
111 111
 		global $wp_styles;
112 112
 
113
-		if( ! gravityview_is_admin_page() ) {
113
+		if ( ! gravityview_is_admin_page() ) {
114 114
 			return;
115 115
 		}
116 116
 
117 117
 		// Dequeue other jQuery styles even if no-conflict is off.
118 118
 		// Terrible-looking tabs help no one.
119
-		if( !empty( $wp_styles->registered ) )  {
120
-			foreach ($wp_styles->registered as $key => $style) {
121
-				if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
119
+		if ( ! empty( $wp_styles->registered ) ) {
120
+			foreach ( $wp_styles->registered as $key => $style ) {
121
+				if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) {
122 122
 					wp_dequeue_style( $key );
123 123
 				}
124 124
 			}
125 125
 		}
126 126
 
127
-		$no_conflict_mode = GravityView_Settings::getSetting('no-conflict-mode');
127
+		$no_conflict_mode = GravityView_Settings::getSetting( 'no-conflict-mode' );
128 128
 
129 129
 		// If no conflict is off, jQuery will suffice.
130
-		if( empty( $no_conflict_mode ) ) {
130
+		if ( empty( $no_conflict_mode ) ) {
131 131
 			return;
132 132
 		}
133 133
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		/**
155 155
 		 * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here.
156 156
 		 */
157
-		do_action('gravityview_remove_conflicts_after');
157
+		do_action( 'gravityview_remove_conflicts_after' );
158 158
 	}
159 159
 
160 160
 	/**
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
 		//reset queue
180 180
 		$queue = array();
181
-		foreach( $wp_objects->queue as $object ) {
182
-			if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) {
183
-				$queue[] = $object;
181
+		foreach ( $wp_objects->queue as $object ) {
182
+			if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) {
183
+				$queue[ ] = $object;
184 184
 			}
185 185
 		}
186 186
 		$wp_objects->queue = $queue;
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 
190 190
 		//unregistering scripts
191 191
 		$registered = array();
192
-		foreach( $wp_objects->registered as $handle => $script_registration ){
193
-			if( in_array( $handle, $required_objects ) ){
192
+		foreach ( $wp_objects->registered as $handle => $script_registration ) {
193
+			if ( in_array( $handle, $required_objects ) ) {
194 194
 				$registered[ $handle ] = $script_registration;
195 195
 			}
196 196
 		}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @param array $registered [description]
206 206
 	 * @param array $scripts    [description]
207 207
 	 */
208
-	private function add_script_dependencies($registered, $scripts) {
208
+	private function add_script_dependencies( $registered, $scripts ) {
209 209
 
210 210
 		//gets all dependent scripts linked to the $scripts array passed
211 211
 		do {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 				$deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array();
215 215
 				foreach ( $deps as $dep ) {
216 216
 					if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) {
217
-						$dependents[] = $dep;
217
+						$dependents[ ] = $dep;
218 218
 					}
219 219
 				}
220 220
 			}
Please login to merge, or discard this patch.