@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 15 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * GravityView_Welcome Class |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * @param mixed $data Additional data to display |
| 352 | 352 | * @return void |
| 353 | 353 | */ |
| 354 | - public static function log_debug( $message, $data = null ){ |
|
| 354 | + public static function log_debug( $message, $data = null ) { |
|
| 355 | 355 | /** |
| 356 | 356 | * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 357 | 357 | * @param string $message Message to display |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | * @param string $message log message |
| 366 | 366 | * @return void |
| 367 | 367 | */ |
| 368 | - public static function log_error( $message, $data = null ){ |
|
| 368 | + public static function log_error( $message, $data = null ) { |
|
| 369 | 369 | /** |
| 370 | 370 | * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 371 | 371 | * @param string $message Error message to display |
@@ -295,7 +295,8 @@ discard block |
||
| 295 | 295 | if ( empty( $license_data ) ) { |
| 296 | 296 | if ( $is_ajax ) { |
| 297 | 297 | exit( json_encode( array() ) ); |
| 298 | - } else { // Non-ajax call |
|
| 298 | + } else { |
|
| 299 | +// Non-ajax call |
|
| 299 | 300 | return json_encode( array() ); |
| 300 | 301 | } |
| 301 | 302 | } |
@@ -325,7 +326,8 @@ discard block |
||
| 325 | 326 | |
| 326 | 327 | if ( $is_ajax ) { |
| 327 | 328 | exit( $json ); |
| 328 | - } else { // Non-ajax call |
|
| 329 | + } else { |
|
| 330 | +// Non-ajax call |
|
| 329 | 331 | return ( rgget('format', $data ) === 'object' ) ? $license_data : $json; |
| 330 | 332 | } |
| 331 | 333 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
| 1191 | 1191 | // Default Label value |
| 1192 | 1192 | $context['label_value'] = gv_label( $args['field'], $entry ); |
| 1193 | 1193 | |
| 1194 | - if ( empty( $context['label'] ) && ! empty( $context['label_value'] ) ){ |
|
| 1194 | + if ( empty( $context['label'] ) && ! empty( $context['label_value'] ) ) { |
|
| 1195 | 1195 | $context['label'] = '<span class="gv-field-label">{{ label_value }}</span>'; |
| 1196 | 1196 | } |
| 1197 | 1197 | |
@@ -1224,7 +1224,7 @@ discard block |
||
| 1224 | 1224 | foreach ( $context as $tag => $value ) { |
| 1225 | 1225 | |
| 1226 | 1226 | // If the tag doesn't exist just skip it |
| 1227 | - if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ){ |
|
| 1227 | + if ( false === strpos( $html, $open_tag . $tag . $close_tag ) && false === strpos( $html, $open_tag . ' ' . $tag . ' ' . $close_tag ) ) { |
|
| 1228 | 1228 | continue; |
| 1229 | 1229 | } |
| 1230 | 1230 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | * |
| 271 | 271 | * @return void |
| 272 | 272 | */ |
| 273 | - public function add_custom_column_content( $column_name = NULL, $post_id ) { |
|
| 273 | + public function add_custom_column_content( $column_name = NULL, $post_id ) { |
|
| 274 | 274 | |
| 275 | 275 | $output = ''; |
| 276 | 276 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | function save_postdata( $post_id ) { |
| 431 | 431 | |
| 432 | - if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ){ |
|
| 432 | + if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
| 433 | 433 | return; |
| 434 | 434 | } |
| 435 | 435 | |
@@ -622,7 +622,7 @@ |
||
| 622 | 622 | 'ymd_dot' => 'Y.m.d', |
| 623 | 623 | ); |
| 624 | 624 | |
| 625 | - if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){ |
|
| 625 | + if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) { |
|
| 626 | 626 | $format = $datepicker[ $field->dateFormat ]; |
| 627 | 627 | } |
| 628 | 628 | |
@@ -183,12 +183,10 @@ discard block |
||
| 183 | 183 | if ( file_exists( $mofile_global ) ) { |
| 184 | 184 | // Look in global /wp-content/languages/[plugin-dir]/ folder |
| 185 | 185 | load_textdomain( $this->_text_domain, $mofile_global ); |
| 186 | - } |
|
| 187 | - elseif ( file_exists( $mofile_local ) ) { |
|
| 186 | + } elseif ( file_exists( $mofile_local ) ) { |
|
| 188 | 187 | // Look in local /wp-content/plugins/[plugin-dir]/languages/ folder |
| 189 | 188 | load_textdomain( $this->_text_domain, $mofile_local ); |
| 190 | - } |
|
| 191 | - else { |
|
| 189 | + } else { |
|
| 192 | 190 | // Load the default language files |
| 193 | 191 | load_plugin_textdomain( $this->_text_domain, false, $lang_dir ); |
| 194 | 192 | } |
@@ -219,7 +217,7 @@ discard block |
||
| 219 | 217 | public function settings() { |
| 220 | 218 | |
| 221 | 219 | // If doing ajax, get outta here |
| 222 | - if( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
|
| 220 | + if( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { |
|
| 223 | 221 | return; |
| 224 | 222 | } |
| 225 | 223 | |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | |
| 614 | 614 | $back_link = esc_url( remove_query_arg( array( 'page', 'view', 'edit' ) ) ); |
| 615 | 615 | |
| 616 | - if( ! $this->is_valid ){ |
|
| 616 | + if( ! $this->is_valid ) { |
|
| 617 | 617 | |
| 618 | 618 | // Keeping this compatible with Gravity Forms. |
| 619 | 619 | $validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>"; |
@@ -1620,9 +1620,7 @@ discard block |
||
| 1620 | 1620 | // Verify |
| 1621 | 1621 | else if( ! $this->is_edit_entry() ) { |
| 1622 | 1622 | $valid = false; |
| 1623 | - } |
|
| 1624 | - |
|
| 1625 | - else { |
|
| 1623 | + } else { |
|
| 1626 | 1624 | $valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key ); |
| 1627 | 1625 | } |
| 1628 | 1626 | |
@@ -116,7 +116,7 @@ discard block |
||
| 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 ) ) { |
|
| 119 | + if( !empty( $wp_styles->registered ) ) { |
|
| 120 | 120 | foreach ($wp_styles->registered as $key => $style) { |
| 121 | 121 | if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
| 122 | 122 | wp_dequeue_style( $key ); |
@@ -189,8 +189,8 @@ discard block |
||
| 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 | } |