@@ -4,10 +4,10 @@ discard block |
||
4 | 4 | |
5 | 5 | function __construct() { |
6 | 6 | |
7 | - if( ! is_admin() ) { return; } |
|
7 | + if ( ! is_admin() ) { return; } |
|
8 | 8 | |
9 | 9 | // If Gravity Forms isn't active or compatibile, stop loading |
10 | - if( false === GravityView_Compatibility::is_valid() ) { |
|
10 | + if ( false === GravityView_Compatibility::is_valid() ) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) ); |
49 | 49 | add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) ); |
50 | 50 | |
51 | - add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) ); |
|
51 | + add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) ); |
|
52 | 52 | |
53 | 53 | add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 ); |
54 | 54 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function no_views_text() { |
65 | 65 | |
66 | - if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { |
|
66 | + if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) { |
|
67 | 67 | return __( 'No Views found in Trash', 'gravityview' ); |
68 | - } elseif( ! empty( $_GET['s'] ) ) { |
|
68 | + } elseif ( ! empty( $_GET[ 's' ] ) ) { |
|
69 | 69 | return __( 'No Views found.', 'gravityview' ); |
70 | 70 | } |
71 | 71 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $error .= ' ' . esc_html__( 'or select another form.', 'gravityview' ); |
110 | 110 | } |
111 | 111 | |
112 | - if( $error ) { |
|
112 | + if ( $error ) { |
|
113 | 113 | ?> |
114 | 114 | <div class="wp-dialog notice-warning inline error wp-clearfix"> |
115 | 115 | <?php echo gravityview_get_floaty(); ?> |
@@ -128,22 +128,22 @@ discard block |
||
128 | 128 | public function backend_actions() { |
129 | 129 | |
130 | 130 | /** @define "GRAVITYVIEW_DIR" "../" */ |
131 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' ); |
|
132 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' ); |
|
133 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' ); |
|
134 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' ); |
|
135 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' ); |
|
136 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' ); |
|
137 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' ); |
|
138 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' ); |
|
139 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' ); |
|
131 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' ); |
|
132 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' ); |
|
133 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' ); |
|
134 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' ); |
|
135 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' ); |
|
136 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' ); |
|
137 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' ); |
|
138 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' ); |
|
139 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' ); |
|
140 | 140 | |
141 | 141 | /** |
142 | 142 | * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded |
143 | 143 | * |
144 | 144 | * Nice place to insert extensions' backend stuff |
145 | 145 | */ |
146 | - do_action('gravityview_include_backend_actions'); |
|
146 | + do_action( 'gravityview_include_backend_actions' ); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | |
160 | 160 | $actions = array(); |
161 | 161 | |
162 | - if( GVCommon::has_cap( 'gravityview_view_settings' ) ) { |
|
163 | - $actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) ); |
|
162 | + if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) { |
|
163 | + $actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) ); |
|
164 | 164 | } |
165 | 165 | |
166 | - if( GVCommon::has_cap( 'gravityview_support_port' ) ) { |
|
167 | - $actions[] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>'; |
|
166 | + if ( GVCommon::has_cap( 'gravityview_support_port' ) ) { |
|
167 | + $actions[ ] = '<a href="http://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>'; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | return array_merge( $actions, $links ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | // By default, there will only be one item being modified. |
193 | 193 | // When in the `bulk_post_updated_messages` filter, there will be passed a number |
194 | 194 | // of modified items that will override this array. |
195 | - $bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts; |
|
195 | + $bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts; |
|
196 | 196 | |
197 | 197 | // If we're starting fresh, a new form was created. |
198 | 198 | // We should let the user know this is the case. |
@@ -200,60 +200,60 @@ discard block |
||
200 | 200 | |
201 | 201 | $new_form_text = ''; |
202 | 202 | |
203 | - if( !empty( $start_fresh ) ) { |
|
203 | + if ( ! empty( $start_fresh ) ) { |
|
204 | 204 | |
205 | 205 | // Get the form that was created |
206 | 206 | $connected_form = gravityview_get_form_id( $post_id ); |
207 | 207 | |
208 | - if( !empty( $connected_form ) ) { |
|
208 | + if ( ! empty( $connected_form ) ) { |
|
209 | 209 | $form = gravityview_get_form( $connected_form ); |
210 | - $form_name = esc_attr( $form['title'] ); |
|
210 | + $form_name = esc_attr( $form[ 'title' ] ); |
|
211 | 211 | $image = self::get_floaty(); |
212 | - $new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>'; |
|
213 | - $new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s |
|
212 | + $new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>'; |
|
213 | + $new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s |
|
214 | 214 | |
215 | 215 | You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don’t forget to %scustomize the form settings%s. |
216 | - ', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&view=settings&id='.$connected_form ).'">', '</a>'); |
|
216 | + ', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&view=settings&id=' . $connected_form ) . '">', '</a>' ); |
|
217 | 217 | $new_form_text = wpautop( $new_form_text ); |
218 | 218 | |
219 | 219 | delete_post_meta( $post_id, '_gravityview_start_fresh' ); |
220 | 220 | } |
221 | 221 | } |
222 | 222 | |
223 | - $messages['gravityview'] = array( |
|
223 | + $messages[ 'gravityview' ] = array( |
|
224 | 224 | 0 => '', // Unused. Messages start at index 1. |
225 | 225 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
226 | - 1 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
226 | + 1 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
227 | 227 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
228 | - 2 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
228 | + 2 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
229 | 229 | 3 => __( 'View deleted.', 'gravityview' ), |
230 | 230 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
231 | - 4 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
231 | + 4 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
232 | 232 | /* translators: %s: date and time of the revision */ |
233 | - 5 => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
|
233 | + 5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false, |
|
234 | 234 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
235 | - 6 => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
235 | + 6 => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
236 | 236 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
237 | - 7 => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
237 | + 7 => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
238 | 238 | 8 => __( 'View submitted.', 'gravityview' ), |
239 | 239 | 9 => sprintf( |
240 | 240 | /* translators: Date and time the View is scheduled to be published */ |
241 | 241 | __( 'View scheduled for: %1$s.', 'gravityview' ), |
242 | 242 | // translators: Publish box date format, see http://php.net/date |
243 | - date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) ) |
|
243 | + date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) ) |
|
244 | 244 | ) . $new_form_text, |
245 | 245 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
246 | - 10 => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
246 | + 10 => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
247 | 247 | |
248 | 248 | /** |
249 | 249 | * These apply to `bulk_post_updated_messages` |
250 | 250 | * @file wp-admin/edit.php |
251 | 251 | */ |
252 | - 'updated' => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ), |
|
253 | - 'locked' => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ), |
|
254 | - 'deleted' => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ), |
|
255 | - 'trashed' => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ), |
|
256 | - 'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ), |
|
252 | + 'updated' => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ), |
|
253 | + 'locked' => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ), |
|
254 | + 'deleted' => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ), |
|
255 | + 'trashed' => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ), |
|
256 | + 'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ), |
|
257 | 257 | ); |
258 | 258 | |
259 | 259 | return $messages; |
@@ -313,29 +313,29 @@ discard block |
||
313 | 313 | static function is_admin_page( $hook = '', $page = NULL ) { |
314 | 314 | global $current_screen, $plugin_page, $pagenow, $post; |
315 | 315 | |
316 | - if( ! is_admin() ) { return false; } |
|
316 | + if ( ! is_admin() ) { return false; } |
|
317 | 317 | |
318 | 318 | $is_page = false; |
319 | 319 | |
320 | - $is_gv_screen = (!empty($current_screen) && isset($current_screen->post_type) && $current_screen->post_type === 'gravityview'); |
|
320 | + $is_gv_screen = ( ! empty( $current_screen ) && isset( $current_screen->post_type ) && $current_screen->post_type === 'gravityview' ); |
|
321 | 321 | |
322 | - $is_gv_post_type_get = (isset($_GET['post_type']) && $_GET['post_type'] === 'gravityview'); |
|
322 | + $is_gv_post_type_get = ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] === 'gravityview' ); |
|
323 | 323 | |
324 | - $is_gv_settings_get = isset( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings'; |
|
324 | + $is_gv_settings_get = isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings'; |
|
325 | 325 | |
326 | - if( empty( $post ) && $pagenow === 'post.php' && !empty( $_GET['post'] ) ) { |
|
327 | - $gv_post = get_post( intval( $_GET['post'] ) ); |
|
328 | - $is_gv_post_type = (!empty($gv_post) && !empty($gv_post->post_type) && $gv_post->post_type === 'gravityview'); |
|
326 | + if ( empty( $post ) && $pagenow === 'post.php' && ! empty( $_GET[ 'post' ] ) ) { |
|
327 | + $gv_post = get_post( intval( $_GET[ 'post' ] ) ); |
|
328 | + $is_gv_post_type = ( ! empty( $gv_post ) && ! empty( $gv_post->post_type ) && $gv_post->post_type === 'gravityview' ); |
|
329 | 329 | } else { |
330 | - $is_gv_post_type = (!empty($post) && !empty($post->post_type) && $post->post_type === 'gravityview'); |
|
330 | + $is_gv_post_type = ( ! empty( $post ) && ! empty( $post->post_type ) && $post->post_type === 'gravityview' ); |
|
331 | 331 | } |
332 | 332 | |
333 | - if( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) { |
|
333 | + if ( $is_gv_screen || $is_gv_post_type || $is_gv_post_type || $is_gv_post_type_get || $is_gv_settings_get ) { |
|
334 | 334 | |
335 | 335 | // $_GET `post_type` variable |
336 | - if(in_array($pagenow, array( 'post.php' , 'post-new.php' )) ) { |
|
336 | + if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) { |
|
337 | 337 | $is_page = 'single'; |
338 | - } else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( !empty( $_GET['page'] ) && $_GET['page'] === 'gravityview_settings' ) ) { |
|
338 | + } else if ( in_array( $plugin_page, array( 'gravityview_settings', 'gravityview_page_gravityview_settings' ) ) || ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'gravityview_settings' ) ) { |
|
339 | 339 | $is_page = 'settings'; |
340 | 340 | } else { |
341 | 341 | $is_page = 'views'; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $is_page = apply_filters( 'gravityview_is_admin_page', $is_page, $hook ); |
351 | 351 | |
352 | 352 | // If the current page is the same as the compared page |
353 | - if( !empty( $page ) ) { |
|
353 | + if ( ! empty( $page ) ) { |
|
354 | 354 | return $is_page === $page; |
355 | 355 | } |
356 | 356 | |
@@ -371,6 +371,6 @@ discard block |
||
371 | 371 | * |
372 | 372 | * @return bool|string If `false`, not a GravityView page. `true` if $page is passed and is the same as current page. Otherwise, the name of the page (`single`, `settings`, or `views`) |
373 | 373 | */ |
374 | -function gravityview_is_admin_page($hook = '', $page = NULL) { |
|
374 | +function gravityview_is_admin_page( $hook = '', $page = NULL ) { |
|
375 | 375 | return GravityView_Admin::is_admin_page( $hook, $page ); |
376 | 376 | } |
@@ -26,24 +26,24 @@ |
||
26 | 26 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
27 | 27 | |
28 | 28 | // Don't link to entry; doesn't make sense. |
29 | - unset( $field_options['show_as_link'] ); |
|
29 | + unset( $field_options[ 'show_as_link' ] ); |
|
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $add_options = array(); |
36 | - $add_options['link_to_source'] = array( |
|
36 | + $add_options[ 'link_to_source' ] = array( |
|
37 | 37 | 'type' => 'checkbox', |
38 | 38 | 'label' => __( 'Link to URL:', 'gravityview' ), |
39 | - 'desc' => __('Display as a link to the Source URL', 'gravityview'), |
|
39 | + 'desc' => __( 'Display as a link to the Source URL', 'gravityview' ), |
|
40 | 40 | 'value' => false, |
41 | 41 | 'merge_tags' => false, |
42 | 42 | ); |
43 | - $add_options['source_link_text'] = array( |
|
43 | + $add_options[ 'source_link_text' ] = array( |
|
44 | 44 | 'type' => 'text', |
45 | 45 | 'label' => __( 'Link Text:', 'gravityview' ), |
46 | - 'desc' => __('Customize the link text. If empty, the link text will be the URL.', 'gravityview'), |
|
46 | + 'desc' => __( 'Customize the link text. If empty, the link text will be the URL.', 'gravityview' ), |
|
47 | 47 | 'value' => NULL, |
48 | 48 | 'merge_tags' => true, |
49 | 49 | ); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function by_id( $entry_id ) { |
42 | 42 | $entry = \GFAPI::get_entry( $entry_id ); |
43 | - if ( !$entry ) { |
|
43 | + if ( ! $entry ) { |
|
44 | 44 | return null; |
45 | 45 | } |
46 | 46 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @return \GV\Entry|null An instance of this entry or null if not found. |
56 | 56 | */ |
57 | 57 | public static function from_entry( $entry ) { |
58 | - if ( empty( $entry['id'] ) ) { |
|
58 | + if ( empty( $entry[ 'id' ] ) ) { |
|
59 | 59 | return null; |
60 | 60 | } |
61 | 61 | |
62 | 62 | $self = new self(); |
63 | 63 | $self->entry = $entry; |
64 | 64 | |
65 | - $self->ID = $self->entry['id']; |
|
65 | + $self->ID = $self->entry[ 'id' ]; |
|
66 | 66 | |
67 | 67 | return $self; |
68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return bool Whether the offset exists or not. |
77 | 77 | */ |
78 | 78 | public function offsetExists( $offset ) { |
79 | - return isset( $this->entry[$offset] ); |
|
79 | + return isset( $this->entry[ $offset ] ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return mixed The value of the requested entry data. |
92 | 92 | */ |
93 | 93 | public function offsetGet( $offset ) { |
94 | - return $this->entry[$offset]; |
|
94 | + return $this->entry[ $offset ]; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | |
8 | 8 | function __construct() { |
9 | 9 | |
10 | - add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 ); |
|
10 | + add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 ); |
|
11 | 11 | |
12 | - add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
|
12 | + add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 ); |
|
13 | 13 | |
14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
15 | 15 | add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' ); |
35 | 35 | } |
36 | 36 | |
37 | - $panels[] = new GravityView_Debug_Bar; |
|
37 | + $panels[ ] = new GravityView_Debug_Bar; |
|
38 | 38 | |
39 | 39 | return $panels; |
40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param array $supported_plugins List of plugins |
45 | 45 | */ |
46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
47 | + $supported_plugins[ 'gravityview' ] = 'GravityView'; |
|
48 | 48 | return $supported_plugins; |
49 | 49 | } |
50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return string "print_r" or "var_export" |
73 | 73 | */ |
74 | 74 | static function get_print_function() { |
75 | - if( ob_get_level() > 0 ) { |
|
75 | + if ( ob_get_level() > 0 ) { |
|
76 | 76 | $function = 'var_export'; |
77 | 77 | } else { |
78 | 78 | $function = 'print_r'; |
@@ -90,17 +90,17 @@ discard block |
||
90 | 90 | 'data' => $data, |
91 | 91 | ); |
92 | 92 | |
93 | - if( !in_array( $notice, self::$notices ) ) { |
|
94 | - self::$notices[] = $notice; |
|
93 | + if ( ! in_array( $notice, self::$notices ) ) { |
|
94 | + self::$notices[ ] = $notice; |
|
95 | 95 | } |
96 | 96 | |
97 | - if ( class_exists("GFLogging") ) { |
|
97 | + if ( class_exists( "GFLogging" ) ) { |
|
98 | 98 | GFLogging::include_logger(); |
99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG ); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - static function log_error( $message = '', $data = null ) { |
|
103 | + static function log_error( $message = '', $data = null ) { |
|
104 | 104 | |
105 | 105 | $function = self::get_print_function(); |
106 | 106 | |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | 'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '', |
111 | 111 | ); |
112 | 112 | |
113 | - if( !in_array( $error, self::$errors ) ) { |
|
114 | - self::$errors[] = $error; |
|
113 | + if ( ! in_array( $error, self::$errors ) ) { |
|
114 | + self::$errors[ ] = $error; |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( class_exists("GFLogging") ) { |
|
117 | + if ( class_exists( "GFLogging" ) ) { |
|
118 | 118 | GFLogging::include_logger(); |
119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
119 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR ); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return GravityView_Compatibility |
77 | 77 | */ |
78 | 78 | public static function getInstance() { |
79 | - if( self::$instance ) { |
|
79 | + if ( self::$instance ) { |
|
80 | 80 | return self::$instance; |
81 | 81 | } |
82 | 82 | return new self; |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | // If Gravity Forms doesn't exist or is outdated, load the admin view class to |
155 | 155 | // show the notice, but not load any post types or process shortcodes. |
156 | 156 | // Without Gravity Forms, there is no GravityView. Beautiful, really. |
157 | - if( ! self::is_valid() ) { |
|
157 | + if ( ! self::is_valid() ) { |
|
158 | 158 | |
159 | 159 | // If the plugin's not loaded, might as well hide the shortcode for people. |
160 | - add_shortcode( 'gravityview', array( $this, '_shortcode_gf_notice') ); |
|
160 | + add_shortcode( 'gravityview', array( $this, '_shortcode_gf_notice' ) ); |
|
161 | 161 | |
162 | 162 | } |
163 | 163 | } |
@@ -183,15 +183,15 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function _shortcode_gf_notice( $atts = array(), $content = null, $shortcode = 'gravityview' ) { |
185 | 185 | |
186 | - if( ! GVCommon::has_cap( 'activate_plugins' ) ) { |
|
186 | + if ( ! GVCommon::has_cap( 'activate_plugins' ) ) { |
|
187 | 187 | return null; |
188 | 188 | } |
189 | 189 | |
190 | 190 | $notices = self::get_notices(); |
191 | 191 | |
192 | - $message = '<div style="border:1px solid red; padding: 15px;"><p style="text-align:center;"><em>' . esc_html__( 'You are seeing this notice because you are an administrator. Other users of the site will see nothing.', 'gravityview') . '</em></p>'; |
|
193 | - foreach( (array)$notices as $notice ) { |
|
194 | - $message .= wpautop( $notice['message'] ); |
|
192 | + $message = '<div style="border:1px solid red; padding: 15px;"><p style="text-align:center;"><em>' . esc_html__( 'You are seeing this notice because you are an administrator. Other users of the site will see nothing.', 'gravityview' ) . '</em></p>'; |
|
193 | + foreach ( (array)$notices as $notice ) { |
|
194 | + $message .= wpautop( $notice[ 'message' ] ); |
|
195 | 195 | } |
196 | 196 | $message .= '</div>'; |
197 | 197 | |
@@ -211,12 +211,12 @@ discard block |
||
211 | 211 | |
212 | 212 | if ( |
213 | 213 | ( defined( 'GRAVITYVIEW_FUTURE_CORE_LOADED' ) && ! gravityview()->plugin->is_compatible_php() ) |
214 | - || ( false === version_compare( phpversion(), GV_MIN_PHP_VERSION , '>=' ) ) |
|
214 | + || ( false === version_compare( phpversion(), GV_MIN_PHP_VERSION, '>=' ) ) |
|
215 | 215 | ) { |
216 | 216 | |
217 | - self::$notices['php_version'] = array( |
|
217 | + self::$notices[ 'php_version' ] = array( |
|
218 | 218 | 'class' => 'error', |
219 | - 'message' => sprintf( __( "%sGravityView requires PHP Version %s or newer.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ), '<h3>', GV_MIN_PHP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.phpversion().'</span>' ), |
|
219 | + 'message' => sprintf( __( "%sGravityView requires PHP Version %s or newer.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ), '<h3>', GV_MIN_PHP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">' . phpversion() . '</span>' ), |
|
220 | 220 | 'cap' => 'manage_options', |
221 | 221 | 'dismiss' => 'php_version', |
222 | 222 | ); |
@@ -224,14 +224,14 @@ discard block |
||
224 | 224 | return false; |
225 | 225 | } |
226 | 226 | |
227 | - if( false === version_compare( phpversion(), GV_FUTURE_MIN_PHP_VERSION , '>=' ) ) { |
|
227 | + if ( false === version_compare( phpversion(), GV_FUTURE_MIN_PHP_VERSION, '>=' ) ) { |
|
228 | 228 | |
229 | 229 | // Show the notice on every update. Yes, annoying, but not as annoying as a plugin breaking. |
230 | - $key = sprintf('php_%s_%s', GV_FUTURE_MIN_PHP_VERSION, GravityView_Plugin::version ); |
|
230 | + $key = sprintf( 'php_%s_%s', GV_FUTURE_MIN_PHP_VERSION, GravityView_Plugin::version ); |
|
231 | 231 | |
232 | 232 | self::$notices[ $key ] = array( |
233 | 233 | 'class' => 'error', |
234 | - 'message' => sprintf( __( "%sGravityView will soon require PHP Version %s.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ), '<h3>', GV_FUTURE_MIN_PHP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.phpversion().'</span>' ), |
|
234 | + 'message' => sprintf( __( "%sGravityView will soon require PHP Version %s.%s \n\nYou're using Version %s. Please ask your host to upgrade your server's PHP.", 'gravityview' ), '<h3>', GV_FUTURE_MIN_PHP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">' . phpversion() . '</span>' ), |
|
235 | 235 | 'cap' => 'manage_options', |
236 | 236 | 'dismiss' => $key, |
237 | 237 | ); |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | || ( false === version_compare( $wp_version, GV_MIN_WP_VERSION, '>=' ) ) |
256 | 256 | ) { |
257 | 257 | |
258 | - self::$notices['wp_version'] = array( |
|
258 | + self::$notices[ 'wp_version' ] = array( |
|
259 | 259 | 'class' => 'error', |
260 | - 'message' => sprintf( __( "%sGravityView requires WordPress %s or newer.%s \n\nYou're using Version %s. Please upgrade your WordPress installation.", 'gravityview' ), '<h3>', GV_MIN_WP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.$wp_version.'</span>' ), |
|
260 | + 'message' => sprintf( __( "%sGravityView requires WordPress %s or newer.%s \n\nYou're using Version %s. Please upgrade your WordPress installation.", 'gravityview' ), '<h3>', GV_MIN_WP_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">' . $wp_version . '</span>' ), |
|
261 | 261 | 'cap' => 'update_core', |
262 | 262 | 'dismiss' => 'wp_version', |
263 | 263 | ); |
@@ -280,10 +280,10 @@ discard block |
||
280 | 280 | public static function check_gravityforms() { |
281 | 281 | |
282 | 282 | // Bypass other checks: if the class exists |
283 | - if( class_exists( 'GFCommon' ) ) { |
|
283 | + if ( class_exists( 'GFCommon' ) ) { |
|
284 | 284 | |
285 | 285 | // Does the version meet future requirements? |
286 | - if( true === version_compare( GFCommon::$version, GV_FUTURE_MIN_GF_VERSION, ">=" ) ) { |
|
286 | + if ( true === version_compare( GFCommon::$version, GV_FUTURE_MIN_GF_VERSION, ">=" ) ) { |
|
287 | 287 | return true; |
288 | 288 | } |
289 | 289 | |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | $class = $meets_minimum ? 'notice-warning' : 'error'; |
298 | 298 | |
299 | 299 | // Show the notice even if the future version requirements aren't met |
300 | - self::$notices['gf_version'] = array( |
|
300 | + self::$notices[ 'gf_version' ] = array( |
|
301 | 301 | 'class' => $class, |
302 | - 'message' => sprintf( __( "%sGravityView requires Gravity Forms Version %s or newer.%s \n\nYou're using Version %s. Please update your Gravity Forms or purchase a license. %sGet Gravity Forms%s - starting at $39%s%s", 'gravityview' ), '<h3>', GV_FUTURE_MIN_GF_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">'.GFCommon::$version.'</span>', "\n\n".'<a href="https://gravityview.co/gravityforms/" class="button button-secondary button-large button-hero">' , '<em>', '</em>', '</a>'), |
|
302 | + 'message' => sprintf( __( "%sGravityView requires Gravity Forms Version %s or newer.%s \n\nYou're using Version %s. Please update your Gravity Forms or purchase a license. %sGet Gravity Forms%s - starting at $39%s%s", 'gravityview' ), '<h3>', GV_FUTURE_MIN_GF_VERSION, "</h3>\n\n", '<span style="font-family: Consolas, Courier, monospace;">' . GFCommon::$version . '</span>', "\n\n" . '<a href="https://gravityview.co/gravityforms/" class="button button-secondary button-large button-hero">', '<em>', '</em>', '</a>' ), |
|
303 | 303 | 'cap' => 'update_plugins', |
304 | 304 | 'dismiss' => 'gf_version_' . GV_FUTURE_MIN_GF_VERSION, |
305 | 305 | ); |
@@ -315,42 +315,42 @@ discard block |
||
315 | 315 | * OR |
316 | 316 | * It's the Network Admin and we just don't know whether the sites have GF activated themselves. |
317 | 317 | */ |
318 | - if( true === $gf_status || is_network_admin() ) { |
|
318 | + if ( true === $gf_status || is_network_admin() ) { |
|
319 | 319 | return true; |
320 | 320 | } |
321 | 321 | |
322 | 322 | // If GFCommon doesn't exist, assume GF not active |
323 | 323 | $return = false; |
324 | 324 | |
325 | - switch( $gf_status ) { |
|
325 | + switch ( $gf_status ) { |
|
326 | 326 | case 'inactive': |
327 | 327 | |
328 | 328 | // Required for multisite |
329 | - if( ! function_exists('wp_create_nonce') ) { |
|
329 | + if ( ! function_exists( 'wp_create_nonce' ) ) { |
|
330 | 330 | require_once ABSPATH . WPINC . '/pluggable.php'; |
331 | 331 | } |
332 | 332 | |
333 | 333 | // Otherwise, throws an error on activation & deactivation "Use of undefined constant LOGGED_IN_COOKIE" |
334 | - if( is_multisite() ) { |
|
334 | + if ( is_multisite() ) { |
|
335 | 335 | wp_cookie_constants(); |
336 | 336 | } |
337 | 337 | |
338 | 338 | $return = false; |
339 | 339 | |
340 | - $button = function_exists('is_network_admin') && is_network_admin() ? '<strong><a href="#gravity-forms">' : '<strong><a href="'. wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=gravityforms/gravityforms.php' ), 'activate-plugin_gravityforms/gravityforms.php') . '" class="button button-large">'; |
|
340 | + $button = function_exists( 'is_network_admin' ) && is_network_admin() ? '<strong><a href="#gravity-forms">' : '<strong><a href="' . wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=gravityforms/gravityforms.php' ), 'activate-plugin_gravityforms/gravityforms.php' ) . '" class="button button-large">'; |
|
341 | 341 | |
342 | - self::$notices['gf_inactive'] = array( |
|
342 | + self::$notices[ 'gf_inactive' ] = array( |
|
343 | 343 | 'class' => 'error', |
344 | - 'message' => sprintf( __( '%sGravityView requires Gravity Forms to be active. %sActivate Gravity Forms%s to use the GravityView plugin.', 'gravityview' ), '<h3>', "</h3>\n\n". $button, '</a></strong>' ), |
|
344 | + 'message' => sprintf( __( '%sGravityView requires Gravity Forms to be active. %sActivate Gravity Forms%s to use the GravityView plugin.', 'gravityview' ), '<h3>', "</h3>\n\n" . $button, '</a></strong>' ), |
|
345 | 345 | 'cap' => 'activate_plugins', |
346 | 346 | 'dismiss' => 'gf_inactive', |
347 | 347 | ); |
348 | 348 | |
349 | 349 | break; |
350 | 350 | default: |
351 | - self::$notices['gf_installed'] = array( |
|
351 | + self::$notices[ 'gf_installed' ] = array( |
|
352 | 352 | 'class' => 'error', |
353 | - 'message' => sprintf( __( '%sGravityView requires Gravity Forms to be installed in order to run properly. %sGet Gravity Forms%s - starting at $39%s%s', 'gravityview' ), '<h3>', "</h3>\n\n".'<a href="http://katz.si/gravityforms" class="button button-secondary button-large button-hero">' , '<em>', '</em>', '</a>'), |
|
353 | + 'message' => sprintf( __( '%sGravityView requires Gravity Forms to be installed in order to run properly. %sGet Gravity Forms%s - starting at $39%s%s', 'gravityview' ), '<h3>', "</h3>\n\n" . '<a href="http://katz.si/gravityforms" class="button button-secondary button-large button-hero">', '<em>', '</em>', '</a>' ), |
|
354 | 354 | 'cap' => 'install_plugins', |
355 | 355 | 'dismiss' => 'gf_installed', |
356 | 356 | ); |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | */ |
368 | 368 | private static function check_gf_directory() { |
369 | 369 | |
370 | - if( class_exists( 'GFDirectory' ) ) { |
|
371 | - self::$notices['gf_directory'] = array( |
|
370 | + if ( class_exists( 'GFDirectory' ) ) { |
|
371 | + self::$notices[ 'gf_directory' ] = array( |
|
372 | 372 | 'class' => 'error is-dismissible', |
373 | - 'title' => __('Potential Conflict', 'gravityview' ), |
|
373 | + 'title' => __( 'Potential Conflict', 'gravityview' ), |
|
374 | 374 | 'message' => __( 'GravityView and Gravity Forms Directory are both active. This may cause problems. If you experience issues, disable the Gravity Forms Directory plugin.', 'gravityview' ), |
375 | 375 | 'dismiss' => 'gf_directory', |
376 | 376 | 'cap' => 'activate_plugins', |
@@ -389,21 +389,21 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public static function get_plugin_status( $location = '' ) { |
391 | 391 | |
392 | - if( ! function_exists('is_plugin_active') ) { |
|
392 | + if ( ! function_exists( 'is_plugin_active' ) ) { |
|
393 | 393 | include_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
394 | 394 | } |
395 | 395 | |
396 | - if( is_network_admin() && is_plugin_active_for_network( $location ) ) { |
|
396 | + if ( is_network_admin() && is_plugin_active_for_network( $location ) ) { |
|
397 | 397 | return true; |
398 | 398 | } |
399 | 399 | |
400 | - if( !is_network_admin() && is_plugin_active( $location ) ) { |
|
400 | + if ( ! is_network_admin() && is_plugin_active( $location ) ) { |
|
401 | 401 | return true; |
402 | 402 | } |
403 | 403 | |
404 | - if( |
|
405 | - !file_exists( trailingslashit( WP_PLUGIN_DIR ) . $location ) && |
|
406 | - !file_exists( trailingslashit( WPMU_PLUGIN_DIR ) . $location ) |
|
404 | + if ( |
|
405 | + ! file_exists( trailingslashit( WP_PLUGIN_DIR ) . $location ) && |
|
406 | + ! file_exists( trailingslashit( WPMU_PLUGIN_DIR ) . $location ) |
|
407 | 407 | ) { |
408 | 408 | return false; |
409 | 409 | } |
@@ -11,10 +11,10 @@ |
||
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div class="gv-search-box gv-search-date"> |
14 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
16 | 16 | <?php } ?> |
17 | 17 | <p> |
18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
19 | 19 | </p> |
20 | 20 | </div> |
21 | 21 | \ No newline at end of file |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
14 | - do_action('gravityview_log_debug', 'search-field-multiselect.php - No choices for field' ); |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | + do_action( 'gravityview_log_debug', 'search-field-multiselect.php - No choices for field' ); |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | * @param string $default_option Default: `—` (—) |
22 | 22 | * @param string $field_type Field type: "select" or "multiselect" |
23 | 23 | */ |
24 | -$default_option = apply_filters('gravityview/extension/search/select_default', '—', 'multiselect' ); |
|
24 | +$default_option = apply_filters( 'gravityview/extension/search/select_default', '—', 'multiselect' ); |
|
25 | 25 | |
26 | 26 | ?> |
27 | 27 | <div class="gv-search-box gv-search-field-multiselect"> |
28 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
29 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
28 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
29 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
30 | 30 | <?php } ?> |
31 | 31 | <p> |
32 | - <select name="<?php echo esc_attr( $search_field['name'] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" multiple> |
|
33 | - <option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
32 | + <select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>[]" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" multiple> |
|
33 | + <option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
34 | 34 | <?php |
35 | - foreach( $search_field['choices'] as $choice ) : ?> |
|
36 | - <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( $choice['value'], $search_field['value'], true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
35 | + foreach ( $search_field[ 'choices' ] as $choice ) : ?> |
|
36 | + <option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( $choice[ 'value' ], $search_field[ 'value' ], true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
37 | 37 | <?php endforeach; ?> |
38 | 38 | </select> |
39 | 39 | </p> |
@@ -7,17 +7,17 @@ |
||
7 | 7 | |
8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
9 | 9 | $view_id = $gravityview_view->getViewId(); |
10 | -$value = $gravityview_view->search_field['value']; |
|
11 | -$label = $gravityview_view->search_field['label']; |
|
10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date"> |
16 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
16 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
17 | 17 | <label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
18 | 18 | <?php } ?> |
19 | 19 | <p> |
20 | - <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>"> |
|
21 | - <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>"> |
|
20 | + <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>"> |
|
21 | + <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>"> |
|
22 | 22 | </p> |
23 | 23 | </div> |
24 | 24 | \ No newline at end of file |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
14 | - do_action('gravityview_log_debug', 'search-field-select.php - No choices for field' ); |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | + do_action( 'gravityview_log_debug', 'search-field-select.php - No choices for field' ); |
|
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
@@ -21,19 +21,19 @@ discard block |
||
21 | 21 | * @param string $default_option Default: `—` (—) |
22 | 22 | * @param string $field_type Field type: "select" or "multiselect" |
23 | 23 | */ |
24 | -$default_option = apply_filters('gravityview/extension/search/select_default', '—', 'select' ); |
|
24 | +$default_option = apply_filters( 'gravityview/extension/search/select_default', '—', 'select' ); |
|
25 | 25 | |
26 | 26 | ?> |
27 | 27 | <div class="gv-search-box gv-search-field-select"> |
28 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
29 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
28 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
29 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
30 | 30 | <?php } ?> |
31 | 31 | <p> |
32 | - <select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"> |
|
33 | - <option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
32 | + <select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"> |
|
33 | + <option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
34 | 34 | <?php |
35 | - foreach( $search_field['choices'] as $choice ) : ?> |
|
36 | - <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $search_field['value'] ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
35 | + foreach ( $search_field[ 'choices' ] as $choice ) : ?> |
|
36 | + <option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $search_field[ 'value' ] ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
37 | 37 | <?php endforeach; ?> |
38 | 38 | </select> |
39 | 39 | </p> |