@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | |
32 | 32 | <?php |
33 | 33 | |
34 | - do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
34 | + do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
35 | 35 | |
36 | - do_action('gravityview_render_field_pickers', 'directory' ); |
|
36 | + do_action('gravityview_render_field_pickers', 'directory' ); |
|
37 | 37 | |
38 | - ?> |
|
38 | + ?> |
|
39 | 39 | |
40 | 40 | <?php // list of available widgets to be shown in the popup ?> |
41 | 41 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | |
61 | 61 | <div id="single-active-fields" class="gv-grid"> |
62 | 62 | <?php |
63 | - if(!empty( $curr_template ) ) { |
|
64 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
65 | - } |
|
66 | - ?> |
|
63 | + if(!empty( $curr_template ) ) { |
|
64 | + do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
65 | + } |
|
66 | + ?> |
|
67 | 67 | </div> |
68 | 68 | <?php |
69 | - do_action('gravityview_render_field_pickers', 'single' ); |
|
69 | + do_action('gravityview_render_field_pickers', 'single' ); |
|
70 | 70 | ?> |
71 | 71 | </div> |
72 | 72 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | </div> |
86 | 86 | |
87 | 87 | <?php |
88 | - do_action('gravityview_render_field_pickers', 'edit' ); |
|
88 | + do_action('gravityview_render_field_pickers', 'edit' ); |
|
89 | 89 | ?> |
90 | 90 | |
91 | 91 | </div> |
@@ -15,25 +15,25 @@ discard block |
||
15 | 15 | |
16 | 16 | <div id="directory-fields" class="gv-section"> |
17 | 17 | |
18 | - <h4><?php esc_html_e( 'Top Widgets', 'gravityview'); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview'); ?></span></h4> |
|
18 | + <h4><?php esc_html_e( 'Top Widgets', 'gravityview' ); ?> <span><?php esc_html_e( 'These widgets will be shown above entries.', 'gravityview' ); ?></span></h4> |
|
19 | 19 | |
20 | - <?php do_action('gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
20 | + <?php do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'header', $post->ID ); ?> |
|
21 | 21 | |
22 | - <h4><?php esc_html_e( 'Entries Fields', 'gravityview'); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview'); ?></span></h4> |
|
22 | + <h4><?php esc_html_e( 'Entries Fields', 'gravityview' ); ?> <span><?php esc_html_e( 'These fields will be shown for each entry.', 'gravityview' ); ?></span></h4> |
|
23 | 23 | |
24 | 24 | <div id="directory-active-fields" class="gv-grid"> |
25 | - <?php if(!empty( $curr_template ) ) { |
|
26 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
25 | + <?php if ( ! empty( $curr_template ) ) { |
|
26 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'directory', $post->ID, true ); |
|
27 | 27 | } ?> |
28 | 28 | </div> |
29 | 29 | |
30 | - <h4><?php esc_html_e( 'Bottom Widgets', 'gravityview'); ?> <i class="gf_tooltip gv_tooltip" title="<?php esc_attr_e( 'These widgets will be shown below entries.', 'gravityview'); ?>"></i></h4> |
|
30 | + <h4><?php esc_html_e( 'Bottom Widgets', 'gravityview' ); ?> <i class="gf_tooltip gv_tooltip" title="<?php esc_attr_e( 'These widgets will be shown below entries.', 'gravityview' ); ?>"></i></h4> |
|
31 | 31 | |
32 | 32 | <?php |
33 | 33 | |
34 | - do_action('gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
34 | + do_action( 'gravityview_render_widgets_active_areas', $curr_template, 'footer', $post->ID ); |
|
35 | 35 | |
36 | - do_action('gravityview_render_field_pickers', 'directory' ); |
|
36 | + do_action( 'gravityview_render_field_pickers', 'directory' ); |
|
37 | 37 | |
38 | 38 | ?> |
39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <div id="directory-available-widgets" class="hide-if-js gv-tooltip"> |
42 | 42 | <div aria-live="polite" role="listbox" class="gv-items-picker-container gv-widget-picker-container" data-layout="grid" data-cols="2"> |
43 | 43 | <button class="close" role="button" aria-label="<?php esc_html_e( 'Close', 'gravityview' ); ?>"><i class="dashicons dashicons-dismiss"></i></button> |
44 | - <?php do_action('gravityview_render_available_widgets' ); ?> |
|
44 | + <?php do_action( 'gravityview_render_available_widgets' ); ?> |
|
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | |
@@ -59,21 +59,21 @@ discard block |
||
59 | 59 | <div id="single-fields" class="gv-section"> |
60 | 60 | |
61 | 61 | <div class="notice notice-warning inline is-dismissible"> |
62 | - <h3><?php printf( esc_html__( 'Note: %s', 'gravityview' ), sprintf( esc_html__( 'No fields link to the %s layout.', 'gravityview'), esc_html__( 'Single Entry', 'gravityview' ) ) ); ?></h3> |
|
62 | + <h3><?php printf( esc_html__( 'Note: %s', 'gravityview' ), sprintf( esc_html__( 'No fields link to the %s layout.', 'gravityview' ), esc_html__( 'Single Entry', 'gravityview' ) ) ); ?></h3> |
|
63 | 63 | <p><a data-beacon-article-modal="54c67bbae4b0512429885516" href="https://docs.gravityview.co/article/70-linking-to-a-single-entry"><?php printf( esc_html__( 'Learn how to link to %s', 'gravityview' ), esc_html__( 'Single Entry', 'gravityview' ) ); ?></a></p> |
64 | 64 | </div> |
65 | 65 | |
66 | - <h4><?php esc_html_e( 'These fields will be shown in Single Entry layout.', 'gravityview'); ?></h4> |
|
66 | + <h4><?php esc_html_e( 'These fields will be shown in Single Entry layout.', 'gravityview' ); ?></h4> |
|
67 | 67 | |
68 | 68 | <div id="single-active-fields" class="gv-grid"> |
69 | 69 | <?php |
70 | - if(!empty( $curr_template ) ) { |
|
71 | - do_action('gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
70 | + if ( ! empty( $curr_template ) ) { |
|
71 | + do_action( 'gravityview_render_directory_active_areas', $curr_template, 'single', $post->ID, true ); |
|
72 | 72 | } |
73 | 73 | ?> |
74 | 74 | </div> |
75 | 75 | <?php |
76 | - do_action('gravityview_render_field_pickers', 'single' ); |
|
76 | + do_action( 'gravityview_render_field_pickers', 'single' ); |
|
77 | 77 | ?> |
78 | 78 | </div> |
79 | 79 | |
@@ -84,20 +84,20 @@ discard block |
||
84 | 84 | <div id="edit-fields" class="gv-section"> |
85 | 85 | |
86 | 86 | <div class="notice notice-warning inline is-dismissible"> |
87 | - <h3><?php printf( esc_html__( 'Note: %s', 'gravityview' ), sprintf( esc_html__( 'No fields link to the %s layout.', 'gravityview'), esc_html__( 'Edit Entry', 'gravityview' ) ) ); ?></h3> |
|
87 | + <h3><?php printf( esc_html__( 'Note: %s', 'gravityview' ), sprintf( esc_html__( 'No fields link to the %s layout.', 'gravityview' ), esc_html__( 'Edit Entry', 'gravityview' ) ) ); ?></h3> |
|
88 | 88 | <p><a data-beacon-article-modal="54c67bb9e4b0512429885513" href="https://docs.gravityview.co/article/67-configuring-the-edit-entry-screen"><?php printf( esc_html__( 'Learn how to link to %s', 'gravityview' ), esc_html__( 'Edit Entry', 'gravityview' ) ); ?></a></p> |
89 | 89 | </div> |
90 | 90 | |
91 | - <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview'); ?> <span><?php esc_html_e('If not configured, all form fields will be displayed.', 'gravityview'); ?></span></h4> |
|
91 | + <h4><?php esc_html_e( 'Fields shown when editing an entry.', 'gravityview' ); ?> <span><?php esc_html_e( 'If not configured, all form fields will be displayed.', 'gravityview' ); ?></span></h4> |
|
92 | 92 | |
93 | 93 | <div id="edit-active-fields" class="gv-grid"> |
94 | 94 | <?php |
95 | - do_action('gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
95 | + do_action( 'gravityview_render_directory_active_areas', apply_filters( 'gravityview/template/edit', 'default_table_edit' ), 'edit', $post->ID, true ); |
|
96 | 96 | ?> |
97 | 97 | </div> |
98 | 98 | |
99 | 99 | <?php |
100 | - do_action('gravityview_render_field_pickers', 'edit' ); |
|
100 | + do_action( 'gravityview_render_field_pickers', 'edit' ); |
|
101 | 101 | ?> |
102 | 102 | |
103 | 103 | </div> |
@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $url = add_query_arg( array( |
71 | 71 | 'utm_source' => 'powered_by', |
72 | - 'utm_term' => get_bloginfo('name' ), |
|
72 | + 'utm_term' => get_bloginfo('name' ), |
|
73 | 73 | ), $url ); |
74 | 74 | |
75 | 75 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $powered_by = gravityview()->plugin->settings->get( 'powered_by', '0' ); |
34 | 34 | |
35 | - if( empty( $powered_by ) ) { |
|
35 | + if ( empty( $powered_by ) ) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected function get_url() { |
61 | 61 | |
62 | - $url = sprintf( self::url, get_bloginfo('name' ) ); |
|
62 | + $url = sprintf( self::url, get_bloginfo( 'name' ) ); |
|
63 | 63 | |
64 | 64 | $affiliate_id = gravityview()->plugin->settings->get( 'affiliate_id', '' ); |
65 | 65 | |
66 | - if( $affiliate_id && is_numeric( $affiliate_id ) ) { |
|
66 | + if ( $affiliate_id && is_numeric( $affiliate_id ) ) { |
|
67 | 67 | $url = add_query_arg( array( 'ref' => $affiliate_id ), $url ); |
68 | 68 | } |
69 | 69 | |
70 | 70 | $url = add_query_arg( array( |
71 | 71 | 'utm_source' => 'powered_by', |
72 | - 'utm_term' => get_bloginfo('name' ), |
|
72 | + 'utm_term' => get_bloginfo( 'name' ), |
|
73 | 73 | ), $url ); |
74 | 74 | |
75 | 75 | /** |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | wp_embed_register_handler( 'gravityview_entry', self::get_entry_regex(), array( __CLASS__, 'render' ), 20000 ); |
27 | 27 | wp_oembed_add_provider( self::get_entry_regex(), self::$provider_url, true ); |
28 | 28 | |
29 | - if ( ! empty( $_GET['gv_oembed_provider'] ) && ! empty( $_GET['url'] ) ) { |
|
29 | + if ( ! empty( $_GET[ 'gv_oembed_provider' ] ) && ! empty( $_GET[ 'url' ] ) ) { |
|
30 | 30 | add_action( 'template_redirect', array( __CLASS__, 'render_provider_request' ) ); |
31 | 31 | } |
32 | 32 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @return void |
44 | 44 | */ |
45 | 45 | public static function render_provider_request() { |
46 | - if ( ! empty( $_GET['url'] ) ) { |
|
47 | - $url = $_GET['url']; |
|
46 | + if ( ! empty( $_GET[ 'url' ] ) ) { |
|
47 | + $url = $_GET[ 'url' ]; |
|
48 | 48 | } else { |
49 | 49 | header( 'HTTP/1.0 404 Not Found' ); |
50 | 50 | exit; |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | */ |
112 | 112 | private static function parse_matches( $matches, $url ) { |
113 | 113 | // If not using permalinks, re-assign values for matching groups |
114 | - if ( ! empty( $matches['entry_slug2'] ) ) { |
|
115 | - $matches['is_cpt'] = $matches['is_cpt2']; |
|
116 | - $matches['slug'] = $matches['slug2']; |
|
117 | - $matches['entry_slug'] = $matches['entry_slug2']; |
|
118 | - unset( $matches['is_cpt2'], $matches['slug2'], $matches['entry_slug2'] ); |
|
114 | + if ( ! empty( $matches[ 'entry_slug2' ] ) ) { |
|
115 | + $matches[ 'is_cpt' ] = $matches[ 'is_cpt2' ]; |
|
116 | + $matches[ 'slug' ] = $matches[ 'slug2' ]; |
|
117 | + $matches[ 'entry_slug' ] = $matches[ 'entry_slug2' ]; |
|
118 | + unset( $matches[ 'is_cpt2' ], $matches[ 'slug2' ], $matches[ 'entry_slug2' ] ); |
|
119 | 119 | } |
120 | 120 | |
121 | - if ( empty( $matches['entry_slug'] ) ) { |
|
121 | + if ( empty( $matches[ 'entry_slug' ] ) ) { |
|
122 | 122 | gravityview()->log->error( 'Entry slug not parsed by regex.', array( 'data' => $matches ) ); |
123 | 123 | return null; |
124 | 124 | } else { |
125 | - $entry_id = $matches['entry_slug']; |
|
125 | + $entry_id = $matches[ 'entry_slug' ]; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | if ( ! $entry = \GV\GF_Entry::by_id( $entry_id ) ) { |
@@ -140,12 +140,12 @@ discard block |
||
140 | 140 | if ( ! $view ) { |
141 | 141 | |
142 | 142 | // If the slug doesn't work, maybe using Plain permalinks and not the slug, only ID |
143 | - if( is_numeric( $matches['slug'] ) ) { |
|
144 | - $view = \GV\View::by_id( $matches['slug'] ); |
|
143 | + if ( is_numeric( $matches[ 'slug' ] ) ) { |
|
144 | + $view = \GV\View::by_id( $matches[ 'slug' ] ); |
|
145 | 145 | } |
146 | 146 | |
147 | - if( ! $view ) { |
|
148 | - $view = \GV\View::from_post( get_page_by_path( $matches['slug'], OBJECT, 'gravityview' ) ); |
|
147 | + if ( ! $view ) { |
|
148 | + $view = \GV\View::from_post( get_page_by_path( $matches[ 'slug' ], OBJECT, 'gravityview' ) ); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | |
177 | 177 | return ' |
178 | 178 | <div class="loading-placeholder" style="background-color:#e6f0f5;"> |
179 | - <h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image.$embed_heading.'</h3> |
|
179 | + <h3 style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;">'.$image . $embed_heading . '</h3> |
|
180 | 180 | <p style="margin:0; padding:0; font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen-Sans, Ubuntu, Cantarell, \'Helvetica Neue\', sans-serif;"> |
181 | - '.$embed_text.' |
|
181 | + '.$embed_text . ' |
|
182 | 182 | </p> |
183 | 183 | <br style="clear: both;"> |
184 | 184 | </div>'; |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | private static function render_preview_notice() { |
193 | 193 | $floaty = \GravityView_Admin::get_floaty(); |
194 | 194 | $title = esc_html__( 'This will look better when it is embedded.', 'gravityview' ); |
195 | - $message = esc_html__( 'Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview'); |
|
196 | - return '<div class="updated notice">'.$floaty.'<h3>'.$title.'</h3><p>'.$message.'</p><br style="clear:both;" /></div>'; |
|
195 | + $message = esc_html__( 'Styles don\'t get loaded when being previewed, so the content below will look strange. Don\'t be concerned!', 'gravityview' ); |
|
196 | + return '<div class="updated notice">' . $floaty . '<h3>' . $title . '</h3><p>' . $message . '</p><br style="clear:both;" /></div>'; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
213 | 213 | } |
214 | 214 | |
215 | - if ( $entry && 'active' !== $entry['status'] ) { |
|
215 | + if ( $entry && 'active' !== $entry[ 'status' ] ) { |
|
216 | 216 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
217 | 217 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
218 | 218 | } |
219 | 219 | |
220 | 220 | if ( $view->settings->get( 'show_only_approved' ) ) { |
221 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
221 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
222 | 222 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
223 | 223 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
224 | 224 | } |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | * Mocks old context, etc. |
250 | 250 | */ |
251 | 251 | $loader = \GravityView_Edit_Entry::getInstance(); |
252 | - $render = $loader->instances['render']; |
|
252 | + $render = $loader->instances[ 'render' ]; |
|
253 | 253 | |
254 | - $form = \GFAPI::get_form( $entry['form_id'] ); |
|
254 | + $form = \GFAPI::get_form( $entry[ 'form_id' ] ); |
|
255 | 255 | |
256 | 256 | // @todo We really need to rewrite Edit Entry soon |
257 | 257 | \GravityView_View::$instance = null; |
@@ -260,13 +260,13 @@ discard block |
||
260 | 260 | $data = \GravityView_View_Data::getInstance( get_post( $view->ID ) ); |
261 | 261 | $template = \GravityView_View::getInstance( array( |
262 | 262 | 'form' => $form, |
263 | - 'form_id' => $form['id'], |
|
263 | + 'form_id' => $form[ 'id' ], |
|
264 | 264 | 'view_id' => $view->ID, |
265 | 265 | 'entries' => array( $entry->as_entry() ), |
266 | 266 | 'atts' => \GVCommon::get_template_settings( $view->ID ), |
267 | 267 | ) ); |
268 | 268 | |
269 | - ob_start() && $render->init( $data, \GV\Entry::by_id( $entry['id'] ), $view ); |
|
269 | + ob_start() && $render->init( $data, \GV\Entry::by_id( $entry[ 'id' ] ), $view ); |
|
270 | 270 | $output = ob_get_clean(); // Render :) |
271 | 271 | } else { |
272 | 272 | /** Remove the back link. */ |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | // Catch either |
311 | 311 | $match_regex = "(?:{$using_permalinks}|{$not_using_permalinks})"; |
312 | 312 | |
313 | - return '#'.$match_regex.'#i'; |
|
313 | + return '#' . $match_regex . '#i'; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -67,20 +67,20 @@ discard block |
||
67 | 67 | $result = array(); |
68 | 68 | if ( ! $lock_holder_user_id ) { |
69 | 69 | $this->set_lock( $object_id ); |
70 | - $result['html'] = __( 'You now have control', 'gravityview' ); |
|
71 | - $result['status'] = 'lock_obtained'; |
|
70 | + $result[ 'html' ] = __( 'You now have control', 'gravityview' ); |
|
71 | + $result[ 'status' ] = 'lock_obtained'; |
|
72 | 72 | } else { |
73 | 73 | |
74 | - if( GVCommon::has_cap( 'gravityforms_edit_entries' ) ) { |
|
74 | + if ( GVCommon::has_cap( 'gravityforms_edit_entries' ) ) { |
|
75 | 75 | $user = get_userdata( $lock_holder_user_id ); |
76 | - $result['html'] = sprintf( __( 'Your request has been sent to %s.', 'gravityview' ), $user->display_name ); |
|
76 | + $result[ 'html' ] = sprintf( __( 'Your request has been sent to %s.', 'gravityview' ), $user->display_name ); |
|
77 | 77 | } else { |
78 | - $result['html'] = __( 'Your request has been sent.', 'gravityview' ); |
|
78 | + $result[ 'html' ] = __( 'Your request has been sent.', 'gravityview' ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $this->update_lock_request_meta( $object_id, $user_id ); |
82 | 82 | |
83 | - $result['status'] = 'lock_requested'; |
|
83 | + $result[ 'status' ] = 'lock_requested'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return $result; |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | $continue_enqueuing = false; |
123 | 123 | |
124 | 124 | // If any Views being loaded have entry locking, enqueue the scripts |
125 | - foreach( $views->all() as $view ) { |
|
125 | + foreach ( $views->all() as $view ) { |
|
126 | 126 | |
127 | 127 | // Make sure the View has edit locking enabled |
128 | - if( ! $view->settings->get( 'edit_locking' ) ) { |
|
128 | + if ( ! $view->settings->get( 'edit_locking' ) ) { |
|
129 | 129 | continue; |
130 | 130 | } |
131 | 131 | |
132 | 132 | // Make sure that the entry belongs to one of the forms connected to one of the Views in this request |
133 | 133 | $joined_forms = $view::get_joined_forms( $view->ID ); |
134 | 134 | |
135 | - $entry_form_id = $entry_array['form_id']; |
|
135 | + $entry_form_id = $entry_array[ 'form_id' ]; |
|
136 | 136 | |
137 | - if( ! isset( $joined_forms[ $entry_form_id ] ) ) { |
|
137 | + if ( ! isset( $joined_forms[ $entry_form_id ] ) ) { |
|
138 | 138 | continue; |
139 | 139 | } |
140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | break; |
144 | 144 | } |
145 | 145 | |
146 | - if( ! $continue_enqueuing ) { |
|
146 | + if ( ! $continue_enqueuing ) { |
|
147 | 147 | return; |
148 | 148 | } |
149 | 149 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | protected function enqueue_scripts( $entry ) { |
165 | 165 | |
166 | - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; |
|
166 | + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET[ 'gform_debug' ] ) ? '' : '.min'; |
|
167 | 167 | $locking_path = GFCommon::get_base_url() . '/includes/locking/'; |
168 | 168 | |
169 | 169 | wp_enqueue_script( 'gforms_locking', $locking_path . "js/locking{$min}.js", array( 'jquery', 'heartbeat' ), GFCommon::$version ); |
@@ -172,20 +172,20 @@ discard block |
||
172 | 172 | $translations = array_map( 'wp_strip_all_tags', $this->get_strings() ); |
173 | 173 | |
174 | 174 | $strings = array( |
175 | - 'noResponse' => $translations['no_response'], |
|
176 | - 'requestAgain' => $translations['request_again'], |
|
177 | - 'requestError' => $translations['request_error'], |
|
178 | - 'gainedControl' => $translations['gained_control'], |
|
179 | - 'rejected' => $translations['request_rejected'], |
|
180 | - 'pending' => $translations['request_pending'], |
|
175 | + 'noResponse' => $translations[ 'no_response' ], |
|
176 | + 'requestAgain' => $translations[ 'request_again' ], |
|
177 | + 'requestError' => $translations[ 'request_error' ], |
|
178 | + 'gainedControl' => $translations[ 'gained_control' ], |
|
179 | + 'rejected' => $translations[ 'request_rejected' ], |
|
180 | + 'pending' => $translations[ 'request_pending' ], |
|
181 | 181 | ); |
182 | 182 | |
183 | - $lock_user_id = $this->check_lock( $entry['id'] ); |
|
183 | + $lock_user_id = $this->check_lock( $entry[ 'id' ] ); |
|
184 | 184 | |
185 | 185 | $vars = array( |
186 | 186 | 'hasLock' => ! $lock_user_id ? 1 : 0, |
187 | 187 | 'lockUI' => $this->get_lock_ui( $lock_user_id ), |
188 | - 'objectID' => $entry['id'], |
|
188 | + 'objectID' => $entry[ 'id' ], |
|
189 | 189 | 'objectType' => 'entry', |
190 | 190 | 'strings' => $strings, |
191 | 191 | ); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $hidden = $locked ? '' : ' hidden'; |
216 | 216 | if ( $locked ) { |
217 | 217 | |
218 | - if( GVCommon::has_cap( 'gravityforms_edit_entries' ) ) { |
|
218 | + if ( GVCommon::has_cap( 'gravityforms_edit_entries' ) ) { |
|
219 | 219 | $avatar = get_avatar( $user->ID, 64 ); |
220 | 220 | $person_editing_text = $user->display_name; |
221 | 221 | } else { |
@@ -322,11 +322,11 @@ discard block |
||
322 | 322 | |
323 | 323 | $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); |
324 | 324 | |
325 | - if ( isset( $_GET['get-edit-lock'] ) ) { |
|
325 | + if ( isset( $_GET[ 'get-edit-lock' ] ) ) { |
|
326 | 326 | $this->set_lock( $entry_id ); |
327 | 327 | echo '<script>window.location = ' . json_encode( remove_query_arg( 'get-edit-lock', $current_url ) ) . ';</script>'; |
328 | 328 | exit(); |
329 | - } else if ( isset( $_GET['release-edit-lock'] ) ) { |
|
329 | + } else if ( isset( $_GET[ 'release-edit-lock' ] ) ) { |
|
330 | 330 | $this->delete_lock_meta( $entry_id ); |
331 | 331 | $current_url = remove_query_arg( 'edit', $current_url ); |
332 | 332 | echo '<script>window.location = ' . json_encode( remove_query_arg( 'release-edit-lock', $current_url ) ) . ';</script>'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** @var WP_Admin_Bar $wp_admin_bar */ |
39 | 39 | global $wp_admin_bar; |
40 | 40 | |
41 | - if( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) { |
|
41 | + if ( is_admin() || ! GVCommon::has_cap( array( 'edit_gravityviews', 'gravityview_edit_entry', 'gravityforms_edit_forms' ) ) ) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | 'meta' => array( |
104 | 104 | 'title' => sprintf( __( 'Edit Entry %s', 'gravityview' ), $entry->get_slug() ), |
105 | 105 | ), |
106 | - 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry['form_id'], $entry['id'] ) ) ), |
|
106 | + 'href' => esc_url_raw( admin_url( sprintf( 'admin.php?page=gf_entries&screen_mode=edit&view=entry&id=%d&lid=%d', $entry[ 'form_id' ], $entry[ 'id' ] ) ) ), |
|
107 | 107 | ) ); |
108 | 108 | |
109 | 109 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** @var WP_Admin_Bar $wp_admin_bar */ |
120 | 120 | global $wp_admin_bar; |
121 | 121 | |
122 | - if( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) { |
|
122 | + if ( GVCommon::has_cap( array( 'edit_gravityviews', 'edit_gravityview', 'gravityforms_edit_forms' ) ) ) { |
|
123 | 123 | |
124 | 124 | $view_data = GravityView_View_Data::getInstance(); |
125 | 125 | $views = $view_data->get_views(); |
@@ -131,21 +131,21 @@ discard block |
||
131 | 131 | $added_views = array(); |
132 | 132 | |
133 | 133 | foreach ( $views as $view ) { |
134 | - $view = \GV\View::by_id( $view['id'] ); |
|
134 | + $view = \GV\View::by_id( $view[ 'id' ] ); |
|
135 | 135 | $view_id = $view->ID; |
136 | 136 | $form_id = $view->form ? $view->form->ID : null; |
137 | 137 | |
138 | 138 | $edit_view_title = __( 'Edit View', 'gravityview' ); |
139 | 139 | $edit_form_title = __( 'Edit Form', 'gravityview' ); |
140 | 140 | |
141 | - if( sizeof( $views ) > 1 ) { |
|
141 | + if ( sizeof( $views ) > 1 ) { |
|
142 | 142 | $edit_view_title = sprintf( _x( 'Edit View #%d', 'Edit View with the ID of %d', 'gravityview' ), $view_id ); |
143 | 143 | $edit_form_title = sprintf( __( 'Edit Form #%d', 'Edit Form with the ID of %d', 'gravityview' ), $form_id ); |
144 | 144 | } |
145 | 145 | |
146 | - if( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) { |
|
146 | + if ( GVCommon::has_cap( 'edit_gravityview', $view_id ) && ! in_array( $view_id, $added_views ) ) { |
|
147 | 147 | |
148 | - $added_views[] = $view_id; |
|
148 | + $added_views[ ] = $view_id; |
|
149 | 149 | |
150 | 150 | $wp_admin_bar->add_menu( array( |
151 | 151 | 'id' => 'edit-view-' . $view_id, |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | ) ); |
156 | 156 | } |
157 | 157 | |
158 | - if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms ) ) { |
|
158 | + if ( ! empty( $form_id ) && GVCommon::has_cap( array( 'gravityforms_edit_forms' ), $form_id ) && ! in_array( $form_id, $added_forms ) ) { |
|
159 | 159 | |
160 | - $added_forms[] = $form_id; |
|
160 | + $added_forms[ ] = $form_id; |
|
161 | 161 | |
162 | 162 | $wp_admin_bar->add_menu( array( |
163 | 163 | 'id' => 'edit-form-' . $form_id, |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $args = array(); |
115 | 115 | |
116 | - $view_id = is_null ( $view ) ? null : $view->ID; |
|
116 | + $view_id = is_null( $view ) ? null : $view->ID; |
|
117 | 117 | |
118 | 118 | $permalink = null; |
119 | 119 | |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | |
127 | 127 | $view_collection = View_Collection::from_post( $post ); |
128 | 128 | |
129 | - if( 1 < $view_collection->count() ) { |
|
130 | - $args['gvid'] = $view_id; |
|
129 | + if ( 1 < $view_collection->count() ) { |
|
130 | + $args[ 'gvid' ] = $view_id; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | } |
@@ -157,21 +157,21 @@ discard block |
||
157 | 157 | */ |
158 | 158 | $link_parts = explode( '?', $permalink ); |
159 | 159 | |
160 | - $query = ! empty( $link_parts[1] ) ? '?' . $link_parts[1] : ''; |
|
160 | + $query = ! empty( $link_parts[ 1 ] ) ? '?' . $link_parts[ 1 ] : ''; |
|
161 | 161 | |
162 | - $permalink = trailingslashit( $link_parts[0] ) . $entry_endpoint_name . '/'. $entry_slug .'/' . $query; |
|
162 | + $permalink = trailingslashit( $link_parts[ 0 ] ) . $entry_endpoint_name . '/' . $entry_slug . '/' . $query; |
|
163 | 163 | } else { |
164 | 164 | $args[ $entry_endpoint_name ] = $entry_slug; |
165 | 165 | } |
166 | 166 | |
167 | 167 | if ( $track_directory ) { |
168 | - if ( ! empty( $_GET['pagenum'] ) ) { |
|
169 | - $args['pagenum'] = intval( $_GET['pagenum'] ); |
|
168 | + if ( ! empty( $_GET[ 'pagenum' ] ) ) { |
|
169 | + $args[ 'pagenum' ] = intval( $_GET[ 'pagenum' ] ); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if ( $sort = Utils::_GET( 'sort' ) ) { |
173 | - $args['sort'] = $sort; |
|
174 | - $args['dir'] = Utils::_GET( 'dir' ); |
|
173 | + $args[ 'sort' ] = $sort; |
|
174 | + $args[ 'dir' ] = Utils::_GET( 'dir' ); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | $entry_slug = \GravityView_API::get_entry_slug( $this->ID, $this->as_entry() ); |
211 | 211 | |
212 | - if( ! $apply_filter ) { |
|
212 | + if ( ! $apply_filter ) { |
|
213 | 213 | return $entry_slug; |
214 | 214 | } |
215 | 215 |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | * @return \GV\GF_Entry|null An instance of this entry or null if not found. |
107 | 107 | */ |
108 | 108 | public static function from_entry( $entry ) { |
109 | - if ( empty( $entry['id'] ) ) { |
|
109 | + if ( empty( $entry[ 'id' ] ) ) { |
|
110 | 110 | return null; |
111 | 111 | } |
112 | 112 | |
113 | 113 | $self = new self(); |
114 | 114 | $self->entry = $entry; |
115 | 115 | |
116 | - $self->ID = $self->entry['id']; |
|
116 | + $self->ID = $self->entry[ 'id' ]; |
|
117 | 117 | $self->slug = $self->get_slug(); |
118 | 118 | |
119 | 119 | return $self; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @return bool Whether the offset exists or not. |
129 | 129 | */ |
130 | 130 | public function offsetExists( $offset ) { |
131 | - return isset( $this->entry[$offset] ); |
|
131 | + return isset( $this->entry[ $offset ] ); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return mixed The value of the requested entry data. |
144 | 144 | */ |
145 | 145 | public function offsetGet( $offset ) { |
146 | - return $this->entry[$offset]; |
|
146 | + return $this->entry[ $offset ]; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | wp_nonce_field( 'gravityview_select_form', 'gravityview_select_form_nonce' ); |
11 | 11 | |
12 | 12 | //current value |
13 | -$current_form = (int) \GV\Utils::_GET( 'form_id', gravityview_get_form_id( $post->ID ) ); |
|
13 | +$current_form = (int)\GV\Utils::_GET( 'form_id', gravityview_get_form_id( $post->ID ) ); |
|
14 | 14 | |
15 | 15 | // If form is in trash or not existing, show error |
16 | 16 | GravityView_Admin::connected_form_warning( $current_form ); |
17 | 17 | |
18 | 18 | // check for available gravity forms |
19 | -$forms = gravityview_get_forms('any', false, 'title' ); |
|
19 | +$forms = gravityview_get_forms( 'any', false, 'title' ); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @param int $current_form Form currently selected in the View (0 if none selected) |
@@ -35,24 +35,24 @@ discard block |
||
35 | 35 | ?> |
36 | 36 | <a class="button button-primary" href="#gv_start_fresh" title="<?php esc_attr_e( 'Use a Form Preset', 'gravityview' ); ?>"><?php esc_html_e( 'Use a Form Preset', 'gravityview' ); ?></a> |
37 | 37 | |
38 | - <?php if( !empty( $forms ) ) { ?> |
|
38 | + <?php if ( ! empty( $forms ) ) { ?> |
|
39 | 39 | <span> <?php esc_html_e( 'or use an existing form', 'gravityview' ); ?> </span> |
40 | 40 | <?php } |
41 | 41 | } |
42 | 42 | |
43 | 43 | // If there are no forms to select, show no forms. |
44 | - if( !empty( $forms ) ) { ?> |
|
44 | + if ( ! empty( $forms ) ) { ?> |
|
45 | 45 | <select name="gravityview_form_id" id="gravityview_form_id"> |
46 | 46 | <option value="" <?php selected( '', $current_form, true ); ?>>— <?php esc_html_e( 'list of forms', 'gravityview' ); ?> —</option> |
47 | - <?php foreach( $forms as $form ) { ?> |
|
48 | - <option value="<?php echo $form['id']; ?>" <?php selected( $form['id'], $current_form, true ); ?>><?php echo esc_html( $form['title'] ); ?></option> |
|
47 | + <?php foreach ( $forms as $form ) { ?> |
|
48 | + <option value="<?php echo $form[ 'id' ]; ?>" <?php selected( $form[ 'id' ], $current_form, true ); ?>><?php echo esc_html( $form[ 'title' ] ); ?></option> |
|
49 | 49 | <?php } ?> |
50 | 50 | </select> |
51 | 51 | <?php } else { ?> |
52 | 52 | <select name="gravityview_form_id" id="gravityview_form_id" class="hidden"><option selected="selected" value=""></option></select> |
53 | 53 | <?php } ?> |
54 | 54 | |
55 | - <button class="button button-primary" <?php if( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></button> |
|
55 | + <button class="button button-primary" <?php if ( empty( $current_form ) ) { echo 'style="display:none;"'; } ?> id="gv_switch_view_button" title="<?php esc_attr_e( 'Switch View', 'gravityview' ); ?>"><?php esc_html_e( 'Switch View Type', 'gravityview' ); ?></button> |
|
56 | 56 | </p> |
57 | 57 | |
58 | 58 | <?php // confirm dialog box ?> |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | // WooCommerce doesn't $post_id |
454 | - if ( empty( $passed_post_id ) ) { |
|
454 | + if ( empty( $passed_post_id ) ) { |
|
455 | 455 | return $passed_title; |
456 | 456 | } |
457 | 457 | |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | */ |
1207 | 1207 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
1208 | 1208 | |
1209 | - switch( strtolower( $address_part ) ){ |
|
1209 | + switch( strtolower( $address_part ) ) { |
|
1210 | 1210 | case 'street': |
1211 | 1211 | $sort_field_id .= '.1'; |
1212 | 1212 | break; |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | */ |
1297 | 1297 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
1298 | 1298 | |
1299 | - if ( empty( $single_entry ) ){ |
|
1299 | + if ( empty( $single_entry ) ) { |
|
1300 | 1300 | return false; |
1301 | 1301 | } else { |
1302 | 1302 | return $single_entry; |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | private function __construct() {} |
86 | 86 | |
87 | 87 | private function initialize() { |
88 | - add_action( 'wp', array( $this, 'parse_content'), 11 ); |
|
88 | + add_action( 'wp', array( $this, 'parse_content' ), 11 ); |
|
89 | 89 | add_filter( 'render_block', array( $this, 'detect_views_in_block_content' ) ); |
90 | 90 | add_filter( 'parse_query', array( $this, 'parse_query_fix_frontpage' ), 10 ); |
91 | - add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 ); |
|
91 | + add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 ); |
|
92 | 92 | |
93 | 93 | // Enqueue scripts and styles after GravityView_Template::register_styles() |
94 | 94 | add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 ); |
@@ -235,18 +235,18 @@ discard block |
||
235 | 235 | |
236 | 236 | if ( ! empty( $view_id ) ) { |
237 | 237 | |
238 | - $this->context_view_id = (int) $view_id; |
|
238 | + $this->context_view_id = (int)$view_id; |
|
239 | 239 | |
240 | - } elseif ( isset( $_GET['gvid'] ) && $multiple_views ) { |
|
240 | + } elseif ( isset( $_GET[ 'gvid' ] ) && $multiple_views ) { |
|
241 | 241 | /** |
242 | 242 | * used on a has_multiple_views context |
243 | 243 | * @see GravityView_API::entry_link |
244 | 244 | */ |
245 | - $this->context_view_id = (int) $_GET['gvid']; |
|
245 | + $this->context_view_id = (int)$_GET[ 'gvid' ]; |
|
246 | 246 | |
247 | 247 | } elseif ( ! $multiple_views ) { |
248 | 248 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
249 | - $this->context_view_id = (int) array_pop( $array_keys ); |
|
249 | + $this->context_view_id = (int)array_pop( $array_keys ); |
|
250 | 250 | unset( $array_keys ); |
251 | 251 | } |
252 | 252 | |
@@ -279,25 +279,25 @@ discard block |
||
279 | 279 | global $wp_rewrite; |
280 | 280 | |
281 | 281 | $is_front_page = ( $query->is_home || $query->is_page ); |
282 | - $show_on_front = ( 'page' === get_option('show_on_front') ); |
|
283 | - $front_page_id = get_option('page_on_front'); |
|
282 | + $show_on_front = ( 'page' === get_option( 'show_on_front' ) ); |
|
283 | + $front_page_id = get_option( 'page_on_front' ); |
|
284 | 284 | |
285 | - if ( $is_front_page && $show_on_front && $front_page_id ) { |
|
285 | + if ( $is_front_page && $show_on_front && $front_page_id ) { |
|
286 | 286 | |
287 | 287 | // Force to be an array, potentially a query string ( entry=16 ) |
288 | 288 | $_query = wp_parse_args( $query->query ); |
289 | 289 | |
290 | 290 | // pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename. |
291 | - if ( isset( $_query['pagename'] ) && '' === $_query['pagename'] ) { |
|
292 | - unset( $_query['pagename'] ); |
|
291 | + if ( isset( $_query[ 'pagename' ] ) && '' === $_query[ 'pagename' ] ) { |
|
292 | + unset( $_query[ 'pagename' ] ); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | // this is where will break from core wordpress |
296 | 296 | /** @internal Don't use this filter; it will be unnecessary soon - it's just a patch for specific use case */ |
297 | 297 | $ignore = apply_filters( 'gravityview/internal/ignored_endpoints', array( 'preview', 'page', 'paged', 'cpage' ), $query ); |
298 | 298 | $endpoints = \GV\Utils::get( $wp_rewrite, 'endpoints' ); |
299 | - foreach ( (array) $endpoints as $endpoint ) { |
|
300 | - $ignore[] = $endpoint[1]; |
|
299 | + foreach ( (array)$endpoints as $endpoint ) { |
|
300 | + $ignore[ ] = $endpoint[ 1 ]; |
|
301 | 301 | } |
302 | 302 | unset( $endpoints ); |
303 | 303 | |
@@ -307,21 +307,21 @@ discard block |
||
307 | 307 | // - The query includes keys that are associated with registered endpoints. `entry`, for example. |
308 | 308 | if ( empty( $_query ) || ! array_diff( array_keys( $_query ), $ignore ) ) { |
309 | 309 | |
310 | - $qv =& $query->query_vars; |
|
310 | + $qv = & $query->query_vars; |
|
311 | 311 | |
312 | 312 | // Prevent redirect when on the single entry endpoint |
313 | - if( self::is_single_entry() ) { |
|
313 | + if ( self::is_single_entry() ) { |
|
314 | 314 | add_filter( 'redirect_canonical', '__return_false' ); |
315 | 315 | } |
316 | 316 | |
317 | 317 | $query->is_page = true; |
318 | 318 | $query->is_home = false; |
319 | - $qv['page_id'] = $front_page_id; |
|
319 | + $qv[ 'page_id' ] = $front_page_id; |
|
320 | 320 | |
321 | 321 | // Correct <!--nextpage--> for page_on_front |
322 | - if ( ! empty( $qv['paged'] ) ) { |
|
323 | - $qv['page'] = $qv['paged']; |
|
324 | - unset( $qv['paged'] ); |
|
322 | + if ( ! empty( $qv[ 'paged' ] ) ) { |
|
323 | + $qv[ 'page' ] = $qv[ 'paged' ]; |
|
324 | + unset( $qv[ 'paged' ] ); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | $blocks = parse_blocks( $post_content ); |
384 | 384 | |
385 | 385 | foreach ( $blocks as $block ) { |
386 | - if ( empty( $block['attrs']['ref'] ) ) { |
|
386 | + if ( empty( $block[ 'attrs' ][ 'ref' ] ) ) { |
|
387 | 387 | continue; |
388 | 388 | } |
389 | 389 | |
390 | - $block_post = get_post( $block['attrs']['ref'] ); |
|
390 | + $block_post = get_post( $block[ 'attrs' ][ 'ref' ] ); |
|
391 | 391 | |
392 | 392 | if ( $block_post ) { |
393 | 393 | $post_content .= $block_post->post_content; |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | |
441 | 441 | $search_method = GravityView_Widget_Search::getInstance()->get_search_method(); |
442 | 442 | |
443 | - if( 'post' === $search_method ) { |
|
443 | + if ( 'post' === $search_method ) { |
|
444 | 444 | $get = $_POST; |
445 | 445 | } else { |
446 | 446 | $get = $_GET; |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $gventry = gravityview()->request->is_entry(); |
493 | 493 | |
494 | 494 | // If this is the directory view, return. |
495 | - if( ! $gventry ) { |
|
495 | + if ( ! $gventry ) { |
|
496 | 496 | return $passed_title; |
497 | 497 | } |
498 | 498 | |
@@ -510,19 +510,19 @@ discard block |
||
510 | 510 | } |
511 | 511 | |
512 | 512 | // WooCommerce doesn't $post_id |
513 | - if ( empty( $passed_post_id ) ) { |
|
513 | + if ( empty( $passed_post_id ) ) { |
|
514 | 514 | return $passed_title; |
515 | 515 | } |
516 | 516 | |
517 | 517 | // Don't modify the title for anything other than the current view/post. |
518 | 518 | // This is true for embedded shortcodes and Views. |
519 | - if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) { |
|
519 | + if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) { |
|
520 | 520 | return $passed_title; |
521 | 521 | } |
522 | 522 | |
523 | 523 | $view = gravityview()->request->is_view(); |
524 | 524 | |
525 | - if( $view ) { |
|
525 | + if ( $view ) { |
|
526 | 526 | return $this->_get_single_entry_title( $view, $entry, $passed_title ); |
527 | 527 | } |
528 | 528 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $view_collection = \GV\View_Collection::from_post( $post ); |
546 | 546 | |
547 | 547 | // We have multiple Views, but no gvid...this isn't valid security |
548 | - if( 1 < $view_collection->count() ) { |
|
548 | + if ( 1 < $view_collection->count() ) { |
|
549 | 549 | return $passed_title; |
550 | 550 | } |
551 | 551 | |
@@ -579,18 +579,18 @@ discard block |
||
579 | 579 | */ |
580 | 580 | $check_entry_display = apply_filters( 'gravityview/single/title/check_entry_display', true, $entry, $view ); |
581 | 581 | |
582 | - if( $check_entry_display ) { |
|
582 | + if ( $check_entry_display ) { |
|
583 | 583 | |
584 | 584 | $check_display = GVCommon::check_entry_display( $entry, $view ); |
585 | 585 | |
586 | - if( is_wp_error( $check_display ) ) { |
|
586 | + if ( is_wp_error( $check_display ) ) { |
|
587 | 587 | return $passed_title; |
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
591 | 591 | $title = $view->settings->get( 'single_title', $passed_title ); |
592 | 592 | |
593 | - $form = GVCommon::get_form( $entry['form_id'] ); |
|
593 | + $form = GVCommon::get_form( $entry[ 'form_id' ] ); |
|
594 | 594 | |
595 | 595 | // We are allowing HTML in the fields, so no escaping the output |
596 | 596 | $title = GravityView_API::replace_variables( $title, $form, $entry ); |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | |
662 | 662 | $context = GravityView_View::getInstance()->getContext(); |
663 | 663 | |
664 | - switch( $context ) { |
|
664 | + switch ( $context ) { |
|
665 | 665 | case 'directory': |
666 | 666 | $tab = __( 'Multiple Entries', 'gravityview' ); |
667 | 667 | break; |
@@ -675,12 +675,12 @@ discard block |
||
675 | 675 | } |
676 | 676 | |
677 | 677 | |
678 | - $title = sprintf( esc_html_x('The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab ); |
|
678 | + $title = sprintf( esc_html_x( 'The %s layout has not been configured.', 'Displayed when a View is not configured. %s is replaced by the tab label', 'gravityview' ), $tab ); |
|
679 | 679 | $edit_link = admin_url( sprintf( 'post.php?post=%d&action=edit#%s-view', $view_id, $context ) ); |
680 | - $action_text = sprintf( esc_html__('Add fields to %s', 'gravityview' ), $tab ); |
|
680 | + $action_text = sprintf( esc_html__( 'Add fields to %s', 'gravityview' ), $tab ); |
|
681 | 681 | $message = esc_html__( 'You can only see this message because you are able to edit this View.', 'gravityview' ); |
682 | 682 | |
683 | - $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 ) ) ); |
|
683 | + $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 ) ) ); |
|
684 | 684 | $output = sprintf( '<h3>%s <strong><a href="%s">%s</a></strong></h3><p>%s</p>', $title, esc_url( $edit_link ), $action_text, $message ); |
685 | 685 | |
686 | 686 | echo GVCommon::generate_notice( $output . $image, 'gv-error error', 'edit_gravityview', $view_id ); |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | $direct_access = apply_filters( 'gravityview_direct_access', true, $view->ID ); |
728 | 728 | $embed_only = $view->settings->get( 'embed_only' ); |
729 | 729 | |
730 | - if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) { |
|
730 | + if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) { |
|
731 | 731 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
732 | 732 | } |
733 | 733 | |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $datetime_format = 'Y-m-d H:i:s'; |
775 | 775 | $search_is_outside_view_bounds = false; |
776 | 776 | |
777 | - if( ! empty( $search_criteria[ $key ] ) ) { |
|
777 | + if ( ! empty( $search_criteria[ $key ] ) ) { |
|
778 | 778 | |
779 | 779 | $search_date = strtotime( $search_criteria[ $key ], GFCommon::get_local_timestamp() ); |
780 | 780 | |
@@ -802,14 +802,14 @@ discard block |
||
802 | 802 | if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) { |
803 | 803 | |
804 | 804 | // Then we override the search and re-set the start date |
805 | - $return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true ); |
|
805 | + $return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true ); |
|
806 | 806 | } |
807 | 807 | } |
808 | 808 | } |
809 | 809 | |
810 | - if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) { |
|
810 | + if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) { |
|
811 | 811 | // The start date is AFTER the end date. This will result in no results, but let's not force the issue. |
812 | - if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) { |
|
812 | + if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) { |
|
813 | 813 | gravityview()->log->error( 'Invalid search: the start date is after the end date.', array( 'data' => $return_search_criteria ) ); |
814 | 814 | } |
815 | 815 | } |
@@ -828,19 +828,19 @@ discard block |
||
828 | 828 | public static function process_search_only_approved( $args, $search_criteria ) { |
829 | 829 | |
830 | 830 | /** @since 1.19 */ |
831 | - if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) { |
|
831 | + if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
832 | 832 | gravityview()->log->debug( 'User can moderate entries; showing all approval statuses' ); |
833 | 833 | return $search_criteria; |
834 | 834 | } |
835 | 835 | |
836 | - if ( ! empty( $args['show_only_approved'] ) ) { |
|
836 | + if ( ! empty( $args[ 'show_only_approved' ] ) ) { |
|
837 | 837 | |
838 | - $search_criteria['field_filters'][] = array( |
|
838 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
839 | 839 | 'key' => GravityView_Entry_Approval::meta_key, |
840 | 840 | 'value' => GravityView_Entry_Approval_Status::APPROVED |
841 | 841 | ); |
842 | 842 | |
843 | - $search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met |
|
843 | + $search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met |
|
844 | 844 | |
845 | 845 | gravityview()->log->debug( '[process_search_only_approved] Search Criteria if show only approved: ', array( 'data' => $search_criteria ) ); |
846 | 846 | } |
@@ -867,18 +867,18 @@ discard block |
||
867 | 867 | */ |
868 | 868 | public static function is_entry_approved( $entry, $args = array() ) { |
869 | 869 | |
870 | - if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) { |
|
870 | + if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) { |
|
871 | 871 | // is implicitly approved if entry is null or View settings doesn't require to check for approval |
872 | 872 | return true; |
873 | 873 | } |
874 | 874 | |
875 | 875 | /** @since 1.19 */ |
876 | - if( ! empty( $args['admin_show_all_statuses'] ) && GVCommon::has_cap('gravityview_moderate_entries') ) { |
|
876 | + if ( ! empty( $args[ 'admin_show_all_statuses' ] ) && GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
877 | 877 | gravityview()->log->debug( 'User can moderate entries, so entry is approved for viewing' ); |
878 | 878 | return true; |
879 | 879 | } |
880 | 880 | |
881 | - $is_approved = gform_get_meta( $entry['id'], GravityView_Entry_Approval::meta_key ); |
|
881 | + $is_approved = gform_get_meta( $entry[ 'id' ], GravityView_Entry_Approval::meta_key ); |
|
882 | 882 | |
883 | 883 | return GravityView_Entry_Approval_Status::is_approved( $is_approved ); |
884 | 884 | } |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | * Compatibility with filters hooking in `gravityview_search_criteria` instead of `gravityview_fe_search_criteria`. |
903 | 903 | */ |
904 | 904 | $criteria = apply_filters( 'gravityview_search_criteria', array(), array( $form_id ), \GV\Utils::get( $args, 'id' ) ); |
905 | - $search_criteria = isset( $criteria['search_criteria'] ) ? $criteria['search_criteria'] : array( 'field_filters' => array() ); |
|
905 | + $search_criteria = isset( $criteria[ 'search_criteria' ] ) ? $criteria[ 'search_criteria' ] : array( 'field_filters' => array() ); |
|
906 | 906 | |
907 | 907 | /** |
908 | 908 | * @filter `gravityview_fe_search_criteria` Modify the search criteria |
@@ -922,29 +922,29 @@ discard block |
||
922 | 922 | gravityview()->log->debug( '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', array( 'data' =>$search_criteria ) ); |
923 | 923 | |
924 | 924 | // implicity search |
925 | - if ( ! empty( $args['search_value'] ) ) { |
|
925 | + if ( ! empty( $args[ 'search_value' ] ) ) { |
|
926 | 926 | |
927 | 927 | // Search operator options. Options: `is` or `contains` |
928 | - $operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains'; |
|
928 | + $operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains'; |
|
929 | 929 | |
930 | - $search_criteria['field_filters'][] = array( |
|
930 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
931 | 931 | 'key' => \GV\Utils::_GET( 'search_field', \GV\Utils::get( $args, 'search_field' ) ), // The field ID to search |
932 | - 'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes. |
|
932 | + 'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes. |
|
933 | 933 | 'operator' => $operator, |
934 | 934 | ); |
935 | 935 | |
936 | 936 | // Lock search mode to "all" with implicit presearch filter. |
937 | - $search_criteria['field_filters']['mode'] = 'all'; |
|
937 | + $search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; |
|
938 | 938 | } |
939 | 939 | |
940 | - if( $search_criteria !== $original_search_criteria ) { |
|
940 | + if ( $search_criteria !== $original_search_criteria ) { |
|
941 | 941 | gravityview()->log->debug( '[get_search_criteria] Search Criteria after implicity search: ', array( 'data' => $search_criteria ) ); |
942 | 942 | } |
943 | 943 | |
944 | 944 | // Handle setting date range |
945 | 945 | $search_criteria = self::process_search_dates( $args, $search_criteria ); |
946 | 946 | |
947 | - if( $search_criteria !== $original_search_criteria ) { |
|
947 | + if ( $search_criteria !== $original_search_criteria ) { |
|
948 | 948 | gravityview()->log->debug( '[get_search_criteria] Search Criteria after date params: ', array( 'data' => $search_criteria ) ); |
949 | 949 | } |
950 | 950 | |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | * @filter `gravityview_status` Modify entry status requirements to be included in search results. |
956 | 956 | * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash` |
957 | 957 | */ |
958 | - $search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args ); |
|
958 | + $search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args ); |
|
959 | 959 | |
960 | 960 | return $search_criteria; |
961 | 961 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
1067 | 1067 | 'search_criteria' => $search_criteria, |
1068 | 1068 | 'sorting' => self::updateViewSorting( $args, $form_id ), |
1069 | 1069 | 'paging' => $paging, |
1070 | - 'cache' => isset( $args['cache'] ) ? $args['cache'] : true, |
|
1070 | + 'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true, |
|
1071 | 1071 | ); |
1072 | 1072 | |
1073 | 1073 | /** |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys. |
1093 | 1093 | * @param array $args View configuration args. |
1094 | 1094 | */ |
1095 | - $parameters = apply_filters( 'gravityview_get_entries_'.\GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id ); |
|
1095 | + $parameters = apply_filters( 'gravityview_get_entries_' . \GV\Utils::get( $args, 'id' ), $parameters, $args, $form_id ); |
|
1096 | 1096 | |
1097 | 1097 | gravityview()->log->debug( '$parameters passed to gravityview_get_entries(): ', array( 'data' => $parameters ) ); |
1098 | 1098 | |
@@ -1117,17 +1117,17 @@ discard block |
||
1117 | 1117 | $default_page_size = apply_filters( 'gravityview_default_page_size', 25 ); |
1118 | 1118 | |
1119 | 1119 | // Paging & offset |
1120 | - $page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : $default_page_size; |
|
1120 | + $page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : $default_page_size; |
|
1121 | 1121 | |
1122 | 1122 | if ( -1 === $page_size ) { |
1123 | 1123 | $page_size = PHP_INT_MAX; |
1124 | 1124 | } |
1125 | 1125 | |
1126 | - $curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] ); |
|
1126 | + $curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] ); |
|
1127 | 1127 | $offset = ( $curr_page - 1 ) * $page_size; |
1128 | 1128 | |
1129 | - if ( ! empty( $args['offset'] ) ) { |
|
1130 | - $offset += intval( $args['offset'] ); |
|
1129 | + if ( ! empty( $args[ 'offset' ] ) ) { |
|
1130 | + $offset += intval( $args[ 'offset' ] ); |
|
1131 | 1131 | } |
1132 | 1132 | |
1133 | 1133 | $paging = array( |
@@ -1152,11 +1152,11 @@ discard block |
||
1152 | 1152 | public static function updateViewSorting( $args, $form_id ) { |
1153 | 1153 | $sorting = array(); |
1154 | 1154 | |
1155 | - $has_values = isset( $_GET['sort'] ); |
|
1155 | + $has_values = isset( $_GET[ 'sort' ] ); |
|
1156 | 1156 | |
1157 | - if ( $has_values && is_array( $_GET['sort'] ) ) { |
|
1158 | - $sorts = array_keys( $_GET['sort'] ); |
|
1159 | - $dirs = array_values( $_GET['sort'] ); |
|
1157 | + if ( $has_values && is_array( $_GET[ 'sort' ] ) ) { |
|
1158 | + $sorts = array_keys( $_GET[ 'sort' ] ); |
|
1159 | + $dirs = array_values( $_GET[ 'sort' ] ); |
|
1160 | 1160 | |
1161 | 1161 | if ( $has_values = array_filter( $dirs ) ) { |
1162 | 1162 | $sort_field_id = end( $sorts ); |
@@ -1165,11 +1165,11 @@ discard block |
||
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | if ( ! isset( $sort_field_id ) ) { |
1168 | - $sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : \GV\Utils::get( $args, 'sort_field' ); |
|
1168 | + $sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : \GV\Utils::get( $args, 'sort_field' ); |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | if ( ! isset( $sort_direction ) ) { |
1172 | - $sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : \GV\Utils::get( $args, 'sort_direction' ); |
|
1172 | + $sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : \GV\Utils::get( $args, 'sort_direction' ); |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | if ( is_array( $sort_field_id ) ) { |
@@ -1201,10 +1201,10 @@ discard block |
||
1201 | 1201 | $form = GFAPI::get_form( $form_id ); |
1202 | 1202 | |
1203 | 1203 | // Get the first GF_Field field ID, set as the key for entry randomization |
1204 | - if ( ! empty( $form['fields'] ) ) { |
|
1204 | + if ( ! empty( $form[ 'fields' ] ) ) { |
|
1205 | 1205 | |
1206 | 1206 | /** @var GF_Field $field */ |
1207 | - foreach ( $form['fields'] as $field ) { |
|
1207 | + foreach ( $form[ 'fields' ] as $field ) { |
|
1208 | 1208 | if ( ! is_a( $field, 'GF_Field' ) ) { |
1209 | 1209 | continue; |
1210 | 1210 | } |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | if ( is_array( $sort_field_id ) ) { |
1250 | 1250 | $modified_ids = array(); |
1251 | 1251 | foreach ( $sort_field_id as $_sort_field_id ) { |
1252 | - $modified_ids []= self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id ); |
|
1252 | + $modified_ids [ ] = self::_override_sorting_id_by_field_type( $_sort_field_id, $form_id ); |
|
1253 | 1253 | } |
1254 | 1254 | return $modified_ids; |
1255 | 1255 | } |
@@ -1258,11 +1258,11 @@ discard block |
||
1258 | 1258 | |
1259 | 1259 | $sort_field = GFFormsModel::get_field( $form, $sort_field_id ); |
1260 | 1260 | |
1261 | - if( ! $sort_field ) { |
|
1261 | + if ( ! $sort_field ) { |
|
1262 | 1262 | return $sort_field_id; |
1263 | 1263 | } |
1264 | 1264 | |
1265 | - switch ( $sort_field['type'] ) { |
|
1265 | + switch ( $sort_field[ 'type' ] ) { |
|
1266 | 1266 | |
1267 | 1267 | case 'address': |
1268 | 1268 | // Sorting by full address |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | */ |
1280 | 1280 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
1281 | 1281 | |
1282 | - switch( strtolower( $address_part ) ){ |
|
1282 | + switch ( strtolower( $address_part ) ) { |
|
1283 | 1283 | case 'street': |
1284 | 1284 | $sort_field_id .= '.1'; |
1285 | 1285 | break; |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | if ( ! class_exists( '\GV\Entry' ) ) { |
1353 | 1353 | |
1354 | 1354 | // Not using gravityview()->log->error(), since that may not exist yet either! |
1355 | - do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary() ); |
|
1355 | + do_action( 'gravityview_log_error', '\GV\Entry not defined yet. Backtrace: ' . wp_debug_backtrace_summary() ); |
|
1356 | 1356 | |
1357 | 1357 | return null; |
1358 | 1358 | } |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | */ |
1370 | 1370 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
1371 | 1371 | |
1372 | - if ( empty( $single_entry ) ){ |
|
1372 | + if ( empty( $single_entry ) ) { |
|
1373 | 1373 | return false; |
1374 | 1374 | } else { |
1375 | 1375 | return $single_entry; |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | $views = $this->getGvOutputData()->get_views(); |
1391 | 1391 | |
1392 | 1392 | foreach ( $views as $view_id => $data ) { |
1393 | - $view = \GV\View::by_id( $data['id'] ); |
|
1393 | + $view = \GV\View::by_id( $data[ 'id' ] ); |
|
1394 | 1394 | $view_id = $view->ID; |
1395 | 1395 | $template_id = gravityview_get_template_id( $view->ID ); |
1396 | 1396 | $data = $view->as_data(); |
@@ -1399,7 +1399,7 @@ discard block |
||
1399 | 1399 | * Don't enqueue the scripts or styles if it's not going to be displayed. |
1400 | 1400 | * @since 1.15 |
1401 | 1401 | */ |
1402 | - if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
1402 | + if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
1403 | 1403 | continue; |
1404 | 1404 | } |
1405 | 1405 | |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | * @param \GV\View The View. |
1429 | 1429 | */ |
1430 | 1430 | $js_dependency = apply_filters( 'gravityview_lightbox_script', $js_dependency, $view ); |
1431 | - $js_dependencies[] = $js_dependency; |
|
1431 | + $js_dependencies[ ] = $js_dependency; |
|
1432 | 1432 | |
1433 | 1433 | /** |
1434 | 1434 | * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox` |
@@ -1444,7 +1444,7 @@ discard block |
||
1444 | 1444 | * @param \GV\View The View. |
1445 | 1445 | */ |
1446 | 1446 | $css_dependency = apply_filters( 'gravityview_lightbox_style', $css_dependency, $view ); |
1447 | - $css_dependencies[] = $css_dependency; |
|
1447 | + $css_dependencies[ ] = $css_dependency; |
|
1448 | 1448 | } |
1449 | 1449 | |
1450 | 1450 | /** |
@@ -1452,19 +1452,19 @@ discard block |
||
1452 | 1452 | * @see https://github.com/katzwebservices/GravityView/issues/536 |
1453 | 1453 | * @since 1.15 |
1454 | 1454 | */ |
1455 | - if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) { |
|
1456 | - $css_dependencies[] = 'dashicons'; |
|
1455 | + if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) { |
|
1456 | + $css_dependencies[ ] = 'dashicons'; |
|
1457 | 1457 | } |
1458 | 1458 | |
1459 | 1459 | wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'assets/lib/jquery.cookie/jquery.cookie.min.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true ); |
1460 | 1460 | |
1461 | 1461 | $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
1462 | 1462 | |
1463 | - wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ) , GravityView_Plugin::version, true ); |
|
1463 | + wp_register_script( 'gravityview-fe-view', plugins_url( 'assets/js/fe-views' . $script_debug . '.js', GRAVITYVIEW_FILE ), apply_filters( 'gravityview_js_dependencies', $js_dependencies ), GravityView_Plugin::version, true ); |
|
1464 | 1464 | |
1465 | 1465 | wp_enqueue_script( 'gravityview-fe-view' ); |
1466 | 1466 | |
1467 | - if ( ! empty( $data['atts']['sort_columns'] ) ) { |
|
1467 | + if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) { |
|
1468 | 1468 | wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' ); |
1469 | 1469 | } |
1470 | 1470 | |
@@ -1527,7 +1527,7 @@ discard block |
||
1527 | 1527 | public static function add_style( $template_id ) { |
1528 | 1528 | |
1529 | 1529 | if ( ! empty( $template_id ) && wp_style_is( 'gravityview_style_' . $template_id, 'registered' ) ) { |
1530 | - gravityview()->log->debug( 'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) ); |
|
1530 | + gravityview()->log->debug( 'Adding extra template style for {template_id}', array( 'template_id' => $template_id ) ); |
|
1531 | 1531 | wp_enqueue_style( 'gravityview_style_' . $template_id ); |
1532 | 1532 | } elseif ( empty( $template_id ) ) { |
1533 | 1533 | gravityview()->log->error( 'Cannot add template style; template_id is empty' ); |
@@ -1558,11 +1558,11 @@ discard block |
||
1558 | 1558 | * Not a table-based template; don't add sort icons |
1559 | 1559 | * @since 1.12 |
1560 | 1560 | */ |
1561 | - if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) { |
|
1561 | + if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) { |
|
1562 | 1562 | return $label; |
1563 | 1563 | } |
1564 | 1564 | |
1565 | - if ( ! $this->is_field_sortable( $field['id'], $form ) ) { |
|
1565 | + if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) { |
|
1566 | 1566 | return $label; |
1567 | 1567 | } |
1568 | 1568 | |
@@ -1570,29 +1570,29 @@ discard block |
||
1570 | 1570 | |
1571 | 1571 | $class = 'gv-sort'; |
1572 | 1572 | |
1573 | - $sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] ); |
|
1573 | + $sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] ); |
|
1574 | 1574 | |
1575 | 1575 | $sort_args = array( |
1576 | - 'sort' => $field['id'], |
|
1576 | + 'sort' => $field[ 'id' ], |
|
1577 | 1577 | 'dir' => 'asc', |
1578 | 1578 | ); |
1579 | 1579 | |
1580 | - if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) { |
|
1580 | + if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) { |
|
1581 | 1581 | //toggle sorting direction. |
1582 | - if ( 'asc' === $sorting['direction'] ) { |
|
1583 | - $sort_args['dir'] = 'desc'; |
|
1582 | + if ( 'asc' === $sorting[ 'direction' ] ) { |
|
1583 | + $sort_args[ 'dir' ] = 'desc'; |
|
1584 | 1584 | $class .= ' gv-icon-sort-desc'; |
1585 | 1585 | } else { |
1586 | - $sort_args['dir'] = 'asc'; |
|
1586 | + $sort_args[ 'dir' ] = 'asc'; |
|
1587 | 1587 | $class .= ' gv-icon-sort-asc'; |
1588 | 1588 | } |
1589 | 1589 | } else { |
1590 | 1590 | $class .= ' gv-icon-caret-up-down'; |
1591 | 1591 | } |
1592 | 1592 | |
1593 | - $url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) ); |
|
1593 | + $url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) ); |
|
1594 | 1594 | |
1595 | - return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a> '. $label; |
|
1595 | + return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a> ' . $label; |
|
1596 | 1596 | |
1597 | 1597 | } |
1598 | 1598 | |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | |
1611 | 1611 | $field_type = $field_id; |
1612 | 1612 | |
1613 | - if( is_numeric( $field_id ) ) { |
|
1613 | + if ( is_numeric( $field_id ) ) { |
|
1614 | 1614 | $field = GFFormsModel::get_field( $form, $field_id ); |
1615 | 1615 | $field_type = $field ? $field->type : $field_id; |
1616 | 1616 | } |
@@ -1633,7 +1633,7 @@ discard block |
||
1633 | 1633 | return false; |
1634 | 1634 | } |
1635 | 1635 | |
1636 | - return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) ); |
|
1636 | + return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) ); |
|
1637 | 1637 | |
1638 | 1638 | } |
1639 | 1639 |