@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base Entry class. |
@@ -24,8 +25,9 @@ discard block |
||
| 24 | 25 | $endpoint = self::get_endpoint_name(); |
| 25 | 26 | |
| 26 | 27 | /** Let's make sure the endpoint array is not polluted. */ |
| 27 | - if ( in_array( array( EP_ALL, $endpoint, $endpoint ), $wp_rewrite->endpoints ) ) |
|
| 28 | - return; |
|
| 28 | + if ( in_array( array( EP_ALL, $endpoint, $endpoint ), $wp_rewrite->endpoints ) ) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | add_rewrite_endpoint( $endpoint, EP_ALL ); |
| 31 | 33 | } |
@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The default GravityView View class. |
@@ -21,8 +22,9 @@ discard block |
||
| 21 | 22 | public static function register_post_type() { |
| 22 | 23 | |
| 23 | 24 | /** Register only once */ |
| 24 | - if ( post_type_exists( 'gravityview' ) ) |
|
| 25 | - return; |
|
| 25 | + if ( post_type_exists( 'gravityview' ) ) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 26 | 28 | |
| 27 | 29 | /** |
| 28 | 30 | * @filter `gravityview_is_hierarchical` Make GravityView Views hierarchical by returning TRUE |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The Request abstract class. |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base \GV\Shortcode class. |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV\Shortcodes; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base \GV\Shortcode class. |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | $this->context_view_id = $_GET['gvid']; |
| 246 | 246 | |
| 247 | - } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
| 247 | + } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
| 248 | 248 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
| 249 | 249 | $this->context_view_id = array_pop( $array_keys ); |
| 250 | 250 | unset( $array_keys ); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | // User reported WooCommerce doesn't pass two args. |
| 455 | - if ( empty( $passed_post_id ) ) { |
|
| 455 | + if ( empty( $passed_post_id ) ) { |
|
| 456 | 456 | return $title; |
| 457 | 457 | } |
| 458 | 458 | |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | */ |
| 1308 | 1308 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
| 1309 | 1309 | |
| 1310 | - switch( strtolower( $address_part ) ){ |
|
| 1310 | + switch( strtolower( $address_part ) ) { |
|
| 1311 | 1311 | case 'street': |
| 1312 | 1312 | $sort_field_id .= '.1'; |
| 1313 | 1313 | break; |
@@ -1392,7 +1392,7 @@ discard block |
||
| 1392 | 1392 | */ |
| 1393 | 1393 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
| 1394 | 1394 | |
| 1395 | - if ( empty( $single_entry ) ){ |
|
| 1395 | + if ( empty( $single_entry ) ) { |
|
| 1396 | 1396 | return false; |
| 1397 | 1397 | } else { |
| 1398 | 1398 | return $single_entry; |
@@ -312,8 +312,9 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | public static function is_admin() { |
| 314 | 314 | |
| 315 | - if ( function_exists( 'gravityview' ) ) |
|
| 316 | - return gravityview()->request->is_admin(); |
|
| 315 | + if ( function_exists( 'gravityview' ) ) { |
|
| 316 | + return gravityview()->request->is_admin(); |
|
| 317 | + } |
|
| 317 | 318 | |
| 318 | 319 | $doing_ajax = defined( 'DOING_AJAX' ) ? DOING_AJAX : false; |
| 319 | 320 | |
@@ -382,7 +383,7 @@ discard block |
||
| 382 | 383 | * @param mixed $data Additional data to display |
| 383 | 384 | * @return void |
| 384 | 385 | */ |
| 385 | - public static function log_debug( $message, $data = null ){ |
|
| 386 | + public static function log_debug( $message, $data = null ) { |
|
| 386 | 387 | /** |
| 387 | 388 | * @action `gravityview_log_debug` Log a debug message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 388 | 389 | * @param string $message Message to display |
@@ -396,7 +397,7 @@ discard block |
||
| 396 | 397 | * @param string $message log message |
| 397 | 398 | * @return void |
| 398 | 399 | */ |
| 399 | - public static function log_error( $message, $data = null ){ |
|
| 400 | + public static function log_error( $message, $data = null ) { |
|
| 400 | 401 | /** |
| 401 | 402 | * @action `gravityview_log_error` Log an error message that shows up in the Gravity Forms Logging Addon and also the Debug Bar plugin output |
| 402 | 403 | * @param string $message Error message to display |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
| 327 | - if( GFCommon::is_product_field( $field['type'] ) ){ |
|
| 327 | + if( GFCommon::is_product_field( $field['type'] ) ) { |
|
| 328 | 328 | $has_product_fields = true; |
| 329 | 329 | } |
| 330 | 330 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | $fields = array(); |
| 386 | 386 | |
| 387 | - foreach ( $extra_fields as $key => $field ){ |
|
| 387 | + foreach ( $extra_fields as $key => $field ) { |
|
| 388 | 388 | if ( ! empty( $only_default_column ) && ! empty( $field['is_default_column'] ) ) { |
| 389 | 389 | $fields[ $key ] = array( 'label' => $field['label'], 'type' => 'entry_meta' ); |
| 390 | 390 | } |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | $form = GFAPI::get_form( $form ); |
| 979 | 979 | } |
| 980 | 980 | |
| 981 | - if ( class_exists( 'GFFormsModel' ) ){ |
|
| 981 | + if ( class_exists( 'GFFormsModel' ) ) { |
|
| 982 | 982 | return GFFormsModel::get_field( $form, $field_id ); |
| 983 | 983 | } else { |
| 984 | 984 | return null; |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | $shortcodes = array(); |
| 1026 | 1026 | |
| 1027 | 1027 | preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); |
| 1028 | - if ( empty( $matches ) ){ |
|
| 1028 | + if ( empty( $matches ) ) { |
|
| 1029 | 1029 | return false; |
| 1030 | 1030 | } |
| 1031 | 1031 | |
@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * A collection of \GV\View objects. |
@@ -39,8 +40,9 @@ discard block |
||
| 39 | 40 | */ |
| 40 | 41 | public function get( $view_id ) { |
| 41 | 42 | foreach ( $this->all() as $view ) { |
| 42 | - if ( $view->ID == $view_id ) |
|
| 43 | - return $view; |
|
| 43 | + if ( $view->ID == $view_id ) { |
|
| 44 | + return $view; |
|
| 45 | + } |
|
| 44 | 46 | } |
| 45 | 47 | return null; |
| 46 | 48 | } |