@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | ?> |
9 | 9 | <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php |
10 | 10 | |
11 | - echo '<span class="gv-label">'.$this->get_field_label().'</span>'; |
|
11 | + echo '<span class="gv-label">' . $this->get_field_label() . '</span>'; |
|
12 | 12 | |
13 | 13 | echo $this->get_tooltip() . $this->get_field_desc(); |
14 | 14 | |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | function render_input( $override_input = null ) { |
23 | - if( isset( $override_input ) ) { |
|
23 | + if ( isset( $override_input ) ) { |
|
24 | 24 | echo $override_input; |
25 | 25 | return; |
26 | 26 | } |
27 | 27 | ?> |
28 | 28 | <select name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>"> |
29 | - <?php foreach( $this->field['options'] as $value => $label ) : ?> |
|
29 | + <?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
30 | 30 | <option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $this->value, true ); ?>><?php echo esc_html( $label ); ?></option> |
31 | 31 | <?php endforeach; ?> |
32 | 32 | </select> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $field_options = array(); |
29 | 29 | |
30 | - if( 'field' === $field_type ) { |
|
30 | + if ( 'field' === $field_type ) { |
|
31 | 31 | |
32 | 32 | // Default options - fields |
33 | 33 | $field_options = array( |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'custom_class' => array( |
46 | 46 | 'type' => 'text', |
47 | 47 | 'label' => __( 'Custom CSS Class:', 'gravityview' ), |
48 | - 'desc' => __( 'This class will be added to the field container', 'gravityview'), |
|
48 | + 'desc' => __( 'This class will be added to the field container', 'gravityview' ), |
|
49 | 49 | 'value' => '', |
50 | 50 | 'merge_tags' => true, |
51 | 51 | 'tooltip' => 'gv_css_merge_tags', |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | ); |
66 | 66 | |
67 | 67 | // Match Table as well as DataTables |
68 | - if( preg_match( '/table/ism', $template_id ) && 'directory' === $context ) { |
|
69 | - $field_options['width'] = array( |
|
68 | + if ( preg_match( '/table/ism', $template_id ) && 'directory' === $context ) { |
|
69 | + $field_options[ 'width' ] = array( |
|
70 | 70 | 'type' => 'number', |
71 | - 'label' => __('Percent Width', 'gravityview'), |
|
72 | - 'desc' => __( 'Leave blank for column width to be based on the field content.', 'gravityview'), |
|
71 | + 'label' => __( 'Percent Width', 'gravityview' ), |
|
72 | + 'desc' => __( 'Leave blank for column width to be based on the field content.', 'gravityview' ), |
|
73 | 73 | 'class' => 'code widefat', |
74 | 74 | 'value' => '', |
75 | 75 | ); |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | 'manage_options' => __( 'Administrator', 'gravityview' ), |
123 | 123 | ); |
124 | 124 | |
125 | - if( is_multisite() ) { |
|
126 | - $select_cap_choices['manage_network'] = __('Multisite Super Admin', 'gravityview' ); |
|
125 | + if ( is_multisite() ) { |
|
126 | + $select_cap_choices[ 'manage_network' ] = __( 'Multisite Super Admin', 'gravityview' ); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @param string $context Optional. What context are we in? Example: `single` or `directory` |
137 | 137 | * @param string $input_type Optional. (textarea, list, select, etc.) |
138 | 138 | */ |
139 | - $select_cap_choices = apply_filters('gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type ); |
|
139 | + $select_cap_choices = apply_filters( 'gravityview_field_visibility_caps', $select_cap_choices, $template_id, $field_id, $context, $input_type ); |
|
140 | 140 | |
141 | 141 | return $select_cap_choices; |
142 | 142 | } |
@@ -163,24 +163,24 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public static function render_field_options( $field_type, $template_id, $field_id, $field_label, $area, $input_type = NULL, $uniqid = '', $current = '', $context = 'single', $item = array() ) { |
165 | 165 | |
166 | - if( empty( $uniqid ) ) { |
|
166 | + if ( empty( $uniqid ) ) { |
|
167 | 167 | //generate a unique field id |
168 | - $uniqid = uniqid('', false); |
|
168 | + $uniqid = uniqid( '', false ); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | // get field/widget options |
172 | 172 | $options = self::get_default_field_options( $field_type, $template_id, $field_id, $context, $input_type ); |
173 | 173 | |
174 | 174 | // two different post arrays, depending of the field type |
175 | - $name_prefix = $field_type .'s' .'['. $area .']['. $uniqid .']'; |
|
175 | + $name_prefix = $field_type . 's' . '[' . $area . '][' . $uniqid . ']'; |
|
176 | 176 | |
177 | 177 | // build output |
178 | 178 | $output = ''; |
179 | - $output .= '<input type="hidden" class="field-key" name="'. $name_prefix .'[id]" value="'. esc_attr( $field_id ) .'">'; |
|
180 | - $output .= '<input type="hidden" class="field-label" name="'. $name_prefix .'[label]" value="'. esc_attr( $field_label ) .'">'; |
|
179 | + $output .= '<input type="hidden" class="field-key" name="' . $name_prefix . '[id]" value="' . esc_attr( $field_id ) . '">'; |
|
180 | + $output .= '<input type="hidden" class="field-label" name="' . $name_prefix . '[label]" value="' . esc_attr( $field_label ) . '">'; |
|
181 | 181 | |
182 | 182 | // If there are no options, return what we got. |
183 | - if(empty($options)) { |
|
183 | + if ( empty( $options ) ) { |
|
184 | 184 | |
185 | 185 | // This is here for checking if the output is empty in render_label() |
186 | 186 | $output .= '<!-- No Options -->'; |
@@ -188,33 +188,33 @@ discard block |
||
188 | 188 | return $output; |
189 | 189 | } |
190 | 190 | |
191 | - $output .= '<div class="gv-dialog-options" title="'. esc_attr( sprintf( __( 'Options: %s', 'gravityview' ) , strip_tags( html_entity_decode( $field_label ) ) ) ) .'">'; |
|
191 | + $output .= '<div class="gv-dialog-options" title="' . esc_attr( sprintf( __( 'Options: %s', 'gravityview' ), strip_tags( html_entity_decode( $field_label ) ) ) ) . '">'; |
|
192 | 192 | |
193 | 193 | /** |
194 | 194 | * @since 1.8 |
195 | 195 | */ |
196 | - if( !empty( $item['subtitle'] ) ) { |
|
197 | - $output .= '<div class="subtitle">' . $item['subtitle'] . '</div>'; |
|
196 | + if ( ! empty( $item[ 'subtitle' ] ) ) { |
|
197 | + $output .= '<div class="subtitle">' . $item[ 'subtitle' ] . '</div>'; |
|
198 | 198 | } |
199 | 199 | |
200 | - foreach( $options as $key => $option ) { |
|
200 | + foreach ( $options as $key => $option ) { |
|
201 | 201 | |
202 | 202 | $value = isset( $current[ $key ] ) ? $current[ $key ] : NULL; |
203 | 203 | |
204 | - $field_output = self::render_field_option( $name_prefix . '['. $key .']' , $option, $value); |
|
204 | + $field_output = self::render_field_option( $name_prefix . '[' . $key . ']', $option, $value ); |
|
205 | 205 | |
206 | 206 | // The setting is empty |
207 | - if( empty( $field_output ) ) { |
|
207 | + if ( empty( $field_output ) ) { |
|
208 | 208 | continue; |
209 | 209 | } |
210 | 210 | |
211 | - switch( $option['type'] ) { |
|
211 | + switch ( $option[ 'type' ] ) { |
|
212 | 212 | // Hide hidden fields |
213 | 213 | case 'hidden': |
214 | - $output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . ' screen-reader-text">'. $field_output . '</div>'; |
|
214 | + $output .= '<div class="gv-setting-container gv-setting-container-' . esc_attr( $key ) . ' screen-reader-text">' . $field_output . '</div>'; |
|
215 | 215 | break; |
216 | 216 | default: |
217 | - $output .= '<div class="gv-setting-container gv-setting-container-'. esc_attr( $key ) . '">'. $field_output .'</div>'; |
|
217 | + $output .= '<div class="gv-setting-container gv-setting-container-' . esc_attr( $key ) . '">' . $field_output . '</div>'; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
@@ -243,17 +243,17 @@ discard block |
||
243 | 243 | * @deprecated setting index 'default' was replaced by 'value' |
244 | 244 | * @see GravityView_FieldType::get_field_defaults |
245 | 245 | */ |
246 | - if( !empty( $option['default'] ) && empty( $option['value'] ) ) { |
|
247 | - $option['value'] = $option['default']; |
|
248 | - _deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting '. $name .' details' ); |
|
246 | + if ( ! empty( $option[ 'default' ] ) && empty( $option[ 'value' ] ) ) { |
|
247 | + $option[ 'value' ] = $option[ 'default' ]; |
|
248 | + _deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[value] instead of [default] when defining the setting ' . $name . ' details' ); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | // prepare to render option field type |
252 | - if( isset( $option['type'] ) ) { |
|
252 | + if ( isset( $option[ 'type' ] ) ) { |
|
253 | 253 | |
254 | 254 | $type_class = self::load_type_class( $option ); |
255 | 255 | |
256 | - if( class_exists( $type_class ) ) { |
|
256 | + if ( class_exists( $type_class ) ) { |
|
257 | 257 | |
258 | 258 | $render_type = new $type_class( $name, $option, $curr_value ); |
259 | 259 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param[in,out] string $output field class name |
270 | 270 | * @param[in] array $option option field data |
271 | 271 | */ |
272 | - $output = apply_filters( "gravityview/option/output/{$option['type']}" , $output, $option ); |
|
272 | + $output = apply_filters( "gravityview/option/output/{$option[ 'type' ]}", $output, $option ); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | } // isset option[type] |
@@ -296,33 +296,33 @@ discard block |
||
296 | 296 | $setting = GravityView_View_Data::get_default_arg( $key, true ); |
297 | 297 | |
298 | 298 | // If the key doesn't exist, there's something wrong. |
299 | - if( empty( $setting ) ) { return; } |
|
299 | + if ( empty( $setting ) ) { return; } |
|
300 | 300 | |
301 | 301 | /** |
302 | 302 | * @deprecated setting index 'name' was replaced by 'label' |
303 | 303 | * @see GravityView_FieldType::get_field_defaults |
304 | 304 | */ |
305 | - if( isset( $setting['name'] ) && empty( $setting['label'] ) ) { |
|
306 | - $setting['label'] = $setting['name']; |
|
307 | - _deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting '. $key .' details' ); |
|
305 | + if ( isset( $setting[ 'name' ] ) && empty( $setting[ 'label' ] ) ) { |
|
306 | + $setting[ 'label' ] = $setting[ 'name' ]; |
|
307 | + _deprecated_function( 'GravityView_FieldType::get_field_defaults', '1.1.7', '[label] instead of [name] when defining the setting ' . $key . ' details' ); |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | $name = esc_attr( sprintf( $name, $key ) ); |
311 | - $setting['id'] = esc_attr( sprintf( $id, $key ) ); |
|
312 | - $setting['tooltip'] = 'gv_' . $key; |
|
311 | + $setting[ 'id' ] = esc_attr( sprintf( $id, $key ) ); |
|
312 | + $setting[ 'tooltip' ] = 'gv_' . $key; |
|
313 | 313 | |
314 | 314 | // Use default if current setting isn't set. |
315 | - $curr_value = isset( $current_settings[ $key ] ) ? $current_settings[ $key ] : $setting['value']; |
|
315 | + $curr_value = isset( $current_settings[ $key ] ) ? $current_settings[ $key ] : $setting[ 'value' ]; |
|
316 | 316 | |
317 | 317 | // default setting type = text |
318 | - $setting['type'] = empty( $setting['type'] ) ? 'text' : $setting['type']; |
|
318 | + $setting[ 'type' ] = empty( $setting[ 'type' ] ) ? 'text' : $setting[ 'type' ]; |
|
319 | 319 | |
320 | 320 | // merge tags |
321 | - if( !isset( $setting['merge_tags'] ) ) { |
|
322 | - if( $setting['type'] === 'text' ) { |
|
323 | - $setting['merge_tags'] = true; |
|
321 | + if ( ! isset( $setting[ 'merge_tags' ] ) ) { |
|
322 | + if ( $setting[ 'type' ] === 'text' ) { |
|
323 | + $setting[ 'merge_tags' ] = true; |
|
324 | 324 | } else { |
325 | - $setting['merge_tags'] = false; |
|
325 | + $setting[ 'merge_tags' ] = false; |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | // render the setting |
332 | 332 | $type_class = self::load_type_class( $setting ); |
333 | - if( class_exists( $type_class ) ) { |
|
333 | + if ( class_exists( $type_class ) ) { |
|
334 | 334 | /** @var GravityView_FieldType $render_type */ |
335 | 335 | $render_type = new $type_class( $name, $setting, $curr_value ); |
336 | 336 | ob_start(); |
@@ -339,17 +339,17 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | // Check if setting is specific for a template |
342 | - if( !empty( $setting['show_in_template'] ) ) { |
|
343 | - if( !is_array( $setting['show_in_template'] ) ) { |
|
344 | - $setting['show_in_template'] = array( $setting['show_in_template'] ); |
|
342 | + if ( ! empty( $setting[ 'show_in_template' ] ) ) { |
|
343 | + if ( ! is_array( $setting[ 'show_in_template' ] ) ) { |
|
344 | + $setting[ 'show_in_template' ] = array( $setting[ 'show_in_template' ] ); |
|
345 | 345 | } |
346 | - $show_if = ' data-show-if="'. implode( ' ', $setting['show_in_template'] ).'"'; |
|
346 | + $show_if = ' data-show-if="' . implode( ' ', $setting[ 'show_in_template' ] ) . '"'; |
|
347 | 347 | } else { |
348 | 348 | $show_if = ''; |
349 | 349 | } |
350 | 350 | |
351 | 351 | // output |
352 | - echo '<tr valign="top" '. $show_if .'>' . $output . '</tr>'; |
|
352 | + echo '<tr valign="top" ' . $show_if . '>' . $output . '</tr>'; |
|
353 | 353 | |
354 | 354 | } |
355 | 355 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public static function load_type_class( $field = NULL ) { |
363 | 363 | |
364 | - if( empty( $field['type'] ) ) { |
|
364 | + if ( empty( $field[ 'type' ] ) ) { |
|
365 | 365 | return NULL; |
366 | 366 | } |
367 | 367 | |
@@ -370,19 +370,19 @@ discard block |
||
370 | 370 | * @param string $class_suffix field class suffix; `GravityView_FieldType_{$class_suffix}` |
371 | 371 | * @param array $field field data |
372 | 372 | */ |
373 | - $type_class = apply_filters( "gravityview/setting/class/{$field['type']}", 'GravityView_FieldType_' . $field['type'], $field ); |
|
373 | + $type_class = apply_filters( "gravityview/setting/class/{$field[ 'type' ]}", 'GravityView_FieldType_' . $field[ 'type' ], $field ); |
|
374 | 374 | |
375 | - if( !class_exists( $type_class ) ) { |
|
375 | + if ( ! class_exists( $type_class ) ) { |
|
376 | 376 | |
377 | 377 | /** |
378 | 378 | * @filter `gravityview/setting/class_file/{field_type}` |
379 | 379 | * @param string $field_type_include_path field class file path |
380 | 380 | * @param array $field field data |
381 | 381 | */ |
382 | - $class_file = apply_filters( "gravityview/setting/class_file/{$field['type']}", GRAVITYVIEW_DIR . "includes/admin/field-types/type_{$field['type']}.php", $field ); |
|
382 | + $class_file = apply_filters( "gravityview/setting/class_file/{$field[ 'type' ]}", GRAVITYVIEW_DIR . "includes/admin/field-types/type_{$field[ 'type' ]}.php", $field ); |
|
383 | 383 | |
384 | - if( $class_file ) { |
|
385 | - if( file_exists( $class_file ) ) { |
|
384 | + if ( $class_file ) { |
|
385 | + if ( file_exists( $class_file ) ) { |
|
386 | 386 | require_once( $class_file ); |
387 | 387 | } |
388 | 388 | } |
@@ -405,8 +405,8 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public static function render_checkbox_option( $name = '', $id = '', $current = '' ) { |
407 | 407 | |
408 | - $output = '<input name="'. esc_attr( $name ) .'" type="hidden" value="0">'; |
|
409 | - $output .= '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="checkbox" value="1" '. checked( $current, '1', false ) .' >'; |
|
408 | + $output = '<input name="' . esc_attr( $name ) . '" type="hidden" value="0">'; |
|
409 | + $output .= '<input name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" type="checkbox" value="1" ' . checked( $current, '1', false ) . ' >'; |
|
410 | 410 | |
411 | 411 | return $output; |
412 | 412 | } |
@@ -424,22 +424,22 @@ discard block |
||
424 | 424 | public static function render_text_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) { |
425 | 425 | |
426 | 426 | // Show the merge tags if the field is a list view |
427 | - $is_list = ( preg_match( '/_list-/ism', $name )); |
|
427 | + $is_list = ( preg_match( '/_list-/ism', $name ) ); |
|
428 | 428 | |
429 | 429 | // Or is a single entry view |
430 | - $is_single = ( preg_match( '/single_/ism', $name )); |
|
430 | + $is_single = ( preg_match( '/single_/ism', $name ) ); |
|
431 | 431 | $show = ( $is_single || $is_list ); |
432 | 432 | |
433 | 433 | $class = ''; |
434 | 434 | // and $add_merge_tags is not false |
435 | - if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) { |
|
435 | + if ( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) { |
|
436 | 436 | $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
437 | 437 | } |
438 | 438 | |
439 | - $class .= !empty( $args['class'] ) ? $args['class'] : 'widefat'; |
|
440 | - $type = !empty( $args['type'] ) ? $args['type'] : 'text'; |
|
439 | + $class .= ! empty( $args[ 'class' ] ) ? $args[ 'class' ] : 'widefat'; |
|
440 | + $type = ! empty( $args[ 'type' ] ) ? $args[ 'type' ] : 'text'; |
|
441 | 441 | |
442 | - return '<input name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" type="'.esc_attr($type).'" value="'. esc_attr( $current ) .'" class="'.esc_attr( $class ).'">'; |
|
442 | + return '<input name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" type="' . esc_attr( $type ) . '" value="' . esc_attr( $current ) . '" class="' . esc_attr( $class ) . '">'; |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | /** |
@@ -454,21 +454,21 @@ discard block |
||
454 | 454 | public static function render_textarea_option( $name = '', $id = '', $current = '', $add_merge_tags = NULL, $args = array() ) { |
455 | 455 | |
456 | 456 | // Show the merge tags if the field is a list view |
457 | - $is_list = ( preg_match( '/_list-/ism', $name )); |
|
457 | + $is_list = ( preg_match( '/_list-/ism', $name ) ); |
|
458 | 458 | |
459 | 459 | // Or is a single entry view |
460 | - $is_single = ( preg_match( '/single_/ism', $name )); |
|
460 | + $is_single = ( preg_match( '/single_/ism', $name ) ); |
|
461 | 461 | $show = ( $is_single || $is_list ); |
462 | 462 | |
463 | 463 | $class = ''; |
464 | 464 | // and $add_merge_tags is not false |
465 | - if( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) { |
|
465 | + if ( $show && $add_merge_tags !== false || $add_merge_tags === 'force' ) { |
|
466 | 466 | $class = 'merge-tag-support mt-position-right mt-hide_all_fields '; |
467 | 467 | } |
468 | 468 | |
469 | - $class .= !empty( $args['class'] ) ? 'widefat '.$args['class'] : 'widefat'; |
|
469 | + $class .= ! empty( $args[ 'class' ] ) ? 'widefat ' . $args[ 'class' ] : 'widefat'; |
|
470 | 470 | |
471 | - return '<textarea name="'. esc_attr( $name ) .'" id="'. esc_attr( $id ) .'" class="'.esc_attr( $class ).'">'. esc_textarea( $current ) .'</textarea>'; |
|
471 | + return '<textarea name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class ) . '">' . esc_textarea( $current ) . '</textarea>'; |
|
472 | 472 | } |
473 | 473 | |
474 | 474 | /** |
@@ -482,9 +482,9 @@ discard block |
||
482 | 482 | */ |
483 | 483 | public static function render_select_option( $name = '', $id = '', $choices, $current = '' ) { |
484 | 484 | |
485 | - $output = '<select name="'. $name .'" id="'. $id .'">'; |
|
486 | - foreach( $choices as $value => $label ) { |
|
487 | - $output .= '<option value="'. esc_attr( $value ) .'" '. selected( $value, $current, false ) .'>'. esc_html( $label ) .'</option>'; |
|
485 | + $output = '<select name="' . $name . '" id="' . $id . '">'; |
|
486 | + foreach ( $choices as $value => $label ) { |
|
487 | + $output .= '<option value="' . esc_attr( $value ) . '" ' . selected( $value, $current, false ) . '>' . esc_html( $label ) . '</option>'; |
|
488 | 488 | } |
489 | 489 | $output .= '</select>'; |
490 | 490 |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | ) ); |
116 | 116 | |
117 | 117 | // This is just HTML we don't need. |
118 | - unset( $response['message'] ); |
|
118 | + unset( $response[ 'message' ] ); |
|
119 | 119 | |
120 | - switch ( intval( $response['license_limit'] ) ) { |
|
120 | + switch ( intval( $response[ 'license_limit' ] ) ) { |
|
121 | 121 | case 1: |
122 | 122 | $package = 'Sol'; |
123 | 123 | break; |
@@ -128,24 +128,24 @@ discard block |
||
128 | 128 | $package = 'Interstellar'; |
129 | 129 | break; |
130 | 130 | default: |
131 | - $package = sprintf( '%d-Site License', $response['license_limit'] ); |
|
131 | + $package = sprintf( '%d-Site License', $response[ 'license_limit' ] ); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $data = array( |
135 | 135 | 'email' => GravityView_Settings::getSetting( 'support-email' ), |
136 | - 'name' => $response['customer_name'], |
|
137 | - 'Valid License?' => ucwords( $response['license'] ), |
|
138 | - 'License Key' => $response['license_key'], |
|
136 | + 'name' => $response[ 'customer_name' ], |
|
137 | + 'Valid License?' => ucwords( $response[ 'license' ] ), |
|
138 | + 'License Key' => $response[ 'license_key' ], |
|
139 | 139 | 'License Level' => $package, |
140 | 140 | 'Site Admin Email' => get_bloginfo( 'admin_email' ), |
141 | 141 | 'Support Email' => GravityView_Settings::getSetting( 'support-email' ), |
142 | - 'License Limit' => $response['license_limit'], |
|
143 | - 'Site Count' => $response['site_count'], |
|
144 | - 'License Expires' => $response['expires'], |
|
145 | - 'Activations Left' => $response['activations_left'], |
|
146 | - 'Payment ID' => $response['payment_id'], |
|
147 | - 'Payment Name' => $response['customer_name'], |
|
148 | - 'Payment Email' => $response['customer_email'], |
|
142 | + 'License Limit' => $response[ 'license_limit' ], |
|
143 | + 'Site Count' => $response[ 'site_count' ], |
|
144 | + 'License Expires' => $response[ 'expires' ], |
|
145 | + 'Activations Left' => $response[ 'activations_left' ], |
|
146 | + 'Payment ID' => $response[ 'payment_id' ], |
|
147 | + 'Payment Name' => $response[ 'customer_name' ], |
|
148 | + 'Payment Email' => $response[ 'customer_email' ], |
|
149 | 149 | 'WordPress Version' => get_bloginfo( 'version', 'display' ), |
150 | 150 | 'PHP Version' => phpversion(), |
151 | 151 | 'GravityView Version' => GravityView_Plugin::version, |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | |
193 | 193 | $plugin_data = get_plugin_data( $active_plugin ); |
194 | 194 | |
195 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
195 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
196 | 196 | } |
197 | 197 | |
198 | - if( ! empty( $extensions ) ) { |
|
198 | + if ( ! empty( $extensions ) ) { |
|
199 | 199 | set_site_transient( self::related_plugins_key, $extensions, HOUR_IN_SECONDS ); |
200 | 200 | } else { |
201 | 201 | return 'There was an error fetching related plugins.'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | add_action( 'gform_entries_first_column_actions', array( $this, 'add_edit_link' ), 10, 5 ); |
12 | 12 | |
13 | 13 | // Add script to enable edit link |
14 | - add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script') ); |
|
14 | + add_action( 'admin_head-forms_page_gf_entries', array( $this, 'add_edit_script' ) ); |
|
15 | 15 | |
16 | 16 | } |
17 | 17 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function add_edit_script() { |
27 | 27 | |
28 | 28 | // We're on a single entry page, or at least not the Entries page. |
29 | - if( !empty( $_GET['view'] ) && $_GET['view'] !== 'entries' ) { return; } |
|
29 | + if ( ! empty( $_GET[ 'view' ] ) && $_GET[ 'view' ] !== 'entries' ) { return; } |
|
30 | 30 | ?> |
31 | 31 | <script> |
32 | 32 | jQuery( document ).ready( function( $ ) { |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | 'page' => 'gf_entries', |
57 | 57 | 'view' => 'entry', |
58 | 58 | 'id' => (int)$form_id, |
59 | - 'lid' => (int)$lead["id"], |
|
59 | + 'lid' => (int)$lead[ "id" ], |
|
60 | 60 | 'screen_mode' => 'edit', |
61 | 61 | ); |
62 | 62 | ?> |
63 | 63 | |
64 | 64 | <span class="edit edit_entry"> |
65 | 65 | | |
66 | - <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview'); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page='.$query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
66 | + <a title="<?php esc_attr_e( 'Edit this entry', 'gravityview' ); ?>" href="<?php echo esc_url( add_query_arg( $params, admin_url( 'admin.php?page=' . $query_string ) ) ); ?>"><?php esc_html_e( 'Edit', 'gravityview' ); ?></a> |
|
67 | 67 | </span> |
68 | 68 | <?php |
69 | 69 | } |
@@ -6,17 +6,17 @@ |
||
6 | 6 | ?><script type="text/javascript"> |
7 | 7 | |
8 | 8 | function DeleteFile(leadId, fieldId, deleteButton){ |
9 | - if(confirm('<?php echo esc_js( __("Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview') ); ?>')){ |
|
9 | + if(confirm('<?php echo esc_js( __( "Would you like to permanently delete this file? 'Cancel' to stop. 'OK' to delete", 'gravityview' ) ); ?>')){ |
|
10 | 10 | var fileIndex = jQuery(deleteButton).parent().index(); |
11 | - var mysack = new sack("<?php echo admin_url("admin-ajax.php")?>"); |
|
11 | + var mysack = new sack("<?php echo admin_url( "admin-ajax.php" )?>"); |
|
12 | 12 | mysack.execute = 1; |
13 | 13 | mysack.method = 'POST'; |
14 | 14 | mysack.setVar( "action", "rg_delete_file" ); |
15 | - mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce("rg_delete_file") ?>" ); |
|
15 | + mysack.setVar( "rg_delete_file", "<?php echo wp_create_nonce( "rg_delete_file" ) ?>" ); |
|
16 | 16 | mysack.setVar( "lead_id", leadId ); |
17 | 17 | mysack.setVar( "field_id", fieldId ); |
18 | 18 | mysack.setVar( "file_index", fileIndex ); |
19 | - mysack.onError = function() { alert('<?php echo esc_js(__('Ajax error while deleting field.', 'gravityview')) ?>' )}; |
|
19 | + mysack.onError = function() { alert('<?php echo esc_js( __( 'Ajax error while deleting field.', 'gravityview' ) ) ?>' )}; |
|
20 | 20 | mysack.runAJAX(); |
21 | 21 | |
22 | 22 | return true; |
@@ -7,13 +7,13 @@ |
||
7 | 7 | extract( $gravityview_view->getCurrentField() ); |
8 | 8 | |
9 | 9 | // Only show the link to logged-in users. |
10 | -if( !GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) { |
|
10 | +if ( ! GravityView_Edit_Entry::check_user_cap_edit_entry( $entry ) ) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
14 | -$link_text = empty( $field_settings['edit_link'] ) ? __('Edit Entry', 'gravityview') : $field_settings['edit_link']; |
|
14 | +$link_text = empty( $field_settings[ 'edit_link' ] ) ? __( 'Edit Entry', 'gravityview' ) : $field_settings[ 'edit_link' ]; |
|
15 | 15 | |
16 | -$link_atts = empty( $field_settings['new_window'] ) ? '' : 'target="_blank"'; |
|
16 | +$link_atts = empty( $field_settings[ 'new_window' ] ) ? '' : 'target="_blank"'; |
|
17 | 17 | |
18 | 18 | $output = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) ); |
19 | 19 |
@@ -7,11 +7,11 @@ |
||
7 | 7 | extract( $gravityview_view->getCurrentField() ); |
8 | 8 | |
9 | 9 | // Only show the link to logged-in users with the rigth caps. |
10 | -if( !GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) { |
|
10 | +if ( ! GravityView_Delete_Entry::check_user_cap_delete_entry( $entry, $field_settings ) ) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
14 | -$link_text = empty( $field_settings['delete_link'] ) ? __('Delete Entry', 'gravityview') : $field_settings['delete_link']; |
|
14 | +$link_text = empty( $field_settings[ 'delete_link' ] ) ? __( 'Delete Entry', 'gravityview' ) : $field_settings[ 'delete_link' ]; |
|
15 | 15 | |
16 | 16 | $link_text = apply_filters( 'gravityview_entry_link', GravityView_API::replace_variables( $link_text, $form, $entry ) ); |
17 | 17 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * @see RGFormsModel::update_lead_property() Trigger when any entry property changes |
81 | 81 | */ |
82 | - foreach( $this->lead_db_columns as $column ) { |
|
82 | + foreach ( $this->lead_db_columns as $column ) { |
|
83 | 83 | add_action( 'gform_update_' . $column, array( $this, 'entry_status_changed' ), 10, 3 ); |
84 | 84 | } |
85 | 85 | |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
115 | - do_action( 'gravityview_log_debug', __METHOD__ . ' adding form ' . $entry['form_id'] . ' to blacklist because entry #' . $lead_id . ' was deleted', array( 'value' => $property_value, 'previous' => $previous_value ) ); |
|
115 | + do_action( 'gravityview_log_debug', __METHOD__ . ' adding form ' . $entry[ 'form_id' ] . ' to blacklist because entry #' . $lead_id . ' was deleted', array( 'value' => $property_value, 'previous' => $previous_value ) ); |
|
116 | 116 | |
117 | - $this->blacklist_add( $entry['form_id'] ); |
|
117 | + $this->blacklist_add( $entry[ 'form_id' ] ); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function entry_updated( $form, $lead_id ) { |
129 | 129 | |
130 | - do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_updated] adding form ' . $form['id'] . ' to blacklist because entry #' . $lead_id . ' was updated' ); |
|
130 | + do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_updated] adding form ' . $form[ 'id' ] . ' to blacklist because entry #' . $lead_id . ' was updated' ); |
|
131 | 131 | |
132 | - $this->blacklist_add( $form['id'] ); |
|
132 | + $this->blacklist_add( $form[ 'id' ] ); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function entry_created( $entry, $form ) { |
146 | 146 | |
147 | - do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_created] adding form ' . $form['id'] . ' to blacklist because entry #' . $entry['id'] . ' was created' ); |
|
147 | + do_action( 'gravityview_log_debug', 'GravityView_Cache[entry_created] adding form ' . $form[ 'id' ] . ' to blacklist because entry #' . $entry[ 'id' ] . ' was created' ); |
|
148 | 148 | |
149 | - $this->blacklist_add( $form['id'] ); |
|
149 | + $this->blacklist_add( $form[ 'id' ] ); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | // Normally just one form, but supports multiple forms |
166 | 166 | // |
167 | 167 | // Array of IDs 12, 5, 14 would result in `f-12f-5f-14` |
168 | - $forms = 'f:' . implode( '&f:', (array) $form_ids ); |
|
168 | + $forms = 'f:' . implode( '&f:', (array)$form_ids ); |
|
169 | 169 | |
170 | 170 | // Prefix for transient keys |
171 | 171 | // Now the prefix would be: `gv-cache-f-12f-5f-14` |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | $blacklist = get_option( self::BLACKLIST_OPTION_NAME, array() ); |
244 | 244 | |
245 | - $updated_list = array_diff( $blacklist, (array) $form_ids ); |
|
245 | + $updated_list = array_diff( $blacklist, (array)$form_ids ); |
|
246 | 246 | |
247 | 247 | do_action( 'gravityview_log_debug', 'GravityView_Cache[blacklist_remove] Removing form IDs from cache blacklist', array( |
248 | 248 | '$form_ids' => $form_ids, |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | return false; |
276 | 276 | } |
277 | 277 | |
278 | - foreach ( (array) $form_ids as $form_id ) { |
|
278 | + foreach ( (array)$form_ids as $form_id ) { |
|
279 | 279 | |
280 | 280 | if ( in_array( $form_id, $blacklist ) ) { |
281 | 281 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache |
348 | 348 | * @param int $time_in_seconds Default: `DAY_IN_SECONDS` |
349 | 349 | */ |
350 | - $cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
350 | + $cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
351 | 351 | |
352 | 352 | do_action( 'gravityview_log_debug', 'GravityView_Cache[set] Setting cache with transient key ' . $this->key . ' for ' . $cache_time . ' seconds' ); |
353 | 353 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | return; |
384 | 384 | } |
385 | 385 | |
386 | - foreach ( (array) $form_ids as $form_id ) { |
|
386 | + foreach ( (array)$form_ids as $form_id ) { |
|
387 | 387 | |
388 | 388 | $key = $this->get_cache_key_prefix( $form_id ); |
389 | 389 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | |
498 | 498 | if ( GVCommon::has_cap( 'edit_gravityviews' ) ) { |
499 | 499 | |
500 | - if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) { |
|
500 | + if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) { |
|
501 | 501 | |
502 | 502 | do_action( 'gravityview_log_debug', 'GravityView_Cache[use_cache] Not using cache: ?cache or ?nocache is in the URL' ); |
503 | 503 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | */ |
527 | 527 | $use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this ); |
528 | 528 | |
529 | - return (boolean) $use_cache; |
|
529 | + return (boolean)$use_cache; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | */ |
18 | 18 | private function __construct( $passed_post = NULL ) { |
19 | 19 | |
20 | - if( !empty( $passed_post ) ) { |
|
20 | + if ( ! empty( $passed_post ) ) { |
|
21 | 21 | |
22 | 22 | $id_or_id_array = $this->maybe_get_view_id( $passed_post ); |
23 | 23 | |
24 | - if( !empty( $id_or_id_array ) ) { |
|
24 | + if ( ! empty( $id_or_id_array ) ) { |
|
25 | 25 | $this->add_view( $id_or_id_array ); |
26 | 26 | } |
27 | 27 | } |
@@ -56,33 +56,33 @@ discard block |
||
56 | 56 | |
57 | 57 | $ids = array(); |
58 | 58 | |
59 | - if( ! empty( $passed_post ) ) { |
|
59 | + if ( ! empty( $passed_post ) ) { |
|
60 | 60 | |
61 | - if( is_numeric( $passed_post ) ) { |
|
61 | + if ( is_numeric( $passed_post ) ) { |
|
62 | 62 | $passed_post = get_post( $passed_post ); |
63 | 63 | } |
64 | 64 | |
65 | 65 | // Convert WP_Posts into WP_Posts[] array |
66 | - if( $passed_post instanceof WP_Post ) { |
|
66 | + if ( $passed_post instanceof WP_Post ) { |
|
67 | 67 | $passed_post = array( $passed_post ); |
68 | 68 | } |
69 | 69 | |
70 | - if( is_array( $passed_post ) ) { |
|
70 | + if ( is_array( $passed_post ) ) { |
|
71 | 71 | |
72 | - foreach ( $passed_post as &$post) { |
|
73 | - if( ( get_post_type( $post ) === 'gravityview' ) ) { |
|
74 | - $ids[] = $post->ID; |
|
75 | - } else{ |
|
72 | + foreach ( $passed_post as &$post ) { |
|
73 | + if ( ( get_post_type( $post ) === 'gravityview' ) ) { |
|
74 | + $ids[ ] = $post->ID; |
|
75 | + } else { |
|
76 | 76 | // Parse the Post Content |
77 | 77 | $id = $this->parse_post_content( $post->post_content ); |
78 | - if( $id ) { |
|
79 | - $ids = array_merge( $ids, (array) $id ); |
|
78 | + if ( $id ) { |
|
79 | + $ids = array_merge( $ids, (array)$id ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // Parse the Post Meta |
83 | 83 | $id = $this->parse_post_meta( $post->ID ); |
84 | - if( $id ) { |
|
85 | - $ids = array_merge( $ids, (array) $id ); |
|
84 | + if ( $id ) { |
|
85 | + $ids = array_merge( $ids, (array)$id ); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
@@ -93,24 +93,24 @@ discard block |
||
93 | 93 | if ( is_string( $passed_post ) ) { |
94 | 94 | |
95 | 95 | $id = $this->parse_post_content( $passed_post ); |
96 | - if( $id ) { |
|
97 | - $ids = array_merge( $ids, (array) $id ); |
|
96 | + if ( $id ) { |
|
97 | + $ids = array_merge( $ids, (array)$id ); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | } else { |
101 | 101 | $id = $this->get_id_from_atts( $passed_post ); |
102 | - $ids[] = intval( $id ); |
|
102 | + $ids[ ] = intval( $id ); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
106 | 106 | |
107 | - if( empty($ids) ) { |
|
107 | + if ( empty( $ids ) ) { |
|
108 | 108 | return NULL; |
109 | 109 | } |
110 | 110 | |
111 | 111 | // If it's just one ID, return that. |
112 | 112 | // Otherwise, return array of IDs |
113 | - return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids; |
|
113 | + return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public static function getInstance( $passed_post = NULL ) { |
120 | 120 | |
121 | - if( empty( self::$instance ) ) { |
|
121 | + if ( empty( self::$instance ) ) { |
|
122 | 122 | self::$instance = new GravityView_View_Data( $passed_post ); |
123 | 123 | } |
124 | 124 | |
@@ -131,19 +131,19 @@ discard block |
||
131 | 131 | |
132 | 132 | function get_view( $view_id, $atts = NULL ) { |
133 | 133 | |
134 | - if( ! is_numeric( $view_id) ) { |
|
135 | - do_action('gravityview_log_error', sprintf('GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id) ); |
|
134 | + if ( ! is_numeric( $view_id ) ) { |
|
135 | + do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[get_view] $view_id passed is not numeric.', $view_id ) ); |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Backup: the view hasn't been fetched yet. Doing it now. |
140 | 140 | if ( ! isset( $this->views[ $view_id ] ) ) { |
141 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] View #%s not set yet.', $view_id) ); |
|
141 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] View #%s not set yet.', $view_id ) ); |
|
142 | 142 | return $this->add_view( $view_id, $atts ); |
143 | 143 | } |
144 | 144 | |
145 | 145 | if ( empty( $this->views[ $view_id ] ) ) { |
146 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id) ); |
|
146 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[get_view] Returning; View #%s was empty.', $view_id ) ); |
|
147 | 147 | return false; |
148 | 148 | } |
149 | 149 | |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | function add_view( $view_id, $atts = NULL ) { |
175 | 175 | |
176 | 176 | // Handle array of IDs |
177 | - if( is_array( $view_id ) ) { |
|
178 | - foreach( $view_id as $id ) { |
|
177 | + if ( is_array( $view_id ) ) { |
|
178 | + foreach ( $view_id as $id ) { |
|
179 | 179 | |
180 | 180 | $this->add_view( $id, $atts ); |
181 | 181 | } |
@@ -184,21 +184,21 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | // The view has been set already; returning stored view. |
187 | - if ( !empty( $this->views[ $view_id ] ) ) { |
|
188 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id) ); |
|
187 | + if ( ! empty( $this->views[ $view_id ] ) ) { |
|
188 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s already exists.', $view_id ) ); |
|
189 | 189 | return $this->views[ $view_id ]; |
190 | 190 | } |
191 | 191 | |
192 | - if( ! $this->view_exists( $view_id ) ) { |
|
193 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id) ); |
|
192 | + if ( ! $this->view_exists( $view_id ) ) { |
|
193 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; View #%s does not exist.', $view_id ) ); |
|
194 | 194 | return false; |
195 | 195 | } |
196 | 196 | |
197 | 197 | $form_id = gravityview_get_form_id( $view_id ); |
198 | 198 | |
199 | - if( empty( $form_id ) ) { |
|
199 | + if ( empty( $form_id ) ) { |
|
200 | 200 | |
201 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id) ); |
|
201 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Returning; Post ID #%s does not have a connected form.', $view_id ) ); |
|
202 | 202 | |
203 | 203 | return false; |
204 | 204 | } |
@@ -206,21 +206,21 @@ discard block |
||
206 | 206 | // Get the settings for the View ID |
207 | 207 | $view_settings = gravityview_get_template_settings( $view_id ); |
208 | 208 | |
209 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id), $view_settings ); |
|
209 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] Settings pulled in from View #%s', $view_id ), $view_settings ); |
|
210 | 210 | |
211 | 211 | // Merge the view settings with the defaults |
212 | 212 | $view_defaults = wp_parse_args( $view_settings, self::get_default_args() ); |
213 | 213 | |
214 | - do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults ); |
|
214 | + do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] View Defaults after merging View Settings with the default args.', $view_defaults ); |
|
215 | 215 | |
216 | - if( ! empty( $atts ) && is_array( $atts ) ) { |
|
216 | + if ( ! empty( $atts ) && is_array( $atts ) ) { |
|
217 | 217 | |
218 | - do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging with the $view_defaults', $atts ); |
|
218 | + do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts before merging with the $view_defaults', $atts ); |
|
219 | 219 | |
220 | 220 | // Get the settings from the shortcode and merge them with defaults. |
221 | 221 | $atts = shortcode_atts( $view_defaults, $atts ); |
222 | 222 | |
223 | - do_action('gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging with the $view_defaults', $atts ); |
|
223 | + do_action( 'gravityview_log_debug', 'GravityView_View_Data[add_view] $atts after merging with the $view_defaults', $atts ); |
|
224 | 224 | |
225 | 225 | } else { |
226 | 226 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | } |
231 | 231 | |
232 | - unset( $atts['id'], $view_defaults, $view_settings ); |
|
232 | + unset( $atts[ 'id' ], $view_defaults, $view_settings ); |
|
233 | 233 | |
234 | 234 | $data = array( |
235 | 235 | 'id' => $view_id, |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | 'form' => gravityview_get_form( $form_id ), |
243 | 243 | ); |
244 | 244 | |
245 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[add_view] View #%s being added.', $view_id), $data ); |
|
245 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[add_view] View #%s being added.', $view_id ), $data ); |
|
246 | 246 | |
247 | 247 | $this->views[ $view_id ] = $data; |
248 | 248 | |
@@ -277,15 +277,15 @@ discard block |
||
277 | 277 | */ |
278 | 278 | private function filter_fields( $dir_fields ) { |
279 | 279 | |
280 | - if( empty( $dir_fields ) || !is_array( $dir_fields ) ) { |
|
280 | + if ( empty( $dir_fields ) || ! is_array( $dir_fields ) ) { |
|
281 | 281 | return $dir_fields; |
282 | 282 | } |
283 | 283 | |
284 | - foreach( $dir_fields as $area => $fields ) { |
|
284 | + foreach ( $dir_fields as $area => $fields ) { |
|
285 | 285 | |
286 | - foreach( (array)$fields as $uniqid => $properties ) { |
|
286 | + foreach ( (array)$fields as $uniqid => $properties ) { |
|
287 | 287 | |
288 | - if( $this->hide_field_check_conditions( $properties ) ) { |
|
288 | + if ( $this->hide_field_check_conditions( $properties ) ) { |
|
289 | 289 | unset( $dir_fields[ $area ][ $uniqid ] ); |
290 | 290 | } |
291 | 291 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | private function hide_field_check_conditions( $properties ) { |
308 | 308 | |
309 | 309 | // logged-in visibility |
310 | - if( ! empty( $properties['only_loggedin'] ) && ! GVCommon::has_cap( $properties['only_loggedin_cap'] ) ) { |
|
310 | + if ( ! empty( $properties[ 'only_loggedin' ] ) && ! GVCommon::has_cap( $properties[ 'only_loggedin_cap' ] ) ) { |
|
311 | 311 | return true; |
312 | 312 | } |
313 | 313 | |
@@ -321,14 +321,14 @@ discard block |
||
321 | 321 | // Get the settings from the shortcode and merge them with defaults. |
322 | 322 | $atts = wp_parse_args( $atts, self::get_default_args() ); |
323 | 323 | |
324 | - $view_id = ! empty( $atts['view_id'] ) ? (int)$atts['view_id'] : NULL; |
|
324 | + $view_id = ! empty( $atts[ 'view_id' ] ) ? (int)$atts[ 'view_id' ] : NULL; |
|
325 | 325 | |
326 | - if( empty( $view_id ) && !empty( $atts['id'] ) ) { |
|
327 | - $view_id = (int)$atts['id']; |
|
326 | + if ( empty( $view_id ) && ! empty( $atts[ 'id' ] ) ) { |
|
327 | + $view_id = (int)$atts[ 'id' ]; |
|
328 | 328 | } |
329 | 329 | |
330 | - if( empty( $view_id ) ) { |
|
331 | - do_action('gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts ); |
|
330 | + if ( empty( $view_id ) ) { |
|
331 | + do_action( 'gravityview_log_error', 'GravityView_View_Data[get_id_from_atts] Returning; no ID defined (Atts)', $atts ); |
|
332 | 332 | return; |
333 | 333 | } |
334 | 334 | |
@@ -350,44 +350,44 @@ discard block |
||
350 | 350 | * @hack This is so that the shortcode is registered for the oEmbed preview in the Admin |
351 | 351 | * @since 1.6 |
352 | 352 | */ |
353 | - if( ! shortcode_exists('gravityview') && class_exists( 'GravityView_Shortcode' ) ) { |
|
353 | + if ( ! shortcode_exists( 'gravityview' ) && class_exists( 'GravityView_Shortcode' ) ) { |
|
354 | 354 | new GravityView_Shortcode; |
355 | 355 | } |
356 | 356 | |
357 | 357 | $shortcodes = gravityview_has_shortcode_r( $content, 'gravityview' ); |
358 | 358 | |
359 | - if( empty( $shortcodes ) ) { |
|
359 | + if ( empty( $shortcodes ) ) { |
|
360 | 360 | return NULL; |
361 | 361 | } |
362 | 362 | |
363 | - do_action('gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes ); |
|
363 | + do_action( 'gravityview_log_debug', 'GravityView_View_Data[parse_post_content] Parsing content, found shortcodes:', $shortcodes ); |
|
364 | 364 | |
365 | 365 | $ids = array(); |
366 | 366 | |
367 | - foreach ($shortcodes as $key => $shortcode) { |
|
367 | + foreach ( $shortcodes as $key => $shortcode ) { |
|
368 | 368 | |
369 | - $args = shortcode_parse_atts( $shortcode[3] ); |
|
369 | + $args = shortcode_parse_atts( $shortcode[ 3 ] ); |
|
370 | 370 | |
371 | - if( empty( $args['id'] ) ) { |
|
372 | - do_action('gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts for Post #%s (Atts)', $post->ID ), $shortcode ); |
|
371 | + if ( empty( $args[ 'id' ] ) ) { |
|
372 | + do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_content] Returning; no ID defined in shortcode atts for Post #%s (Atts)', $post->ID ), $shortcode ); |
|
373 | 373 | continue; |
374 | 374 | } |
375 | 375 | |
376 | - do_action('gravityview_log_debug', sprintf('GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args['id']), $args ); |
|
376 | + do_action( 'gravityview_log_debug', sprintf( 'GravityView_View_Data[parse_post_content] Adding view #%s with shortcode args', $args[ 'id' ] ), $args ); |
|
377 | 377 | |
378 | 378 | // Store the View to the object for later fetching. |
379 | - $this->add_view( $args['id'], $args ); |
|
379 | + $this->add_view( $args[ 'id' ], $args ); |
|
380 | 380 | |
381 | - $ids[] = $args['id']; |
|
381 | + $ids[ ] = $args[ 'id' ]; |
|
382 | 382 | } |
383 | 383 | |
384 | - if( empty($ids) ) { |
|
384 | + if ( empty( $ids ) ) { |
|
385 | 385 | return NULL; |
386 | 386 | } |
387 | 387 | |
388 | 388 | // If it's just one ID, return that. |
389 | 389 | // Otherwise, return array of IDs |
390 | - return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids; |
|
390 | + return ( sizeof( $ids ) === 1 ) ? $ids[ 0 ] : $ids; |
|
391 | 391 | |
392 | 392 | } |
393 | 393 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | */ |
409 | 409 | $meta_keys = (array)apply_filters( 'gravityview/data/parse/meta_keys', array(), $post_id ); |
410 | 410 | |
411 | - if( empty( $meta_keys ) ) { |
|
411 | + if ( empty( $meta_keys ) ) { |
|
412 | 412 | return NULL; |
413 | 413 | } |
414 | 414 | |
@@ -416,16 +416,16 @@ discard block |
||
416 | 416 | |
417 | 417 | $meta_content = ''; |
418 | 418 | |
419 | - foreach( $meta_keys as $key ) { |
|
420 | - $meta = get_post_meta( $post_id, $key , true ); |
|
421 | - if( ! is_string( $meta ) ) { |
|
419 | + foreach ( $meta_keys as $key ) { |
|
420 | + $meta = get_post_meta( $post_id, $key, true ); |
|
421 | + if ( ! is_string( $meta ) ) { |
|
422 | 422 | continue; |
423 | 423 | } |
424 | 424 | $meta_content .= $meta . ' '; |
425 | 425 | } |
426 | 426 | |
427 | - if( empty( $meta_content ) ) { |
|
428 | - do_action('gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys ); |
|
427 | + if ( empty( $meta_content ) ) { |
|
428 | + do_action( 'gravityview_log_error', sprintf( 'GravityView_View_Data[parse_post_meta] Returning; Empty custom fields for Post #%s (Custom fields keys:)', $post_id ), $meta_keys ); |
|
429 | 429 | return NULL; |
430 | 430 | } |
431 | 431 | |
@@ -452,16 +452,16 @@ discard block |
||
452 | 452 | $message = NULL; |
453 | 453 | |
454 | 454 | // Not invalid if not set! |
455 | - if( empty( $post_id ) || empty( $view_id ) ) { |
|
455 | + if ( empty( $post_id ) || empty( $view_id ) ) { |
|
456 | 456 | |
457 | - if( $empty_is_valid ) { |
|
457 | + if ( $empty_is_valid ) { |
|
458 | 458 | return true; |
459 | 459 | } |
460 | 460 | |
461 | 461 | $message = esc_html__( 'The ID is required.', 'gravityview' ); |
462 | 462 | } |
463 | 463 | |
464 | - if( ! $message ) { |
|
464 | + if ( ! $message ) { |
|
465 | 465 | $status = get_post_status( $post_id ); |
466 | 466 | |
467 | 467 | // Nothing exists with that post ID. |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
476 | - if( ! $message ) { |
|
476 | + if ( ! $message ) { |
|
477 | 477 | |
478 | 478 | // Nothing exists with that post ID. |
479 | 479 | if ( empty( $status ) || in_array( $status, array( 'revision', 'attachment' ) ) ) { |
@@ -482,25 +482,25 @@ discard block |
||
482 | 482 | |
483 | 483 | } |
484 | 484 | |
485 | - if( ! $message ) { |
|
485 | + if ( ! $message ) { |
|
486 | 486 | $view_ids_in_post = GravityView_View_Data::getInstance()->maybe_get_view_id( $post_id ); |
487 | 487 | |
488 | 488 | // The post or page specified does not contain the shortcode. |
489 | - if ( false === in_array( $view_id, (array) $view_ids_in_post ) ) { |
|
489 | + if ( false === in_array( $view_id, (array)$view_ids_in_post ) ) { |
|
490 | 490 | $message = sprintf( esc_html__( 'The Post ID entered is not valid. You may have entered a post or page that does not contain the selected View. Make sure the post contains the following shortcode: %s', 'gravityview' ), '<br /><code>[gravityview id="' . intval( $view_id ) . '"]</code>' ); |
491 | 491 | } |
492 | 492 | } |
493 | 493 | |
494 | - if( ! $message ) { |
|
494 | + if ( ! $message ) { |
|
495 | 495 | |
496 | 496 | // It's a View |
497 | - if( 'gravityview' === get_post_type( $post_id ) ) { |
|
498 | - $message = esc_html__( 'The ID is already a View.', 'gravityview' );; |
|
497 | + if ( 'gravityview' === get_post_type( $post_id ) ) { |
|
498 | + $message = esc_html__( 'The ID is already a View.', 'gravityview' ); ; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | } |
502 | 502 | |
503 | - if( $message ) { |
|
503 | + if ( $message ) { |
|
504 | 504 | return new WP_Error( 'invalid_embed_id', $message ); |
505 | 505 | } |
506 | 506 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | |
518 | 518 | $args = self::get_default_args( $with_details ); |
519 | 519 | |
520 | - if( !isset( $args[ $key ] ) ) { return NULL; } |
|
520 | + if ( ! isset( $args[ $key ] ) ) { return NULL; } |
|
521 | 521 | |
522 | 522 | return $args[ $key ]; |
523 | 523 | } |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | */ |
547 | 547 | $default_settings = apply_filters( 'gravityview_default_args', array( |
548 | 548 | 'id' => array( |
549 | - 'label' => __('View ID', 'gravityview'), |
|
549 | + 'label' => __( 'View ID', 'gravityview' ), |
|
550 | 550 | 'type' => 'number', |
551 | 551 | 'group' => 'default', |
552 | 552 | 'value' => NULL, |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | 'show_in_shortcode' => false, |
555 | 555 | ), |
556 | 556 | 'page_size' => array( |
557 | - 'label' => __('Number of entries per page', 'gravityview'), |
|
557 | + 'label' => __( 'Number of entries per page', 'gravityview' ), |
|
558 | 558 | 'type' => 'number', |
559 | 559 | 'class' => 'small-text', |
560 | 560 | 'group' => 'default', |
@@ -594,40 +594,40 @@ discard block |
||
594 | 594 | 'user_edit' => array( |
595 | 595 | 'label' => __( 'Allow User Edit', 'gravityview' ), |
596 | 596 | 'group' => 'default', |
597 | - 'desc' => __('Allow logged-in users to edit entries they created.', 'gravityview'), |
|
597 | + 'desc' => __( 'Allow logged-in users to edit entries they created.', 'gravityview' ), |
|
598 | 598 | 'value' => 0, |
599 | - 'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
599 | + 'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
600 | 600 | 'type' => 'checkbox', |
601 | 601 | 'show_in_shortcode' => true, |
602 | 602 | ), |
603 | 603 | 'user_delete' => array( |
604 | 604 | 'label' => __( 'Allow User Delete', 'gravityview' ), |
605 | 605 | 'group' => 'default', |
606 | - 'desc' => __('Allow logged-in users to delete entries they created.', 'gravityview'), |
|
606 | + 'desc' => __( 'Allow logged-in users to delete entries they created.', 'gravityview' ), |
|
607 | 607 | 'value' => 0, |
608 | - 'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
608 | + 'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
609 | 609 | 'type' => 'checkbox', |
610 | 610 | 'show_in_shortcode' => true, |
611 | 611 | ), |
612 | 612 | 'sort_field' => array( |
613 | - 'label' => __('Sort by field', 'gravityview'), |
|
613 | + 'label' => __( 'Sort by field', 'gravityview' ), |
|
614 | 614 | 'type' => 'select', |
615 | 615 | 'value' => '', |
616 | 616 | 'group' => 'sort', |
617 | 617 | 'options' => array( |
618 | - '' => __( 'Default', 'gravityview'), |
|
619 | - 'date_created' => __( 'Date Created', 'gravityview'), |
|
618 | + '' => __( 'Default', 'gravityview' ), |
|
619 | + 'date_created' => __( 'Date Created', 'gravityview' ), |
|
620 | 620 | ), |
621 | 621 | 'show_in_shortcode' => true, |
622 | 622 | ), |
623 | 623 | 'sort_direction' => array( |
624 | - 'label' => __('Sort direction', 'gravityview'), |
|
624 | + 'label' => __( 'Sort direction', 'gravityview' ), |
|
625 | 625 | 'type' => 'select', |
626 | 626 | 'value' => 'ASC', |
627 | 627 | 'group' => 'sort', |
628 | 628 | 'options' => array( |
629 | - 'ASC' => __('ASC', 'gravityview'), |
|
630 | - 'DESC' => __('DESC', 'gravityview'), |
|
629 | + 'ASC' => __( 'ASC', 'gravityview' ), |
|
630 | + 'DESC' => __( 'DESC', 'gravityview' ), |
|
631 | 631 | //'RAND' => __('Random', 'gravityview'), |
632 | 632 | ), |
633 | 633 | 'show_in_shortcode' => true, |
@@ -643,83 +643,83 @@ discard block |
||
643 | 643 | 'show_in_template' => array( 'default_table' ), |
644 | 644 | ), |
645 | 645 | 'start_date' => array( |
646 | - 'label' => __('Filter by Start Date', 'gravityview'), |
|
646 | + 'label' => __( 'Filter by Start Date', 'gravityview' ), |
|
647 | 647 | 'class' => 'gv-datepicker', |
648 | - 'desc' => __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
648 | + 'desc' => __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
649 | 649 | 'type' => 'text', |
650 | 650 | 'value' => '', |
651 | 651 | 'group' => 'filter', |
652 | 652 | 'show_in_shortcode' => true, |
653 | 653 | ), |
654 | 654 | 'end_date' => array( |
655 | - 'label' => __('Filter by End Date', 'gravityview'), |
|
655 | + 'label' => __( 'Filter by End Date', 'gravityview' ), |
|
656 | 656 | 'class' => 'gv-datepicker', |
657 | - 'desc' => __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
657 | + 'desc' => __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
658 | 658 | 'type' => 'text', |
659 | 659 | 'value' => '', |
660 | 660 | 'group' => 'filter', |
661 | 661 | 'show_in_shortcode' => true, |
662 | 662 | ), |
663 | 663 | 'class' => array( |
664 | - 'label' => __('CSS Class', 'gravityview'), |
|
665 | - 'desc' => __('CSS class to add to the wrapping HTML container.', 'gravityview'), |
|
664 | + 'label' => __( 'CSS Class', 'gravityview' ), |
|
665 | + 'desc' => __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ), |
|
666 | 666 | 'group' => 'default', |
667 | 667 | 'type' => 'text', |
668 | 668 | 'value' => '', |
669 | 669 | 'show_in_shortcode' => false, |
670 | 670 | ), |
671 | 671 | 'search_value' => array( |
672 | - 'label' => __('Search Value', 'gravityview'), |
|
673 | - 'desc' => __('Define a default search value for the View', 'gravityview'), |
|
672 | + 'label' => __( 'Search Value', 'gravityview' ), |
|
673 | + 'desc' => __( 'Define a default search value for the View', 'gravityview' ), |
|
674 | 674 | 'type' => 'text', |
675 | 675 | 'value' => '', |
676 | 676 | 'group' => 'filter', |
677 | 677 | 'show_in_shortcode' => false, |
678 | 678 | ), |
679 | 679 | 'search_field' => array( |
680 | - 'label' => __('Search Field', 'gravityview'), |
|
681 | - 'desc' => __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'), |
|
680 | + 'label' => __( 'Search Field', 'gravityview' ), |
|
681 | + 'desc' => __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ), |
|
682 | 682 | 'type' => 'number', |
683 | 683 | 'value' => '', |
684 | 684 | 'group' => 'filter', |
685 | 685 | 'show_in_shortcode' => false, |
686 | 686 | ), |
687 | 687 | 'single_title' => array( |
688 | - 'label' => __('Single Entry Title', 'gravityview'), |
|
688 | + 'label' => __( 'Single Entry Title', 'gravityview' ), |
|
689 | 689 | 'type' => 'text', |
690 | - 'desc' => __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'), |
|
690 | + 'desc' => __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ), |
|
691 | 691 | 'group' => 'default', |
692 | 692 | 'value' => '', |
693 | 693 | 'show_in_shortcode' => false, |
694 | 694 | 'full_width' => true, |
695 | 695 | ), |
696 | 696 | 'back_link_label' => array( |
697 | - 'label' => __('Back Link Label', 'gravityview'), |
|
697 | + 'label' => __( 'Back Link Label', 'gravityview' ), |
|
698 | 698 | 'group' => 'default', |
699 | - 'desc' => __('The text of the link that returns to the multiple entries view.', 'gravityview'), |
|
699 | + 'desc' => __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ), |
|
700 | 700 | 'type' => 'text', |
701 | 701 | 'value' => '', |
702 | 702 | 'show_in_shortcode' => false, |
703 | 703 | 'full_width' => true, |
704 | 704 | ), |
705 | 705 | 'embed_only' => array( |
706 | - 'label' => __('Prevent Direct Access', 'gravityview'), |
|
706 | + 'label' => __( 'Prevent Direct Access', 'gravityview' ), |
|
707 | 707 | 'group' => 'default', |
708 | - 'desc' => __('Only allow access to this View when embedded using the shortcode.', 'gravityview'), |
|
708 | + 'desc' => __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ), |
|
709 | 709 | 'type' => 'checkbox', |
710 | 710 | 'value' => '', |
711 | 711 | 'show_in_shortcode' => false, |
712 | 712 | 'full_width' => true, |
713 | 713 | ), |
714 | - )); |
|
714 | + ) ); |
|
715 | 715 | |
716 | 716 | // By default, we only want the key => value pairing, not the whole array. |
717 | - if( empty( $with_details ) ) { |
|
717 | + if ( empty( $with_details ) ) { |
|
718 | 718 | |
719 | 719 | $defaults = array(); |
720 | 720 | |
721 | - foreach( $default_settings as $key => $value ) { |
|
722 | - $defaults[ $key ] = $value['value']; |
|
721 | + foreach ( $default_settings as $key => $value ) { |
|
722 | + $defaults[ $key ] = $value[ 'value' ]; |
|
723 | 723 | } |
724 | 724 | |
725 | 725 | return $defaults; |
@@ -728,12 +728,12 @@ discard block |
||
728 | 728 | // But sometimes, we want all the details. |
729 | 729 | else { |
730 | 730 | |
731 | - foreach ($default_settings as $key => $value) { |
|
731 | + foreach ( $default_settings as $key => $value ) { |
|
732 | 732 | |
733 | 733 | // If the $group argument is set for the method, |
734 | 734 | // ignore any settings that aren't in that group. |
735 | - if( !empty( $group ) && is_string( $group ) ) { |
|
736 | - if( empty( $value['group'] ) || $value['group'] !== $group ) { |
|
735 | + if ( ! empty( $group ) && is_string( $group ) ) { |
|
736 | + if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) { |
|
737 | 737 | unset( $default_settings[ $key ] ); |
738 | 738 | } |
739 | 739 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | foreach ( $passed_post as &$post) { |
73 | 73 | if( ( get_post_type( $post ) === 'gravityview' ) ) { |
74 | 74 | $ids[] = $post->ID; |
75 | - } else{ |
|
75 | + } else { |
|
76 | 76 | // Parse the Post Content |
77 | 77 | $id = $this->parse_post_content( $post->post_content ); |
78 | 78 | if( $id ) { |