@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | array( |
84 | 84 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), |
85 | 85 | 'action' => 'entry_creator_get_users', |
86 | - 'gf25' => (bool) gravityview()->plugin->is_GF_25(), |
|
86 | + 'gf25' => (bool)gravityview()->plugin->is_GF_25(), |
|
87 | 87 | 'language' => array( |
88 | 88 | 'search_placeholder' => esc_html__( 'Search by ID, login, email, or name.', 'gravityview' ), |
89 | 89 | ), |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | ) |
108 | 108 | ); |
109 | 109 | |
110 | - if ( ! wp_verify_nonce( $post_var['gv_nonce'], 'gv_entry_creator' ) ) { |
|
110 | + if ( ! wp_verify_nonce( $post_var[ 'gv_nonce' ], 'gv_entry_creator' ) ) { |
|
111 | 111 | die(); |
112 | 112 | } |
113 | 113 | |
114 | - $search_string = $post_var['q']; |
|
114 | + $search_string = $post_var[ 'q' ]; |
|
115 | 115 | |
116 | 116 | if ( is_numeric( $search_string ) ) { |
117 | 117 | $user_args = array( |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing |
161 | - $result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true ); |
|
161 | + $result = RGFormsModel::update_entry_property( (int)$entry[ 'id' ], 'created_by', (int)$user_id, false, true ); |
|
162 | 162 | |
163 | 163 | if ( false === $result ) { |
164 | 164 | $status = __( 'Error', 'gravityview' ); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | return; |
181 | 181 | } |
182 | 182 | |
183 | - GravityView_Entry_Notes::add_note( $entry['id'], - 1, 'GravityView', $note, 'gravityview' ); |
|
183 | + GravityView_Entry_Notes::add_note( $entry[ 'id' ], - 1, 'GravityView', $note, 'gravityview' ); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | // If screen mode isn't set, then we're in the wrong place. |
218 | - if ( empty( $_REQUEST['screen_mode'] ) ) { |
|
218 | + if ( empty( $_REQUEST[ 'screen_mode' ] ) ) { |
|
219 | 219 | return; |
220 | 220 | } |
221 | 221 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | // If $_GET['screen_mode'] is set to edit, set $_POST value |
243 | 243 | if ( \GV\Utils::_GET( 'screen_mode' ) === 'edit' ) { |
244 | - $_POST["screen_mode"] = 'edit'; |
|
244 | + $_POST[ "screen_mode" ] = 'edit'; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' ); |
317 | 317 | |
318 | 318 | $entry_creator_user = GVCommon::get_users( 'change_entry_creator', array( 'include' => $entry_creator_user_id ) ); |
319 | - $entry_creator_user = isset( $entry_creator_user[0] ) ? $entry_creator_user[0] : array(); |
|
319 | + $entry_creator_user = isset( $entry_creator_user[ 0 ] ) ? $entry_creator_user[ 0 ] : array(); |
|
320 | 320 | |
321 | 321 | $output .= '<option value="0" ' . selected( true, empty( $entry_creator_user_id ), false ) . '> — ' . esc_attr_x( 'No User', 'No user assigned to the entry', 'gravityview' ) . ' — </option>'; |
322 | 322 | |
@@ -335,18 +335,18 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | $user_count = count_users(); |
338 | - $user_count = $user_count['total_users']; |
|
338 | + $user_count = $user_count[ 'total_users' ]; |
|
339 | 339 | $users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 ); |
340 | 340 | if ( $user_count > $users_displayed ) { |
341 | 341 | $remaining_users = $user_count - $users_displayed; |
342 | - $user_users = _n( esc_html__('user', 'gravityview' ), esc_html__('users', 'gravityview' ), $remaining_users ); |
|
342 | + $user_users = _n( esc_html__( 'user', 'gravityview' ), esc_html__( 'users', 'gravityview' ), $remaining_users ); |
|
343 | 343 | $message = esc_html_x( 'Use the input above to search the remaining %d %s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gravityview' ); |
344 | 344 | $message = sprintf( $message, $remaining_users, $user_users ); |
345 | - $output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>'; |
|
345 | + $output .= '<option value="_user_count" disabled="disabled">' . esc_html( $message ) . '</option>'; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | $output .= '</select>'; |
349 | - $output .= '<input name="originally_created_by" value="' . esc_attr( $entry['created_by'] ) . '" type="hidden" />'; |
|
349 | + $output .= '<input name="originally_created_by" value="' . esc_attr( $entry[ 'created_by' ] ) . '" type="hidden" />'; |
|
350 | 350 | $output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false ); |
351 | 351 | |
352 | 352 | echo $output; |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | * @return array |
361 | 361 | */ |
362 | 362 | function register_gform_noconflict( $assets ) { |
363 | - $assets[] = 'gravityview_selectwoo'; |
|
364 | - $assets[] = 'gravityview_entry_creator'; |
|
363 | + $assets[ ] = 'gravityview_selectwoo'; |
|
364 | + $assets[ ] = 'gravityview_entry_creator'; |
|
365 | 365 | |
366 | 366 | return $assets; |
367 | 367 | } |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | <div id="publishing-action"> |
21 | 21 | <?php |
22 | 22 | |
23 | - /** |
|
24 | - * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL |
|
25 | - * @since 1.11.1 |
|
26 | - * @since 2.11 The cancel link now uses history.back() so the $back_link URL matters less. |
|
27 | - * @param string $back_link Existing URL of the Cancel link |
|
28 | - * @param array $form The Gravity Forms form |
|
29 | - * @param array $entry The Gravity Forms entry |
|
30 | - * @param int $view_id The current View ID |
|
31 | - */ |
|
32 | - $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id ); |
|
23 | + /** |
|
24 | + * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL |
|
25 | + * @since 1.11.1 |
|
26 | + * @since 2.11 The cancel link now uses history.back() so the $back_link URL matters less. |
|
27 | + * @param string $back_link Existing URL of the Cancel link |
|
28 | + * @param array $form The Gravity Forms form |
|
29 | + * @param array $entry The Gravity Forms entry |
|
30 | + * @param int $view_id The current View ID |
|
31 | + */ |
|
32 | + $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id ); |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @action `gravityview/edit-entry/publishing-action/before` Triggered before the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container. |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | * @used-by GravityView_Delete_Entry::add_delete_button() |
85 | 85 | * |
86 | 86 | * @since 1.5.1 |
87 | - * @since 2.0.13 Added $post_id |
|
87 | + * @since 2.0.13 Added $post_id |
|
88 | 88 | * @param array $form The Gravity Forms form |
89 | 89 | * @param array $entry The Gravity Forms entry |
90 | 90 | * @param int $view_id The current View ID |
91 | - * @param int $post_id The current Post ID |
|
91 | + * @param int $post_id The current Post ID |
|
92 | 92 | */ |
93 | 93 | do_action( 'gravityview/edit-entry/publishing-action/after', $object->form, $object->entry, $object->view_id, $object->post_id ); |
94 | 94 | ?> |
@@ -44,35 +44,35 @@ discard block |
||
44 | 44 | |
45 | 45 | if ( $object->show_previous_button ) { |
46 | 46 | $previous_tabindex = GFCommon::get_tabindex(); |
47 | - $previous_label = GFCommon::replace_variables( $labels['previous'], $object->form, $object->entry ); |
|
47 | + $previous_label = GFCommon::replace_variables( $labels[ 'previous' ], $object->form, $object->entry ); |
|
48 | 48 | ?> |
49 | - <input id="gform_previous_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" /> |
|
49 | + <input id="gform_previous_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $previous_label ); ?>" name="save" /> |
|
50 | 50 | <?php |
51 | 51 | } |
52 | 52 | |
53 | 53 | if ( $object->show_next_button ) { |
54 | - $next_tabindex = GFCommon::get_tabindex(); |
|
55 | - $next_label = GFCommon::replace_variables( $labels['next'], $object->form, $object->entry ); |
|
54 | + $next_tabindex = GFCommon::get_tabindex(); |
|
55 | + $next_label = GFCommon::replace_variables( $labels[ 'next' ], $object->form, $object->entry ); |
|
56 | 56 | ?> |
57 | - <input id="gform_next_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" /> |
|
57 | + <input id="gform_next_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $next_label ); ?>" name="save" /> |
|
58 | 58 | <?php |
59 | 59 | } |
60 | 60 | |
61 | 61 | if ( $object->show_update_button ) { |
62 | - $update_tabindex = GFCommon::get_tabindex(); |
|
63 | - $update_label = GFCommon::replace_variables( $labels['submit'], $object->form, $object->entry ); |
|
62 | + $update_tabindex = GFCommon::get_tabindex(); |
|
63 | + $update_label = GFCommon::replace_variables( $labels[ 'submit' ], $object->form, $object->entry ); |
|
64 | 64 | ?> |
65 | - <input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" /> |
|
65 | + <input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $update_label ); ?>" name="save" /> |
|
66 | 66 | <?php |
67 | 67 | } |
68 | 68 | |
69 | - $cancel_tabindex = GFCommon::get_tabindex(); |
|
70 | - $cancel_label = GFCommon::replace_variables( $labels['cancel'], $object->form, $object->entry ); |
|
69 | + $cancel_tabindex = GFCommon::get_tabindex(); |
|
70 | + $cancel_label = GFCommon::replace_variables( $labels[ 'cancel' ], $object->form, $object->entry ); |
|
71 | 71 | |
72 | 72 | // If the entry has been edited, history.back() will keep pointing to the Edit Entry screen. Go back before editing, please! |
73 | 73 | // On first visit, will be history.go(-1) because (0 + 1 * -1). |
74 | 74 | // After updating twice, history.go(-3) because (2 + 1 * -1) |
75 | - $update_count = (int) \GV\Utils::_POST( 'update_count', 0 ); |
|
75 | + $update_count = (int)\GV\Utils::_POST( 'update_count', 0 ); |
|
76 | 76 | $cancel_onclick = 'history.go(' . ( $update_count + 1 ) * -1 . '); return false;'; |
77 | 77 | ?> |
78 | 78 | <a class="btn btn-sm button button-small gv-button-cancel" onclick="<?php echo esc_attr( $cancel_onclick ); ?>" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $cancel_label ); ?></a> |
@@ -94,5 +94,5 @@ discard block |
||
94 | 94 | ?> |
95 | 95 | <input type='hidden' name='update_count' value='<?php echo $update_count + 1; ?>'/> |
96 | 96 | <input type="hidden" name="action" value="update" /> |
97 | - <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" /> |
|
97 | + <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" /> |
|
98 | 98 | </div> |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | foreach ( $field->choices as $choice ) { |
49 | 49 | if ( is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value[ $input_id ] ) ) { |
50 | - return $choice['score']; |
|
50 | + return $choice[ 'score' ]; |
|
51 | 51 | } else if ( ! is_array( $value ) && RGFormsModel::choice_value_match( $field, $choice, $value ) ) { |
52 | - return $choice['score']; |
|
52 | + return $choice[ 'score' ]; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
60 | 60 | |
61 | - unset( $field_options['search_filter'] ); |
|
61 | + unset( $field_options[ 'search_filter' ] ); |
|
62 | 62 | |
63 | 63 | if ( 'edit' === $context ) { |
64 | 64 | return $field_options; |
@@ -80,18 +80,18 @@ discard block |
||
80 | 80 | 'text' => __( 'Text value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ), |
81 | 81 | ); |
82 | 82 | |
83 | - if( $field->field->gsurveyLikertEnableScoring ) { |
|
84 | - $likert_display_options['score'] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ); |
|
83 | + if ( $field->field->gsurveyLikertEnableScoring ) { |
|
84 | + $likert_display_options[ 'score' ] = __( 'Score value of the selected choice', 'gravityview' ) . ( $show_suffix ? '' : $multiple_rows_suffix ); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | // Maintain for back-compatibility |
88 | - $add_options['score'] = array( |
|
88 | + $add_options[ 'score' ] = array( |
|
89 | 89 | 'type' => 'hidden', |
90 | 90 | 'value' => '', |
91 | 91 | 'group' => 'display', |
92 | 92 | ); |
93 | 93 | |
94 | - $add_options['choice_display'] = array( |
|
94 | + $add_options[ 'choice_display' ] = array( |
|
95 | 95 | 'type' => 'radio', |
96 | 96 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
97 | 97 | 'options' => $likert_display_options, |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | ); |
104 | 104 | } |
105 | 105 | |
106 | - if( 'checkbox' === $field->field->inputType && $input_id ) { |
|
107 | - $field_options['choice_display'] = array( |
|
106 | + if ( 'checkbox' === $field->field->inputType && $input_id ) { |
|
107 | + $field_options[ 'choice_display' ] = array( |
|
108 | 108 | 'type' => 'radio', |
109 | 109 | 'class' => 'vertical', |
110 | 110 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | if ( 'rating' === $field->field->inputType ) { |
123 | - $field_options['choice_display'] = array( |
|
123 | + $field_options[ 'choice_display' ] = array( |
|
124 | 124 | 'type' => 'radio', |
125 | 125 | 'class' => 'vertical', |
126 | 126 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -26,52 +26,52 @@ |
||
26 | 26 | |
27 | 27 | <?php // list all the available templates (type= fresh or custom ) ?> |
28 | 28 | <div class="gv-grid"> |
29 | - <?php foreach( $templates as $id => $template ) { |
|
29 | + <?php foreach ( $templates as $id => $template ) { |
|
30 | 30 | $selected = ( $id == $current_template ) ? ' gv-selected' : ''; |
31 | - $placeholder = ! empty( $template['buy_source'] ); |
|
32 | - $is_included = ! empty( $template['included'] ); |
|
31 | + $placeholder = ! empty( $template[ 'buy_source' ] ); |
|
32 | + $is_included = ! empty( $template[ 'included' ] ); |
|
33 | 33 | $plugin_data = GravityView_Admin_Installer::get_wp_plugins_data( \GV\Utils::get( $template, 'textdomain', '' ) ); |
34 | 34 | $button_text = empty( $plugin_data ) ? esc_html__( 'Install Layout', 'gravityview' ) : esc_html__( 'Activate & Select Layout', 'gravityview' ); |
35 | 35 | $button_class = 'gv-layout-' . ( empty( $plugin_data ) ? 'install' : 'activate' ); |
36 | - $template_path = isset($plugin_data['path']) ? $plugin_data['path'] : ''; |
|
36 | + $template_path = isset( $plugin_data[ 'path' ] ) ? $plugin_data[ 'path' ] : ''; |
|
37 | 37 | |
38 | 38 | ?> |
39 | 39 | <div class="gv-grid-col-1-4"> |
40 | - <div class="gv-view-types-module<?php echo $selected; if( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>"> |
|
40 | + <div class="gv-view-types-module<?php echo $selected; if ( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>"> |
|
41 | 41 | <div class="gv-view-types-normal"> |
42 | - <img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>"> |
|
43 | - <h5><?php echo esc_html( $template['label'] ); ?></h5> |
|
44 | - <p class="description"><?php echo esc_html( $template['description'] ); ?></p> |
|
42 | + <img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>"> |
|
43 | + <h5><?php echo esc_html( $template[ 'label' ] ); ?></h5> |
|
44 | + <p class="description"><?php echo esc_html( $template[ 'description' ] ); ?></p> |
|
45 | 45 | </div> |
46 | 46 | <div class="gv-view-types-hover"> |
47 | 47 | <div> |
48 | 48 | <?php |
49 | - if( $is_included ) { |
|
49 | + if ( $is_included ) { |
|
50 | 50 | ?> |
51 | 51 | <p><a href="<?php echo esc_url( admin_url( 'edit.php?post_type=gravityview&page=gv-admin-installer' ) ); ?>" class="button button-secondary button-hero <?php echo $button_class; ?>" rel="internal" data-template-path="<?php echo $template_path; ?>"><?php echo $button_text; ?></a></p> |
52 | - <?php if( !empty( $template['license'] ) ) { ?> |
|
53 | - <p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', ' ', $template['license'] ) ) ); ?></p> |
|
52 | + <?php if ( ! empty( $template[ 'license' ] ) ) { ?> |
|
53 | + <p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), esc_html( str_replace( ' ', ' ', $template[ 'license' ] ) ) ); ?></p> |
|
54 | 54 | <?php } ?> |
55 | 55 | <?php |
56 | - } elseif( $placeholder ) { |
|
57 | - $utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template['license'] ) . '&utm_content=' . urlencode( $template['slug'] ); |
|
56 | + } elseif ( $placeholder ) { |
|
57 | + $utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template[ 'license' ] ) . '&utm_content=' . urlencode( $template[ 'slug' ] ); |
|
58 | 58 | ?> |
59 | - <p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p> |
|
59 | + <p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gravityview' ); ?></a></p> |
|
60 | 60 | |
61 | - <?php if( !empty( $template['preview'] ) ) { ?> |
|
62 | - <p><a href="<?php echo esc_url( $template['preview'] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview'); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p> |
|
61 | + <?php if ( ! empty( $template[ 'preview' ] ) ) { ?> |
|
62 | + <p><a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gravityview' ); ?>"></i> <?php esc_html_e( 'Try a demo', 'gravityview' ); ?></a></p> |
|
63 | 63 | <?php } ?> |
64 | 64 | |
65 | - <?php if( ! empty( $template['license'] ) ) { ?> |
|
66 | - <p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', ' ', $template['license'] ) ) . '</a>' ); ?></p> |
|
65 | + <?php if ( ! empty( $template[ 'license' ] ) ) { ?> |
|
66 | + <p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gravityview' ), '<a href="https://gravityview.co/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', ' ', $template[ 'license' ] ) ) . '</a>' ); ?></p> |
|
67 | 67 | <?php } ?> |
68 | 68 | <?php } |
69 | 69 | |
70 | - if ($placeholder || $is_included) { ?> </div><div class="hidden"> <?php } ?> |
|
70 | + if ( $placeholder || $is_included ) { ?> </div><div class="hidden"> <?php } ?> |
|
71 | 71 | |
72 | - <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p> |
|
73 | - <?php if( !empty( $template['preview'] ) ) { ?> |
|
74 | - <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a> |
|
72 | + <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview' ); ?></a></p> |
|
73 | + <?php if ( ! empty( $template[ 'preview' ] ) ) { ?> |
|
74 | + <a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview' ); ?>"></i></a> |
|
75 | 75 | <?php } ?> |
76 | 76 | </div> |
77 | 77 | </div> |
@@ -114,14 +114,14 @@ |
||
114 | 114 | /** Require critical legacy core files. @todo Deprecate */ |
115 | 115 | require_once $this->plugin->dir( 'includes/import-functions.php' ); |
116 | 116 | require_once $this->plugin->dir( 'includes/helper-functions.php' ); |
117 | - require_once $this->plugin->dir( 'includes/class-common.php'); |
|
118 | - require_once $this->plugin->dir( 'includes/connector-functions.php'); |
|
117 | + require_once $this->plugin->dir( 'includes/class-common.php' ); |
|
118 | + require_once $this->plugin->dir( 'includes/connector-functions.php' ); |
|
119 | 119 | require_once $this->plugin->dir( 'includes/class-gravityview-compatibility.php' ); |
120 | 120 | require_once $this->plugin->dir( 'includes/class-gravityview-roles-capabilities.php' ); |
121 | 121 | require_once $this->plugin->dir( 'includes/class-gravityview-admin-notices.php' ); |
122 | 122 | require_once $this->plugin->dir( 'includes/class-admin.php' ); |
123 | - require_once $this->plugin->dir( 'includes/class-post-types.php'); |
|
124 | - require_once $this->plugin->dir( 'includes/class-cache.php'); |
|
123 | + require_once $this->plugin->dir( 'includes/class-post-types.php' ); |
|
124 | + require_once $this->plugin->dir( 'includes/class-cache.php' ); |
|
125 | 125 | |
126 | 126 | /** |
127 | 127 | * GravityView extensions and widgets. |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function gravityview_import_helper_fix_line_breaks( $postmeta = array(), $post_id = 0, $post = array() ) { |
48 | 48 | |
49 | - if ( empty( $post['postmeta'] ) ) { |
|
49 | + if ( empty( $post[ 'postmeta' ] ) ) { |
|
50 | 50 | return $postmeta; |
51 | 51 | } |
52 | 52 | |
53 | - if ( 'gravityview' !== $post['post_type'] ) { |
|
53 | + if ( 'gravityview' !== $post[ 'post_type' ] ) { |
|
54 | 54 | return $postmeta; |
55 | 55 | } |
56 | 56 | |
@@ -62,27 +62,27 @@ discard block |
||
62 | 62 | $performed_fix = false; |
63 | 63 | |
64 | 64 | foreach ( $postmeta as &$meta ) { |
65 | - $key = $meta['key']; |
|
65 | + $key = $meta[ 'key' ]; |
|
66 | 66 | |
67 | 67 | if ( ! in_array( $key, $keys_to_fix, true ) ) { |
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | |
71 | - $is_valid_serialized_data = maybe_unserialize( $meta['value'] ); |
|
71 | + $is_valid_serialized_data = maybe_unserialize( $meta[ 'value' ] ); |
|
72 | 72 | |
73 | 73 | // The values are not corrupted serialized data. No need to fix. |
74 | 74 | if ( false !== $is_valid_serialized_data ) { |
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | |
78 | - $meta['value'] = str_replace( "\n", "\n\n", $meta['value'] ); |
|
78 | + $meta[ 'value' ] = str_replace( "\n", "\n\n", $meta[ 'value' ] ); |
|
79 | 79 | |
80 | 80 | $performed_fix = true; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // Leave a note that this modification has been done. We'll use it later. |
84 | 84 | if ( $performed_fix ) { |
85 | - $postmeta[] = array( |
|
85 | + $postmeta[ ] = array( |
|
86 | 86 | 'key' => '_gravityview_fixed_import_serialization', |
87 | 87 | 'value' => 1, |
88 | 88 | ); |