@@ -171,11 +171,13 @@ |
||
| 171 | 171 | $public_display['nickname'] = $profileuser->nickname; |
| 172 | 172 | $public_display['username'] = $profileuser->user_login; |
| 173 | 173 | |
| 174 | - if ( !empty($profileuser->first_name) ) |
|
| 175 | - $public_display['firstname'] = $profileuser->first_name; |
|
| 174 | + if ( !empty($profileuser->first_name) ) { |
|
| 175 | + $public_display['firstname'] = $profileuser->first_name; |
|
| 176 | + } |
|
| 176 | 177 | |
| 177 | - if ( !empty($profileuser->last_name) ) |
|
| 178 | - $public_display['lastname'] = $profileuser->last_name; |
|
| 178 | + if ( !empty($profileuser->last_name) ) { |
|
| 179 | + $public_display['lastname'] = $profileuser->last_name; |
|
| 180 | + } |
|
| 179 | 181 | |
| 180 | 182 | if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) { |
| 181 | 183 | $public_display['firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name; |
@@ -4,7 +4,9 @@ |
||
| 4 | 4 | //set_site_transient( 'update_plugins', null ); |
| 5 | 5 | |
| 6 | 6 | // Exit if accessed directly |
| 7 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 7 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 8 | + exit; |
|
| 9 | +} |
|
| 8 | 10 | |
| 9 | 11 | /** |
| 10 | 12 | * Allows plugins to use their own update API. |
@@ -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 |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if( $result === true ) { |
| 320 | 320 | $note = empty( $approved ) ? __( 'Disapproved the Entry for GravityView', 'gravityview' ) : __( 'Approved the Entry for GravityView', 'gravityview' ); |
| 321 | 321 | |
| 322 | - if( class_exists( 'GravityView_Entry_Notes' ) ){ |
|
| 322 | + if( class_exists( 'GravityView_Entry_Notes' ) ) { |
|
| 323 | 323 | global $current_user; |
| 324 | 324 | get_currentuserinfo(); |
| 325 | 325 | GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note ); |
@@ -432,23 +432,17 @@ discard block |
||
| 432 | 432 | do_action( 'gravityview_log_error', __METHOD__ . ' entry_id or form_id are empty.', $_POST ); |
| 433 | 433 | |
| 434 | 434 | $result = false; |
| 435 | - } |
|
| 436 | - |
|
| 437 | - else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) { |
|
| 435 | + } else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) { |
|
| 438 | 436 | |
| 439 | 437 | do_action( 'gravityview_log_error', __METHOD__ . ' Security check failed.', $_POST ); |
| 440 | 438 | |
| 441 | 439 | $result = false; |
| 442 | - } |
|
| 443 | - |
|
| 444 | - else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) { |
|
| 440 | + } else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) { |
|
| 445 | 441 | |
| 446 | 442 | do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' ); |
| 447 | 443 | |
| 448 | 444 | $result = false; |
| 449 | - } |
|
| 450 | - |
|
| 451 | - else { |
|
| 445 | + } else { |
|
| 452 | 446 | |
| 453 | 447 | $result = self::update_approved( $_POST['entry_id'], $_POST['approved'], $_POST['form_id'] ); |
| 454 | 448 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | $this->context_view_id = $_GET['gvid']; |
| 243 | 243 | |
| 244 | - } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
| 244 | + } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
| 245 | 245 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
| 246 | 246 | $this->context_view_id = array_pop( $array_keys ); |
| 247 | 247 | unset( $array_keys ); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | global $post; |
| 270 | 270 | |
| 271 | 271 | // If in admin and NOT AJAX request, get outta here. |
| 272 | - if ( GravityView_Plugin::is_admin() ) { |
|
| 272 | + if ( GravityView_Plugin::is_admin() ) { |
|
| 273 | 273 | return; |
| 274 | 274 | } |
| 275 | 275 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | // User reported WooCommerce doesn't pass two args. |
| 375 | - if ( empty( $passed_post_id ) ) { |
|
| 375 | + if ( empty( $passed_post_id ) ) { |
|
| 376 | 376 | return $title; |
| 377 | 377 | } |
| 378 | 378 | |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | */ |
| 1109 | 1109 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
| 1110 | 1110 | |
| 1111 | - switch( strtolower( $address_part ) ){ |
|
| 1111 | + switch( strtolower( $address_part ) ) { |
|
| 1112 | 1112 | case 'street': |
| 1113 | 1113 | $sort_field_id .= '.1'; |
| 1114 | 1114 | break; |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | */ |
| 1189 | 1189 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
| 1190 | 1190 | |
| 1191 | - if ( empty( $single_entry ) ){ |
|
| 1191 | + if ( empty( $single_entry ) ) { |
|
| 1192 | 1192 | return false; |
| 1193 | 1193 | } else { |
| 1194 | 1194 | return $single_entry; |
@@ -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 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // Dequeue other jQuery styles even if no-conflict is off. |
| 268 | 268 | // Terrible-looking tabs help no one. |
| 269 | - if( !empty( $wp_styles->registered ) ) { |
|
| 269 | + if( !empty( $wp_styles->registered ) ) { |
|
| 270 | 270 | foreach ($wp_styles->registered as $key => $style) { |
| 271 | 271 | if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
| 272 | 272 | wp_dequeue_style( $key ); |
@@ -337,8 +337,8 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | //unregistering scripts |
| 339 | 339 | $registered = array(); |
| 340 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 341 | - if( in_array( $handle, $required_objects ) ){ |
|
| 340 | + foreach( $wp_objects->registered as $handle => $script_registration ) { |
|
| 341 | + if( in_array( $handle, $required_objects ) ) { |
|
| 342 | 342 | $registered[ $handle ] = $script_registration; |
| 343 | 343 | } |
| 344 | 344 | } |
@@ -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 | |