@@ -195,7 +195,6 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @deprecated 2.0.7 |
| 197 | 197 | * |
| 198 | - * @param array $handles Array of meta keys to check for existence of shortcodes |
|
| 199 | 198 | * @param int $post_id The ID being checked by GravityView |
| 200 | 199 | * |
| 201 | 200 | * @return array Meta key array, merged with existing meta keys |
@@ -209,7 +208,6 @@ discard block |
||
| 209 | 208 | * |
| 210 | 209 | * @since 2.0.7 |
| 211 | 210 | * |
| 212 | - * @param array $handles Array of meta keys to check for existence of shortcodes |
|
| 213 | 211 | * @param \WP_Post $post The ID being checked by GravityView |
| 214 | 212 | * |
| 215 | 213 | * @return array Meta key array, merged with existing meta keys |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | private function maybe_add_hooks() { |
| 111 | 111 | $class_exists = $this->class_name && class_exists( $this->class_name ); |
| 112 | 112 | $function_exists = $this->function_name && function_exists( $this->function_name ); |
| 113 | - $constant_defined = $this->constant_name && defined("{$this->constant_name}"); |
|
| 113 | + $constant_defined = $this->constant_name && defined( "{$this->constant_name}" ); |
|
| 114 | 114 | |
| 115 | - if( $class_exists || $function_exists || $constant_defined ) { |
|
| 115 | + if ( $class_exists || $function_exists || $constant_defined ) { |
|
| 116 | 116 | $this->add_hooks(); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -124,23 +124,23 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | protected function add_hooks() { |
| 126 | 126 | |
| 127 | - if( $this->meta_keys ) { |
|
| 127 | + if ( $this->meta_keys ) { |
|
| 128 | 128 | add_filter( 'gravityview/data/parse/meta_keys', array( $this, 'merge_meta_keys' ), 10, 2 ); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if( $this->content_meta_keys ) { |
|
| 131 | + if ( $this->content_meta_keys ) { |
|
| 132 | 132 | add_filter( 'gravityview/view_collection/from_post/meta_keys', array( $this, 'merge_content_meta_keys' ), 10, 3 ); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if( $this->script_handles ) { |
|
| 135 | + if ( $this->script_handles ) { |
|
| 136 | 136 | add_filter( 'gravityview_noconflict_scripts', array( $this, 'merge_noconflict_scripts' ) ); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if( $this->style_handles ) { |
|
| 139 | + if ( $this->style_handles ) { |
|
| 140 | 140 | add_filter( 'gravityview_noconflict_styles', array( $this, 'merge_noconflict_styles' ) ); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - if( $this->post_type_support ) { |
|
| 143 | + if ( $this->post_type_support ) { |
|
| 144 | 144 | add_filter( 'gravityview_post_type_support', array( $this, 'merge_post_type_support' ), 10, 2 ); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $meta_keys = apply_filters_ref_array( 'gravityview/view_collection/from_post/meta_keys', array( array(), $post, &$views ) ); |
| 100 | 100 | |
| 101 | 101 | if ( function_exists( 'apply_filters_deprecated' ) ) { |
| 102 | - $meta_keys = (array) apply_filters_deprecated( 'gravityview/data/parse/meta_keys', array( $meta_keys, $post->ID ), '2.0.7', 'gravityview/view_collection/from_post/meta_keys' ); |
|
| 102 | + $meta_keys = (array)apply_filters_deprecated( 'gravityview/data/parse/meta_keys', array( $meta_keys, $post->ID ), '2.0.7', 'gravityview/view_collection/from_post/meta_keys' ); |
|
| 103 | 103 | } else { |
| 104 | 104 | /** |
| 105 | 105 | * @filter `gravityview/data/parse/meta_keys` |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @todo Require WP 4.6.0 so that `apply_filters_deprecated` is always available |
| 108 | 108 | * @see The `gravityview/view_collection/from_post/meta_keys` filter. |
| 109 | 109 | */ |
| 110 | - $meta_keys = (array) apply_filters( 'gravityview/data/parse/meta_keys', $meta_keys, $post->ID ); |
|
| 110 | + $meta_keys = (array)apply_filters( 'gravityview/data/parse/meta_keys', $meta_keys, $post->ID ); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** What about inside post meta values? */ |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | /** Let's find us some [gravityview] shortcodes perhaps. */ |
| 139 | 139 | foreach ( Shortcode::parse( $content ) as $shortcode ) { |
| 140 | - if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts['id'] ) ) { |
|
| 140 | + if ( $shortcode->name != 'gravityview' || empty( $shortcode->atts[ 'id' ] ) ) { |
|
| 141 | 141 | continue; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if ( is_numeric( $shortcode->atts['id'] ) ) { |
|
| 145 | - $view = View::by_id( $shortcode->atts['id'] ); |
|
| 144 | + if ( is_numeric( $shortcode->atts[ 'id' ] ) ) { |
|
| 145 | + $view = View::by_id( $shortcode->atts[ 'id' ] ); |
|
| 146 | 146 | if ( ! $view ) { |
| 147 | 147 | continue; |
| 148 | 148 | } |
@@ -39,17 +39,17 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | function merge_content_meta_keys( $meta_keys = array(), $post = null, & $views = null ) { |
| 41 | 41 | |
| 42 | - if( empty( $post->panels_data ) || empty( $post->panels_data['widgets'] ) ) { |
|
| 42 | + if ( empty( $post->panels_data ) || empty( $post->panels_data[ 'widgets' ] ) ) { |
|
| 43 | 43 | return $meta_keys; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - foreach ( (array) $post->panels_data['widgets'] as $widget ) { |
|
| 46 | + foreach ( (array)$post->panels_data[ 'widgets' ] as $widget ) { |
|
| 47 | 47 | |
| 48 | - if ( empty( $widget['text'] ) ) { |
|
| 48 | + if ( empty( $widget[ 'text' ] ) ) { |
|
| 49 | 49 | continue; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - $views->merge( \GV\View_Collection::from_content( $widget['text'] ) ); |
|
| 52 | + $views->merge( \GV\View_Collection::from_content( $widget[ 'text' ] ) ); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return $meta_keys; |