@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * Try subkeys after split. |
92 | 92 | */ |
93 | 93 | if ( count( $parts = explode( '/', $key, 2 ) ) > 1 ) { |
94 | - return self::get( self::get( $array, $parts[0] ), $parts[1], $default ); |
|
94 | + return self::get( self::get( $array, $parts[ 0 ] ), $parts[ 1 ], $default ); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return $default; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public static function gf_query_debug( $query ) { |
146 | 146 | $introspect = $query->_introspect(); |
147 | 147 | return array( |
148 | - 'where' => $query->_where_unwrap( $introspect['where'] ) |
|
148 | + 'where' => $query->_where_unwrap( $introspect[ 'where' ] ) |
|
149 | 149 | ); |
150 | 150 | } |
151 | 151 | } |
@@ -29,11 +29,11 @@ |
||
29 | 29 | $KWS_GF_Change_Lead_Creator = new KWS_GF_Change_Lead_Creator; |
30 | 30 | |
31 | 31 | // Now, no validation is required in the methods; let's hook in. |
32 | - remove_action('admin_init', array( $KWS_GF_Change_Lead_Creator, 'set_screen_mode' ) ); |
|
32 | + remove_action( 'admin_init', array( $KWS_GF_Change_Lead_Creator, 'set_screen_mode' ) ); |
|
33 | 33 | |
34 | - remove_action("gform_entry_info", array( $KWS_GF_Change_Lead_Creator, 'add_select' ), 10 ); |
|
34 | + remove_action( "gform_entry_info", array( $KWS_GF_Change_Lead_Creator, 'add_select' ), 10 ); |
|
35 | 35 | |
36 | - remove_action("gform_after_update_entry", array( $KWS_GF_Change_Lead_Creator, 'update_entry_creator' ), 10 ); |
|
36 | + remove_action( "gform_after_update_entry", array( $KWS_GF_Change_Lead_Creator, 'update_entry_creator' ), 10 ); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | } |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * This allows us to fake it till we make it. |
110 | 110 | */ |
111 | 111 | $parameters = $view->settings->as_atts(); |
112 | - if ( ! empty( $parameters['sort_field'] ) && is_array( $parameters['sort_field'] ) ) { |
|
112 | + if ( ! empty( $parameters[ 'sort_field' ] ) && is_array( $parameters[ 'sort_field' ] ) ) { |
|
113 | 113 | $has_multisort = true; |
114 | - $parameters['sort_field'] = reset( $parameters['sort_field'] ); |
|
115 | - if ( ! empty( $parameters['sort_direction'] ) && is_array( $parameters['sort_direction'] ) ) { |
|
116 | - $parameters['sort_direction'] = reset( $parameters['sort_direction'] ); |
|
114 | + $parameters[ 'sort_field' ] = reset( $parameters[ 'sort_field' ] ); |
|
115 | + if ( ! empty( $parameters[ 'sort_direction' ] ) && is_array( $parameters[ 'sort_direction' ] ) ) { |
|
116 | + $parameters[ 'sort_direction' ] = reset( $parameters[ 'sort_direction' ] ); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | 'entries' => $entries, |
129 | 129 | 'request' => $request, |
130 | 130 | ), empty( $parameters ) ? array() : array( |
131 | - 'paging' => $parameters['paging'], |
|
132 | - 'sorting' => $parameters['sorting'], |
|
131 | + 'paging' => $parameters[ 'paging' ], |
|
132 | + 'sorting' => $parameters[ 'sorting' ], |
|
133 | 133 | ), empty( $post ) ? array() : array( |
134 | 134 | 'post' => $post, |
135 | 135 | ) ) ); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | if( is_array( $search_field['value'] ) ) { |
19 | - gravityview()->log->debug( 'search-field-select.php - Array values passed; using first value.' ); |
|
19 | + gravityview()->log->debug( 'search-field-select.php - Array values passed; using first value.' ); |
|
20 | 20 | $search_field['value'] = reset( $search_field['value'] ); |
21 | 21 | } |
22 | 22 |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | $search_field = $gravityview_view->search_field; |
11 | 11 | |
12 | 12 | // Make sure that there are choices to display |
13 | -if( empty( $search_field['choices'] ) ) { |
|
13 | +if ( empty( $search_field[ 'choices' ] ) ) { |
|
14 | 14 | gravityview()->log->debug( 'search-field-select.php - No choices for field' ); |
15 | 15 | return; |
16 | 16 | } |
17 | 17 | |
18 | -if( is_array( $search_field['value'] ) ) { |
|
18 | +if ( is_array( $search_field[ 'value' ] ) ) { |
|
19 | 19 | gravityview()->log->debug( 'search-field-select.php - Array values passed; using first value.' ); |
20 | - $search_field['value'] = reset( $search_field['value'] ); |
|
20 | + $search_field[ 'value' ] = reset( $search_field[ 'value' ] ); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -26,26 +26,26 @@ discard block |
||
26 | 26 | * @param string $default_option Default: `—` (—) |
27 | 27 | * @param string $field_type Field type: "select" or "multiselect" |
28 | 28 | */ |
29 | -$default_option = apply_filters('gravityview/extension/search/select_default', '—', 'select' ); |
|
29 | +$default_option = apply_filters( 'gravityview/extension/search/select_default', '—', 'select' ); |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | <div class="gv-search-box gv-search-field-select"> |
33 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
34 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
33 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
34 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
35 | 35 | <?php } ?> |
36 | 36 | <p> |
37 | - <select name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"> |
|
38 | - <option value="" <?php gv_selected( '', $search_field['value'], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
37 | + <select name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"> |
|
38 | + <option value="" <?php gv_selected( '', $search_field[ 'value' ], true ); ?>><?php echo esc_html( $default_option ); ?></option> |
|
39 | 39 | <?php |
40 | - foreach( $search_field['choices'] as $choice ) { ?> |
|
41 | - <?php if ( is_array( $choice['value'] ) ) { ?> |
|
42 | - <optgroup label="<?php echo esc_attr( $choice['text'] ); ?>"> |
|
43 | - <?php foreach ( $choice['value'] as $subchoice ): ?> |
|
44 | - <option value="<?php echo esc_attr( $subchoice['value'] ); ?>"><?php echo esc_html( $subchoice['text'] ); ?></option> |
|
40 | + foreach ( $search_field[ 'choices' ] as $choice ) { ?> |
|
41 | + <?php if ( is_array( $choice[ 'value' ] ) ) { ?> |
|
42 | + <optgroup label="<?php echo esc_attr( $choice[ 'text' ] ); ?>"> |
|
43 | + <?php foreach ( $choice[ 'value' ] as $subchoice ): ?> |
|
44 | + <option value="<?php echo esc_attr( $subchoice[ 'value' ] ); ?>"><?php echo esc_html( $subchoice[ 'text' ] ); ?></option> |
|
45 | 45 | <?php endforeach; ?> |
46 | 46 | </optgroup> |
47 | 47 | <?php } else { ?> |
48 | - <option value="<?php echo esc_attr( $choice['value'] ); ?>" <?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $search_field['value'] ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
48 | + <option value="<?php echo esc_attr( $choice[ 'value' ] ); ?>" <?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $search_field[ 'value' ] ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
49 | 49 | <?php } ?> |
50 | 50 | <?php } ?> |
51 | 51 | </select> |
@@ -15,34 +15,34 @@ |
||
15 | 15 | $field_info_items = array(); |
16 | 16 | |
17 | 17 | // Fields with IDs, not like Source URL or Entry ID |
18 | - if( is_numeric( $this->id ) ) { |
|
18 | + if ( is_numeric( $this->id ) ) { |
|
19 | 19 | |
20 | - $field_type_title = GFCommon::get_field_type_title( $this->item['input_type'] ); |
|
20 | + $field_type_title = GFCommon::get_field_type_title( $this->item[ 'input_type' ] ); |
|
21 | 21 | |
22 | - $field_info_items[] = array( |
|
23 | - 'value' => sprintf( __('Type: %s', 'gravityview'), $field_type_title ) |
|
22 | + $field_info_items[ ] = array( |
|
23 | + 'value' => sprintf( __( 'Type: %s', 'gravityview' ), $field_type_title ) |
|
24 | 24 | ); |
25 | 25 | |
26 | - $field_info_items[] = array( |
|
27 | - 'value' => sprintf( __('Field ID: %s', 'gravityview'), $this->id ), |
|
26 | + $field_info_items[ ] = array( |
|
27 | + 'value' => sprintf( __( 'Field ID: %s', 'gravityview' ), $this->id ), |
|
28 | 28 | ); |
29 | 29 | } |
30 | 30 | |
31 | - if( !empty( $this->item['desc'] ) ) { |
|
32 | - $field_info_items[] = array( |
|
33 | - 'value' => $this->item['desc'] |
|
31 | + if ( ! empty( $this->item[ 'desc' ] ) ) { |
|
32 | + $field_info_items[ ] = array( |
|
33 | + 'value' => $this->item[ 'desc' ] |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | |
37 | - if( !empty( $this->item['adminLabel'] ) ) { |
|
38 | - $field_info_items[] = array( |
|
39 | - 'value' => sprintf( __('Admin Label: %s', 'gravityview' ), $this->item['adminLabel'] ), |
|
37 | + if ( ! empty( $this->item[ 'adminLabel' ] ) ) { |
|
38 | + $field_info_items[ ] = array( |
|
39 | + 'value' => sprintf( __( 'Admin Label: %s', 'gravityview' ), $this->item[ 'adminLabel' ] ), |
|
40 | 40 | 'class' => 'gv-sublabel' |
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | - $field_info_items[] = array( |
|
45 | - 'value' => sprintf( __('Form ID: %s', 'gravityview' ), $this->form_id ), |
|
44 | + $field_info_items[ ] = array( |
|
45 | + 'value' => sprintf( __( 'Form ID: %s', 'gravityview' ), $this->form_id ), |
|
46 | 46 | 'hide_in_picker' => true, |
47 | 47 | ); |
48 | 48 |
@@ -58,16 +58,16 @@ |
||
58 | 58 | if ( $view->joins ) { |
59 | 59 | $form_ids = array(); |
60 | 60 | foreach ( $view->joins as $join ) { |
61 | - $form_ids[] = $join->join->ID; |
|
62 | - $form_ids[] = $join->join_on->ID; |
|
61 | + $form_ids[ ] = $join->join->ID; |
|
62 | + $form_ids[ ] = $join->join_on->ID; |
|
63 | 63 | } |
64 | 64 | foreach ( $entry->entries as $e ) { |
65 | - if ( ! in_array( $e['form_id'], $form_ids ) ) { |
|
65 | + if ( ! in_array( $e[ 'form_id' ], $form_ids ) ) { |
|
66 | 66 | gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $e->ID, 'view_id' => $view->ID ) ); |
67 | 67 | return null; |
68 | 68 | } |
69 | 69 | } |
70 | - } else if ( $view->form && $view->form->ID != $entry['form_id'] ) { |
|
70 | + } else if ( $view->form && $view->form->ID != $entry[ 'form_id' ] ) { |
|
71 | 71 | gravityview()->log->error( 'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array( 'entry_id' => $entry->ID, 'view_id' => $view->ID ) ); |
72 | 72 | return null; |
73 | 73 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | if ( ! $entry instanceof Entry ) { |
45 | 45 | continue; |
46 | 46 | } |
47 | - $_entry->entries[ $entry['form_id'] ] = &$entry; |
|
47 | + $_entry->entries[ $entry[ 'form_id' ] ] = &$entry; |
|
48 | 48 | } |
49 | 49 | return $_entry; |
50 | 50 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | foreach ( $this->entries as $entry ) { |
67 | 67 | $entry = $entry->as_entry(); |
68 | - $_entry['_multi'][ $entry['form_id'] ] = $entry; |
|
68 | + $_entry[ '_multi' ][ $entry[ 'form_id' ] ] = $entry; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | public function get_permalink( \GV\View $view = null, \GV\Request $request = null, $track_directory = true ) { |
88 | 88 | $slugs = array(); |
89 | 89 | add_filter( 'gravityview/entry/slug', $callback = function( $slug ) use ( &$slugs ) { |
90 | - $slugs[] = $slug; |
|
90 | + $slugs[ ] = $slug; |
|
91 | 91 | return implode( ',', $slugs ); |
92 | 92 | }, 10, 1 ); |
93 | 93 |
@@ -140,7 +140,7 @@ |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | $entry = Multi_Entry::from_entries( array_filter( $multientry ) ); |
143 | - } else { |
|
143 | + } else { |
|
144 | 144 | /** |
145 | 145 | * A regular one. |
146 | 146 | */ |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public static function is_add_oembed_preview() { |
47 | 47 | /** The preview request is a parse-embed AJAX call without a type set. */ |
48 | - return ( self::is_ajax() && ! empty( $_POST['action'] ) && $_POST['action'] == 'parse-embed' && ! isset( $_POST['type'] ) ); |
|
48 | + return ( self::is_ajax() && ! empty( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'parse-embed' && ! isset( $_POST[ 'type' ] ) ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return boolean |
64 | 64 | */ |
65 | 65 | public static function is_rest() { |
66 | - return ! empty( $GLOBALS['wp']->query_vars['rest_route'] ); |
|
66 | + return ! empty( $GLOBALS[ 'wp' ]->query_vars[ 'rest_route' ] ); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return false; |
126 | 126 | } |
127 | 127 | |
128 | - if ( ! in_array( $e['form_id'], $valid_forms ) ) { |
|
128 | + if ( ! in_array( $e[ 'form_id' ], $valid_forms ) ) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | |
143 | 143 | $entry = Multi_Entry::from_entries( array_filter( $multientry ) ); |
144 | - } else { |
|
144 | + } else { |
|
145 | 145 | /** |
146 | 146 | * A regular one. |
147 | 147 | */ |
@@ -196,15 +196,15 @@ discard block |
||
196 | 196 | $get = $_GET; |
197 | 197 | } |
198 | 198 | |
199 | - unset( $get['mode'] ); |
|
199 | + unset( $get[ 'mode' ] ); |
|
200 | 200 | |
201 | 201 | $get = array_filter( $get, 'gravityview_is_not_empty_string' ); |
202 | 202 | |
203 | - if( $has_field_key = $this->_has_field_key( $get ) ) { |
|
203 | + if ( $has_field_key = $this->_has_field_key( $get ) ) { |
|
204 | 204 | return true; |
205 | 205 | } |
206 | 206 | |
207 | - return isset( $get['gv_search'] ) || isset( $get['gv_start'] ) || isset( $get['gv_end'] ) || isset( $get['gv_by'] ) || isset( $get['gv_id'] ); |
|
207 | + return isset( $get[ 'gv_search' ] ) || isset( $get[ 'gv_start' ] ) || isset( $get[ 'gv_end' ] ) || isset( $get[ 'gv_by' ] ) || isset( $get[ 'gv_id' ] ); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | |
228 | 228 | $meta = array(); |
229 | 229 | foreach ( $fields as $field ) { |
230 | - if( empty( $field->_gf_field_class_name ) ) { |
|
231 | - $meta[] = preg_quote( $field->name ); |
|
230 | + if ( empty( $field->_gf_field_class_name ) ) { |
|
231 | + $meta[ ] = preg_quote( $field->name ); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
235 | 235 | foreach ( $get as $key => $value ) { |
236 | - if ( preg_match('/^filter_(([0-9_]+)|'. implode( '|', $meta ) .')$/sm', $key ) ) { |
|
236 | + if ( preg_match( '/^filter_(([0-9_]+)|' . implode( '|', $meta ) . ')$/sm', $key ) ) { |
|
237 | 237 | $has_field_key = true; |
238 | 238 | break; |
239 | 239 | } |
@@ -170,10 +170,10 @@ |
||
170 | 170 | */ |
171 | 171 | public function is_edit_entry( $form_id = 0 ) { |
172 | 172 | /** |
173 | - * @filter `gravityview_is_edit_entry` Whether we're currently on the Edit Entry screen \n |
|
174 | - * The Edit Entry functionality overrides this value. |
|
175 | - * @param boolean $is_edit_entry |
|
176 | - */ |
|
173 | + * @filter `gravityview_is_edit_entry` Whether we're currently on the Edit Entry screen \n |
|
174 | + * The Edit Entry functionality overrides this value. |
|
175 | + * @param boolean $is_edit_entry |
|
176 | + */ |
|
177 | 177 | if ( ( $entry = $this->is_entry( $form_id ) ) && apply_filters( 'gravityview_is_edit_entry', false ) ) { |
178 | 178 | if ( $entry->is_multi() ) { |
179 | 179 | return array_pop( $entry->entries ); |
@@ -24,6 +24,6 @@ |
||
24 | 24 | $plugin_theme_hooks_files = glob( $include_path . 'class-gravityview-{plugin,theme}-hooks-*.php', $glob_flags ); |
25 | 25 | |
26 | 26 | // Load all plugin and theme files automatically |
27 | -foreach ( (array) $plugin_theme_hooks_files as $gv_hooks_filename ) { |
|
27 | +foreach ( (array)$plugin_theme_hooks_files as $gv_hooks_filename ) { |
|
28 | 28 | include $gv_hooks_filename; |
29 | 29 | } |
30 | 30 | \ No newline at end of file |