@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | |
27 | 27 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
28 | 28 | |
29 | - unset( $field_options['search_filter'] ); |
|
29 | + unset( $field_options[ 'search_filter' ] ); |
|
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | - $add_options['link_to_file'] = array( |
|
35 | + $add_options[ 'link_to_file' ] = array( |
|
36 | 36 | 'type' => 'checkbox', |
37 | 37 | 'label' => __( 'Display as a Link:', 'gravityview' ), |
38 | - 'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'), |
|
38 | + 'desc' => __( 'Display the uploaded files as links, rather than embedded content.', 'gravityview' ), |
|
39 | 39 | 'value' => false, |
40 | 40 | 'merge_tags' => false, |
41 | 41 | ); |
42 | 42 | |
43 | - $add_options['image_width'] = array( |
|
43 | + $add_options[ 'image_width' ] = array( |
|
44 | 44 | 'type' => 'text', |
45 | 45 | 'label' => __( 'Custom Width:', 'gravityview' ), |
46 | 46 | 'desc' => __( 'Override the default image width (250).', 'gravityview' ), |
@@ -158,14 +158,14 @@ discard block |
||
158 | 158 | $base_id = null; |
159 | 159 | |
160 | 160 | $is_single = gravityview_get_context() === 'single'; |
161 | - $lightbox = ! empty( $gravityview_view->atts['lightbox'] ); |
|
161 | + $lightbox = ! empty( $gravityview_view->atts[ 'lightbox' ] ); |
|
162 | 162 | $field_compat = $gravityview_view->getCurrentField(); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $output_arr = array(); |
166 | 166 | |
167 | 167 | // Get an array of file paths for the field. |
168 | - $file_paths = \GV\Utils::get( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
168 | + $file_paths = \GV\Utils::get( $field, 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
169 | 169 | |
170 | 170 | // The $value JSON was probably truncated; let's check lead_detail_long. |
171 | 171 | if ( ! is_array( $file_paths ) ) { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $rendered = null; |
186 | 186 | |
187 | 187 | // If the site is HTTPS, use HTTPS |
188 | - if ( function_exists('set_url_scheme') ) { |
|
188 | + if ( function_exists( 'set_url_scheme' ) ) { |
|
189 | 189 | $file_path = set_url_scheme( $file_path ); |
190 | 190 | } |
191 | 191 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $file_path_info = pathinfo( $file_path ); |
197 | 197 | |
198 | 198 | // If pathinfo() gave us the extension of the file, run the switch statement using that. |
199 | - $extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] ); |
|
199 | + $extension = empty( $file_path_info[ 'extension' ] ) ? NULL : strtolower( $file_path_info[ 'extension' ] ); |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * @filter `gravityview/fields/fileupload/extension` Modify the file extension before it's used in display logic |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | $extension = apply_filters( 'gravityview/fields/fileupload/extension', $extension, $file_path ); |
208 | 208 | |
209 | - $basename = $file_path_info['basename']; |
|
209 | + $basename = $file_path_info[ 'basename' ]; |
|
210 | 210 | |
211 | 211 | // Get the secure download URL |
212 | 212 | $is_secure = false; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | $audio_settings = apply_filters( 'gravityview_audio_settings', array( |
248 | 248 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
249 | - 'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id'] |
|
249 | + 'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings[ 'id' ] |
|
250 | 250 | ), $context ); |
251 | 251 | |
252 | 252 | /** |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | $video_settings = apply_filters( 'gravityview_video_settings', array( |
277 | 277 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
278 | - 'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id'] |
|
278 | + 'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings[ 'id' ] |
|
279 | 279 | ), $context ); |
280 | 280 | |
281 | 281 | /** |
@@ -299,20 +299,20 @@ discard block |
||
299 | 299 | $file_path = add_query_arg( array( 'gv-iframe' => 'true' ), $file_path ); |
300 | 300 | } |
301 | 301 | |
302 | - $field_settings['link_to_file'] = true; |
|
302 | + $field_settings[ 'link_to_file' ] = true; |
|
303 | 303 | |
304 | 304 | // Images |
305 | 305 | } else if ( in_array( $extension, GravityView_Image::get_image_extensions() ) ) { |
306 | 306 | $width = \GV\Utils::get( $field_settings, 'image_width', 250 ); |
307 | 307 | $image_atts = array( |
308 | 308 | 'src' => $file_path, |
309 | - 'class' => 'gv-image gv-field-id-' . $field_settings['id'], |
|
310 | - 'alt' => $field_settings['label'], |
|
311 | - 'width' => ( $is_single ? null : ( $width ? $width: 250 ) ) |
|
309 | + 'class' => 'gv-image gv-field-id-' . $field_settings[ 'id' ], |
|
310 | + 'alt' => $field_settings[ 'label' ], |
|
311 | + 'width' => ( $is_single ? null : ( $width ? $width : 250 ) ) |
|
312 | 312 | ); |
313 | 313 | |
314 | 314 | if ( $is_secure ) { |
315 | - $image_atts['validate_src'] = false; |
|
315 | + $image_atts[ 'validate_src' ] = false; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | |
334 | 334 | unset( $gv_entry ); |
335 | 335 | |
336 | - if ( $lightbox && empty( $field_settings['show_as_link'] ) ) { |
|
336 | + if ( $lightbox && empty( $field_settings[ 'show_as_link' ] ) ) { |
|
337 | 337 | |
338 | 338 | $lightbox_link_atts = array( |
339 | 339 | 'rel' => sprintf( "%s-%s", $gv_class, $entry_slug ), |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | // Show as link should render the image regardless. |
351 | - if ( ! empty( $field_settings['show_as_link'] ) ) { |
|
351 | + if ( ! empty( $field_settings[ 'show_as_link' ] ) ) { |
|
352 | 352 | $text = $rendered; |
353 | 353 | } |
354 | 354 | } |
355 | 355 | // For all other non-media file types (ZIP, for example), always show as a link regardless of setting. |
356 | 356 | else { |
357 | - $field_settings['link_to_file'] = true; |
|
357 | + $field_settings[ 'link_to_file' ] = true; |
|
358 | 358 | $disable_lightbox = true; |
359 | 359 | } |
360 | 360 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', false, $field_compat, $context ); |
371 | 371 | |
372 | 372 | // Output textualized content where |
373 | - if ( ! $disable_wrapped_link && ( ! empty( $field_settings['link_to_file'] ) || ! empty( $field_settings['show_as_link'] ) ) ) { |
|
373 | + if ( ! $disable_wrapped_link && ( ! empty( $field_settings[ 'link_to_file' ] ) || ! empty( $field_settings[ 'show_as_link' ] ) ) ) { |
|
374 | 374 | /** |
375 | 375 | * Modify the link text (defaults to the file name) |
376 | 376 | * |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | $content = apply_filters( 'gravityview/fields/fileupload/link_content', $text, $field_compat, $context ); |
385 | 385 | |
386 | - if ( empty( $field_settings['show_as_link'] ) ) { |
|
386 | + if ( empty( $field_settings[ 'show_as_link' ] ) ) { |
|
387 | 387 | /** |
388 | 388 | * @filter `gravityview/fields/fileupload/link_atts` Modify the link attributes for a file upload field |
389 | 389 | * @since 2.0 Added $context |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $content = empty( $rendered ) ? $text : $rendered; |
405 | 405 | } |
406 | 406 | |
407 | - $output_arr[] = array( |
|
407 | + $output_arr[ ] = array( |
|
408 | 408 | 'file_path' => $file_path, |
409 | 409 | 'content' => $content |
410 | 410 | ); |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | // Make sure that there are choices to display |
22 | -if( empty( $search_field['choices'] ) ) { |
|
22 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
23 | 23 | gravityview()->log->debug( 'search-field-chainedselect.php - No choices for field' ); |
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | 27 | $form = \GV\GF_Form::from_form( $gravityview_view->getForm() ); |
28 | 28 | |
29 | -$field = \GV\GF_Field::by_id( $form, $search_field['key'] ); |
|
29 | +$field = \GV\GF_Field::by_id( $form, $search_field[ 'key' ] ); |
|
30 | 30 | |
31 | 31 | /** @var GF_Chained_Field_Select $gf_field */ |
32 | 32 | $gf_field = $field->field; |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $gf_field->chainedSelectsAlignment = $gravityview_view->search_layout; |
53 | 53 | ?> |
54 | 54 | <div class="gv-search-box gv-search-field-chainedselect"> |
55 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
56 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
55 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
56 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
57 | 57 | <?php |
58 | 58 | } |
59 | 59 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | <script> |
68 | 68 | ( function( $ ) { |
69 | 69 | $( 'select', '.gv-search-field-chainedselect').on( 'change', function( e ) { |
70 | - window.gform.doAction( 'gform_input_change', e.target, <?php echo (int) $form->ID; ?>, <?php echo (int) $field->ID; ?> ); |
|
70 | + window.gform.doAction( 'gform_input_change', e.target, <?php echo (int)$form->ID; ?>, <?php echo (int)$field->ID; ?> ); |
|
71 | 71 | }); |
72 | 72 | <?php |
73 | 73 | echo strtr( 'new GFChainedSelects( {form_id}, {field_id}, {hide_inactive}, "{search_layout}" );', array( |
74 | 74 | '{form_id}' => $form->ID, |
75 | 75 | '{field_id}' => $field->ID, |
76 | - '{hide_inactive}' => (int) $hide_inactive, |
|
76 | + '{hide_inactive}' => (int)$hide_inactive, |
|
77 | 77 | '{search_layout}' => $gravityview_view->search_layout, |
78 | 78 | ) ); |
79 | 79 | ?> |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | return $searchable_fields; |
60 | 60 | } |
61 | 61 | |
62 | - foreach( $searchable_fields as $searchable_field ) { |
|
62 | + foreach ( $searchable_fields as $searchable_field ) { |
|
63 | 63 | |
64 | 64 | if ( self::INPUT_TYPE !== \GV\Utils::get( $searchable_field, 'input' ) ) { |
65 | 65 | continue; |
66 | 66 | } |
67 | 67 | |
68 | - $field = GFAPI::get_field( $searchable_field['form_id'], $searchable_field['field'] ); |
|
68 | + $field = GFAPI::get_field( $searchable_field[ 'form_id' ], $searchable_field[ 'field' ] ); |
|
69 | 69 | |
70 | - foreach( $field->get_entry_inputs() as $input ) { |
|
71 | - $searchable_fields[] = array( |
|
72 | - 'field' => $input['id'], |
|
70 | + foreach ( $field->get_entry_inputs() as $input ) { |
|
71 | + $searchable_fields[ ] = array( |
|
72 | + 'field' => $input[ 'id' ], |
|
73 | 73 | ); |
74 | 74 | } |
75 | 75 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function print_styles( $search_widget, $search_field ) { |
89 | 89 | |
90 | - if( self::INPUT_TYPE !== \GV\Utils::get( $search_field, 'type' ) ) { |
|
90 | + if ( self::INPUT_TYPE !== \GV\Utils::get( $search_field, 'type' ) ) { |
|
91 | 91 | return; |
92 | 92 | } |
93 | 93 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function print_scripts( $search_widget, $search_field ) { |
140 | 140 | |
141 | - if( self::INPUT_TYPE !== \GV\Utils::get( $search_field, 'type' ) ) { |
|
141 | + if ( self::INPUT_TYPE !== \GV\Utils::get( $search_field, 'type' ) ) { |
|
142 | 142 | return; |
143 | 143 | } |
144 | 144 | |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | foreach ( $gf_field->get_entry_inputs() as $input ) { |
179 | 179 | |
180 | 180 | // Inputs are converted from . to _ |
181 | - $input_url_arg = 'input_' . str_replace( '.', '_', $input['id'] ); |
|
181 | + $input_url_arg = 'input_' . str_replace( '.', '_', $input[ 'id' ] ); |
|
182 | 182 | |
183 | - $field_values[ $input['id'] ] = \GV\Utils::_REQUEST( $input_url_arg ); |
|
183 | + $field_values[ $input[ 'id' ] ] = \GV\Utils::_REQUEST( $input_url_arg ); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | return $field_values; |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | */ |
206 | 206 | function modify_searchable_fields( $fields, $form_id ) { |
207 | 207 | |
208 | - foreach( $fields as $key => $field ) { |
|
209 | - if( 'chainedselect' === $field['type'] && ! empty( $field['parent'] ) ) { |
|
208 | + foreach ( $fields as $key => $field ) { |
|
209 | + if ( 'chainedselect' === $field[ 'type' ] && ! empty( $field[ 'parent' ] ) ) { |
|
210 | 210 | unset( $fields[ $key ] ); |
211 | 211 | } |
212 | 212 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * |
236 | 236 | * @return string |
237 | 237 | */ |
238 | - public function set_input_type( $input_type, $field_type, $field_id ) { |
|
238 | + public function set_input_type( $input_type, $field_type, $field_id ) { |
|
239 | 239 | |
240 | 240 | if ( ! in_array( $field_type, array( 'chainedselect' ) ) ) { |
241 | 241 | return $input_type; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - if( ! is_admin() ) { return; } |
|
21 | + if ( ! is_admin() ) { return; } |
|
22 | 22 | |
23 | 23 | $this->add_hooks(); |
24 | 24 | } |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function add_hooks() { |
34 | 34 | //Hooks for no-conflict functionality |
35 | - add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000); |
|
36 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9); |
|
35 | + add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 ); |
|
36 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 ); |
|
37 | 37 | |
38 | - add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000); |
|
39 | - add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11); |
|
40 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1); |
|
41 | - add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1); |
|
38 | + add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 ); |
|
39 | + add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 ); |
|
40 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 ); |
|
41 | + add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function no_conflict_scripts() { |
52 | 52 | global $wp_scripts; |
53 | 53 | |
54 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
54 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | 58 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
59 | 59 | |
60 | - if( empty( $no_conflict_mode ) ) { |
|
60 | + if ( empty( $no_conflict_mode ) ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -116,15 +116,15 @@ discard block |
||
116 | 116 | function no_conflict_styles() { |
117 | 117 | global $wp_styles; |
118 | 118 | |
119 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
119 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
120 | 120 | return; |
121 | 121 | } |
122 | 122 | |
123 | 123 | // Dequeue other jQuery styles even if no-conflict is off. |
124 | 124 | // Terrible-looking tabs help no one. |
125 | - if( !empty( $wp_styles->registered ) ) { |
|
126 | - foreach ($wp_styles->registered as $key => $style) { |
|
127 | - if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
125 | + if ( ! empty( $wp_styles->registered ) ) { |
|
126 | + foreach ( $wp_styles->registered as $key => $style ) { |
|
127 | + if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
128 | 128 | wp_dequeue_style( $key ); |
129 | 129 | } |
130 | 130 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
134 | 134 | |
135 | 135 | // If no conflict is off, jQuery will suffice. |
136 | - if( empty( $no_conflict_mode ) ) { |
|
136 | + if ( empty( $no_conflict_mode ) ) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** |
162 | 162 | * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here. |
163 | 163 | */ |
164 | - do_action('gravityview_remove_conflicts_after'); |
|
164 | + do_action( 'gravityview_remove_conflicts_after' ); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | |
195 | 195 | //reset queue |
196 | 196 | $queue = array(); |
197 | - foreach( $wp_objects->queue as $object ) { |
|
198 | - if( in_array( $object, $required_objects ) || preg_match( $allow_regex, $object ) ) { |
|
199 | - $queue[] = $object; |
|
197 | + foreach ( $wp_objects->queue as $object ) { |
|
198 | + if ( in_array( $object, $required_objects ) || preg_match( $allow_regex, $object ) ) { |
|
199 | + $queue[ ] = $object; |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | $wp_objects->queue = $queue; |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | |
206 | 206 | //unregistering scripts |
207 | 207 | $registered = array(); |
208 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
209 | - if( in_array( $handle, $required_objects ) || preg_match( $allow_regex, $handle ) ){ |
|
208 | + foreach ( $wp_objects->registered as $handle => $script_registration ) { |
|
209 | + if ( in_array( $handle, $required_objects ) || preg_match( $allow_regex, $handle ) ) { |
|
210 | 210 | $registered[ $handle ] = $script_registration; |
211 | 211 | } |
212 | 212 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @param array $registered [description] |
222 | 222 | * @param array $scripts [description] |
223 | 223 | */ |
224 | - private function add_script_dependencies($registered, $scripts) { |
|
224 | + private function add_script_dependencies( $registered, $scripts ) { |
|
225 | 225 | |
226 | 226 | //gets all dependent scripts linked to the $scripts array passed |
227 | 227 | do { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array(); |
231 | 231 | foreach ( $deps as $dep ) { |
232 | 232 | if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) { |
233 | - $dependents[] = $dep; |
|
233 | + $dependents[ ] = $dep; |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | // Dequeue other jQuery styles even if no-conflict is off. |
124 | 124 | // Terrible-looking tabs help no one. |
125 | - if( !empty( $wp_styles->registered ) ) { |
|
125 | + if( !empty( $wp_styles->registered ) ) { |
|
126 | 126 | foreach ($wp_styles->registered as $key => $style) { |
127 | 127 | if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
128 | 128 | wp_dequeue_style( $key ); |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | |
206 | 206 | //unregistering scripts |
207 | 207 | $registered = array(); |
208 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
209 | - if( in_array( $handle, $required_objects ) || preg_match( $allow_regex, $handle ) ){ |
|
208 | + foreach( $wp_objects->registered as $handle => $script_registration ) { |
|
209 | + if( in_array( $handle, $required_objects ) || preg_match( $allow_regex, $handle ) ) { |
|
210 | 210 | $registered[ $handle ] = $script_registration; |
211 | 211 | } |
212 | 212 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'author' => self::author, |
99 | 99 | 'language' => get_locale(), |
100 | 100 | 'url' => home_url(), |
101 | - 'beta' => $this->settings->get( 'beta' ), |
|
101 | + 'beta' => $this->settings->get( 'beta' ), |
|
102 | 102 | 'php_version' => phpversion(), |
103 | 103 | 'wp_version' => get_bloginfo( 'version' ), |
104 | 104 | 'gv_version' => \GV\Plugin::$version, |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | private function license_call_update_settings( $license_data, $data ) { |
523 | 523 | $settings = array(); |
524 | 524 | |
525 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
525 | + $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
526 | 526 | $settings['license_key_status'] = $license_data->license; |
527 | 527 | $settings['license_key_response'] = (array)$license_data; |
528 | 528 | |
@@ -663,14 +663,14 @@ discard block |
||
663 | 663 | // Call the custom API. |
664 | 664 | $response = wp_remote_post( self::url, array( |
665 | 665 | 'timeout' => 15, |
666 | - 'sslverify' => false, |
|
667 | - 'body' => array( |
|
668 | - 'edd_action' => 'check_license', |
|
669 | - 'license' => trim( $this->settings->get( 'license_key' ) ), |
|
670 | - 'item_name' => self::name, |
|
671 | - 'url' => home_url(), |
|
672 | - 'site_data' => $this->get_site_data(), |
|
673 | - ), |
|
666 | + 'sslverify' => false, |
|
667 | + 'body' => array( |
|
668 | + 'edd_action' => 'check_license', |
|
669 | + 'license' => trim( $this->settings->get( 'license_key' ) ), |
|
670 | + 'item_name' => self::name, |
|
671 | + 'url' => home_url(), |
|
672 | + 'site_data' => $this->get_site_data(), |
|
673 | + ), |
|
674 | 674 | )); |
675 | 675 | |
676 | 676 | // make sure the response came back okay |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ); |
107 | 107 | |
108 | 108 | if ( ! empty( $action ) ) { |
109 | - $settings['edd_action'] = esc_attr( $action ); |
|
109 | + $settings[ 'edd_action' ] = esc_attr( $action ); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return array_map( 'urlencode', $settings ); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | // If doing ajax, get outta here. |
129 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
129 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) { |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | 'format' => 'json', |
174 | 174 | ) ); |
175 | 175 | |
176 | - if ( $is_ajax && empty( $data['license'] ) ) { |
|
176 | + if ( $is_ajax && empty( $data[ 'license' ] ) ) { |
|
177 | 177 | die( -1 ); |
178 | 178 | } |
179 | 179 | |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | |
202 | 202 | $json = json_encode( $license_data ); |
203 | 203 | |
204 | - $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action'); |
|
204 | + $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' ); |
|
205 | 205 | |
206 | 206 | $is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX ); |
207 | 207 | |
208 | - do_action('gravityview/admin_installer/delete_downloads_data', true ); |
|
208 | + do_action( 'gravityview/admin_installer/delete_downloads_data', true ); |
|
209 | 209 | |
210 | 210 | if ( $is_check_action_button ) { |
211 | 211 | delete_transient( self::status_transient_key ); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // most likely a mistake. |
217 | 217 | } else if ( $license_data->license !== 'failed' && $update_license ) { |
218 | 218 | |
219 | - if ( ! empty( $data['field_id'] ) ) { |
|
219 | + if ( ! empty( $data[ 'field_id' ] ) ) { |
|
220 | 220 | set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS ); |
221 | 221 | } |
222 | 222 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $class = 'hide'; |
245 | 245 | $message = ''; |
246 | 246 | } else { |
247 | - if( ! empty( $license_data->error ) ) { |
|
247 | + if ( ! empty( $license_data->error ) ) { |
|
248 | 248 | $class = 'error'; |
249 | 249 | $string_key = $license_data->error; |
250 | 250 | } else { $class = $license_data->license; |
@@ -268,12 +268,12 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function license_details( $response = array() ) { |
270 | 270 | |
271 | - $response = (array) $response; |
|
271 | + $response = (array)$response; |
|
272 | 272 | |
273 | 273 | $return = ''; |
274 | 274 | $wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>'; |
275 | 275 | |
276 | - if ( ! empty( $response['license_key'] ) ) { |
|
276 | + if ( ! empty( $response[ 'license_key' ] ) ) { |
|
277 | 277 | $return .= '<h3>' . rtrim( esc_html__( 'License Details:', 'gravityview' ), ':' ) . '</h3>'; |
278 | 278 | |
279 | 279 | if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) { |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | |
285 | - $return .= $this->strings( $response['license'], $response ); |
|
286 | - } elseif ( ! empty( $response['license_name'] ) ) { |
|
285 | + $return .= $this->strings( $response[ 'license' ], $response ); |
|
286 | + } elseif ( ! empty( $response[ 'license_name' ] ) ) { |
|
287 | 287 | $response_keys = array( |
288 | 288 | 'license_name' => '', |
289 | 289 | 'license_limit' => '', |
@@ -298,22 +298,22 @@ discard block |
||
298 | 298 | $response = wp_parse_args( $response, $response_keys ); |
299 | 299 | |
300 | 300 | $login_link_class = gravityview()->plugin->is_GF_25() ? 'button button-outline outline' : 'text-link'; |
301 | - $renews_on = ( 'lifetime' === $response['expires'] ) ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ); |
|
302 | - $login_link = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
303 | - $local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
304 | - $license_limit = empty( $response['license_limit'] ) ? __( 'Unlimited', 'gravityview' ) : (int) $response['license_limit']; |
|
301 | + $renews_on = ( 'lifetime' === $response[ 'expires' ] ) ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ); |
|
302 | + $login_link = sprintf( '<a href="%s" class="gv-access-account ' . $login_link_class . '" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
303 | + $local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
304 | + $license_limit = empty( $response[ 'license_limit' ] ) ? __( 'Unlimited', 'gravityview' ) : (int)$response[ 'license_limit' ]; |
|
305 | 305 | |
306 | 306 | |
307 | 307 | $details = array( |
308 | - 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response['license_name'] ) . '</span>' ), |
|
309 | - 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), '<span class="gv-license-detail">' . esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . '</span>' . $renews_on . $login_link, |
|
310 | - 'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response['site_count'] ), esc_html( $license_limit ) ) . '</span>' . $local_text, |
|
311 | - 'upgrade' => $this->get_upgrade_html( $response['upgrades'] ), |
|
308 | + 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), '<span class="gv-license-detail">' . esc_html( $response[ 'license_name' ] ) . '</span>' ), |
|
309 | + 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), '<span class="gv-license-detail">' . esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . '</span>' . $renews_on . $login_link, |
|
310 | + 'activations' => sprintf( str_replace( '%d', '%s', esc_html__( 'Activations: %d of %s sites', 'gravityview' ) ), '<span class="gv-license-detail">' . intval( $response[ 'site_count' ] ), esc_html( $license_limit ) ) . '</span>' . $local_text, |
|
311 | + 'upgrade' => $this->get_upgrade_html( $response[ 'upgrades' ] ), |
|
312 | 312 | ); |
313 | 313 | |
314 | - if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) { |
|
315 | - unset( $details['upgrade'] ); |
|
316 | - $details['licensed_to'] .= '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
314 | + if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) { |
|
315 | + unset( $details[ 'upgrade' ] ); |
|
316 | + $details[ 'licensed_to' ] .= '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | $return .= '<ul>'; |
@@ -345,20 +345,20 @@ discard block |
||
345 | 345 | if ( ! empty( $upgrades ) ) { |
346 | 346 | |
347 | 347 | $locale_parts = explode( '_', get_locale() ); |
348 | - $is_english = ( 'en' === $locale_parts[0] ); |
|
348 | + $is_english = ( 'en' === $locale_parts[ 0 ] ); |
|
349 | 349 | |
350 | 350 | $output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>'; |
351 | 351 | $output .= '<ul>'; |
352 | 352 | |
353 | 353 | foreach ( $upgrades as $upgrade_id => $upgrade ) { |
354 | - $upgrade = (object) $upgrade; |
|
354 | + $upgrade = (object)$upgrade; |
|
355 | 355 | |
356 | 356 | $anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) ); |
357 | 357 | |
358 | 358 | if ( $is_english && isset( $upgrade->description ) ) { |
359 | 359 | $message = esc_html( $upgrade->description ); |
360 | 360 | } else { |
361 | - switch( $upgrade->price_id ) { |
|
361 | + switch ( $upgrade->price_id ) { |
|
362 | 362 | // Interstellar |
363 | 363 | case 1: |
364 | 364 | default: |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'invalid_item_id' => esc_html__( 'This license key does not have access to this plugin.', 'gravityview' ), |
438 | 438 | 'missing' => esc_html__( 'The license key entered is invalid.', 'gravityview' ), // Missing is "the license couldn't be found", not "you submitted an empty license" |
439 | 439 | 'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ), |
440 | - 'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ), |
|
440 | + 'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ), |
|
441 | 441 | 'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ), |
442 | 442 | 'verifying_license' => esc_html__( 'Verifying license…', 'gravityview' ), |
443 | 443 | 'activate_license' => esc_html__( 'Activate License', 'gravityview' ), |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | if ( ! empty( $license_data->renewal_url ) ) { |
467 | 467 | $renew_license_url = $license_data->renewal_url; |
468 | - } elseif( ! empty( $license_data->license_key ) ) { |
|
468 | + } elseif ( ! empty( $license_data->license_key ) ) { |
|
469 | 469 | $renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key ); |
470 | 470 | } else { |
471 | 471 | $renew_license_url = 'https://gravityview.co/account/'; |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | * @return array|\WP_Error |
483 | 483 | */ |
484 | 484 | private function _license_get_remote_response( $data, $license = '' ) { |
485 | - $api_params = $this->_get_edd_settings( $data['edd_action'], $license ); |
|
485 | + $api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license ); |
|
486 | 486 | |
487 | 487 | $url = add_query_arg( $api_params, self::url ); |
488 | 488 | |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | private function license_call_update_settings( $license_data, $data ) { |
523 | 523 | $settings = array(); |
524 | 524 | |
525 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
526 | - $settings['license_key_status'] = $license_data->license; |
|
527 | - $settings['license_key_response'] = (array)$license_data; |
|
525 | + $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] ); |
|
526 | + $settings[ 'license_key_status' ] = $license_data->license; |
|
527 | + $settings[ 'license_key_response' ] = (array)$license_data; |
|
528 | 528 | |
529 | 529 | $this->settings->set( $settings ); |
530 | 530 | } |
@@ -544,9 +544,9 @@ discard block |
||
544 | 544 | $status = trim( $this->settings->get( 'license_key_status' ) ); |
545 | 545 | $key = trim( $this->settings->get( 'license_key' ) ); |
546 | 546 | |
547 | - if ( !empty( $key ) ) { |
|
547 | + if ( ! empty( $key ) ) { |
|
548 | 548 | $response = $this->settings->get( 'license_key_response' ); |
549 | - $response = is_array( $response ) ? (object) $response : json_decode( $response ); |
|
549 | + $response = is_array( $response ) ? (object)$response : json_decode( $response ); |
|
550 | 550 | } else { |
551 | 551 | $response = array(); |
552 | 552 | } |
@@ -589,11 +589,11 @@ discard block |
||
589 | 589 | |
590 | 590 | $submit = '<div class="gv-edd-button-wrapper">'; |
591 | 591 | foreach ( $fields as $field ) { |
592 | - $field['type'] = 'button'; |
|
593 | - $field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class; |
|
594 | - $field['style'] = 'margin-left: 10px;'; |
|
595 | - if( $disabled_attribute ) { |
|
596 | - $field['disabled'] = $disabled_attribute; |
|
592 | + $field[ 'type' ] = 'button'; |
|
593 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class; |
|
594 | + $field[ 'style' ] = 'margin-left: 10px;'; |
|
595 | + if ( $disabled_attribute ) { |
|
596 | + $field[ 'disabled' ] = $disabled_attribute; |
|
597 | 597 | } |
598 | 598 | $submit .= $this->settings->as_html( $field, $echo ); |
599 | 599 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | 'url' => home_url(), |
672 | 672 | 'site_data' => $this->get_site_data(), |
673 | 673 | ), |
674 | - )); |
|
674 | + ) ); |
|
675 | 675 | |
676 | 676 | // make sure the response came back okay |
677 | 677 | if ( is_wp_error( $response ) ) { |
@@ -701,45 +701,45 @@ discard block |
||
701 | 701 | $theme_data = wp_get_theme(); |
702 | 702 | $theme = $theme_data->Name . ' ' . $theme_data->Version; |
703 | 703 | |
704 | - $data['gv_version'] = Plugin::$version; |
|
705 | - $data['php_version'] = phpversion(); |
|
706 | - $data['wp_version'] = get_bloginfo( 'version' ); |
|
707 | - $data['gf_version'] = \GFForms::$version; |
|
708 | - $data['server'] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
709 | - $data['multisite'] = is_multisite(); |
|
710 | - $data['theme'] = $theme; |
|
711 | - $data['url'] = home_url(); |
|
712 | - $data['license_key'] = $this->settings->get( 'license_key' ); |
|
713 | - $data['beta'] = $this->settings->get( 'beta' ); |
|
704 | + $data[ 'gv_version' ] = Plugin::$version; |
|
705 | + $data[ 'php_version' ] = phpversion(); |
|
706 | + $data[ 'wp_version' ] = get_bloginfo( 'version' ); |
|
707 | + $data[ 'gf_version' ] = \GFForms::$version; |
|
708 | + $data[ 'server' ] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
709 | + $data[ 'multisite' ] = is_multisite(); |
|
710 | + $data[ 'theme' ] = $theme; |
|
711 | + $data[ 'url' ] = home_url(); |
|
712 | + $data[ 'license_key' ] = $this->settings->get( 'license_key' ); |
|
713 | + $data[ 'beta' ] = $this->settings->get( 'beta' ); |
|
714 | 714 | |
715 | 715 | // View Data |
716 | 716 | $gravityview_posts = wp_count_posts( 'gravityview', 'readable' ); |
717 | 717 | |
718 | - $data['view_count'] = null; |
|
719 | - $data['view_first'] = null; |
|
720 | - $data['view_latest'] = null; |
|
718 | + $data[ 'view_count' ] = null; |
|
719 | + $data[ 'view_first' ] = null; |
|
720 | + $data[ 'view_latest' ] = null; |
|
721 | 721 | |
722 | 722 | if ( $gravityview_posts->publish ) { |
723 | - $data['view_count'] = $gravityview_posts->publish; |
|
723 | + $data[ 'view_count' ] = $gravityview_posts->publish; |
|
724 | 724 | |
725 | 725 | $first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' ); |
726 | 726 | $latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' ); |
727 | 727 | |
728 | 728 | if ( $first = array_shift( $first ) ) { |
729 | - $data['view_first'] = $first->post_date; |
|
729 | + $data[ 'view_first' ] = $first->post_date; |
|
730 | 730 | } |
731 | 731 | if ( $latest = array_pop( $latest ) ) { |
732 | - $data['view_latest'] = $latest->post_date; |
|
732 | + $data[ 'view_latest' ] = $latest->post_date; |
|
733 | 733 | } |
734 | 734 | } |
735 | 735 | |
736 | 736 | // Form counts |
737 | 737 | if ( class_exists( 'GFFormsModel' ) ) { |
738 | 738 | $form_data = \GFFormsModel::get_form_count(); |
739 | - $data['forms_total'] = Utils::get( $form_data, 'total', 0 ); |
|
740 | - $data['forms_active'] = Utils::get( $form_data, 'active', 0 ); |
|
741 | - $data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 ); |
|
742 | - $data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 ); |
|
739 | + $data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 ); |
|
740 | + $data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 ); |
|
741 | + $data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
742 | + $data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | // Retrieve current plugin information |
@@ -747,13 +747,13 @@ discard block |
||
747 | 747 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
748 | 748 | } |
749 | 749 | |
750 | - $data['integrations'] = self::get_related_plugins_and_extensions(); |
|
751 | - $data['active_plugins'] = get_option( 'active_plugins', array() ); |
|
752 | - $data['inactive_plugins'] = array(); |
|
753 | - $data['locale'] = get_locale(); |
|
750 | + $data[ 'integrations' ] = self::get_related_plugins_and_extensions(); |
|
751 | + $data[ 'active_plugins' ] = get_option( 'active_plugins', array() ); |
|
752 | + $data[ 'inactive_plugins' ] = array(); |
|
753 | + $data[ 'locale' ] = get_locale(); |
|
754 | 754 | |
755 | 755 | // Validate request on the GV server |
756 | - $data['hash'] = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] ); |
|
756 | + $data[ 'hash' ] = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] ); |
|
757 | 757 | |
758 | 758 | return $data; |
759 | 759 | } |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | |
784 | 784 | $plugin_data = get_plugin_data( $active_plugin ); |
785 | 785 | |
786 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
786 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
787 | 787 | } |
788 | 788 | |
789 | 789 | if ( ! empty( $extensions ) ) { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | // If doing ajax, get outta here. |
129 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
129 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
@@ -191,7 +191,8 @@ discard block |
||
191 | 191 | if ( empty( $license_data ) ) { |
192 | 192 | if ( $is_ajax ) { |
193 | 193 | exit( json_encode( array() ) ); |
194 | - } else { // Non-ajax call |
|
194 | + } else { |
|
195 | +// Non-ajax call |
|
195 | 196 | return json_encode( array() ); |
196 | 197 | } |
197 | 198 | } |
@@ -226,7 +227,8 @@ discard block |
||
226 | 227 | |
227 | 228 | if ( $is_ajax ) { |
228 | 229 | exit( $json ); |
229 | - } else { // Non-ajax call |
|
230 | + } else { |
|
231 | +// Non-ajax call |
|
230 | 232 | return ( Utils::_GET( 'format', Utils::get( $data, 'format' ) ) === 'object' ) ? $license_data : $json; |
231 | 233 | } |
232 | 234 | } |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | $tab = wp_parse_args( $tab_settings, $tab_defaults ); |
181 | 181 | |
182 | 182 | // Force the screen to be GravityView |
183 | - $tab['screen'] = 'gravityview'; |
|
183 | + $tab[ 'screen' ] = 'gravityview'; |
|
184 | 184 | |
185 | 185 | if ( class_exists( 'GravityView_Metabox_Tab' ) ) { |
186 | - $metabox = new \GravityView_Metabox_Tab( $tab['id'], $tab['title'], $tab['file'], $tab['icon-class'], $tab['callback'], $tab['callback_args'] ); |
|
186 | + $metabox = new \GravityView_Metabox_Tab( $tab[ 'id' ], $tab[ 'title' ], $tab[ 'file' ], $tab[ 'icon-class' ], $tab[ 'callback' ], $tab[ 'callback_args' ] ); |
|
187 | 187 | \GravityView_Metabox_Tabs::add( $metabox ); |
188 | 188 | } else { |
189 | - add_meta_box( 'gravityview_' . $tab['id'], $tab['title'], $tab['callback'], $tab['screen'], $tab['context'], $tab['priority'] ); |
|
189 | + add_meta_box( 'gravityview_' . $tab[ 'id' ], $tab[ 'title' ], $tab[ 'callback' ], $tab[ 'screen' ], $tab[ 'context' ], $tab[ 'priority' ] ); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | */ |
212 | 212 | protected function is_extension_supported() { |
213 | 213 | |
214 | - self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool) self::$is_compatible ); |
|
214 | + self::$is_compatible = is_array( self::$is_compatible ) ? self::$is_compatible : array( get_called_class() => (bool)self::$is_compatible ); |
|
215 | 215 | |
216 | 216 | if ( ! function_exists( 'gravityview' ) ) { |
217 | 217 | $message = sprintf( __( 'Could not activate the %s Extension; GravityView is not active.', 'gravityview' ), esc_html( $this->_title ) ); |
218 | - } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version , ">=" ) ) { |
|
219 | - $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_gravityview_version.'</tt>' ); |
|
220 | - } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version , ">=" ) ) { |
|
221 | - $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>'.$this->_min_php_version.'</tt>' ); |
|
218 | + } else if ( false === version_compare( Plugin::$version, $this->_min_gravityview_version, ">=" ) ) { |
|
219 | + $message = sprintf( __( 'The %s Extension requires GravityView Version %s or newer.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_gravityview_version . '</tt>' ); |
|
220 | + } else if ( isset( $this->_min_php_version ) && false === version_compare( phpversion(), $this->_min_php_version, ">=" ) ) { |
|
221 | + $message = sprintf( __( 'The %s Extension requires PHP Version %s or newer. Please ask your host to upgrade your server\'s PHP.', 'gravityview' ), esc_html( $this->_title ), '<tt>' . $this->_min_php_version . '</tt>' ); |
|
222 | 222 | } else if ( ! empty( $this->_max_gravityview_version ) && false === version_compare( $this->_max_gravityview_version, Plugin::$version, ">" ) ) { |
223 | 223 | $message = sprintf( __( 'The %s Extension is not compatible with this version of GravityView. Please update the Extension to the latest version.', 'gravityview' ), esc_html( $this->_title ) ); |
224 | 224 | } else { |
@@ -258,12 +258,12 @@ discard block |
||
258 | 258 | |
259 | 259 | $locale = get_locale(); |
260 | 260 | |
261 | - if ( function_exists('get_user_locale') && is_admin() ) { |
|
261 | + if ( function_exists( 'get_user_locale' ) && is_admin() ) { |
|
262 | 262 | $locale = get_user_locale(); |
263 | 263 | } |
264 | 264 | |
265 | 265 | // Traditional WordPress plugin locale filter |
266 | - $locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain ); |
|
266 | + $locale = apply_filters( 'plugin_locale', $locale, $this->_text_domain ); |
|
267 | 267 | |
268 | 268 | $mofile = sprintf( '%1$s-%2$s.mo', $this->_text_domain, $locale ); |
269 | 269 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | public function settings() { |
292 | 292 | |
293 | 293 | // If doing ajax, get outta here. |
294 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
294 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST( 'action' ) ) ) { |
|
295 | 295 | return; |
296 | 296 | } |
297 | 297 | |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | 'version' => $this->_version, // current version number |
315 | 315 | 'license' => \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ), |
316 | 316 | 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
317 | - 'item_name' => $this->_title, // name of this plugin |
|
318 | - 'author' => strip_tags( $this->_author ), // author of this plugin |
|
317 | + 'item_name' => $this->_title, // name of this plugin |
|
318 | + 'author' => strip_tags( $this->_author ), // author of this plugin |
|
319 | 319 | 'php_version' => phpversion(), |
320 | 320 | 'wp_version' => get_bloginfo( 'version' ), |
321 | 321 | 'gv_version' => \GV\Plugin::$version, |
@@ -347,16 +347,16 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public static function add_notice( $notice = array() ) { |
349 | 349 | |
350 | - if ( is_array( $notice ) && empty( $notice['message'] ) ) { |
|
350 | + if ( is_array( $notice ) && empty( $notice[ 'message' ] ) ) { |
|
351 | 351 | gravityview()->log->error( 'Notice not set', array( 'data' => $notice ) ); |
352 | 352 | return; |
353 | 353 | } else if ( is_string( $notice ) ) { |
354 | 354 | $notice = array( 'message' => $notice ); |
355 | 355 | } |
356 | 356 | |
357 | - $notice['class'] = empty( $notice['class'] ) ? 'error' : $notice['class']; |
|
357 | + $notice[ 'class' ] = empty( $notice[ 'class' ] ) ? 'error' : $notice[ 'class' ]; |
|
358 | 358 | |
359 | - self::$admin_notices []= $notice; |
|
359 | + self::$admin_notices [ ] = $notice; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | foreach ( self::$admin_notices as $key => $notice ) { |
373 | - echo '<div id="message" class="'. esc_attr( $notice['class'] ).'">'; |
|
374 | - echo wpautop( $notice['message'] ); |
|
373 | + echo '<div id="message" class="' . esc_attr( $notice[ 'class' ] ) . '">'; |
|
374 | + echo wpautop( $notice[ 'message' ] ); |
|
375 | 375 | echo '<div class="clear"></div>'; |
376 | 376 | echo '</div>'; |
377 | 377 | } |
@@ -291,7 +291,7 @@ |
||
291 | 291 | public function settings() { |
292 | 292 | |
293 | 293 | // If doing ajax, get outta here. |
294 | - if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
294 | + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && 'update-plugin' !== Utils::_POST('action') ) ) { |
|
295 | 295 | return; |
296 | 296 | } |
297 | 297 |
@@ -311,17 +311,17 @@ |
||
311 | 311 | $this->_remote_update_url, |
312 | 312 | $this->_path, |
313 | 313 | array( |
314 | - 'version' => $this->_version, // current version number |
|
315 | - 'license' => \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ), |
|
316 | - 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
|
317 | - 'item_name' => $this->_title, // name of this plugin |
|
318 | - 'author' => strip_tags( $this->_author ), // author of this plugin |
|
319 | - 'php_version' => phpversion(), |
|
320 | - 'wp_version' => get_bloginfo( 'version' ), |
|
321 | - 'gv_version' => \GV\Plugin::$version, |
|
322 | - 'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production', |
|
323 | - ) |
|
324 | - ); |
|
314 | + 'version' => $this->_version, // current version number |
|
315 | + 'license' => \GV\Utils::get( $license, 'license_key', \GV\Utils::get( $license, 'license', null ) ), |
|
316 | + 'item_id' => $this->_item_id, // The ID of the download on _remote_update_url |
|
317 | + 'item_name' => $this->_title, // name of this plugin |
|
318 | + 'author' => strip_tags( $this->_author ), // author of this plugin |
|
319 | + 'php_version' => phpversion(), |
|
320 | + 'wp_version' => get_bloginfo( 'version' ), |
|
321 | + 'gv_version' => \GV\Plugin::$version, |
|
322 | + 'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production', |
|
323 | + ) |
|
324 | + ); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | // autoload-classmap.php @generated by Strauss |
4 | 4 | |
5 | -$trustedlogin = dirname(__FILE__); |
|
5 | +$trustedlogin = dirname( __FILE__ ); |
|
6 | 6 | |
7 | 7 | return array( |
8 | 8 | 'GravityView\Psr\Log\LoggerAwareTrait' => $trustedlogin . '/psr/log/Psr/Log/LoggerAwareTrait.php', |
@@ -152,17 +152,17 @@ discard block |
||
152 | 152 | |
153 | 153 | add_filter( 'gravityview/sortable/field_blocklist', array( $this, '_filter_sortable_fields' ), 1 ); |
154 | 154 | |
155 | - if( $this->entry_meta_key ) { |
|
155 | + if ( $this->entry_meta_key ) { |
|
156 | 156 | add_filter( 'gform_entry_meta', array( $this, 'add_entry_meta' ) ); |
157 | 157 | add_filter( 'gravityview/common/sortable_fields', array( $this, 'add_sortable_field' ), 10, 2 ); |
158 | 158 | } |
159 | 159 | |
160 | - if( $this->_custom_merge_tag ) { |
|
160 | + if ( $this->_custom_merge_tag ) { |
|
161 | 161 | add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 ); |
162 | 162 | add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 ); |
163 | 163 | } |
164 | 164 | |
165 | - if( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
165 | + if ( 'meta' === $this->group || '' !== $this->default_search_label ) { |
|
166 | 166 | add_filter( 'gravityview_search_field_label', array( $this, 'set_default_search_label' ), 10, 3 ); |
167 | 167 | } |
168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * Auto-assign label from Gravity Forms label, if exists |
171 | 171 | * @since 1.20 |
172 | 172 | */ |
173 | - if( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
173 | + if ( empty( $this->label ) && ! empty( $this->_gf_field_class_name ) && class_exists( $this->_gf_field_class_name ) ) { |
|
174 | 174 | $this->label = ucfirst( GF_Fields::get( $this->name )->get_form_editor_field_title() ); |
175 | 175 | } |
176 | 176 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | 'type' => $this->name |
217 | 217 | ); |
218 | 218 | |
219 | - $fields["{$this->entry_meta_key}"] = $added_field; |
|
219 | + $fields[ "{$this->entry_meta_key}" ] = $added_field; |
|
220 | 220 | |
221 | 221 | return $fields; |
222 | 222 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | function set_default_search_label( $label = '', $gf_field = null, $field = array() ) { |
238 | 238 | |
239 | - if( $this->name === $field['field'] && '' === $label ) { |
|
239 | + if ( $this->name === $field[ 'field' ] && '' === $label ) { |
|
240 | 240 | $label = esc_html( $this->default_search_label ); |
241 | 241 | } |
242 | 242 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * |
258 | 258 | * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text. |
259 | 259 | */ |
260 | - public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
260 | + public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
261 | 261 | |
262 | 262 | // Is there is field merge tag? Strip whitespace off the ned, too. |
263 | 263 | preg_match_all( '/{' . preg_quote( $this->_custom_merge_tag ) . ':?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER ); |
@@ -290,19 +290,19 @@ discard block |
||
290 | 290 | */ |
291 | 291 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
292 | 292 | |
293 | - foreach( $matches as $match ) { |
|
293 | + foreach ( $matches as $match ) { |
|
294 | 294 | |
295 | - $full_tag = $match[0]; |
|
295 | + $full_tag = $match[ 0 ]; |
|
296 | 296 | |
297 | 297 | // Strip the Merge Tags |
298 | - $tag = str_replace( array( '{', '}'), '', $full_tag ); |
|
298 | + $tag = str_replace( array( '{', '}' ), '', $full_tag ); |
|
299 | 299 | |
300 | 300 | // Replace the value from the entry, if exists |
301 | - if( isset( $entry[ $tag ] ) ) { |
|
301 | + if ( isset( $entry[ $tag ] ) ) { |
|
302 | 302 | |
303 | 303 | $value = $entry[ $tag ]; |
304 | 304 | |
305 | - if( is_callable( array( $this, 'get_content') ) ) { |
|
305 | + if ( is_callable( array( $this, 'get_content' ) ) ) { |
|
306 | 306 | $value = $this->get_content( $value ); |
307 | 307 | } |
308 | 308 | |
@@ -375,8 +375,8 @@ discard block |
||
375 | 375 | */ |
376 | 376 | public function _filter_sortable_fields( $not_sortable ) { |
377 | 377 | |
378 | - if( ! $this->is_sortable ) { |
|
379 | - $not_sortable[] = $this->name; |
|
378 | + if ( ! $this->is_sortable ) { |
|
379 | + $not_sortable[ ] = $this->name; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | return $not_sortable; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | */ |
394 | 394 | function add_entry_meta( $entry_meta ) { |
395 | 395 | |
396 | - if( ! isset( $entry_meta["{$this->entry_meta_key}"] ) ) { |
|
396 | + if ( ! isset( $entry_meta[ "{$this->entry_meta_key}" ] ) ) { |
|
397 | 397 | |
398 | 398 | $added_meta = array( |
399 | 399 | 'label' => $this->label, |
@@ -402,13 +402,13 @@ discard block |
||
402 | 402 | ); |
403 | 403 | |
404 | 404 | if ( $this->entry_meta_update_callback && is_callable( $this->entry_meta_update_callback ) ) { |
405 | - $added_meta['update_entry_meta_callback'] = $this->entry_meta_update_callback; |
|
405 | + $added_meta[ 'update_entry_meta_callback' ] = $this->entry_meta_update_callback; |
|
406 | 406 | } |
407 | 407 | |
408 | - $entry_meta["{$this->entry_meta_key}"] = $added_meta; |
|
408 | + $entry_meta[ "{$this->entry_meta_key}" ] = $added_meta; |
|
409 | 409 | |
410 | 410 | } else { |
411 | - gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' => $entry_meta["{$this->entry_meta_key}"] ) ); |
|
411 | + gravityview()->log->error( 'Entry meta already set: {meta_key}', array( 'meta_key' => $this->entry_meta_key, 'data' => $entry_meta[ "{$this->entry_meta_key}" ] ) ); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | return $entry_meta; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | 'date_display' => array( |
444 | 444 | 'type' => 'text', |
445 | 445 | 'label' => __( 'Override Date Format', 'gravityview' ), |
446 | - 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ), |
|
446 | + 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://wordpress.org/support/article/formatting-date-and-time/" rel="external">', '</a>' ), |
|
447 | 447 | /** |
448 | 448 | * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time) |
449 | 449 | * @param null|string $date_format Date Format (default: null) |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | |
480 | 480 | $options = $this->field_support_options(); |
481 | 481 | |
482 | - if( isset( $options[ $key ] ) ) { |
|
482 | + if ( isset( $options[ $key ] ) ) { |
|
483 | 483 | $field_options[ $key ] = $options[ $key ]; |
484 | 484 | } |
485 | 485 | |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | $connected_form = \GV\Utils::_POST( 'form_id' ); |
544 | 544 | |
545 | 545 | // Otherwise, get the Form ID from the Post page |
546 | - if( empty( $connected_form ) ) { |
|
546 | + if ( empty( $connected_form ) ) { |
|
547 | 547 | $connected_form = gravityview_get_form_id( get_the_ID() ); |
548 | 548 | } |
549 | 549 | |
550 | - if( empty( $connected_form ) ) { |
|
550 | + if ( empty( $connected_form ) ) { |
|
551 | 551 | gravityview()->log->error( 'Form not found for form ID "{form_id}"', array( 'form_id' => $connected_form ) ); |
552 | 552 | return false; |
553 | 553 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | private static function disable_show_only_approved_entries( $gravityview ) { |
60 | 60 | |
61 | - if ( ! isset( $_GET['disable_setting'] ) || ! wp_verify_nonce( $_GET['gv-setting'], 'setting' ) ) { |
|
61 | + if ( ! isset( $_GET[ 'disable_setting' ] ) || ! wp_verify_nonce( $_GET[ 'gv-setting' ], 'setting' ) ) { |
|
62 | 62 | return; |
63 | 63 | } |
64 | 64 | |
65 | 65 | $settings = $gravityview->view->settings->all(); |
66 | 66 | |
67 | - $settings['show_only_approved'] = 0; |
|
67 | + $settings[ 'show_only_approved' ] = 0; |
|
68 | 68 | |
69 | - $updated = update_post_meta( $gravityview->view->ID, '_gravityview_template_settings', $settings ); |
|
69 | + $updated = update_post_meta( $gravityview->view->ID, '_gravityview_template_settings', $settings ); |
|
70 | 70 | |
71 | 71 | if ( ! $updated ) { |
72 | 72 | gravityview()->log->error( 'Could not update View settings => Show only approved' ); |
@@ -273,8 +273,7 @@ discard block |
||
273 | 273 | $tab = __( 'Edit Entry', 'gravityview' ); |
274 | 274 | $context = 'edit'; |
275 | 275 | break; |
276 | - case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ): |
|
277 | - $tab = __( 'Single Entry', 'gravityview' ); |
|
276 | + case ( $gravityview->request->is_entry( $gravityview->view->form ? $gravityview->view->form->ID : 0 ) ) : $tab = __( 'Single Entry', 'gravityview' ); |
|
278 | 277 | $context = 'single'; |
279 | 278 | break; |
280 | 279 | default: |
@@ -296,7 +295,7 @@ discard block |
||
296 | 295 | $action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab ); |
297 | 296 | $message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' ); |
298 | 297 | |
299 | - $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
298 | + $image = sprintf( '<img alt="%s" src="%s" style="margin-top: 10px;" />', $tab, esc_url( plugins_url( sprintf( 'assets/images/tab-%s.png', $context ), GRAVITYVIEW_FILE ) ) ); |
|
300 | 299 | $output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message ); |
301 | 300 | |
302 | 301 | echo \GVCommon::generate_notice( $output . $image, 'gv-warning warning', 'edit_gravityview', $gravityview->view->ID ); |
@@ -322,11 +321,11 @@ discard block |
||
322 | 321 | |
323 | 322 | $post_types = get_post_types(); |
324 | 323 | |
325 | - foreach( $post_types as $post_type ) { |
|
324 | + foreach ( $post_types as $post_type ) { |
|
326 | 325 | $post_type_rewrite = get_post_type_object( $post_type )->rewrite; |
327 | 326 | |
328 | 327 | if ( $slug = \GV\Utils::get( $post_type_rewrite, 'slug' ) ) { |
329 | - $reserved_slugs[] = $slug; |
|
328 | + $reserved_slugs[ ] = $slug; |
|
330 | 329 | } |
331 | 330 | } |
332 | 331 |
@@ -213,7 +213,7 @@ |
||
213 | 213 | |
214 | 214 | <p class="gv-notice-admin-message"><em>{admin_message}</em></p> |
215 | 215 | </div> |
216 | -EOD; |
|
216 | +eod; |
|
217 | 217 | |
218 | 218 | $notice_title = _n( |
219 | 219 | esc_html__( 'There is an unapproved entry that is not being shown.', 'gravityview' ), |