@@ -24,21 +24,21 @@ discard block |
||
24 | 24 | |
25 | 25 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
26 | 26 | |
27 | - unset( $field_options['search_filter'] ); |
|
27 | + unset( $field_options[ 'search_filter' ] ); |
|
28 | 28 | |
29 | - if( 'edit' === $context ) { |
|
29 | + if ( 'edit' === $context ) { |
|
30 | 30 | return $field_options; |
31 | 31 | } |
32 | 32 | |
33 | - $add_options['link_to_file'] = array( |
|
33 | + $add_options[ 'link_to_file' ] = array( |
|
34 | 34 | 'type' => 'checkbox', |
35 | 35 | 'label' => __( 'Display as a Link:', 'gravityview' ), |
36 | - 'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'), |
|
36 | + 'desc' => __( 'Display the uploaded files as links, rather than embedded content.', 'gravityview' ), |
|
37 | 37 | 'value' => false, |
38 | 38 | 'merge_tags' => false, |
39 | 39 | ); |
40 | 40 | |
41 | - $add_options['image_width'] = array( |
|
41 | + $add_options[ 'image_width' ] = array( |
|
42 | 42 | 'type' => 'text', |
43 | 43 | 'label' => __( 'Custom Width:', 'gravityview' ), |
44 | 44 | 'desc' => __( 'Override the default image width (250).', 'gravityview' ), |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | $base_id = null; |
128 | 128 | |
129 | 129 | $is_single = gravityview_get_context() === 'single'; |
130 | - $lightbox = ! empty( $gravityview_view->atts['lightbox'] ); |
|
130 | + $lightbox = ! empty( $gravityview_view->atts[ 'lightbox' ] ); |
|
131 | 131 | $field_compat = $gravityview_view->getCurrentField(); |
132 | 132 | } |
133 | 133 | |
134 | 134 | $output_arr = array(); |
135 | 135 | |
136 | 136 | // Get an array of file paths for the field. |
137 | - $file_paths = \GV\Utils::get( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
137 | + $file_paths = \GV\Utils::get( $field, 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
138 | 138 | |
139 | 139 | // The $value JSON was probably truncated; let's check lead_detail_long. |
140 | 140 | if ( ! is_array( $file_paths ) ) { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $rendered = null; |
154 | 154 | |
155 | 155 | // If the site is HTTPS, use HTTPS |
156 | - if ( function_exists('set_url_scheme') ) { |
|
156 | + if ( function_exists( 'set_url_scheme' ) ) { |
|
157 | 157 | $file_path = set_url_scheme( $file_path ); |
158 | 158 | } |
159 | 159 | |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | $file_path_info = pathinfo( $file_path ); |
165 | 165 | |
166 | 166 | // If pathinfo() gave us the extension of the file, run the switch statement using that. |
167 | - $extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] ); |
|
168 | - $basename = $file_path_info['basename']; |
|
167 | + $extension = empty( $file_path_info[ 'extension' ] ) ? NULL : strtolower( $file_path_info[ 'extension' ] ); |
|
168 | + $basename = $file_path_info[ 'basename' ]; |
|
169 | 169 | |
170 | 170 | // Get the secure download URL |
171 | 171 | $is_secure = false; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | $audio_settings = apply_filters( 'gravityview_audio_settings', array( |
204 | 204 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
205 | - 'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id'] |
|
205 | + 'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings[ 'id' ] |
|
206 | 206 | ), $context ); |
207 | 207 | |
208 | 208 | /** |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | $video_settings = apply_filters( 'gravityview_video_settings', array( |
240 | 240 | 'src' => $insecure_file_path, // Needs to be insecure path so WP can parse extension |
241 | - 'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id'] |
|
241 | + 'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings[ 'id' ] |
|
242 | 242 | ), $context ); |
243 | 243 | |
244 | 244 | /** |
@@ -271,13 +271,13 @@ discard block |
||
271 | 271 | $width = \GV\Utils::get( $field_settings, 'image_width', 250 ); |
272 | 272 | $image_atts = array( |
273 | 273 | 'src' => $file_path, |
274 | - 'class' => 'gv-image gv-field-id-' . $field_settings['id'], |
|
275 | - 'alt' => $field_settings['label'], |
|
276 | - 'width' => ( $is_single ? null : ( $width ? $width: 250 ) ) |
|
274 | + 'class' => 'gv-image gv-field-id-' . $field_settings[ 'id' ], |
|
275 | + 'alt' => $field_settings[ 'label' ], |
|
276 | + 'width' => ( $is_single ? null : ( $width ? $width : 250 ) ) |
|
277 | 277 | ); |
278 | 278 | |
279 | 279 | if ( $is_secure ) { |
280 | - $image_atts['validate_src'] = false; |
|
280 | + $image_atts[ 'validate_src' ] = false; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | $image = new GravityView_Image( $image_atts ); |
294 | 294 | |
295 | - $entry_slug = GravityView_API::get_entry_slug( $entry['id'], $entry ); |
|
295 | + $entry_slug = GravityView_API::get_entry_slug( $entry[ 'id' ], $entry ); |
|
296 | 296 | |
297 | 297 | /** |
298 | 298 | * @filter `gravityview/fields/fileupload/allow_insecure_lightbox` Allow insecure links to be shown for the lighbox. |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | $override_security = apply_filters( 'gravityview/fields/fileupload/allow_insecure_lightbox', false, $file_path, $field_settings, $context ); |
305 | 305 | |
306 | - if ( $lightbox && empty( $field_settings['show_as_link'] ) && ( ! $is_secure || $override_security ) ) { |
|
306 | + if ( $lightbox && empty( $field_settings[ 'show_as_link' ] ) && ( ! $is_secure || $override_security ) ) { |
|
307 | 307 | $lightbox_link_atts = array( |
308 | 308 | 'rel' => sprintf( "%s-%s", $gv_class, $entry_slug ), |
309 | 309 | 'class' => 'thickbox', |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $lightbox_link_atts = apply_filters( 'gravityview/fields/fileupload/link_atts', $lightbox_link_atts, $field_compat, $context ); |
313 | 313 | |
314 | 314 | if ( $override_security ) { |
315 | - $image_atts['src'] = $insecure_file_path; |
|
315 | + $image_atts[ 'src' ] = $insecure_file_path; |
|
316 | 316 | $image = new GravityView_Image( $image_atts ); |
317 | 317 | $file_path = $insecure_file_path; |
318 | 318 | // :( a kitten died somewhere |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | |
326 | 326 | // Show as link should render the image regardless. |
327 | - if ( ! empty( $field_settings['show_as_link'] ) ) { |
|
327 | + if ( ! empty( $field_settings[ 'show_as_link' ] ) ) { |
|
328 | 328 | $text = $rendered; |
329 | 329 | } |
330 | 330 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', false, $field_compat, $context ); |
342 | 342 | |
343 | 343 | // Output textualized content where |
344 | - if ( ! $disable_wrapped_link && ( ! empty( $field_settings['link_to_file'] ) || ! empty( $field_settings['show_as_link'] ) ) ) { |
|
344 | + if ( ! $disable_wrapped_link && ( ! empty( $field_settings[ 'link_to_file' ] ) || ! empty( $field_settings[ 'show_as_link' ] ) ) ) { |
|
345 | 345 | /** |
346 | 346 | * Modify the link text (defaults to the file name) |
347 | 347 | * |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | $content = apply_filters( 'gravityview/fields/fileupload/link_content', $text, $field_compat, $context ); |
356 | 356 | |
357 | - if ( empty( $field_settings['show_as_link'] ) ) { |
|
357 | + if ( empty( $field_settings[ 'show_as_link' ] ) ) { |
|
358 | 358 | /** |
359 | 359 | * @filter `gravityview/fields/fileupload/link_atts` Modify the link attributes for a file upload field |
360 | 360 | * @param array|string $link_atts Array or attributes string |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $content = empty( $rendered ) ? $text : $rendered; |
371 | 371 | } |
372 | 372 | |
373 | - $output_arr[] = array( |
|
373 | + $output_arr[ ] = array( |
|
374 | 374 | 'file_path' => $file_path, |
375 | 375 | 'content' => $content |
376 | 376 | ); |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | */ |
48 | 48 | $atts = apply_filters( 'gravityview/shortcodes/gventry/atts', $atts ); |
49 | 49 | |
50 | - $view = \GV\View::by_id( $atts['view_id'] ); |
|
50 | + $view = \GV\View::by_id( $atts[ 'view_id' ] ); |
|
51 | 51 | |
52 | 52 | if ( ! $view ) { |
53 | - gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts['view_id'] ) ); |
|
53 | + gravityview()->log->error( 'View does not exist #{view_id}', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
54 | 54 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', null, null, $atts ); |
55 | 55 | } |
56 | 56 | |
57 | - $entry_id = ! empty( $atts['entry_id'] ) ? $atts['entry_id'] : $atts['id']; |
|
57 | + $entry_id = ! empty( $atts[ 'entry_id' ] ) ? $atts[ 'entry_id' ] : $atts[ 'id' ]; |
|
58 | 58 | |
59 | - switch( $entry_id ): |
|
59 | + switch ( $entry_id ): |
|
60 | 60 | case 'last': |
61 | 61 | if ( class_exists( '\GF_Query' ) ) { |
62 | 62 | /** |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | * Since we're using \GF_Query shorthand initialization we have to reverse the order parameters here. |
66 | 66 | */ |
67 | 67 | add_filter( 'gravityview_get_entries', $filter = function( $parameters, $args, $form_id ) { |
68 | - if ( ! empty( $parameters['sorting'] ) ) { |
|
68 | + if ( ! empty( $parameters[ 'sorting' ] ) ) { |
|
69 | 69 | /** |
70 | 70 | * Reverse existing sorts. |
71 | 71 | */ |
72 | - $sort = &$parameters['sorting']; |
|
73 | - $sort['direction'] = $sort['direction'] == 'RAND' ? : ( $sort['direction'] == 'ASC' ? 'DESC' : 'ASC' ); |
|
72 | + $sort = &$parameters[ 'sorting' ]; |
|
73 | + $sort[ 'direction' ] = $sort[ 'direction' ] == 'RAND' ?: ( $sort[ 'direction' ] == 'ASC' ? 'DESC' : 'ASC' ); |
|
74 | 74 | } else { |
75 | 75 | /** |
76 | 76 | * Otherwise, sort by date_created. |
77 | 77 | */ |
78 | - $parameters['sorting'] = array( |
|
78 | + $parameters[ 'sorting' ] = array( |
|
79 | 79 | 'key' => 'id', |
80 | 80 | 'direction' => 'ASC', |
81 | 81 | 'is_numeric' => true |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | /** If a sort already exists, reverse it. */ |
92 | 92 | if ( $sort = end( $entries->sorts ) ) { |
93 | - $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ? : ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
93 | + $entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ?: ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode ); |
|
94 | 94 | } else { |
95 | 95 | /** Otherwise, sort by date_created */ |
96 | 96 | $entries = $entries->sort( new \GV\Entry_Sort( \GV\Internal_Field::by_id( 'id' ), \GV\Entry_Sort::ASC ), \GV\Entry_Sort::NUMERIC ); |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | break; |
109 | 109 | default: |
110 | 110 | if ( ! $entry = \GV\GF_Entry::by_id( $entry_id ) ) { |
111 | - gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts['view_id'] ) ); |
|
111 | + gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) ); |
|
112 | 112 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, null, $atts ); |
113 | 113 | } |
114 | 114 | endswitch; |
115 | 115 | |
116 | - if ( $view->form->ID != $entry['form_id'] ) { |
|
116 | + if ( $view->form->ID != $entry[ 'form_id' ] ) { |
|
117 | 117 | gravityview()->log->error( 'Entry does not belong to view (form mismatch)' ); |
118 | 118 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
119 | 119 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return apply_filters( 'gravityview/shortcodes/gventry/output', get_the_password_form( $view->ID ), $view, $entry, $atts ); |
124 | 124 | } |
125 | 125 | |
126 | - if ( ! $view->form ) { |
|
126 | + if ( ! $view->form ) { |
|
127 | 127 | gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) ); |
128 | 128 | |
129 | 129 | /** |
@@ -146,43 +146,43 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | /** Unapproved entries. */ |
149 | - if ( $entry['status'] != 'active' ) { |
|
149 | + if ( $entry[ 'status' ] != 'active' ) { |
|
150 | 150 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
151 | 151 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
152 | 152 | } |
153 | 153 | |
154 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
154 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
155 | 155 | |
156 | 156 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
157 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
157 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
158 | 158 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
159 | 159 | return apply_filters( 'gravityview/shortcodes/gventry/output', '', $view, $entry, $atts ); |
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
163 | - if ( $atts['edit'] ) { |
|
163 | + if ( $atts[ 'edit' ] ) { |
|
164 | 164 | /** |
165 | 165 | * Based on code in our unit-tests. |
166 | 166 | * Mocks old context, etc. |
167 | 167 | */ |
168 | 168 | $loader = \GravityView_Edit_Entry::getInstance(); |
169 | - $render = $loader->instances['render']; |
|
169 | + $render = $loader->instances[ 'render' ]; |
|
170 | 170 | |
171 | 171 | add_filter( 'gravityview/is_single_entry', '__return_true' ); |
172 | 172 | |
173 | - $form = \GFAPI::get_form( $entry['form_id'] ); |
|
173 | + $form = \GFAPI::get_form( $entry[ 'form_id' ] ); |
|
174 | 174 | |
175 | 175 | $data = \GravityView_View_Data::getInstance( $view ); |
176 | 176 | $template = \GravityView_View::getInstance( array( |
177 | 177 | 'form' => $form, |
178 | - 'form_id' => $form['id'], |
|
178 | + 'form_id' => $form[ 'id' ], |
|
179 | 179 | 'view_id' => $view->ID, |
180 | 180 | 'entries' => array( $entry ), |
181 | 181 | 'atts' => \GVCommon::get_template_settings( $view->ID ), |
182 | 182 | ) ); |
183 | 183 | |
184 | - $_GET['edit'] = wp_create_nonce( |
|
185 | - \GravityView_Edit_Entry::get_nonce_key( $view->ID, $form['id'], $entry['id'] ) |
|
184 | + $_GET[ 'edit' ] = wp_create_nonce( |
|
185 | + \GravityView_Edit_Entry::get_nonce_key( $view->ID, $form[ 'id' ], $entry[ 'id' ] ) |
|
186 | 186 | ); |
187 | 187 | |
188 | 188 | add_filter( 'gravityview/edit_entry/success', $callback = function( $message ) use ( $view, $entry, $atts ) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | return apply_filters( 'gravityview/shortcodes/gventry/edit/success', $message, $view, $entry, $atts ); |
200 | 200 | } ); |
201 | 201 | |
202 | - ob_start() && $render->init( $data, \GV\Entry::by_id( $entry['id'] ), $view ); |
|
202 | + ob_start() && $render->init( $data, \GV\Entry::by_id( $entry[ 'id' ] ), $view ); |
|
203 | 203 | $output = ob_get_clean(); // Render :) |
204 | 204 | |
205 | 205 | remove_filter( 'gravityview/is_single_entry', '__return_true' ); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $renderer = new \GV\Entry_Renderer(); |
212 | 212 | |
213 | 213 | $request = new \GV\Mock_Request(); |
214 | - $request->returns['is_entry'] = $entry; |
|
214 | + $request->returns[ 'is_entry' ] = $entry; |
|
215 | 215 | |
216 | 216 | $output = $renderer->render( $entry, $view, $request ); |
217 | 217 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | parent::add_hooks(); |
44 | 44 | |
45 | - add_shortcode( 'gv_pageviews', array( $this, 'pageviews') ); |
|
45 | + add_shortcode( 'gv_pageviews', array( $this, 'pageviews' ) ); |
|
46 | 46 | |
47 | 47 | add_filter( 'gravityview/fields/custom/decode_shortcodes', array( $this, 'inject_entry_id' ), 10, 3 ); |
48 | 48 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * Used as sort of an action via the gravityview/fields/custom/decode_shortcodes filter. |
69 | 69 | */ |
70 | 70 | public function inject_entry_id( $r, $content, $context ) { |
71 | - if ( ! empty( $context->entry['id'] ) ) { |
|
72 | - $this->next_id = $context->entry['id']; |
|
71 | + if ( ! empty( $context->entry[ 'id' ] ) ) { |
|
72 | + $this->next_id = $context->entry[ 'id' ]; |
|
73 | 73 | } else { |
74 | 74 | $this->next_id = false; // Nothing to look at, move along |
75 | 75 | } |
@@ -97,13 +97,13 @@ discard block |
||
97 | 97 | 'id' => $this->next_id, |
98 | 98 | ), $atts ); |
99 | 99 | |
100 | - if ( ! $this->atts['id'] ) { |
|
100 | + if ( ! $this->atts[ 'id' ] ) { |
|
101 | 101 | return; // The ID was not set |
102 | 102 | } |
103 | 103 | |
104 | 104 | add_filter( 'pageviews_placeholder_preload', array( $this, 'preload_callback' ) ); |
105 | 105 | |
106 | - $output = Pageviews::placeholder( 'GV' . $this->atts['id'] ); // Prefix the ID to avoid collissions with default post IDs |
|
106 | + $output = Pageviews::placeholder( 'GV' . $this->atts[ 'id' ] ); // Prefix the ID to avoid collissions with default post IDs |
|
107 | 107 | |
108 | 108 | remove_filter( 'pageviews_placeholder_preload', array( $this, 'preload_callback' ) ); |
109 | 109 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * Set the preload text. |
115 | 115 | */ |
116 | 116 | public function preload_callback( $preload ) { |
117 | - return $this->atts['preload']; |
|
117 | + return $this->atts[ 'preload' ]; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function increment_callback() { |
124 | 124 | if ( $entry = gravityview()->request->is_entry() ) { |
125 | - $increment = 'GV' . $entry['id']; |
|
125 | + $increment = 'GV' . $entry[ 'id' ]; |
|
126 | 126 | ?> |
127 | 127 | _pv_config.incr = <?php echo json_encode( $increment ); ?>; |
128 | 128 | <?php |
@@ -60,28 +60,28 @@ discard block |
||
60 | 60 | if ( $object->show_previous_button ) { |
61 | 61 | $previous_tabindex = GFCommon::get_tabindex(); |
62 | 62 | ?> |
63 | - <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( $labels['previous'] ); ?>" name="save" /> |
|
63 | + <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( $labels[ 'previous' ] ); ?>" name="save" /> |
|
64 | 64 | <?php |
65 | 65 | } |
66 | 66 | |
67 | 67 | if ( $object->show_next_button ) { |
68 | - $next_tabindex = GFCommon::get_tabindex(); |
|
68 | + $next_tabindex = GFCommon::get_tabindex(); |
|
69 | 69 | ?> |
70 | - <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( $labels['next'] ); ?>" name="save" /> |
|
70 | + <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( $labels[ 'next' ] ); ?>" name="save" /> |
|
71 | 71 | <?php |
72 | 72 | } |
73 | 73 | |
74 | 74 | if ( $object->show_update_button ) { |
75 | - $update_tabindex = GFCommon::get_tabindex(); |
|
75 | + $update_tabindex = GFCommon::get_tabindex(); |
|
76 | 76 | ?> |
77 | - <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( $labels['submit'] ); ?>" name="save" /> |
|
77 | + <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( $labels[ 'submit' ] ); ?>" name="save" /> |
|
78 | 78 | <?php |
79 | 79 | } |
80 | 80 | |
81 | - $cancel_tabindex = GFCommon::get_tabindex(); |
|
81 | + $cancel_tabindex = GFCommon::get_tabindex(); |
|
82 | 82 | |
83 | 83 | ?> |
84 | - <a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $labels['cancel'] ); ?></a> |
|
84 | + <a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $labels[ 'cancel' ] ); ?></a> |
|
85 | 85 | <?php |
86 | 86 | |
87 | 87 | /** |
@@ -97,5 +97,5 @@ discard block |
||
97 | 97 | |
98 | 98 | ?> |
99 | 99 | <input type="hidden" name="action" value="update" /> |
100 | - <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" /> |
|
100 | + <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" /> |
|
101 | 101 | </div> |
@@ -17,7 +17,7 @@ |
||
17 | 17 | return self::$instance; |
18 | 18 | } |
19 | 19 | |
20 | - public function shortcode( $atts, $content = '', $tag = '') { |
|
20 | + public function shortcode( $atts, $content = '', $tag = '' ) { |
|
21 | 21 | $shortcode = new \GV\Shortcodes\gvlogic(); |
22 | 22 | return $shortcode->callback( $atts, $content, $tag ); |
23 | 23 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | public function __destruct() { |
95 | - remove_filter( $this->filter_prefix . '_get_template_part', $this->_add_id_specific_templates_callback );; |
|
95 | + remove_filter( $this->filter_prefix . '_get_template_part', $this->_add_id_specific_templates_callback ); ; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -175,59 +175,59 @@ discard block |
||
175 | 175 | |
176 | 176 | if ( $is_view && $post ) { |
177 | 177 | if ( $field_type ) { |
178 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $view_id, $field_type, $slug_name ); |
|
179 | - $inputType && $specifics []= sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $view_id, $inputType, $slug_name ); |
|
180 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $field_type ); |
|
181 | - $inputType && $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $inputType ); |
|
182 | - $specifics []= sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $field_type, $slug_name ); |
|
183 | - $inputType && $specifics []= sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $inputType, $slug_name ); |
|
184 | - $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $field_type ); |
|
185 | - $inputType && $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $inputType ); |
|
178 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $view_id, $field_type, $slug_name ); |
|
179 | + $inputType && $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s-%s.php', $slug_dir, $post->ID, $view_id, $inputType, $slug_name ); |
|
180 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $field_type ); |
|
181 | + $inputType && $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $inputType ); |
|
182 | + $specifics [ ] = sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $field_type, $slug_name ); |
|
183 | + $inputType && $specifics [ ] = sprintf( '%spost-%d-field-%s-%s.php', $slug_dir, $post->ID, $inputType, $slug_name ); |
|
184 | + $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $field_type ); |
|
185 | + $inputType && $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $inputType ); |
|
186 | 186 | } |
187 | 187 | |
188 | - $specifics []= sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $slug_name ); |
|
189 | - $specifics []= sprintf( '%spost-%d-view-%d-field.php', $slug_dir, $post->ID, $view_id ); |
|
190 | - $specifics []= sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
191 | - $specifics []= sprintf( '%spost-%d-field.php', $slug_dir, $post->ID ); |
|
188 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field-%s.php', $slug_dir, $post->ID, $view_id, $slug_name ); |
|
189 | + $specifics [ ] = sprintf( '%spost-%d-view-%d-field.php', $slug_dir, $post->ID, $view_id ); |
|
190 | + $specifics [ ] = sprintf( '%spost-%d-field-%s.php', $slug_dir, $post->ID, $slug_name ); |
|
191 | + $specifics [ ] = sprintf( '%spost-%d-field.php', $slug_dir, $post->ID ); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** Field-specific */ |
195 | 195 | if ( $field_id && $form_id ) { |
196 | 196 | |
197 | 197 | if ( $field_id ) { |
198 | - $specifics []= sprintf( '%sform-%d-field-%d-%s.php', $slug_dir, $form_id, $field_id, $slug_name ); |
|
199 | - $specifics []= sprintf( '%sform-%d-field-%d.php', $slug_dir, $form_id, $field_id ); |
|
198 | + $specifics [ ] = sprintf( '%sform-%d-field-%d-%s.php', $slug_dir, $form_id, $field_id, $slug_name ); |
|
199 | + $specifics [ ] = sprintf( '%sform-%d-field-%d.php', $slug_dir, $form_id, $field_id ); |
|
200 | 200 | |
201 | 201 | if ( $view_id ) { |
202 | - $specifics []= sprintf( '%sview-%d-field-%d.php', $slug_dir, $view_id, $field_id ); |
|
202 | + $specifics [ ] = sprintf( '%sview-%d-field-%d.php', $slug_dir, $view_id, $field_id ); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | |
206 | 206 | if ( $field_type ) { |
207 | - $specifics []= sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $form_id, $field_type, $slug_name ); |
|
208 | - $inputType && $specifics []= sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $form_id, $inputType, $slug_name ); |
|
209 | - $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $field_type ); |
|
210 | - $inputType && $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $inputType ); |
|
211 | - |
|
212 | - $specifics []= sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $view_id, $field_type, $slug_name ); |
|
213 | - $inputType && $specifics []= sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $view_id, $inputType, $slug_name ); |
|
214 | - $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $field_type ); |
|
215 | - $inputType && $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $inputType ); |
|
216 | - |
|
217 | - $specifics []= sprintf( '%sfield-%s-%s.php', $slug_dir, $field_type, $slug_name ); |
|
218 | - $inputType && $specifics []= sprintf( '%sfield-%s-%s.php', $slug_dir, $inputType, $slug_name ); |
|
219 | - $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $field_type ); |
|
220 | - $inputType && $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $inputType ); |
|
207 | + $specifics [ ] = sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $form_id, $field_type, $slug_name ); |
|
208 | + $inputType && $specifics [ ] = sprintf( '%sform-%d-field-%s-%s.php', $slug_dir, $form_id, $inputType, $slug_name ); |
|
209 | + $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $field_type ); |
|
210 | + $inputType && $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $inputType ); |
|
211 | + |
|
212 | + $specifics [ ] = sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $view_id, $field_type, $slug_name ); |
|
213 | + $inputType && $specifics [ ] = sprintf( '%sview-%d-field-%s-%s.php', $slug_dir, $view_id, $inputType, $slug_name ); |
|
214 | + $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $field_type ); |
|
215 | + $inputType && $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $inputType ); |
|
216 | + |
|
217 | + $specifics [ ] = sprintf( '%sfield-%s-%s.php', $slug_dir, $field_type, $slug_name ); |
|
218 | + $inputType && $specifics [ ] = sprintf( '%sfield-%s-%s.php', $slug_dir, $inputType, $slug_name ); |
|
219 | + $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $field_type ); |
|
220 | + $inputType && $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $inputType ); |
|
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | 224 | if ( $form_id ) { |
225 | 225 | /** Generic field templates */ |
226 | - $specifics []= sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $slug_name ); |
|
227 | - $specifics []= sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $slug_name ); |
|
226 | + $specifics [ ] = sprintf( '%sview-%d-field-%s.php', $slug_dir, $view_id, $slug_name ); |
|
227 | + $specifics [ ] = sprintf( '%sform-%d-field-%s.php', $slug_dir, $form_id, $slug_name ); |
|
228 | 228 | |
229 | - $specifics []= sprintf( '%sview-%d-field.php', $slug_dir, $view_id ); |
|
230 | - $specifics []= sprintf( '%sform-%d-field.php', $slug_dir, $form_id ); |
|
229 | + $specifics [ ] = sprintf( '%sview-%d-field.php', $slug_dir, $view_id ); |
|
230 | + $specifics [ ] = sprintf( '%sform-%d-field.php', $slug_dir, $form_id ); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | * Ignore some types that conflict. |
236 | 236 | */ |
237 | 237 | if ( ! in_array( $field_type, array( 'notes' ) ) ) { |
238 | - $specifics []= sprintf( '%s.php', $field_type ); |
|
239 | - $specifics []= sprintf( 'fields/%s.php', $field_type ); |
|
238 | + $specifics [ ] = sprintf( '%s.php', $field_type ); |
|
239 | + $specifics [ ] = sprintf( 'fields/%s.php', $field_type ); |
|
240 | 240 | } |
241 | 241 | |
242 | - $specifics []= sprintf( '%sfield-%s.php', $slug_dir, $slug_name ); |
|
243 | - $specifics []= sprintf( '%sfield.php', $slug_dir ); |
|
242 | + $specifics [ ] = sprintf( '%sfield-%s.php', $slug_dir, $slug_name ); |
|
243 | + $specifics [ ] = sprintf( '%sfield.php', $slug_dir ); |
|
244 | 244 | |
245 | 245 | return array_merge( $specifics, $templates ); |
246 | 246 | }; |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | /** Prevent any PHP warnings that may be generated. */ |
275 | 275 | ob_start(); |
276 | 276 | |
277 | - $display_value = \GFCommon::get_lead_field_display( $this->field->field, $value, $entry['currency'], false, 'html' ); |
|
277 | + $display_value = \GFCommon::get_lead_field_display( $this->field->field, $value, $entry[ 'currency' ], false, 'html' ); |
|
278 | 278 | |
279 | 279 | if ( $errors = ob_get_clean() ) { |
280 | 280 | gravityview()->log->error( 'Errors when calling GFCommon::get_lead_field_display()', array( 'data' => $errors ) ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ); |
101 | 101 | |
102 | 102 | if ( ! empty( $action ) ) { |
103 | - $settings['edd_action'] = esc_attr( $action ); |
|
103 | + $settings[ 'edd_action' ] = esc_attr( $action ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return array_map( 'urlencode', $settings ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'format' => 'json', |
157 | 157 | ) ); |
158 | 158 | |
159 | - if ( $is_ajax && empty( $data['license'] ) ) { |
|
159 | + if ( $is_ajax && empty( $data[ 'license' ] ) ) { |
|
160 | 160 | die( -1 ); |
161 | 161 | } |
162 | 162 | |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | |
185 | 185 | $json = json_encode( $license_data ); |
186 | 186 | |
187 | - $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action'); |
|
187 | + $update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' ); |
|
188 | 188 | |
189 | 189 | $is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX ); |
190 | 190 | |
191 | 191 | if ( 'deactivate_license' === Utils::get( $data, 'edd_action' ) ) { |
192 | - do_action('gravityview/admin_installer/delete_downloads_data', true ); |
|
192 | + do_action( 'gravityview/admin_installer/delete_downloads_data', true ); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | if ( $is_check_action_button ) { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | // most likely a mistake. |
202 | 202 | } else if ( $license_data->license !== 'failed' && $update_license ) { |
203 | 203 | |
204 | - if ( ! empty( $data['field_id'] ) ) { |
|
204 | + if ( ! empty( $data[ 'field_id' ] ) ) { |
|
205 | 205 | set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS ); |
206 | 206 | } |
207 | 207 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | if ( empty( $license_data ) ) { |
229 | 229 | $message = ''; |
230 | 230 | } else { |
231 | - if( ! empty( $license_data->error ) ) { |
|
231 | + if ( ! empty( $license_data->error ) ) { |
|
232 | 232 | $class = 'error'; |
233 | 233 | $string_key = $license_data->error; |
234 | 234 | } else { $class = $license_data->license; |
@@ -254,17 +254,17 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function license_details( $response = array() ) { |
256 | 256 | |
257 | - $response = (array) $response; |
|
257 | + $response = (array)$response; |
|
258 | 258 | |
259 | 259 | $return = ''; |
260 | 260 | $wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>'; |
261 | 261 | |
262 | - if ( ! empty( $response['license_key'] ) ) { |
|
262 | + if ( ! empty( $response[ 'license_key' ] ) ) { |
|
263 | 263 | $return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>'; |
264 | 264 | |
265 | 265 | if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) { |
266 | - $return .= $this->strings( $response['license'], $response ); |
|
267 | - } elseif ( ! empty( $response['license_name'] ) ) { |
|
266 | + $return .= $this->strings( $response[ 'license' ], $response ); |
|
267 | + } elseif ( ! empty( $response[ 'license_name' ] ) ) { |
|
268 | 268 | $response_keys = array( |
269 | 269 | 'license_name' => '', |
270 | 270 | 'license_limit' => '', |
@@ -278,21 +278,21 @@ discard block |
||
278 | 278 | // Make sure all the keys are set |
279 | 279 | $response = wp_parse_args( $response, $response_keys ); |
280 | 280 | |
281 | - $login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
282 | - $local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
283 | - $license_limit = empty( $response['license_limit'] ) ? __( 'Unlimited', 'gravityview' ) : (int) $response['license_limit']; |
|
281 | + $login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) ); |
|
282 | + $local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' ); |
|
283 | + $license_limit = empty( $response[ 'license_limit' ] ) ? __( 'Unlimited', 'gravityview' ) : (int)$response[ 'license_limit' ]; |
|
284 | 284 | |
285 | - $details = array( |
|
286 | - 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ), |
|
287 | - 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link, |
|
288 | - 'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $license_limit ) ) . $local_text, |
|
289 | - 'expires' => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ), |
|
290 | - 'upgrade' => $this->get_upgrade_html( $response['upgrades'] ), |
|
285 | + $details = array( |
|
286 | + 'license' => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ), |
|
287 | + 'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link, |
|
288 | + 'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $license_limit ) ) . $local_text, |
|
289 | + 'expires' => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ), |
|
290 | + 'upgrade' => $this->get_upgrade_html( $response[ 'upgrades' ] ), |
|
291 | 291 | ); |
292 | 292 | |
293 | - if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) { |
|
294 | - unset( $details['upgrade'] ); |
|
295 | - $details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
293 | + if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) { |
|
294 | + unset( $details[ 'upgrade' ] ); |
|
295 | + $details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | $return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>'; |
@@ -318,20 +318,20 @@ discard block |
||
318 | 318 | if ( ! empty( $upgrades ) ) { |
319 | 319 | |
320 | 320 | $locale_parts = explode( '_', get_locale() ); |
321 | - $is_english = ( 'en' === $locale_parts[0] ); |
|
321 | + $is_english = ( 'en' === $locale_parts[ 0 ] ); |
|
322 | 322 | |
323 | 323 | $output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>'; |
324 | 324 | $output .= '<ul class="ul-disc">'; |
325 | 325 | |
326 | 326 | foreach ( $upgrades as $upgrade_id => $upgrade ) { |
327 | - $upgrade = (object) $upgrade; |
|
327 | + $upgrade = (object)$upgrade; |
|
328 | 328 | |
329 | 329 | $anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) ); |
330 | 330 | |
331 | 331 | if ( $is_english && isset( $upgrade->description ) ) { |
332 | 332 | $message = esc_html( $upgrade->description ); |
333 | 333 | } else { |
334 | - switch( $upgrade->price_id ) { |
|
334 | + switch ( $upgrade->price_id ) { |
|
335 | 335 | // Interstellar |
336 | 336 | case 1: |
337 | 337 | default: |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | 'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ), |
391 | 391 | 'missing' => esc_html__( 'Invalid license key.', 'gravityview' ), |
392 | 392 | 'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ), |
393 | - 'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ), |
|
393 | + 'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ), |
|
394 | 394 | 'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ), |
395 | 395 | |
396 | 396 | 'verifying_license' => esc_html__( 'Verifying license…', 'gravityview' ), |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | if ( ! empty( $license_data->renewal_url ) ) { |
421 | 421 | $renew_license_url = $license_data->renewal_url; |
422 | - } elseif( ! empty( $license_data->license_key ) ) { |
|
422 | + } elseif ( ! empty( $license_data->license_key ) ) { |
|
423 | 423 | $renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key ); |
424 | 424 | } else { |
425 | 425 | $renew_license_url = 'https://gravityview.co/account/'; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * @return array|\WP_Error |
437 | 437 | */ |
438 | 438 | private function _license_get_remote_response( $data, $license = '' ) { |
439 | - $api_params = $this->_get_edd_settings( $data['edd_action'], $license ); |
|
439 | + $api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license ); |
|
440 | 440 | |
441 | 441 | $url = add_query_arg( $api_params, self::url ); |
442 | 442 | |
@@ -476,9 +476,9 @@ discard block |
||
476 | 476 | private function license_call_update_settings( $license_data, $data ) { |
477 | 477 | $settings = array(); |
478 | 478 | |
479 | - $settings['license_key'] = $license_data->license_key = trim( $data['license'] ); |
|
480 | - $settings['license_key_status'] = $license_data->license; |
|
481 | - $settings['license_key_response'] = (array)$license_data; |
|
479 | + $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] ); |
|
480 | + $settings[ 'license_key_status' ] = $license_data->license; |
|
481 | + $settings[ 'license_key_response' ] = (array)$license_data; |
|
482 | 482 | |
483 | 483 | $this->settings->set( $settings ); |
484 | 484 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | |
494 | 494 | if ( ! empty( $key ) ) { |
495 | 495 | $response = $this->settings->get( 'license_key_response' ); |
496 | - $response = is_array( $response ) ? (object) $response : json_decode( $response ); |
|
496 | + $response = is_array( $response ) ? (object)$response : json_decode( $response ); |
|
497 | 497 | } else { |
498 | 498 | $response = array(); |
499 | 499 | } |
@@ -535,11 +535,11 @@ discard block |
||
535 | 535 | |
536 | 536 | $submit = '<div class="gv-edd-button-wrapper">'; |
537 | 537 | foreach ( $fields as $field ) { |
538 | - $field['type'] = 'button'; |
|
539 | - $field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class; |
|
540 | - $field['style'] = 'margin-left: 10px;'; |
|
541 | - if( $disabled_attribute ) { |
|
542 | - $field['disabled'] = $disabled_attribute; |
|
538 | + $field[ 'type' ] = 'button'; |
|
539 | + $field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class; |
|
540 | + $field[ 'style' ] = 'margin-left: 10px;'; |
|
541 | + if ( $disabled_attribute ) { |
|
542 | + $field[ 'disabled' ] = $disabled_attribute; |
|
543 | 543 | } |
544 | 544 | $submit .= $this->settings->as_html( $field, $echo ); |
545 | 545 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | 'url' => home_url(), |
619 | 619 | 'site_data' => $this->get_site_data(), |
620 | 620 | ), |
621 | - )); |
|
621 | + ) ); |
|
622 | 622 | |
623 | 623 | // make sure the response came back okay |
624 | 624 | if ( is_wp_error( $response ) ) { |
@@ -649,45 +649,45 @@ discard block |
||
649 | 649 | $theme_data = wp_get_theme(); |
650 | 650 | $theme = $theme_data->Name . ' ' . $theme_data->Version; |
651 | 651 | |
652 | - $data['gv_version'] = Plugin::$version; |
|
653 | - $data['php_version'] = phpversion(); |
|
654 | - $data['wp_version'] = get_bloginfo( 'version' ); |
|
655 | - $data['gf_version'] = \GFForms::$version; |
|
656 | - $data['server'] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
657 | - $data['multisite'] = is_multisite(); |
|
658 | - $data['theme'] = $theme; |
|
659 | - $data['url'] = home_url(); |
|
660 | - $data['license_key'] = $this->settings->get( 'license_key' ); |
|
661 | - $data['beta'] = $this->settings->get( 'beta' ); |
|
652 | + $data[ 'gv_version' ] = Plugin::$version; |
|
653 | + $data[ 'php_version' ] = phpversion(); |
|
654 | + $data[ 'wp_version' ] = get_bloginfo( 'version' ); |
|
655 | + $data[ 'gf_version' ] = \GFForms::$version; |
|
656 | + $data[ 'server' ] = Utils::get( $_SERVER, 'SERVER_SOFTWARE' ); |
|
657 | + $data[ 'multisite' ] = is_multisite(); |
|
658 | + $data[ 'theme' ] = $theme; |
|
659 | + $data[ 'url' ] = home_url(); |
|
660 | + $data[ 'license_key' ] = $this->settings->get( 'license_key' ); |
|
661 | + $data[ 'beta' ] = $this->settings->get( 'beta' ); |
|
662 | 662 | |
663 | 663 | // View Data |
664 | 664 | $gravityview_posts = wp_count_posts( 'gravityview', 'readable' ); |
665 | 665 | |
666 | - $data['view_count'] = null; |
|
667 | - $data['view_first'] = null; |
|
668 | - $data['view_latest'] = null; |
|
666 | + $data[ 'view_count' ] = null; |
|
667 | + $data[ 'view_first' ] = null; |
|
668 | + $data[ 'view_latest' ] = null; |
|
669 | 669 | |
670 | 670 | if ( $gravityview_posts->publish ) { |
671 | - $data['view_count'] = $gravityview_posts->publish; |
|
671 | + $data[ 'view_count' ] = $gravityview_posts->publish; |
|
672 | 672 | |
673 | 673 | $first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' ); |
674 | 674 | $latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' ); |
675 | 675 | |
676 | 676 | if ( $first = array_shift( $first ) ) { |
677 | - $data['view_first'] = $first->post_date; |
|
677 | + $data[ 'view_first' ] = $first->post_date; |
|
678 | 678 | } |
679 | 679 | if ( $latest = array_pop( $latest ) ) { |
680 | - $data['view_latest'] = $latest->post_date; |
|
680 | + $data[ 'view_latest' ] = $latest->post_date; |
|
681 | 681 | } |
682 | 682 | } |
683 | 683 | |
684 | 684 | // Form counts |
685 | 685 | if ( class_exists( 'GFFormsModel' ) ) { |
686 | 686 | $form_data = \GFFormsModel::get_form_count(); |
687 | - $data['forms_total'] = Utils::get( $form_data, 'total', 0 ); |
|
688 | - $data['forms_active'] = Utils::get( $form_data, 'active', 0 ); |
|
689 | - $data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 ); |
|
690 | - $data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 ); |
|
687 | + $data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 ); |
|
688 | + $data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 ); |
|
689 | + $data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
690 | + $data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 ); |
|
691 | 691 | } |
692 | 692 | |
693 | 693 | // Retrieve current plugin information |
@@ -695,13 +695,13 @@ discard block |
||
695 | 695 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
696 | 696 | } |
697 | 697 | |
698 | - $data['integrations'] = self::get_related_plugins_and_extensions(); |
|
699 | - $data['active_plugins'] = get_option( 'active_plugins', array() ); |
|
700 | - $data['inactive_plugins'] = array(); |
|
701 | - $data['locale'] = get_locale(); |
|
698 | + $data[ 'integrations' ] = self::get_related_plugins_and_extensions(); |
|
699 | + $data[ 'active_plugins' ] = get_option( 'active_plugins', array() ); |
|
700 | + $data[ 'inactive_plugins' ] = array(); |
|
701 | + $data[ 'locale' ] = get_locale(); |
|
702 | 702 | |
703 | 703 | // Validate request on the GV server |
704 | - $data['hash'] = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] ); |
|
704 | + $data[ 'hash' ] = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] ); |
|
705 | 705 | |
706 | 706 | return $data; |
707 | 707 | } |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | |
732 | 732 | $plugin_data = get_plugin_data( $active_plugin ); |
733 | 733 | |
734 | - $extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] ); |
|
734 | + $extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] ); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | if ( ! empty( $extensions ) ) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | 'total' => wp_count_posts( 'gravityview' )->publish, |
64 | 64 | ); |
65 | 65 | foreach ( $items as $item ) { |
66 | - $data['views'][] = $this->prepare_view_for_response( $item, $request ); |
|
66 | + $data[ 'views' ][ ] = $this->prepare_view_for_response( $item, $request ); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return new \WP_REST_Response( $data, 200 ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $url = $request->get_url_params(); |
84 | 84 | |
85 | - $view_id = intval( $url['id'] ); |
|
85 | + $view_id = intval( $url[ 'id' ] ); |
|
86 | 86 | |
87 | 87 | $item = get_post( $view_id ); |
88 | 88 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // Only output the fields that should be displayed. |
115 | 115 | $allowed = array(); |
116 | 116 | foreach ( $view->fields->by_position( "{$context}_*" )->by_visible( $view )->all() as $field ) { |
117 | - $allowed[] = $field; |
|
117 | + $allowed[ ] = $field; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // Tack on additional fields if needed |
135 | 135 | foreach ( array_diff( $allowed_field_ids, wp_list_pluck( $allowed, 'ID' ) ) as $field_id ) { |
136 | - $allowed[] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id ); |
|
136 | + $allowed[ ] = is_numeric( $field_id ) ? \GV\GF_Field::by_id( $view->form, $field_id ) : \GV\Internal_Field::by_id( $field_id ); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $r = new Request( $request ); |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | public function get_sub_items( $request ) { |
212 | 212 | |
213 | 213 | $url = $request->get_url_params(); |
214 | - $view_id = intval( $url['id'] ); |
|
214 | + $view_id = intval( $url[ 'id' ] ); |
|
215 | 215 | $format = \GV\Utils::get( $url, 'format', 'json' ); |
216 | 216 | |
217 | - if( $post_id = $request->get_param('post_id') ) { |
|
217 | + if ( $post_id = $request->get_param( 'post_id' ) ) { |
|
218 | 218 | global $post; |
219 | 219 | |
220 | 220 | $post = get_post( $post_id ); |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | $data = array( 'entries' => $entries->all(), 'total' => $entries->total() ); |
321 | 321 | |
322 | - foreach ( $data['entries'] as &$entry ) { |
|
322 | + foreach ( $data[ 'entries' ] as &$entry ) { |
|
323 | 323 | $entry = $this->prepare_entry_for_response( $view, $entry, $request, 'directory' ); |
324 | 324 | } |
325 | 325 | |
@@ -338,8 +338,8 @@ discard block |
||
338 | 338 | */ |
339 | 339 | public function get_sub_item( $request ) { |
340 | 340 | $url = $request->get_url_params(); |
341 | - $view_id = intval( $url['id'] ); |
|
342 | - $entry_id = intval( $url['s_id'] ); |
|
341 | + $view_id = intval( $url[ 'id' ] ); |
|
342 | + $entry_id = intval( $url[ 's_id' ] ); |
|
343 | 343 | $format = \GV\Utils::get( $url, 'format', 'json' ); |
344 | 344 | |
345 | 345 | $view = \GV\View::by_id( $view_id ); |
@@ -374,32 +374,32 @@ discard block |
||
374 | 374 | // Add all the WP_Post data |
375 | 375 | $view_post = $view_post->to_array(); |
376 | 376 | |
377 | - unset( $view_post['to_ping'], $view_post['ping_status'], $view_post['pinged'], $view_post['post_type'], $view_post['filter'], $view_post['post_category'], $view_post['tags_input'], $view_post['post_content'], $view_post['post_content_filtered'] ); |
|
377 | + unset( $view_post[ 'to_ping' ], $view_post[ 'ping_status' ], $view_post[ 'pinged' ], $view_post[ 'post_type' ], $view_post[ 'filter' ], $view_post[ 'post_category' ], $view_post[ 'tags_input' ], $view_post[ 'post_content' ], $view_post[ 'post_content_filtered' ] ); |
|
378 | 378 | |
379 | 379 | $return = wp_parse_args( $item, $view_post ); |
380 | 380 | |
381 | - $return['title'] = $return['post_title']; |
|
381 | + $return[ 'title' ] = $return[ 'post_title' ]; |
|
382 | 382 | |
383 | - $return['settings'] = isset( $return['atts'] ) ? $return['atts'] : array(); |
|
384 | - unset( $return['atts'], $return['view_id'] ); |
|
383 | + $return[ 'settings' ] = isset( $return[ 'atts' ] ) ? $return[ 'atts' ] : array(); |
|
384 | + unset( $return[ 'atts' ], $return[ 'view_id' ] ); |
|
385 | 385 | |
386 | - $return['search_criteria'] = array( |
|
386 | + $return[ 'search_criteria' ] = array( |
|
387 | 387 | 'page_size' => rgars( $return, 'settings/page_size' ), |
388 | 388 | 'sort_field' => rgars( $return, 'settings/sort_field' ), |
389 | 389 | 'sort_direction' => rgars( $return, 'settings/sort_direction' ), |
390 | 390 | 'offset' => rgars( $return, 'settings/offset' ), |
391 | 391 | ); |
392 | 392 | |
393 | - unset( $return['settings']['page_size'], $return['settings']['sort_field'], $return['settings']['sort_direction'] ); |
|
393 | + unset( $return[ 'settings' ][ 'page_size' ], $return[ 'settings' ][ 'sort_field' ], $return[ 'settings' ][ 'sort_direction' ] ); |
|
394 | 394 | |
395 | 395 | // Redact for non-logged ins |
396 | 396 | if ( ! \GVCommon::has_cap( 'edit_others_gravityviews' ) ) { |
397 | - unset( $return['settings'] ); |
|
398 | - unset( $return['search_criteria'] ); |
|
397 | + unset( $return[ 'settings' ] ); |
|
398 | + unset( $return[ 'search_criteria' ] ); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | if ( ! \GFCommon::current_user_can_any( 'gravityforms_edit_forms' ) ) { |
402 | - unset( $return['form'] ); |
|
402 | + unset( $return[ 'form' ] ); |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | return $return; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $view_id = func_get_arg( 1 ); // $view_id override |
416 | 416 | } else { |
417 | 417 | $url = $request->get_url_params(); |
418 | - $view_id = intval( $url['id'] ); |
|
418 | + $view_id = intval( $url[ 'id' ] ); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if ( ! $view = \GV\View::by_id( $view_id ) ) { |
@@ -461,8 +461,8 @@ discard block |
||
461 | 461 | } |
462 | 462 | |
463 | 463 | $url = $request->get_url_params(); |
464 | - $view_id = intval( $url['id'] ); |
|
465 | - $entry_id = intval( $url['s_id'] ); |
|
464 | + $view_id = intval( $url[ 'id' ] ); |
|
465 | + $entry_id = intval( $url[ 's_id' ] ); |
|
466 | 466 | |
467 | 467 | $view = \GV\View::by_id( $view_id ); |
468 | 468 | |
@@ -470,11 +470,11 @@ discard block |
||
470 | 470 | return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' ); |
471 | 471 | } |
472 | 472 | |
473 | - if ( $entry['form_id'] != $view->form->ID ) { |
|
473 | + if ( $entry[ 'form_id' ] != $view->form->ID ) { |
|
474 | 474 | return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' ); |
475 | 475 | } |
476 | 476 | |
477 | - if ( $entry['status'] != 'active' ) { |
|
477 | + if ( $entry[ 'status' ] != 'active' ) { |
|
478 | 478 | return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' ); |
479 | 479 | } |
480 | 480 | |
@@ -482,10 +482,10 @@ discard block |
||
482 | 482 | return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' ); |
483 | 483 | } |
484 | 484 | |
485 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
485 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
486 | 486 | |
487 | 487 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
488 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
488 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
489 | 489 | return new \WP_Error( 'rest_forbidden', 'You are not allowed to view this content.', 'gravityview' ); |
490 | 490 | } |
491 | 491 | } |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $additional = array(); |
99 | 99 | |
100 | 100 | // form-19-table-body.php |
101 | - $additional[] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
101 | + $additional[ ] = sprintf( 'form-%d-%s-%s.php', $this->view->form ? $this->view->form->ID : 0, $slug, $name ); |
|
102 | 102 | |
103 | 103 | // view-3-table-body.php |
104 | - $additional[] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
104 | + $additional[ ] = sprintf( 'view-%d-%s-%s.php', $this->view->ID, $slug, $name ); |
|
105 | 105 | |
106 | 106 | global $post; |
107 | 107 | if ( $post ) { |
108 | 108 | // page-19-table-body.php |
109 | - $additional[] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
109 | + $additional[ ] = sprintf( 'page-%d-%s-%s.php', $post->ID, $slug, $name ); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Combine with existing table-body.php and table.php |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | ob_start(); |
131 | 131 | |
132 | 132 | $request = new Mock_Request(); |
133 | - $request->returns['is_view'] = $this->view; |
|
133 | + $request->returns[ 'is_view' ] = $this->view; |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * You got one shot. One opportunity. To render all the widgets you have ever wanted. |
@@ -144,17 +144,17 @@ discard block |
||
144 | 144 | foreach ( array( 'gravityview_before', 'gravityview_after' ) as $hook ) { |
145 | 145 | /** WordPress 4.6 and lower compatibility, when WP_Hook classes were still absent. */ |
146 | 146 | if ( is_array( $wp_filter[ $hook ] ) ) { |
147 | - if ( ! empty( $wp_filter[ $hook ][10] ) ) { |
|
148 | - foreach ( $wp_filter[ $hook ][10] as $function_key => $callback ) { |
|
147 | + if ( ! empty( $wp_filter[ $hook ][ 10 ] ) ) { |
|
148 | + foreach ( $wp_filter[ $hook ][ 10 ] as $function_key => $callback ) { |
|
149 | 149 | if ( strpos( $function_key, 'render_widget_hooks' ) ) { |
150 | - unset( $wp_filter[ $hook ][10][ $function_key ] ); |
|
150 | + unset( $wp_filter[ $hook ][ 10 ][ $function_key ] ); |
|
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | 154 | } else { |
155 | - foreach ( $wp_filter[ $hook ]->callbacks[10] as $function_key => $callback ) { |
|
155 | + foreach ( $wp_filter[ $hook ]->callbacks[ 10 ] as $function_key => $callback ) { |
|
156 | 156 | if ( strpos( $function_key, 'render_widget_hooks' ) ) { |
157 | - unset( $wp_filter[ $hook ]->callbacks[10][ $function_key ] ); |
|
157 | + unset( $wp_filter[ $hook ]->callbacks[ 10 ][ $function_key ] ); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | if ( $this->entry ) { |
167 | 167 | |
168 | - $request->returns['is_entry'] = $this->entry; |
|
168 | + $request->returns[ 'is_entry' ] = $this->entry; |
|
169 | 169 | |
170 | 170 | global $post; |
171 | 171 | |
@@ -199,11 +199,11 @@ discard block |
||
199 | 199 | * This allows us to fake it till we make it. |
200 | 200 | */ |
201 | 201 | $parameters = $this->view->settings->as_atts(); |
202 | - if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) { |
|
202 | + if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) { |
|
203 | 203 | $has_multisort = true; |
204 | - $parameters['sort_field'] = reset( $parameters['sort_field'] ); |
|
205 | - if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) { |
|
206 | - $parameters['sort_direction'] = reset( $parameters['sort_direction'] ); |
|
204 | + $parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] ); |
|
205 | + if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) { |
|
206 | + $parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] ); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | 'fields' => $this->view->fields->by_visible( $this->view ), |
223 | 223 | 'in_the_loop' => true, |
224 | 224 | ), empty( $parameters ) ? array() : array( |
225 | - 'paging' => $parameters['paging'], |
|
226 | - 'sorting' => $parameters['sorting'], |
|
225 | + 'paging' => $parameters[ 'paging' ], |
|
226 | + 'sorting' => $parameters[ 'sorting' ], |
|
227 | 227 | ), $post ? array( |
228 | 228 | 'post' => $post, |
229 | 229 | ) : array() ) ); |