@@ -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 GravityView WordPress plugin class. |
@@ -68,8 +69,9 @@ discard block |
||
| 68 | 69 | * @return \GV\Plugin The global instance of GravityView Plugin. |
| 69 | 70 | */ |
| 70 | 71 | public static function get() { |
| 71 | - if ( ! self::$__instance instanceof self ) |
|
| 72 | - self::$__instance = new self; |
|
| 72 | + if ( ! self::$__instance instanceof self ) { |
|
| 73 | + self::$__instance = new self; |
|
| 74 | + } |
|
| 73 | 75 | return self::$__instance; |
| 74 | 76 | } |
| 75 | 77 | |
@@ -92,8 +94,9 @@ discard block |
||
| 92 | 94 | * Stop all further functionality from loading if the WordPress |
| 93 | 95 | * plugin is incompatible with the current environment. |
| 94 | 96 | */ |
| 95 | - if ( ! $this->is_compatible() ) |
|
| 96 | - return; |
|
| 97 | + if ( ! $this->is_compatible() ) { |
|
| 98 | + return; |
|
| 99 | + } |
|
| 97 | 100 | |
| 98 | 101 | /** Register hooks that are fired when the plugin is activated and deactivated. */ |
| 99 | 102 | register_activation_hook( $this->dir( 'gravityview.php' ), array( $this, 'activate' ) ); |
@@ -236,8 +239,9 @@ discard block |
||
| 236 | 239 | * @return string The version of Gravity Forms. |
| 237 | 240 | */ |
| 238 | 241 | private function get_gravityforms_version() { |
| 239 | - if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) |
|
| 240 | - throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
| 242 | + if ( !class_exists( '\GFCommon' ) || !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_INACTIVE_OVERRIDE'] ) ) { |
|
| 243 | + throw new \ErrorException( 'Gravity Forms is inactive or not installed.' ); |
|
| 244 | + } |
|
| 241 | 245 | |
| 242 | 246 | return !empty( $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] ) ? |
| 243 | 247 | $GLOBALS['GRAVITYVIEW_TESTS_GF_VERSION_OVERRIDE'] : \GFCommon::$version; |
@@ -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 | * A generic Collection base 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 default Request class. |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** Deprecated, see \GV\View_Collection::from_post */ |
| 82 | 82 | if( ( get_post_type( $post ) === 'gravityview' ) ) { |
| 83 | 83 | $ids[] = $post->ID; |
| 84 | - } else{ |
|
| 84 | + } else { |
|
| 85 | 85 | // Parse the Post Content |
| 86 | 86 | $id = $this->parse_post_content( $post->post_content ); |
| 87 | 87 | if( $id ) { |
@@ -105,8 +105,9 @@ discard block |
||
| 105 | 105 | if ( function_exists( 'gravityview' ) ) { |
| 106 | 106 | $shortcodes = \GV\Shortcode::parse( $passed_post ); |
| 107 | 107 | foreach ( $shortcodes as $shortcode ) { |
| 108 | - if ( $shortcode->name == 'gravityview' && !empty( $shortcode->atts['id'] ) ) |
|
| 109 | - $ids []= $shortcode->atts['id']; |
|
| 108 | + if ( $shortcode->name == 'gravityview' && !empty( $shortcode->atts['id'] ) ) { |
|
| 109 | + $ids []= $shortcode->atts['id']; |
|
| 110 | + } |
|
| 110 | 111 | } |
| 111 | 112 | } else { |
| 112 | 113 | /** Deprecated, use \GV\Shortcode::parse. */ |
@@ -507,7 +508,7 @@ discard block |
||
| 507 | 508 | } |
| 508 | 509 | |
| 509 | 510 | if( ! $message ) { |
| 510 | - if ( function_exists( 'gravityview' ) && $post = get_post( $post_id ) ) { |
|
| 511 | + if ( function_exists( 'gravityview' ) && $post = get_post( $post_id ) ) { |
|
| 511 | 512 | $views = GV\View_Collection::from_post( $post ); |
| 512 | 513 | $view_ids_in_post = array_map( function( $view ) { return $view->ID; }, $views->all() ); |
| 513 | 514 | } else { |
@@ -231,8 +231,9 @@ |
||
| 231 | 231 | if ( function_exists( 'gravityview' ) && $post = get_post( $post_id ) ) { |
| 232 | 232 | $views = \GV\View_Collection::from_post( $post ); |
| 233 | 233 | $views = $views->all(); |
| 234 | - if ( ! empty( $views ) ) |
|
| 235 | - $this->view_id = $views[0]->ID; |
|
| 234 | + if ( ! empty( $views ) ) { |
|
| 235 | + $this->view_id = $views[0]->ID; |
|
| 236 | + } |
|
| 236 | 237 | } else { |
| 237 | 238 | /** Deprecated. */ |
| 238 | 239 | $this->view_id = GravityView_View_Data::getInstance()->maybe_get_view_id( $post_id ); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * |
| 51 | 51 | * @return array Blacklist, with "total" added. If not edit context, original field blacklist. Otherwise, blacklist including total. |
| 52 | 52 | */ |
| 53 | - public function add_to_blacklist( $blacklist = array(), $context = NULL ){ |
|
| 53 | + public function add_to_blacklist( $blacklist = array(), $context = NULL ) { |
|
| 54 | 54 | |
| 55 | 55 | if( empty( $context ) || $context !== 'edit' ) { |
| 56 | 56 | return $blacklist; |