@@ -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; |