@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function allowed_atts( $atts = array() ) { |
104 | 104 | |
105 | - $atts['data-fancybox'] = null; |
|
106 | - $atts['data-fancybox-trigger'] = null; |
|
107 | - $atts['data-fancybox-index'] = null; |
|
108 | - $atts['data-src'] = null; |
|
109 | - $atts['data-type'] = null; |
|
110 | - $atts['data-width'] = null; |
|
111 | - $atts['data-height'] = null; |
|
112 | - $atts['data-srcset'] = null; |
|
113 | - $atts['data-caption'] = null; |
|
114 | - $atts['data-options'] = null; |
|
115 | - $atts['data-filter'] = null; |
|
105 | + $atts[ 'data-fancybox' ] = null; |
|
106 | + $atts[ 'data-fancybox-trigger' ] = null; |
|
107 | + $atts[ 'data-fancybox-index' ] = null; |
|
108 | + $atts[ 'data-src' ] = null; |
|
109 | + $atts[ 'data-type' ] = null; |
|
110 | + $atts[ 'data-width' ] = null; |
|
111 | + $atts[ 'data-height' ] = null; |
|
112 | + $atts[ 'data-srcset' ] = null; |
|
113 | + $atts[ 'data-caption' ] = null; |
|
114 | + $atts[ 'data-options' ] = null; |
|
115 | + $atts[ 'data-filter' ] = null; |
|
116 | 116 | |
117 | 117 | return $atts; |
118 | 118 | } |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | return $link_atts; |
127 | 127 | } |
128 | 128 | |
129 | - $link_atts['class'] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox'; |
|
129 | + $link_atts[ 'class' ] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox'; |
|
130 | 130 | |
131 | - $link_atts['class'] = gravityview_sanitize_html_class( $link_atts['class'] ); |
|
131 | + $link_atts[ 'class' ] = gravityview_sanitize_html_class( $link_atts[ 'class' ] ); |
|
132 | 132 | |
133 | 133 | if ( $context && ! empty( $context->field->field ) ) { |
134 | 134 | if ( $context->field->field->multipleFiles ) { |
135 | 135 | $entry = $context->entry->as_entry(); |
136 | - $link_atts['data-fancybox'] = 'gallery-' . sprintf( "%s-%s-%s", $entry['form_id'], $context->field->ID, $context->entry->get_slug() ); |
|
136 | + $link_atts[ 'data-fancybox' ] = 'gallery-' . sprintf( "%s-%s-%s", $entry[ 'form_id' ], $context->field->ID, $context->entry->get_slug() ); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * @see RGFormsModel::update_lead_property() Trigger when any entry property changes |
83 | 83 | */ |
84 | - foreach( $this->lead_db_columns as $column ) { |
|
84 | + foreach ( $this->lead_db_columns as $column ) { |
|
85 | 85 | add_action( 'gform_update_' . $column, array( $this, 'entry_status_changed' ), 10, 3 ); |
86 | 86 | } |
87 | 87 | |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
115 | - gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{lead_id} was deleted', array( 'form_id' => $entry['form_id'], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) ); |
|
115 | + gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{lead_id} was deleted', array( 'form_id' => $entry[ 'form_id' ], 'entry_id' => $lead_id, 'data' => array( 'value' => $property_value, 'previous' => $previous_value ) ) ); |
|
116 | 116 | |
117 | - $this->blacklist_add( $entry['form_id'] ); |
|
117 | + $this->blacklist_add( $entry[ 'form_id' ] ); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function entry_updated( $form, $lead_id ) { |
129 | 129 | |
130 | - gravityview()->log->debug(' adding form {form_id} to blacklist because entry #{entry_id} was updated', array( 'form_id' => $form['id'], 'entry_id' => $lead_id ) ); |
|
130 | + gravityview()->log->debug( ' adding form {form_id} to blacklist because entry #{entry_id} was updated', array( 'form_id' => $form[ 'id' ], 'entry_id' => $lead_id ) ); |
|
131 | 131 | |
132 | - $this->blacklist_add( $form['id'] ); |
|
132 | + $this->blacklist_add( $form[ 'id' ] ); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function entry_created( $entry, $form ) { |
146 | 146 | |
147 | - gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{entry_id} was created', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) ); |
|
147 | + gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{entry_id} was created', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) ); |
|
148 | 148 | |
149 | - $this->blacklist_add( $form['id'] ); |
|
149 | + $this->blacklist_add( $form[ 'id' ] ); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | return; |
163 | 163 | } |
164 | 164 | |
165 | - gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{entry_id} was added', array( 'form_id' => $form['id'], 'entry_id' => $entry['id'] ) ); |
|
165 | + gravityview()->log->debug( 'adding form {form_id} to blacklist because entry #{entry_id} was added', array( 'form_id' => $form[ 'id' ], 'entry_id' => $entry[ 'id' ] ) ); |
|
166 | 166 | |
167 | - $this->blacklist_add( $form['id'] ); |
|
167 | + $this->blacklist_add( $form[ 'id' ] ); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | // Normally just one form, but supports multiple forms |
184 | 184 | // |
185 | 185 | // Array of IDs 12, 5, 14 would result in `f:12-f:5-f:14` |
186 | - $forms = 'f:' . implode( '-f:', (array) $form_ids ); |
|
186 | + $forms = 'f:' . implode( '-f:', (array)$form_ids ); |
|
187 | 187 | |
188 | 188 | // Prefix for transient keys |
189 | 189 | // Now the prefix would be: `gv-cache-f:12-f:5-f:14-` |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $form_ids = is_array( $form_ids ) ? $form_ids : array( $form_ids ); |
236 | 236 | |
237 | 237 | // Add the passed form IDs |
238 | - $blacklist = array_merge( (array) $blacklist, $form_ids ); |
|
238 | + $blacklist = array_merge( (array)$blacklist, $form_ids ); |
|
239 | 239 | |
240 | 240 | // Don't duplicate |
241 | 241 | $blacklist = array_unique( $blacklist ); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | |
267 | 267 | $blacklist = get_option( self::BLACKLIST_OPTION_NAME, array() ); |
268 | 268 | |
269 | - $updated_list = array_diff( $blacklist, (array) $form_ids ); |
|
269 | + $updated_list = array_diff( $blacklist, (array)$form_ids ); |
|
270 | 270 | |
271 | 271 | gravityview()->log->debug( 'Removing form IDs from cache blacklist', array( 'data' => array( |
272 | 272 | '$form_ids' => $form_ids, |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return false; |
300 | 300 | } |
301 | 301 | |
302 | - foreach ( (array) $form_ids as $form_id ) { |
|
302 | + foreach ( (array)$form_ids as $form_id ) { |
|
303 | 303 | |
304 | 304 | if ( in_array( $form_id, $blacklist ) ) { |
305 | 305 | |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @filter `gravityview_cache_time_{$filter_name}` Modify the cache time for a type of cache |
374 | 374 | * @param int $time_in_seconds Default: `DAY_IN_SECONDS` |
375 | 375 | */ |
376 | - $cache_time = (int) apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
376 | + $cache_time = (int)apply_filters( 'gravityview_cache_time_' . $filter_name, DAY_IN_SECONDS ); |
|
377 | 377 | |
378 | 378 | gravityview()->log->debug( 'Setting cache with transient key {key} for {cache_time} seconds', array( 'key' => $this->key, 'cache_time' => $cache_time ) ); |
379 | 379 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | return; |
410 | 410 | } |
411 | 411 | |
412 | - foreach ( (array) $form_ids as $form_id ) { |
|
412 | + foreach ( (array)$form_ids as $form_id ) { |
|
413 | 413 | |
414 | 414 | $key = '_transient_gv-cache-'; |
415 | 415 | |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | public function use_cache() { |
521 | 521 | |
522 | 522 | // Exit early if debugging (unless running PHPUnit) |
523 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined('DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) { |
|
523 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! ( defined( 'DOING_GRAVITYVIEW_TESTS' ) && DOING_GRAVITYVIEW_TESTS ) ) { |
|
524 | 524 | return apply_filters( 'gravityview_use_cache', false, $this ); |
525 | 525 | } |
526 | 526 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | |
529 | 529 | if ( GVCommon::has_cap( 'edit_gravityviews' ) ) { |
530 | 530 | |
531 | - if ( isset( $_GET['cache'] ) || isset( $_GET['nocache'] ) ) { |
|
531 | + if ( isset( $_GET[ 'cache' ] ) || isset( $_GET[ 'nocache' ] ) ) { |
|
532 | 532 | |
533 | 533 | gravityview()->log->debug( 'Not using cache: ?cache or ?nocache is in the URL' ); |
534 | 534 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | */ |
556 | 556 | $use_cache = apply_filters( 'gravityview_use_cache', $use_cache, $this ); |
557 | 557 | |
558 | - return (boolean) $use_cache; |
|
558 | + return (boolean)$use_cache; |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | } |