@@ -69,7 +69,7 @@ |
||
69 | 69 | * |
70 | 70 | * @since 1.16 |
71 | 71 | * |
72 | - * @param int|string $value Number value for the field |
|
72 | + * @param string $value Number value for the field |
|
73 | 73 | * |
74 | 74 | * @return string Based on $value; `1`: "One-Time Payment"; `2`: "Subscription" |
75 | 75 | */ |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function get_content( $output, $entry, $field_settings, $field ) { |
60 | 60 | |
61 | 61 | /** Overridden by a template. */ |
62 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
62 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
63 | 63 | |
64 | 64 | return $this->get_string_from_value( $output ); |
65 | 65 | } |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | switch ( intval( $value ) ) { |
79 | 79 | case self::ONE_TIME_PAYMENT: |
80 | 80 | default: |
81 | - $return = __('One-Time Payment', 'gravityview'); |
|
81 | + $return = __( 'One-Time Payment', 'gravityview' ); |
|
82 | 82 | break; |
83 | 83 | |
84 | 84 | case self::SUBSCRIPTION: |
85 | - $return = __('Subscription', 'gravityview'); |
|
85 | + $return = __( 'Subscription', 'gravityview' ); |
|
86 | 86 | break; |
87 | 87 | } |
88 | 88 |
@@ -135,7 +135,7 @@ |
||
135 | 135 | * @param bool $url_encode Whether to URL-encode output |
136 | 136 | * @param bool $esc_html Whether to apply `esc_html()` to output |
137 | 137 | * |
138 | - * @return mixed |
|
138 | + * @return string |
|
139 | 139 | */ |
140 | 140 | public static function replace_gv_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
141 | 141 |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | add_filter( 'gravityview/sortable/field_blacklist', array( $this, '_filter_sortable_fields' ), 1 ); |
111 | 111 | |
112 | - if( $this->_custom_merge_tag ) { |
|
112 | + if ( $this->_custom_merge_tag ) { |
|
113 | 113 | add_filter( 'gform_custom_merge_tags', array( $this, '_filter_gform_custom_merge_tags' ), 10, 4 ); |
114 | 114 | add_filter( 'gform_replace_merge_tags', array( $this, '_filter_gform_replace_merge_tags' ), 10, 7 ); |
115 | 115 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @return string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text. |
133 | 133 | */ |
134 | - public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
134 | + public function _filter_gform_replace_merge_tags( $text, $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * This prevents the gform_replace_merge_tags filter from being called twice, as defined in: |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @see GFCommon::replace_variables_prepopulate() |
140 | 140 | * @todo Remove eventually: Gravity Forms fixed this issue in 1.9.14 |
141 | 141 | */ |
142 | - if( false === $form ) { |
|
142 | + if ( false === $form ) { |
|
143 | 143 | return $text; |
144 | 144 | } |
145 | 145 | |
@@ -172,19 +172,19 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
174 | 174 | |
175 | - foreach( $matches as $match ) { |
|
175 | + foreach ( $matches as $match ) { |
|
176 | 176 | |
177 | - $full_tag = $match[0]; |
|
177 | + $full_tag = $match[ 0 ]; |
|
178 | 178 | |
179 | 179 | // Strip the Merge Tags |
180 | - $tag = str_replace( array( '{', '}'), '', $full_tag ); |
|
180 | + $tag = str_replace( array( '{', '}' ), '', $full_tag ); |
|
181 | 181 | |
182 | 182 | // Replace the value from the entry, if exists |
183 | - if( isset( $entry[ $tag ] ) ) { |
|
183 | + if ( isset( $entry[ $tag ] ) ) { |
|
184 | 184 | |
185 | 185 | $value = $entry[ $tag ]; |
186 | 186 | |
187 | - if( is_callable( array( $this, 'get_content') ) ) { |
|
187 | + if ( is_callable( array( $this, 'get_content' ) ) ) { |
|
188 | 188 | $value = $this->get_content( $value ); |
189 | 189 | } |
190 | 190 | |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function _filter_sortable_fields( $not_sortable ) { |
259 | 259 | |
260 | - if( ! $this->is_sortable ) { |
|
261 | - $not_sortable[] = $this->name; |
|
260 | + if ( ! $this->is_sortable ) { |
|
261 | + $not_sortable[ ] = $this->name; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | return $not_sortable; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | 'date_display' => array( |
288 | 288 | 'type' => 'text', |
289 | 289 | 'label' => __( 'Override Date Format', 'gravityview' ), |
290 | - 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview'), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ), |
|
290 | + 'desc' => sprintf( __( 'Define how the date is displayed (using %sthe PHP date format%s)', 'gravityview' ), '<a href="https://codex.wordpress.org/Formatting_Date_and_Time">', '</a>' ), |
|
291 | 291 | /** |
292 | 292 | * @filter `gravityview_date_format` Override the date format with a [PHP date format](https://codex.wordpress.org/Formatting_Date_and_Time) |
293 | 293 | * @param[in,out] null|string $date_format Date Format (default: null) |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | $options = $this->field_support_options(); |
314 | 314 | |
315 | - if( isset( $options[ $key ] ) ) { |
|
315 | + if ( isset( $options[ $key ] ) ) { |
|
316 | 316 | $field_options[ $key ] = $options[ $key ]; |
317 | 317 | } |
318 | 318 | |
@@ -376,11 +376,11 @@ discard block |
||
376 | 376 | $connected_form = rgpost( 'form_id' ); |
377 | 377 | |
378 | 378 | // Otherwise, get the Form ID from the Post page |
379 | - if( empty( $connected_form ) ) { |
|
379 | + if ( empty( $connected_form ) ) { |
|
380 | 380 | $connected_form = gravityview_get_form_id( get_the_ID() ); |
381 | 381 | } |
382 | 382 | |
383 | - if( empty( $connected_form ) ) { |
|
383 | + if ( empty( $connected_form ) ) { |
|
384 | 384 | do_action( 'gravityview_log_error', sprintf( '%s: Form not found for form ID "%s"', __METHOD__, $connected_form ) ); |
385 | 385 | return false; |
386 | 386 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | $delete = $this->get_delete_setting(); |
36 | 36 | |
37 | - if( GravityView_Roles_Capabilities::has_cap( 'gravityview_uninstall' ) && 'delete' === $delete ) { |
|
37 | + if ( GravityView_Roles_Capabilities::has_cap( 'gravityview_uninstall' ) && 'delete' === $delete ) { |
|
38 | 38 | $this->fire_everything(); |
39 | 39 | } |
40 | 40 | } |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | $notes_table = class_exists( 'GFFormsModel' ) ? GFFormsModel::get_lead_notes_table_name() : $wpdb->prefix . 'rg_lead_notes'; |
99 | 99 | |
100 | - $disapproved = __('Disapproved the Entry for GravityView', 'gravityview'); |
|
101 | - $approved = __('Approved the Entry for GravityView', 'gravityview'); |
|
100 | + $disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' ); |
|
101 | + $approved = __( 'Approved the Entry for GravityView', 'gravityview' ); |
|
102 | 102 | |
103 | 103 | $sql = $wpdb->prepare( " |
104 | 104 | DELETE FROM $notes_table |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | $this->context_view_id = $_GET['gvid']; |
243 | 243 | |
244 | - } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
244 | + } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
245 | 245 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
246 | 246 | $this->context_view_id = array_pop( $array_keys ); |
247 | 247 | unset( $array_keys ); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | global $post; |
270 | 270 | |
271 | 271 | // If in admin and NOT AJAX request, get outta here. |
272 | - if ( GravityView_Plugin::is_admin() ) { |
|
272 | + if ( GravityView_Plugin::is_admin() ) { |
|
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | } |
373 | 373 | |
374 | 374 | // User reported WooCommerce doesn't pass two args. |
375 | - if ( empty( $passed_post_id ) ) { |
|
375 | + if ( empty( $passed_post_id ) ) { |
|
376 | 376 | return $title; |
377 | 377 | } |
378 | 378 | |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | */ |
1109 | 1109 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
1110 | 1110 | |
1111 | - switch( strtolower( $address_part ) ){ |
|
1111 | + switch( strtolower( $address_part ) ) { |
|
1112 | 1112 | case 'street': |
1113 | 1113 | $sort_field_id .= '.1'; |
1114 | 1114 | break; |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | */ |
1189 | 1189 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
1190 | 1190 | |
1191 | - if ( empty( $single_entry ) ){ |
|
1191 | + if ( empty( $single_entry ) ) { |
|
1192 | 1192 | return false; |
1193 | 1193 | } else { |
1194 | 1194 | return $single_entry; |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | private function __construct() {} |
86 | 86 | |
87 | 87 | private function initialize() { |
88 | - add_action( 'wp', array( $this, 'parse_content'), 11 ); |
|
89 | - add_action( 'template_redirect', array( $this, 'set_entry_data'), 1 ); |
|
88 | + add_action( 'wp', array( $this, 'parse_content' ), 11 ); |
|
89 | + add_action( 'template_redirect', array( $this, 'set_entry_data' ), 1 ); |
|
90 | 90 | |
91 | 91 | // Enqueue scripts and styles after GravityView_Template::register_styles() |
92 | 92 | add_action( 'wp_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 20 ); |
@@ -233,15 +233,15 @@ discard block |
||
233 | 233 | |
234 | 234 | $this->context_view_id = $view_id; |
235 | 235 | |
236 | - } elseif ( isset( $_GET['gvid'] ) && $this->getGvOutputData()->has_multiple_views() ) { |
|
236 | + } elseif ( isset( $_GET[ 'gvid' ] ) && $this->getGvOutputData()->has_multiple_views() ) { |
|
237 | 237 | /** |
238 | 238 | * used on a has_multiple_views context |
239 | 239 | * @see GravityView_API::entry_link |
240 | 240 | * @see GravityView_View_Data::getInstance()->has_multiple_views() |
241 | 241 | */ |
242 | - $this->context_view_id = $_GET['gvid']; |
|
242 | + $this->context_view_id = $_GET[ 'gvid' ]; |
|
243 | 243 | |
244 | - } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
244 | + } elseif ( ! $this->getGvOutputData()->has_multiple_views() ) { |
|
245 | 245 | $array_keys = array_keys( $this->getGvOutputData()->get_views() ); |
246 | 246 | $this->context_view_id = array_pop( $array_keys ); |
247 | 247 | unset( $array_keys ); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | global $post; |
270 | 270 | |
271 | 271 | // If in admin and NOT AJAX request, get outta here. |
272 | - if ( GravityView_Plugin::is_admin() ) { |
|
272 | + if ( GravityView_Plugin::is_admin() ) { |
|
273 | 273 | return; |
274 | 274 | } |
275 | 275 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | |
282 | 282 | $this->setIsGravityviewPostType( get_post_type( $post ) === 'gravityview' ); |
283 | 283 | |
284 | - $post_id = $this->getPostId() ? $this->getPostId() : (isset( $post ) ? $post->ID : null ); |
|
284 | + $post_id = $this->getPostId() ? $this->getPostId() : ( isset( $post ) ? $post->ID : null ); |
|
285 | 285 | $this->setPostId( $post_id ); |
286 | 286 | $post_has_shortcode = ! empty( $post->post_content ) ? gravityview_has_shortcode_r( $post->post_content, 'gravityview' ) : false; |
287 | 287 | $this->setPostHasShortcode( $this->isGravityviewPostType() ? null : ! empty( $post_has_shortcode ) ); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | $search_method = GravityView_Widget_Search::getInstance()->get_search_method(); |
319 | 319 | |
320 | - if( 'post' === $search_method ) { |
|
320 | + if ( 'post' === $search_method ) { |
|
321 | 321 | $get = $_POST; |
322 | 322 | } else { |
323 | 323 | $get = $_GET; |
@@ -373,20 +373,20 @@ discard block |
||
373 | 373 | * @param boolean $in_the_loop Whether to apply the filter to the menu title and the meta tag <title> - outside the loop |
374 | 374 | * @param array $entry Current entry |
375 | 375 | */ |
376 | - $apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop' , in_the_loop(), $entry ); |
|
376 | + $apply_outside_loop = apply_filters( 'gravityview/single/title/out_loop', in_the_loop(), $entry ); |
|
377 | 377 | |
378 | 378 | if ( ! $apply_outside_loop ) { |
379 | 379 | return $title; |
380 | 380 | } |
381 | 381 | |
382 | 382 | // User reported WooCommerce doesn't pass two args. |
383 | - if ( empty( $passed_post_id ) ) { |
|
383 | + if ( empty( $passed_post_id ) ) { |
|
384 | 384 | return $title; |
385 | 385 | } |
386 | 386 | |
387 | 387 | // Don't modify the title for anything other than the current view/post. |
388 | 388 | // This is true for embedded shortcodes and Views. |
389 | - if ( is_object( $post ) && (int) $post->ID !== (int) $passed_post_id ) { |
|
389 | + if ( is_object( $post ) && (int)$post->ID !== (int)$passed_post_id ) { |
|
390 | 390 | return $title; |
391 | 391 | } |
392 | 392 | |
@@ -396,19 +396,19 @@ discard block |
||
396 | 396 | $view_meta = $this->getGvOutputData()->get_view( $context_view_id ); |
397 | 397 | } else { |
398 | 398 | foreach ( $this->getGvOutputData()->get_views() as $view_id => $view_data ) { |
399 | - if ( intval( $view_data['form_id'] ) === intval( $entry['form_id'] ) ) { |
|
399 | + if ( intval( $view_data[ 'form_id' ] ) === intval( $entry[ 'form_id' ] ) ) { |
|
400 | 400 | $view_meta = $view_data; |
401 | 401 | break; |
402 | 402 | } |
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
406 | - if ( ! empty( $view_meta['atts']['single_title'] ) ) { |
|
406 | + if ( ! empty( $view_meta[ 'atts' ][ 'single_title' ] ) ) { |
|
407 | 407 | |
408 | - $title = $view_meta['atts']['single_title']; |
|
408 | + $title = $view_meta[ 'atts' ][ 'single_title' ]; |
|
409 | 409 | |
410 | 410 | // We are allowing HTML in the fields, so no escaping the output |
411 | - $title = GravityView_API::replace_variables( $title, $view_meta['form'], $entry ); |
|
411 | + $title = GravityView_API::replace_variables( $title, $view_meta[ 'form' ], $entry ); |
|
412 | 412 | |
413 | 413 | $title = do_shortcode( $title ); |
414 | 414 | } |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | public function render_view( $passed_args ) { |
510 | 510 | |
511 | 511 | // validate attributes |
512 | - if ( empty( $passed_args['id'] ) ) { |
|
512 | + if ( empty( $passed_args[ 'id' ] ) ) { |
|
513 | 513 | do_action( 'gravityview_log_error', '[render_view] Returning; no ID defined.', $passed_args ); |
514 | 514 | return null; |
515 | 515 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | return null; |
532 | 532 | } |
533 | 533 | |
534 | - $view_id = $passed_args['id']; |
|
534 | + $view_id = $passed_args[ 'id' ]; |
|
535 | 535 | |
536 | 536 | $view_data = $this->getGvOutputData()->get_view( $view_id, $passed_args ); |
537 | 537 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $passed_args = array_filter( $passed_args, 'strlen' ); |
545 | 545 | |
546 | 546 | //Override shortcode args over View template settings |
547 | - $atts = wp_parse_args( $passed_args, $view_data['atts'] ); |
|
547 | + $atts = wp_parse_args( $passed_args, $view_data[ 'atts' ] ); |
|
548 | 548 | |
549 | 549 | do_action( 'gravityview_log_debug', '[render_view] Arguments after merging with View settings: ', $atts ); |
550 | 550 | |
@@ -566,11 +566,11 @@ discard block |
||
566 | 566 | * Don't render View if user isn't allowed to see it |
567 | 567 | * @since 1.15 |
568 | 568 | */ |
569 | - if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
569 | + if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
570 | 570 | return null; |
571 | 571 | } |
572 | 572 | |
573 | - if( $this->isGravityviewPostType() ) { |
|
573 | + if ( $this->isGravityviewPostType() ) { |
|
574 | 574 | |
575 | 575 | /** |
576 | 576 | * @filter `gravityview_direct_access` Should Views be directly accessible, or only visible using the shortcode? |
@@ -582,9 +582,9 @@ discard block |
||
582 | 582 | */ |
583 | 583 | $direct_access = apply_filters( 'gravityview_direct_access', true, $view_id ); |
584 | 584 | |
585 | - $embed_only = ! empty( $atts['embed_only'] ); |
|
585 | + $embed_only = ! empty( $atts[ 'embed_only' ] ); |
|
586 | 586 | |
587 | - if( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) { |
|
587 | + if ( ! $direct_access || ( $embed_only && ! GVCommon::has_cap( 'read_private_gravityviews' ) ) ) { |
|
588 | 588 | return __( 'You are not allowed to view this content.', 'gravityview' ); |
589 | 589 | } |
590 | 590 | } |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | |
600 | 600 | $gravityview_view = new GravityView_View( $view_data ); |
601 | 601 | |
602 | - $post_id = ! empty( $atts['post_id'] ) ? intval( $atts['post_id'] ) : $this->getPostId(); |
|
602 | + $post_id = ! empty( $atts[ 'post_id' ] ) ? intval( $atts[ 'post_id' ] ) : $this->getPostId(); |
|
603 | 603 | |
604 | 604 | $gravityview_view->setPostId( $post_id ); |
605 | 605 | |
@@ -609,20 +609,20 @@ discard block |
||
609 | 609 | do_action( 'gravityview_log_debug', '[render_view] Executing Directory View' ); |
610 | 610 | |
611 | 611 | //fetch template and slug |
612 | - $view_slug = apply_filters( 'gravityview_template_slug_'. $view_data['template_id'], 'table', 'directory' ); |
|
612 | + $view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'directory' ); |
|
613 | 613 | |
614 | 614 | do_action( 'gravityview_log_debug', '[render_view] View template slug: ', $view_slug ); |
615 | 615 | |
616 | 616 | /** |
617 | 617 | * Disable fetching initial entries for views that don't need it (DataTables) |
618 | 618 | */ |
619 | - $get_entries = apply_filters( 'gravityview_get_view_entries_'.$view_slug, true ); |
|
619 | + $get_entries = apply_filters( 'gravityview_get_view_entries_' . $view_slug, true ); |
|
620 | 620 | |
621 | 621 | /** |
622 | 622 | * Hide View data until search is performed |
623 | 623 | * @since 1.5.4 |
624 | 624 | */ |
625 | - if ( ! empty( $atts['hide_until_searched'] ) && ! $this->isSearch() ) { |
|
625 | + if ( ! empty( $atts[ 'hide_until_searched' ] ) && ! $this->isSearch() ) { |
|
626 | 626 | $gravityview_view->setHideUntilSearched( true ); |
627 | 627 | $get_entries = false; |
628 | 628 | } |
@@ -630,23 +630,23 @@ discard block |
||
630 | 630 | |
631 | 631 | if ( $get_entries ) { |
632 | 632 | |
633 | - if ( ! empty( $atts['sort_columns'] ) ) { |
|
633 | + if ( ! empty( $atts[ 'sort_columns' ] ) ) { |
|
634 | 634 | // add filter to enable column sorting |
635 | - add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ) , 100, 3 ); |
|
635 | + add_filter( 'gravityview/template/field_label', array( $this, 'add_columns_sort_links' ), 100, 3 ); |
|
636 | 636 | } |
637 | 637 | |
638 | - $view_entries = self::get_view_entries( $atts, $view_data['form_id'] ); |
|
638 | + $view_entries = self::get_view_entries( $atts, $view_data[ 'form_id' ] ); |
|
639 | 639 | |
640 | - do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries['count'], sizeof( $view_entries['entries'] ) ) ); |
|
640 | + do_action( 'gravityview_log_debug', sprintf( '[render_view] Get Entries. Found %s entries total, showing %d entries', $view_entries[ 'count' ], sizeof( $view_entries[ 'entries' ] ) ) ); |
|
641 | 641 | |
642 | 642 | } else { |
643 | 643 | |
644 | 644 | $view_entries = array( 'count' => null, 'entries' => null, 'paging' => null ); |
645 | 645 | |
646 | - do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_'.$view_slug.'` is false' ); |
|
646 | + do_action( 'gravityview_log_debug', '[render_view] Not fetching entries because `gravityview_get_view_entries_' . $view_slug . '` is false' ); |
|
647 | 647 | } |
648 | 648 | |
649 | - $gravityview_view->setPaging( $view_entries['paging'] ); |
|
649 | + $gravityview_view->setPaging( $view_entries[ 'paging' ] ); |
|
650 | 650 | $gravityview_view->setContext( 'directory' ); |
651 | 651 | $sections = array( 'header', 'body', 'footer' ); |
652 | 652 | |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | // user requested Single Entry View |
656 | 656 | do_action( 'gravityview_log_debug', '[render_view] Executing Single View' ); |
657 | 657 | |
658 | - do_action( 'gravityview_render_entry_'.$view_data['id'] ); |
|
658 | + do_action( 'gravityview_render_entry_' . $view_data[ 'id' ] ); |
|
659 | 659 | |
660 | 660 | $entry = $this->getEntry(); |
661 | 661 | |
@@ -682,20 +682,20 @@ discard block |
||
682 | 682 | // We're in single view, but the view being processed is not the same view the single entry belongs to. |
683 | 683 | // important: do not remove this as it prevents fake attempts of displaying entries from other views/forms |
684 | 684 | if ( $this->getGvOutputData()->has_multiple_views() && $view_id != $this->get_context_view_id() ) { |
685 | - do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: '. $view_id ); |
|
685 | + do_action( 'gravityview_log_debug', '[render_view] In single entry view, but the entry does not belong to this View. Perhaps there are multiple views on the page. View ID: ' . $view_id ); |
|
686 | 686 | return null; |
687 | 687 | } |
688 | 688 | |
689 | 689 | //fetch template and slug |
690 | - $view_slug = apply_filters( 'gravityview_template_slug_' . $view_data['template_id'], 'table', 'single' ); |
|
690 | + $view_slug = apply_filters( 'gravityview_template_slug_' . $view_data[ 'template_id' ], 'table', 'single' ); |
|
691 | 691 | do_action( 'gravityview_log_debug', '[render_view] View single template slug: ', $view_slug ); |
692 | 692 | |
693 | 693 | //fetch entry detail |
694 | - $view_entries['count'] = 1; |
|
695 | - $view_entries['entries'][] = $entry; |
|
696 | - do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries['entries'] ); |
|
694 | + $view_entries[ 'count' ] = 1; |
|
695 | + $view_entries[ 'entries' ][ ] = $entry; |
|
696 | + do_action( 'gravityview_log_debug', '[render_view] Get single entry: ', $view_entries[ 'entries' ] ); |
|
697 | 697 | |
698 | - $back_link_label = isset( $atts['back_link_label'] ) ? $atts['back_link_label'] : null; |
|
698 | + $back_link_label = isset( $atts[ 'back_link_label' ] ) ? $atts[ 'back_link_label' ] : null; |
|
699 | 699 | |
700 | 700 | // set back link label |
701 | 701 | $gravityview_view->setBackLinkLabel( $back_link_label ); |
@@ -705,11 +705,11 @@ discard block |
||
705 | 705 | } |
706 | 706 | |
707 | 707 | // add template style |
708 | - self::add_style( $view_data['template_id'] ); |
|
708 | + self::add_style( $view_data[ 'template_id' ] ); |
|
709 | 709 | |
710 | 710 | // Prepare to render view and set vars |
711 | - $gravityview_view->setEntries( $view_entries['entries'] ); |
|
712 | - $gravityview_view->setTotalEntries( $view_entries['count'] ); |
|
711 | + $gravityview_view->setEntries( $view_entries[ 'entries' ] ); |
|
712 | + $gravityview_view->setTotalEntries( $view_entries[ 'count' ] ); |
|
713 | 713 | |
714 | 714 | // If Edit |
715 | 715 | if ( 'edit' === gravityview_get_context() ) { |
@@ -722,11 +722,11 @@ discard block |
||
722 | 722 | |
723 | 723 | } else { |
724 | 724 | // finaly we'll render some html |
725 | - $sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data['template_id'] ); |
|
725 | + $sections = apply_filters( 'gravityview_render_view_sections', $sections, $view_data[ 'template_id' ] ); |
|
726 | 726 | |
727 | 727 | do_action( 'gravityview_log_debug', '[render_view] Sections to render: ', $sections ); |
728 | 728 | foreach ( $sections as $section ) { |
729 | - do_action( 'gravityview_log_debug', '[render_view] Rendering '. $section . ' section.' ); |
|
729 | + do_action( 'gravityview_log_debug', '[render_view] Rendering ' . $section . ' section.' ); |
|
730 | 730 | $gravityview_view->render( $view_slug, $section, false ); |
731 | 731 | } |
732 | 732 | } |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | $datetime_format = 'Y-m-d H:i:s'; |
781 | 781 | $search_is_outside_view_bounds = false; |
782 | 782 | |
783 | - if( ! empty( $search_criteria[ $key ] ) ) { |
|
783 | + if ( ! empty( $search_criteria[ $key ] ) ) { |
|
784 | 784 | |
785 | 785 | $search_date = strtotime( $search_criteria[ $key ] ); |
786 | 786 | |
@@ -808,14 +808,14 @@ discard block |
||
808 | 808 | if ( empty( $search_criteria[ $key ] ) || $search_is_outside_view_bounds ) { |
809 | 809 | |
810 | 810 | // Then we override the search and re-set the start date |
811 | - $return_search_criteria[ $key ] = date_i18n( $datetime_format , $date, true ); |
|
811 | + $return_search_criteria[ $key ] = date_i18n( $datetime_format, $date, true ); |
|
812 | 812 | } |
813 | 813 | } |
814 | 814 | } |
815 | 815 | |
816 | - if( isset( $return_search_criteria['start_date'] ) && isset( $return_search_criteria['end_date'] ) ) { |
|
816 | + if ( isset( $return_search_criteria[ 'start_date' ] ) && isset( $return_search_criteria[ 'end_date' ] ) ) { |
|
817 | 817 | // The start date is AFTER the end date. This will result in no results, but let's not force the issue. |
818 | - if ( strtotime( $return_search_criteria['start_date'] ) > strtotime( $return_search_criteria['end_date'] ) ) { |
|
818 | + if ( strtotime( $return_search_criteria[ 'start_date' ] ) > strtotime( $return_search_criteria[ 'end_date' ] ) ) { |
|
819 | 819 | do_action( 'gravityview_log_error', __METHOD__ . ' Invalid search: the start date is after the end date.', $return_search_criteria ); |
820 | 820 | } |
821 | 821 | } |
@@ -833,9 +833,9 @@ discard block |
||
833 | 833 | */ |
834 | 834 | public static function process_search_only_approved( $args, $search_criteria ) { |
835 | 835 | |
836 | - if ( ! empty( $args['show_only_approved'] ) ) { |
|
837 | - $search_criteria['field_filters'][] = array( 'key' => 'is_approved', 'value' => 'Approved' ); |
|
838 | - $search_criteria['field_filters']['mode'] = 'all'; // force all the criterias to be met |
|
836 | + if ( ! empty( $args[ 'show_only_approved' ] ) ) { |
|
837 | + $search_criteria[ 'field_filters' ][ ] = array( 'key' => 'is_approved', 'value' => 'Approved' ); |
|
838 | + $search_criteria[ 'field_filters' ][ 'mode' ] = 'all'; // force all the criterias to be met |
|
839 | 839 | |
840 | 840 | do_action( 'gravityview_log_debug', '[process_search_only_approved] Search Criteria if show only approved: ', $search_criteria ); |
841 | 841 | } |
@@ -859,12 +859,12 @@ discard block |
||
859 | 859 | */ |
860 | 860 | public static function is_entry_approved( $entry, $args = array() ) { |
861 | 861 | |
862 | - if ( empty( $entry['id'] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args['show_only_approved'] ) ) { |
|
862 | + if ( empty( $entry[ 'id' ] ) || ( array_key_exists( 'show_only_approved', $args ) && ! $args[ 'show_only_approved' ] ) ) { |
|
863 | 863 | // is implicitly approved if entry is null or View settings doesn't require to check for approval |
864 | 864 | return true; |
865 | 865 | } |
866 | 866 | |
867 | - $is_approved = gform_get_meta( $entry['id'], 'is_approved' ); |
|
867 | + $is_approved = gform_get_meta( $entry[ 'id' ], 'is_approved' ); |
|
868 | 868 | |
869 | 869 | if ( $is_approved ) { |
870 | 870 | return true; |
@@ -897,26 +897,26 @@ discard block |
||
897 | 897 | do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after hook gravityview_fe_search_criteria: ', $search_criteria ); |
898 | 898 | |
899 | 899 | // implicity search |
900 | - if ( ! empty( $args['search_value'] ) ) { |
|
900 | + if ( ! empty( $args[ 'search_value' ] ) ) { |
|
901 | 901 | |
902 | 902 | // Search operator options. Options: `is` or `contains` |
903 | - $operator = ! empty( $args['search_operator'] ) && in_array( $args['search_operator'], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args['search_operator'] : 'contains'; |
|
903 | + $operator = ! empty( $args[ 'search_operator' ] ) && in_array( $args[ 'search_operator' ], array( 'is', 'isnot', '>', '<', 'contains' ) ) ? $args[ 'search_operator' ] : 'contains'; |
|
904 | 904 | |
905 | - $search_criteria['field_filters'][] = array( |
|
905 | + $search_criteria[ 'field_filters' ][ ] = array( |
|
906 | 906 | 'key' => rgget( 'search_field', $args ), // The field ID to search |
907 | - 'value' => _wp_specialchars( $args['search_value'] ), // The value to search. Encode ampersands but not quotes. |
|
907 | + 'value' => _wp_specialchars( $args[ 'search_value' ] ), // The value to search. Encode ampersands but not quotes. |
|
908 | 908 | 'operator' => $operator, |
909 | 909 | ); |
910 | 910 | } |
911 | 911 | |
912 | - if( $search_criteria !== $original_search_criteria ) { |
|
912 | + if ( $search_criteria !== $original_search_criteria ) { |
|
913 | 913 | do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after implicity search: ', $search_criteria ); |
914 | 914 | } |
915 | 915 | |
916 | 916 | // Handle setting date range |
917 | 917 | $search_criteria = self::process_search_dates( $args, $search_criteria ); |
918 | 918 | |
919 | - if( $search_criteria !== $original_search_criteria ) { |
|
919 | + if ( $search_criteria !== $original_search_criteria ) { |
|
920 | 920 | do_action( 'gravityview_log_debug', '[get_search_criteria] Search Criteria after date params: ', $search_criteria ); |
921 | 921 | } |
922 | 922 | |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | * @filter `gravityview_status` Modify entry status requirements to be included in search results. |
928 | 928 | * @param string $status Default: `active`. Accepts all Gravity Forms entry statuses, including `spam` and `trash` |
929 | 929 | */ |
930 | - $search_criteria['status'] = apply_filters( 'gravityview_status', 'active', $args ); |
|
930 | + $search_criteria[ 'status' ] = apply_filters( 'gravityview_status', 'active', $args ); |
|
931 | 931 | |
932 | 932 | return $search_criteria; |
933 | 933 | } |
@@ -973,16 +973,16 @@ discard block |
||
973 | 973 | $search_criteria = self::get_search_criteria( $args, $form_id ); |
974 | 974 | |
975 | 975 | // Paging & offset |
976 | - $page_size = ! empty( $args['page_size'] ) ? intval( $args['page_size'] ) : apply_filters( 'gravityview_default_page_size', 25 ); |
|
976 | + $page_size = ! empty( $args[ 'page_size' ] ) ? intval( $args[ 'page_size' ] ) : apply_filters( 'gravityview_default_page_size', 25 ); |
|
977 | 977 | |
978 | 978 | if ( -1 === $page_size ) { |
979 | 979 | $page_size = PHP_INT_MAX; |
980 | 980 | } |
981 | 981 | |
982 | - if ( isset( $args['offset'] ) ) { |
|
983 | - $offset = intval( $args['offset'] ); |
|
982 | + if ( isset( $args[ 'offset' ] ) ) { |
|
983 | + $offset = intval( $args[ 'offset' ] ); |
|
984 | 984 | } else { |
985 | - $curr_page = empty( $_GET['pagenum'] ) ? 1 : intval( $_GET['pagenum'] ); |
|
985 | + $curr_page = empty( $_GET[ 'pagenum' ] ) ? 1 : intval( $_GET[ 'pagenum' ] ); |
|
986 | 986 | $offset = ( $curr_page - 1 ) * $page_size; |
987 | 987 | } |
988 | 988 | |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | 'search_criteria' => $search_criteria, |
1001 | 1001 | 'sorting' => $sorting, |
1002 | 1002 | 'paging' => $paging, |
1003 | - 'cache' => isset( $args['cache'] ) ? $args['cache'] : true, |
|
1003 | + 'cache' => isset( $args[ 'cache' ] ) ? $args[ 'cache' ] : true, |
|
1004 | 1004 | ); |
1005 | 1005 | |
1006 | 1006 | /** |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | * @param array $parameters Array with `search_criteria`, `sorting` and `paging` keys. |
1026 | 1026 | * @param array $args View configuration args. |
1027 | 1027 | */ |
1028 | - $parameters = apply_filters( 'gravityview_get_entries_'.$args['id'], $parameters, $args, $form_id ); |
|
1028 | + $parameters = apply_filters( 'gravityview_get_entries_' . $args[ 'id' ], $parameters, $args, $form_id ); |
|
1029 | 1029 | |
1030 | 1030 | do_action( 'gravityview_log_debug', '[get_view_entries] $parameters passed to gravityview_get_entries(): ', $parameters ); |
1031 | 1031 | |
@@ -1065,8 +1065,8 @@ discard block |
||
1065 | 1065 | */ |
1066 | 1066 | public static function updateViewSorting( $args, $form_id ) { |
1067 | 1067 | $sorting = array(); |
1068 | - $sort_field_id = isset( $_GET['sort'] ) ? $_GET['sort'] : rgar( $args, 'sort_field' ); |
|
1069 | - $sort_direction = isset( $_GET['dir'] ) ? $_GET['dir'] : rgar( $args, 'sort_direction' ); |
|
1068 | + $sort_field_id = isset( $_GET[ 'sort' ] ) ? $_GET[ 'sort' ] : rgar( $args, 'sort_field' ); |
|
1069 | + $sort_direction = isset( $_GET[ 'dir' ] ) ? $_GET[ 'dir' ] : rgar( $args, 'sort_direction' ); |
|
1070 | 1070 | |
1071 | 1071 | $sort_field_id = self::_override_sorting_id_by_field_type( $sort_field_id, $form_id ); |
1072 | 1072 | |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | |
1107 | 1107 | $sort_field = GFFormsModel::get_field( $form, $sort_field_id ); |
1108 | 1108 | |
1109 | - switch ( $sort_field['type'] ) { |
|
1109 | + switch ( $sort_field[ 'type' ] ) { |
|
1110 | 1110 | |
1111 | 1111 | case 'address': |
1112 | 1112 | // Sorting by full address |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | */ |
1124 | 1124 | $address_part = apply_filters( 'gravityview/sorting/address', 'city', $sort_field_id, $form_id ); |
1125 | 1125 | |
1126 | - switch( strtolower( $address_part ) ){ |
|
1126 | + switch ( strtolower( $address_part ) ) { |
|
1127 | 1127 | case 'street': |
1128 | 1128 | $sort_field_id .= '.1'; |
1129 | 1129 | break; |
@@ -1203,7 +1203,7 @@ discard block |
||
1203 | 1203 | */ |
1204 | 1204 | $single_entry = apply_filters( 'gravityview/is_single_entry', $single_entry ); |
1205 | 1205 | |
1206 | - if ( empty( $single_entry ) ){ |
|
1206 | + if ( empty( $single_entry ) ) { |
|
1207 | 1207 | return false; |
1208 | 1208 | } else { |
1209 | 1209 | return $single_entry; |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | * Don't enqueue the scripts or styles if it's not going to be displayed. |
1231 | 1231 | * @since 1.15 |
1232 | 1232 | */ |
1233 | - if( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
1233 | + if ( is_user_logged_in() && false === GVCommon::has_cap( 'read_gravityview', $view_id ) ) { |
|
1234 | 1234 | continue; |
1235 | 1235 | } |
1236 | 1236 | |
@@ -1239,19 +1239,19 @@ discard block |
||
1239 | 1239 | $css_dependencies = array(); |
1240 | 1240 | |
1241 | 1241 | // If the thickbox is enqueued, add dependencies |
1242 | - if ( ! empty( $data['atts']['lightbox'] ) ) { |
|
1242 | + if ( ! empty( $data[ 'atts' ][ 'lightbox' ] ) ) { |
|
1243 | 1243 | |
1244 | 1244 | /** |
1245 | 1245 | * @filter `gravity_view_lightbox_script` Override the lightbox script to enqueue. Default: `thickbox` |
1246 | 1246 | * @param string $script_slug If you want to use a different lightbox script, return the name of it here. |
1247 | 1247 | */ |
1248 | - $js_dependencies[] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' ); |
|
1248 | + $js_dependencies[ ] = apply_filters( 'gravity_view_lightbox_script', 'thickbox' ); |
|
1249 | 1249 | |
1250 | 1250 | /** |
1251 | 1251 | * @filter `gravity_view_lightbox_style` Modify the lightbox CSS slug. Default: `thickbox` |
1252 | 1252 | * @param string $script_slug If you want to use a different lightbox script, return the name of its CSS file here. |
1253 | 1253 | */ |
1254 | - $css_dependencies[] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' ); |
|
1254 | + $css_dependencies[ ] = apply_filters( 'gravity_view_lightbox_style', 'thickbox' ); |
|
1255 | 1255 | } |
1256 | 1256 | |
1257 | 1257 | /** |
@@ -1259,25 +1259,25 @@ discard block |
||
1259 | 1259 | * @see https://github.com/katzwebservices/GravityView/issues/536 |
1260 | 1260 | * @since 1.15 |
1261 | 1261 | */ |
1262 | - if( gravityview_view_has_single_checkbox_or_radio( $data['form'], $data['fields'] ) ) { |
|
1263 | - $css_dependencies[] = 'dashicons'; |
|
1262 | + if ( gravityview_view_has_single_checkbox_or_radio( $data[ 'form' ], $data[ 'fields' ] ) ) { |
|
1263 | + $css_dependencies[ ] = 'dashicons'; |
|
1264 | 1264 | } |
1265 | 1265 | |
1266 | 1266 | wp_register_script( 'gravityview-jquery-cookie', plugins_url( 'includes/lib/jquery-cookie/jquery_cookie.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version, true ); |
1267 | 1267 | |
1268 | 1268 | $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
1269 | 1269 | |
1270 | - 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 ); |
|
1270 | + 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 ); |
|
1271 | 1271 | |
1272 | 1272 | wp_enqueue_script( 'gravityview-fe-view' ); |
1273 | 1273 | |
1274 | - if ( ! empty( $data['atts']['sort_columns'] ) ) { |
|
1274 | + if ( ! empty( $data[ 'atts' ][ 'sort_columns' ] ) ) { |
|
1275 | 1275 | wp_enqueue_style( 'gravityview_font', plugins_url( 'assets/css/font.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' ); |
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | wp_enqueue_style( 'gravityview_default_style', plugins_url( 'templates/css/gv-default-styles.css', GRAVITYVIEW_FILE ), $css_dependencies, GravityView_Plugin::version, 'all' ); |
1279 | 1279 | |
1280 | - self::add_style( $data['template_id'] ); |
|
1280 | + self::add_style( $data[ 'template_id' ] ); |
|
1281 | 1281 | |
1282 | 1282 | } |
1283 | 1283 | |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | } elseif ( empty( $template_id ) ) { |
1314 | 1314 | do_action( 'gravityview_log_error', '[add_style] Cannot add template style; template_id is empty' ); |
1315 | 1315 | } else { |
1316 | - do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_'.$template_id ) ); |
|
1316 | + do_action( 'gravityview_log_error', sprintf( '[add_style] Cannot add template style; %s is not registered', 'gravityview_style_' . $template_id ) ); |
|
1317 | 1317 | } |
1318 | 1318 | |
1319 | 1319 | } |
@@ -1338,11 +1338,11 @@ discard block |
||
1338 | 1338 | * Not a table-based template; don't add sort icons |
1339 | 1339 | * @since 1.12 |
1340 | 1340 | */ |
1341 | - if( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) { |
|
1341 | + if ( ! preg_match( '/table/ism', GravityView_View::getInstance()->getTemplatePartSlug() ) ) { |
|
1342 | 1342 | return $label; |
1343 | 1343 | } |
1344 | 1344 | |
1345 | - if ( ! $this->is_field_sortable( $field['id'], $form ) ) { |
|
1345 | + if ( ! $this->is_field_sortable( $field[ 'id' ], $form ) ) { |
|
1346 | 1346 | return $label; |
1347 | 1347 | } |
1348 | 1348 | |
@@ -1350,29 +1350,29 @@ discard block |
||
1350 | 1350 | |
1351 | 1351 | $class = 'gv-sort'; |
1352 | 1352 | |
1353 | - $sort_field_id = self::_override_sorting_id_by_field_type( $field['id'], $form['id'] ); |
|
1353 | + $sort_field_id = self::_override_sorting_id_by_field_type( $field[ 'id' ], $form[ 'id' ] ); |
|
1354 | 1354 | |
1355 | 1355 | $sort_args = array( |
1356 | - 'sort' => $field['id'], |
|
1356 | + 'sort' => $field[ 'id' ], |
|
1357 | 1357 | 'dir' => 'asc', |
1358 | 1358 | ); |
1359 | 1359 | |
1360 | - if ( ! empty( $sorting['key'] ) && (string) $sort_field_id === (string) $sorting['key'] ) { |
|
1360 | + if ( ! empty( $sorting[ 'key' ] ) && (string)$sort_field_id === (string)$sorting[ 'key' ] ) { |
|
1361 | 1361 | //toggle sorting direction. |
1362 | - if ( 'asc' === $sorting['direction'] ) { |
|
1363 | - $sort_args['dir'] = 'desc'; |
|
1362 | + if ( 'asc' === $sorting[ 'direction' ] ) { |
|
1363 | + $sort_args[ 'dir' ] = 'desc'; |
|
1364 | 1364 | $class .= ' gv-icon-sort-desc'; |
1365 | 1365 | } else { |
1366 | - $sort_args['dir'] = 'asc'; |
|
1366 | + $sort_args[ 'dir' ] = 'asc'; |
|
1367 | 1367 | $class .= ' gv-icon-sort-asc'; |
1368 | 1368 | } |
1369 | 1369 | } else { |
1370 | 1370 | $class .= ' gv-icon-caret-up-down'; |
1371 | 1371 | } |
1372 | 1372 | |
1373 | - $url = add_query_arg( $sort_args, remove_query_arg( array('pagenum') ) ); |
|
1373 | + $url = add_query_arg( $sort_args, remove_query_arg( array( 'pagenum' ) ) ); |
|
1374 | 1374 | |
1375 | - return '<a href="'. esc_url_raw( $url ) .'" class="'. $class .'" ></a> '. $label; |
|
1375 | + return '<a href="' . esc_url_raw( $url ) . '" class="' . $class . '" ></a> ' . $label; |
|
1376 | 1376 | |
1377 | 1377 | } |
1378 | 1378 | |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | |
1391 | 1391 | $field_type = $field_id; |
1392 | 1392 | |
1393 | - if( is_numeric( $field_id ) ) { |
|
1393 | + if ( is_numeric( $field_id ) ) { |
|
1394 | 1394 | $field = GFFormsModel::get_field( $form, $field_id ); |
1395 | 1395 | $field_type = $field->type; |
1396 | 1396 | } |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | return false; |
1414 | 1414 | } |
1415 | 1415 | |
1416 | - return apply_filters( "gravityview/sortable/formfield_{$form['id']}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) ); |
|
1416 | + return apply_filters( "gravityview/sortable/formfield_{$form[ 'id' ]}_{$field_id}", apply_filters( "gravityview/sortable/field_{$field_id}", true, $form ) ); |
|
1417 | 1417 | |
1418 | 1418 | } |
1419 | 1419 |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Sets the single entry ID and also the entry |
153 | - * @param bool|int|string $single_entry |
|
153 | + * @param boolean|string $single_entry |
|
154 | 154 | */ |
155 | 155 | public function setSingleEntry( $single_entry ) { |
156 | 156 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | /** |
169 | 169 | * Set the current entry |
170 | - * @param array|int $entry Entry array or entry slug or ID |
|
170 | + * @param boolean|string $entry Entry array or entry slug or ID |
|
171 | 171 | */ |
172 | 172 | public function setEntry( $entry ) { |
173 | 173 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * |
226 | 226 | * |
227 | 227 | * |
228 | - * @param null $view_id |
|
228 | + * @param string $view_id |
|
229 | 229 | */ |
230 | 230 | public function set_context_view_id( $view_id = null ) { |
231 | 231 | |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | * |
958 | 958 | * @uses gravityview_get_entries() |
959 | 959 | * @access public |
960 | - * @param array $args\n |
|
960 | + * @param array $args |
|
961 | 961 | * - $id - View id |
962 | 962 | * - $page_size - Page |
963 | 963 | * - $sort_field - form field id to sort |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | /** |
1414 | 1414 | * Checks if field (column) is sortable |
1415 | 1415 | * |
1416 | - * @param string $field Field settings |
|
1416 | + * @param string $field_id Field settings |
|
1417 | 1417 | * @param array $form Gravity Forms form array |
1418 | 1418 | * |
1419 | 1419 | * @since 1.7 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | parent::add_hooks(); |
58 | 58 | |
59 | - if( gravityview_is_admin_page() ) { |
|
59 | + if ( gravityview_is_admin_page() ) { |
|
60 | 60 | |
61 | 61 | // Make Yoast metabox go down to the bottom please. |
62 | 62 | add_filter( 'wpseo_metabox_prio', array( $this, '__return_low' ) ); |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | global $pagenow; |
84 | 84 | |
85 | 85 | // New View page |
86 | - if( $pagenow === 'post-new.php' ) { |
|
87 | - $options['hideeditbox-gravityview'] = true; |
|
86 | + if ( $pagenow === 'post-new.php' ) { |
|
87 | + $options[ 'hideeditbox-gravityview' ] = true; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $options; |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $gv_page = gravityview_is_admin_page( '', 'single' ); |
79 | 79 | |
80 | 80 | // New View or Edit View page |
81 | - if( $gv_page && $pagenow === 'post-new.php' ) { |
|
81 | + if ( $gv_page && $pagenow === 'post-new.php' ) { |
|
82 | 82 | remove_meta_box( 'woothemes-settings', 'gravityview', 'normal' ); |
83 | 83 | } |
84 | 84 | } |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | function init() { |
22 | 22 | |
23 | 23 | $icon = is_admin() ? '<i class="icon gv-icon-astronaut-head"></i> ' : NULL; |
24 | - $this->title( $icon . __('GravityView', 'gravityview') ); |
|
24 | + $this->title( $icon . __( 'GravityView', 'gravityview' ) ); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | function get_warnings() { |
28 | 28 | |
29 | - if( is_null( $this->warnings ) ) { |
|
29 | + if ( is_null( $this->warnings ) ) { |
|
30 | 30 | $this->warnings = GravityView_Logging::get_errors(); |
31 | 31 | } |
32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | function get_notices() { |
37 | 37 | |
38 | - if( is_null( $this->notices ) ) { |
|
38 | + if ( is_null( $this->notices ) ) { |
|
39 | 39 | $this->notices = GravityView_Logging::get_notices(); |
40 | 40 | } |
41 | 41 | |
@@ -84,27 +84,27 @@ discard block |
||
84 | 84 | </style> |
85 | 85 | <div id='debug-bar-gravityview'>"; |
86 | 86 | |
87 | - $output .= '<img src="'.plugins_url('assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ).'" class="alignright" alt="" width="100" height="132" />'; |
|
87 | + $output .= '<img src="' . plugins_url( 'assets/images/astronaut-200x263.png', GRAVITYVIEW_FILE ) . '" class="alignright" alt="" width="100" height="132" />'; |
|
88 | 88 | |
89 | 89 | |
90 | 90 | $warnings = $this->get_warnings(); |
91 | 91 | $notices = $this->get_notices(); |
92 | 92 | |
93 | - if(count($warnings)) { |
|
94 | - $output .= '<h3><span>'.__('Warnings', 'gravityview').'</span></h3>'; |
|
93 | + if ( count( $warnings ) ) { |
|
94 | + $output .= '<h3><span>' . __( 'Warnings', 'gravityview' ) . '</span></h3>'; |
|
95 | 95 | $output .= '<ol>'; |
96 | - foreach ( $warnings as $key => $notice) { |
|
97 | - if(empty($notice['message'])) { continue; } |
|
98 | - $output .= '<li><a href="#'.sanitize_html_class( 'gv-warning-' . $key ).'">'.strip_tags($notice['message']).'</a></li>'; |
|
96 | + foreach ( $warnings as $key => $notice ) { |
|
97 | + if ( empty( $notice[ 'message' ] ) ) { continue; } |
|
98 | + $output .= '<li><a href="#' . sanitize_html_class( 'gv-warning-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>'; |
|
99 | 99 | } |
100 | 100 | $output .= '</ol><hr />'; |
101 | 101 | } |
102 | - if(count($notices)) { |
|
103 | - $output .= '<h3><span>'.__('Logs', 'gravityview').'</span></h3>'; |
|
102 | + if ( count( $notices ) ) { |
|
103 | + $output .= '<h3><span>' . __( 'Logs', 'gravityview' ) . '</span></h3>'; |
|
104 | 104 | $output .= '<ol>'; |
105 | - foreach ( $notices as $key => $notice) { |
|
106 | - if(empty($notice['message'])) { continue; } |
|
107 | - $output .= '<li><a href="#'.sanitize_html_class( 'gv-notice-' . $key ).'">'.strip_tags($notice['message']).'</a></li>'; |
|
105 | + foreach ( $notices as $key => $notice ) { |
|
106 | + if ( empty( $notice[ 'message' ] ) ) { continue; } |
|
107 | + $output .= '<li><a href="#' . sanitize_html_class( 'gv-notice-' . $key ) . '">' . strip_tags( $notice[ 'message' ] ) . '</a></li>'; |
|
108 | 108 | } |
109 | 109 | $output .= '</ol><hr />'; |
110 | 110 | } |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | if ( count( $warnings ) ) { |
113 | 113 | $output .= '<h3>Warnings</h3>'; |
114 | 114 | $output .= '<ol class="debug-bar-php-list">'; |
115 | - foreach ( $warnings as $key => $notice) { $output .= $this->render_item( $notice, 'gv-warning-' . $key ); } |
|
115 | + foreach ( $warnings as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-warning-' . $key ); } |
|
116 | 116 | $output .= '</ol>'; |
117 | 117 | } |
118 | 118 | |
119 | 119 | if ( count( $notices ) ) { |
120 | 120 | $output .= '<h3>Notices</h3>'; |
121 | 121 | $output .= '<ol class="debug-bar-php-list">'; |
122 | - foreach ( $notices as $key => $notice) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); } |
|
122 | + foreach ( $notices as $key => $notice ) { $output .= $this->render_item( $notice, 'gv-notice-' . $key ); } |
|
123 | 123 | $output .= '</ol>'; |
124 | 124 | } |
125 | 125 | |
@@ -133,17 +133,17 @@ discard block |
||
133 | 133 | * @param string|array $item Unescaped |
134 | 134 | * @return string Escaped HTML |
135 | 135 | */ |
136 | - function esc_html_recursive($item) { |
|
137 | - if(is_object($item)) { |
|
138 | - foreach($item as $key => $value) { |
|
139 | - $item->{$key} = $this->esc_html_recursive($value); |
|
136 | + function esc_html_recursive( $item ) { |
|
137 | + if ( is_object( $item ) ) { |
|
138 | + foreach ( $item as $key => $value ) { |
|
139 | + $item->{$key} = $this->esc_html_recursive( $value ); |
|
140 | 140 | } |
141 | - } else if(is_array($item)) { |
|
142 | - foreach($item as $key => $value) { |
|
143 | - $item[$key] = $this->esc_html_recursive($value); |
|
141 | + } else if ( is_array( $item ) ) { |
|
142 | + foreach ( $item as $key => $value ) { |
|
143 | + $item[ $key ] = $this->esc_html_recursive( $value ); |
|
144 | 144 | } |
145 | 145 | } else { |
146 | - $item = esc_html($item); |
|
146 | + $item = esc_html( $item ); |
|
147 | 147 | } |
148 | 148 | return $item; |
149 | 149 | } |
@@ -159,26 +159,26 @@ discard block |
||
159 | 159 | |
160 | 160 | $output = ''; |
161 | 161 | |
162 | - if(!empty($notice['message'])) { |
|
163 | - $output .= '<a id="'.sanitize_html_class( $anchor ).'"></a>'; |
|
162 | + if ( ! empty( $notice[ 'message' ] ) ) { |
|
163 | + $output .= '<a id="' . sanitize_html_class( $anchor ) . '"></a>'; |
|
164 | 164 | $output .= "<li class='debug-bar-php-notice'>"; |
165 | 165 | } |
166 | 166 | |
167 | 167 | $output .= '<div class="clear"></div>'; |
168 | 168 | |
169 | 169 | // Title |
170 | - $output .= '<div class="gravityview-debug-bar-title">'.esc_attr( $notice['message'] ).'</div>'; |
|
170 | + $output .= '<div class="gravityview-debug-bar-title">' . esc_attr( $notice[ 'message' ] ) . '</div>'; |
|
171 | 171 | |
172 | 172 | // Debugging Output |
173 | - if( empty( $notice['data'] ) ) { |
|
174 | - if( !is_null( $notice['data'] ) ) { |
|
175 | - $output .= '<em>'._x('Empty', 'Debugging output data is empty.', 'gravityview' ).'</em>'; |
|
173 | + if ( empty( $notice[ 'data' ] ) ) { |
|
174 | + if ( ! is_null( $notice[ 'data' ] ) ) { |
|
175 | + $output .= '<em>' . _x( 'Empty', 'Debugging output data is empty.', 'gravityview' ) . '</em>'; |
|
176 | 176 | } |
177 | 177 | } else { |
178 | - $output .= sprintf( '<pre>%s</pre>', print_r($this->esc_html_recursive( $notice['data'] ), true) ); |
|
178 | + $output .= sprintf( '<pre>%s</pre>', print_r( $this->esc_html_recursive( $notice[ 'data' ] ), true ) ); |
|
179 | 179 | } |
180 | 180 | |
181 | - if(!empty($notice['message'])) { |
|
181 | + if ( ! empty( $notice[ 'message' ] ) ) { |
|
182 | 182 | $output .= '</li>'; |
183 | 183 | } |
184 | 184 |
@@ -5,4 +5,4 @@ |
||
5 | 5 | * @deprecated 1.7.5 |
6 | 6 | */ |
7 | 7 | |
8 | -include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' ); |
|
8 | +include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' ); |
@@ -11,29 +11,29 @@ discard block |
||
11 | 11 | $field_info_items = array(); |
12 | 12 | |
13 | 13 | // Fields with IDs, not like Source URL or Entry ID |
14 | - if( is_numeric( $this->id ) ) { |
|
14 | + if ( is_numeric( $this->id ) ) { |
|
15 | 15 | |
16 | - $field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] ); |
|
16 | + $field_type_title = GFCommon::get_field_type_title( $this->item[ 'input_type' ] ); |
|
17 | 17 | |
18 | - $field_info_items[] = array( |
|
19 | - 'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title ) |
|
18 | + $field_info_items[ ] = array( |
|
19 | + 'value' => sprintf( __( 'Type: %s', 'gravityview' ), $field_type_title ) |
|
20 | 20 | ); |
21 | 21 | |
22 | - $field_info_items[] = array( |
|
23 | - 'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ), |
|
22 | + $field_info_items[ ] = array( |
|
23 | + 'value' => sprintf( __( 'Field ID: %s', 'gravityview' ), $this->id ), |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | } |
27 | 27 | |
28 | - if( !empty( $this->item['desc'] ) ) { |
|
29 | - $field_info_items[] = array( |
|
30 | - 'value' => $this->item['desc'] |
|
28 | + if ( ! empty( $this->item[ 'desc' ] ) ) { |
|
29 | + $field_info_items[ ] = array( |
|
30 | + 'value' => $this->item[ 'desc' ] |
|
31 | 31 | ); |
32 | 32 | } |
33 | 33 | |
34 | - if( !empty( $this->item['adminLabel'] ) ) { |
|
35 | - $field_info_items[] = array( |
|
36 | - 'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ), |
|
34 | + if ( ! empty( $this->item[ 'adminLabel' ] ) ) { |
|
35 | + $field_info_items[ ] = array( |
|
36 | + 'value' => sprintf( __( 'Admin Label: %s', 'gravityview' ), $this->item[ 'adminLabel' ] ), |
|
37 | 37 | 'class' => 'gv-sublabel' |
38 | 38 | ); |
39 | 39 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $field_info = ''; |
53 | 53 | $field_info_items = array(); |
54 | 54 | |
55 | - if( !empty( $this->item['description'] ) ) { |
|
55 | + if ( ! empty( $this->item[ 'description' ] ) ) { |
|
56 | 56 | |
57 | - $field_info_items[] = array( |
|
58 | - 'value' => $this->item['description'] |
|
57 | + $field_info_items[ ] = array( |
|
58 | + 'value' => $this->item[ 'description' ] |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | } |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | function __construct( $title = '', $field_id, $item = array(), $settings = array() ) { |
81 | 81 | |
82 | 82 | // Backward compat |
83 | - if( !empty( $item['type'] ) ) { |
|
84 | - $item['input_type'] = $item['type']; |
|
85 | - unset( $item['type'] ); |
|
83 | + if ( ! empty( $item[ 'type' ] ) ) { |
|
84 | + $item[ 'input_type' ] = $item[ 'type' ]; |
|
85 | + unset( $item[ 'type' ] ); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // Prevent items from not having index set |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | 'adminLabel' => NULL, |
97 | 97 | 'adminOnly' => NULL, |
98 | 98 | 'subtitle' => NULL, |
99 | - )); |
|
99 | + ) ); |
|
100 | 100 | |
101 | 101 | $this->title = $title; |
102 | 102 | $this->item = $item; |
103 | 103 | $this->id = $field_id; |
104 | 104 | $this->settings = $settings; |
105 | - $this->label_type = $item['label_type']; |
|
105 | + $this->label_type = $item[ 'label_type' ]; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | */ |
142 | 142 | $field_info_items = apply_filters( 'gravityview_admin_label_item_info', $field_info_items, $this ); |
143 | 143 | |
144 | - if( $html ) { |
|
144 | + if ( $html ) { |
|
145 | 145 | |
146 | 146 | foreach ( $field_info_items as $item ) { |
147 | - $class = isset($item['class']) ? sanitize_html_class( $item['class'] ).' description' : 'description'; |
|
147 | + $class = isset( $item[ 'class' ] ) ? sanitize_html_class( $item[ 'class' ] ) . ' description' : 'description'; |
|
148 | 148 | // Add the title in case the value's long, in which case, it'll be truncated by CSS. |
149 | - $output .= '<span class="'.$class.'">'; |
|
150 | - $output .= esc_html( $item['value'] ); |
|
149 | + $output .= '<span class="' . $class . '">'; |
|
150 | + $output .= esc_html( $item[ 'value' ] ); |
|
151 | 151 | $output .= '</span>'; |
152 | 152 | } |
153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $values = wp_list_pluck( $field_info_items, 'value' ); |
157 | 157 | |
158 | - $output = esc_html( implode(', ', $values) ); |
|
158 | + $output = esc_html( implode( ', ', $values ) ); |
|
159 | 159 | |
160 | 160 | } |
161 | 161 | |
@@ -170,53 +170,53 @@ discard block |
||
170 | 170 | */ |
171 | 171 | function getOutput() { |
172 | 172 | |
173 | - $settings_title = sprintf(__('Configure %s Settings', 'gravityview'), ucfirst($this->label_type)); |
|
174 | - $delete_title = sprintf(__('Remove %s', 'gravityview'), ucfirst($this->label_type)); |
|
175 | - $single_link_title = __('This field links to the Single Entry', 'gravityview'); |
|
173 | + $settings_title = sprintf( __( 'Configure %s Settings', 'gravityview' ), ucfirst( $this->label_type ) ); |
|
174 | + $delete_title = sprintf( __( 'Remove %s', 'gravityview' ), ucfirst( $this->label_type ) ); |
|
175 | + $single_link_title = __( 'This field links to the Single Entry', 'gravityview' ); |
|
176 | 176 | |
177 | 177 | // $settings_html will just be hidden inputs if empty. Otherwise, it'll have an <ul>. Ugly hack, I know. |
178 | 178 | // TODO: Un-hack this |
179 | - $hide_settings_link = ( empty( $this->item['settings_html'] ) || strpos( $this->item['settings_html'], '<!-- No Options -->') > 0 ) ? 'hide-if-js' : ''; |
|
179 | + $hide_settings_link = ( empty( $this->item[ 'settings_html' ] ) || strpos( $this->item[ 'settings_html' ], '<!-- No Options -->' ) > 0 ) ? 'hide-if-js' : ''; |
|
180 | 180 | $settings_link = sprintf( '<a href="#settings" class="dashicons-admin-generic dashicons %s" title="%s"></a>', $hide_settings_link, esc_attr( $settings_title ) ); |
181 | 181 | |
182 | 182 | // Should we show the icon that the field is being used as a link to single entry? |
183 | - $hide_show_as_link_class = empty( $this->settings['show_as_link'] ) ? 'hide-if-js' : ''; |
|
184 | - $show_as_link = '<span class="dashicons dashicons-admin-links '.$hide_show_as_link_class.'" title="'.esc_attr( $single_link_title ).'"></span>'; |
|
183 | + $hide_show_as_link_class = empty( $this->settings[ 'show_as_link' ] ) ? 'hide-if-js' : ''; |
|
184 | + $show_as_link = '<span class="dashicons dashicons-admin-links ' . $hide_show_as_link_class . '" title="' . esc_attr( $single_link_title ) . '"></span>'; |
|
185 | 185 | |
186 | 186 | // When a field label is empty, use the Field ID |
187 | - $label = empty( $this->title ) ? sprintf( _x('Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview'), $this->id ) : $this->title; |
|
187 | + $label = empty( $this->title ) ? sprintf( _x( 'Field #%s (No Label)', 'Label in field picker for empty label', 'gravityview' ), $this->id ) : $this->title; |
|
188 | 188 | |
189 | 189 | // If there's a custom label, and show label is checked, use that as the field heading |
190 | - if( !empty( $this->settings['custom_label'] ) && !empty( $this->settings['show_label'] ) ) { |
|
191 | - $label = $this->settings['custom_label']; |
|
192 | - } else if( !empty( $this->item['customLabel'] ) ) { |
|
193 | - $label = $this->item['customLabel']; |
|
190 | + if ( ! empty( $this->settings[ 'custom_label' ] ) && ! empty( $this->settings[ 'show_label' ] ) ) { |
|
191 | + $label = $this->settings[ 'custom_label' ]; |
|
192 | + } else if ( ! empty( $this->item[ 'customLabel' ] ) ) { |
|
193 | + $label = $this->item[ 'customLabel' ]; |
|
194 | 194 | } |
195 | 195 | |
196 | - $output = '<h5 class="selectable gfield field-id-'.esc_attr($this->id).'">'; |
|
196 | + $output = '<h5 class="selectable gfield field-id-' . esc_attr( $this->id ) . '">'; |
|
197 | 197 | |
198 | 198 | $label = esc_attr( $label ); |
199 | 199 | |
200 | - if( !empty( $this->item['parent'] ) ) { |
|
201 | - $label .= ' <small>('.esc_attr( $this->item['parent']['label'] ) .')</small>'; |
|
200 | + if ( ! empty( $this->item[ 'parent' ] ) ) { |
|
201 | + $label .= ' <small>(' . esc_attr( $this->item[ 'parent' ][ 'label' ] ) . ')</small>'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | // Name of field / widget |
205 | - $output .= '<span class="gv-field-label" data-original-title="'.esc_attr( $label ).'" title="'. $this->get_item_info( false ) .'">'. $label . '</span>'; |
|
205 | + $output .= '<span class="gv-field-label" data-original-title="' . esc_attr( $label ) . '" title="' . $this->get_item_info( false ) . '">' . $label . '</span>'; |
|
206 | 206 | |
207 | 207 | |
208 | - $output .= '<span class="gv-field-controls">'.$settings_link.$show_as_link.'<a href="#remove" class="dashicons-dismiss dashicons" title="'.esc_attr( $delete_title ) .'"></a></span>'; |
|
208 | + $output .= '<span class="gv-field-controls">' . $settings_link . $show_as_link . '<a href="#remove" class="dashicons-dismiss dashicons" title="' . esc_attr( $delete_title ) . '"></a></span>'; |
|
209 | 209 | |
210 | 210 | // Displays only in the field/widget picker. |
211 | - if( $field_info = $this->get_item_info() ) { |
|
212 | - $output .= '<span class="gv-field-info">'.$field_info.'</span>'; |
|
211 | + if ( $field_info = $this->get_item_info() ) { |
|
212 | + $output .= '<span class="gv-field-info">' . $field_info . '</span>'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | $output .= '</h5>'; |
216 | 216 | |
217 | - $container_class = !empty( $this->item['parent'] ) ? ' gv-child-field' : ''; |
|
217 | + $container_class = ! empty( $this->item[ 'parent' ] ) ? ' gv-child-field' : ''; |
|
218 | 218 | |
219 | - $output = '<div data-fieldid="'.esc_attr($this->id).'" data-inputtype="'.esc_attr( $this->item['input_type'] ).'" class="gv-fields'.$container_class.'">'.$output.$this->item['settings_html'].'</div>'; |
|
219 | + $output = '<div data-fieldid="' . esc_attr( $this->id ) . '" data-inputtype="' . esc_attr( $this->item[ 'input_type' ] ) . '" class="gv-fields' . $container_class . '">' . $output . $this->item[ 'settings_html' ] . '</div>'; |
|
220 | 220 | |
221 | 221 | return $output; |
222 | 222 | } |