@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public static function get_instance() { |
87 | 87 | |
88 | - if( empty( self::$instance ) ) { |
|
88 | + if ( empty( self::$instance ) ) { |
|
89 | 89 | self::$instance = new self; |
90 | 90 | } |
91 | 91 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | |
120 | 120 | $operators = array_merge( self::$SUPPORTED_ARRAY_OPERATORS, self::$SUPPORTED_NUMERIC_OPERATORS, self::$SUPPORTED_SCALAR_OPERATORS, self::$SUPPORTED_CUSTOM_OPERATORS ); |
121 | 121 | |
122 | - if( $with_values ) { |
|
122 | + if ( $with_values ) { |
|
123 | 123 | $operators_with_values = array(); |
124 | - foreach( $operators as $key ) { |
|
124 | + foreach ( $operators as $key ) { |
|
125 | 125 | $operators_with_values[ $key ] = ''; |
126 | 126 | } |
127 | 127 | return $operators_with_values; |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | */ |
139 | 139 | private function set_operation( $operation = '' ) { |
140 | 140 | |
141 | - if( empty( $operation ) ) { |
|
141 | + if ( empty( $operation ) ) { |
|
142 | 142 | return false; |
143 | 143 | } |
144 | 144 | |
145 | 145 | $operators = $this->get_operators( false ); |
146 | 146 | |
147 | - if( !in_array( $operation, $operators ) ) { |
|
148 | - do_action( 'gravityview_log_debug', __METHOD__ .' Attempted to add invalid operation type.', $operation ); |
|
147 | + if ( ! in_array( $operation, $operators ) ) { |
|
148 | + do_action( 'gravityview_log_debug', __METHOD__ . ' Attempted to add invalid operation type.', $operation ); |
|
149 | 149 | return false; |
150 | 150 | } |
151 | 151 | |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | */ |
166 | 166 | private function setup_operation_and_comparison() { |
167 | 167 | |
168 | - foreach( $this->atts as $key => $value ) { |
|
168 | + foreach ( $this->atts as $key => $value ) { |
|
169 | 169 | |
170 | 170 | $valid = $this->set_operation( $key ); |
171 | 171 | |
172 | - if( $valid ) { |
|
172 | + if ( $valid ) { |
|
173 | 173 | $this->comparison = $value; |
174 | 174 | return true; |
175 | 175 | } |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | return null; |
196 | 196 | } |
197 | 197 | |
198 | - if( empty( $atts ) ) { |
|
199 | - do_action( 'gravityview_log_error', __METHOD__.' $atts are empty.', $atts ); |
|
198 | + if ( empty( $atts ) ) { |
|
199 | + do_action( 'gravityview_log_error', __METHOD__ . ' $atts are empty.', $atts ); |
|
200 | 200 | return null; |
201 | 201 | } |
202 | 202 | |
@@ -210,16 +210,16 @@ discard block |
||
210 | 210 | $this->parse_atts(); |
211 | 211 | |
212 | 212 | // We need an "if" |
213 | - if( false === $this->if ) { |
|
214 | - do_action( 'gravityview_log_error', __METHOD__.' $atts->if is empty.', $this->passed_atts ); |
|
213 | + if ( false === $this->if ) { |
|
214 | + do_action( 'gravityview_log_error', __METHOD__ . ' $atts->if is empty.', $this->passed_atts ); |
|
215 | 215 | return null; |
216 | 216 | } |
217 | 217 | |
218 | 218 | $setup = $this->setup_operation_and_comparison(); |
219 | 219 | |
220 | 220 | // We need an operation and comparison value |
221 | - if( ! $setup ) { |
|
222 | - do_action( 'gravityview_log_error', __METHOD__.' No valid operators were passed.', $this->atts ); |
|
221 | + if ( ! $setup ) { |
|
222 | + do_action( 'gravityview_log_error', __METHOD__ . ' No valid operators were passed.', $this->atts ); |
|
223 | 223 | return null; |
224 | 224 | } |
225 | 225 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function get_output() { |
254 | 254 | |
255 | - if( $this->is_match ) { |
|
255 | + if ( $this->is_match ) { |
|
256 | 256 | $output = $this->content; |
257 | 257 | } else { |
258 | 258 | $output = $this->else_content; |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | * @param string $output HTML/text output |
267 | 267 | * @param GVLogic_Shortcode $this This class |
268 | 268 | */ |
269 | - $output = apply_filters('gravityview/gvlogic/output', $output, $this ); |
|
269 | + $output = apply_filters( 'gravityview/gvlogic/output', $output, $this ); |
|
270 | 270 | |
271 | - do_action( 'gravityview_log_debug', __METHOD__ .' Output: ', $output ); |
|
271 | + do_action( 'gravityview_log_debug', __METHOD__ . ' Output: ', $output ); |
|
272 | 272 | |
273 | 273 | return $output; |
274 | 274 | } |
@@ -286,14 +286,14 @@ discard block |
||
286 | 286 | list( $before_else, $after_else ) = array_pad( explode( '[else]', $passed_content ), 2, NULL ); |
287 | 287 | list( $before_else_if, $after_else_if ) = array_pad( explode( '[else', $passed_content ), 2, NULL ); |
288 | 288 | |
289 | - $else_attr = isset( $this->atts['else'] ) ? $this->atts['else'] : NULL; |
|
289 | + $else_attr = isset( $this->atts[ 'else' ] ) ? $this->atts[ 'else' ] : NULL; |
|
290 | 290 | $else_content = isset( $after_else ) ? $after_else : $else_attr; |
291 | 291 | |
292 | 292 | // The content is everything OTHER than the [else] |
293 | 293 | $this->content = $before_else_if; |
294 | 294 | |
295 | 295 | if ( ! $this->is_match ) { |
296 | - if( $elseif_content = $this->process_elseif( $before_else ) ) { |
|
296 | + if ( $elseif_content = $this->process_elseif( $before_else ) ) { |
|
297 | 297 | $this->else_content = $elseif_content; |
298 | 298 | } else { |
299 | 299 | $this->else_content = $else_content; |
@@ -321,16 +321,16 @@ discard block |
||
321 | 321 | foreach ( $else_if_matches as $key => $else_if_match ) { |
322 | 322 | |
323 | 323 | // If $else_if_match[5] exists and has content, check for more shortcodes |
324 | - preg_match_all( '/' . $regex . '/', $else_if_match[5] . '[/else]', $recursive_matches, PREG_SET_ORDER ); |
|
324 | + preg_match_all( '/' . $regex . '/', $else_if_match[ 5 ] . '[/else]', $recursive_matches, PREG_SET_ORDER ); |
|
325 | 325 | |
326 | 326 | // If the logic passes, this is the value that should be used for $this->else_content |
327 | - $else_if_value = $else_if_match[5]; |
|
328 | - $check_elseif_match = $else_if_match[0]; |
|
327 | + $else_if_value = $else_if_match[ 5 ]; |
|
328 | + $check_elseif_match = $else_if_match[ 0 ]; |
|
329 | 329 | |
330 | 330 | // Retrieve the value of the match that is currently being checked, without any other [else] tags |
331 | - if( ! empty( $recursive_matches[0][0] ) ) { |
|
332 | - $else_if_value = str_replace( $recursive_matches[0][0], '', $else_if_value ); |
|
333 | - $check_elseif_match = str_replace( $recursive_matches[0][0], '', $check_elseif_match ); |
|
331 | + if ( ! empty( $recursive_matches[ 0 ][ 0 ] ) ) { |
|
332 | + $else_if_value = str_replace( $recursive_matches[ 0 ][ 0 ], '', $else_if_value ); |
|
333 | + $check_elseif_match = str_replace( $recursive_matches[ 0 ][ 0 ], '', $check_elseif_match ); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | $check_elseif_match = str_replace( '[else', '[gvlogicelse', $check_elseif_match ); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | // Process any remaining [else] tags |
350 | - return $this->process_elseif( $else_if_match[5] ); |
|
350 | + return $this->process_elseif( $else_if_match[ 5 ] ); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | return false; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $this->atts = function_exists( 'array_intersect_key' ) ? array_intersect_key( $this->passed_atts, $this->atts ) : $this->atts; |
374 | 374 | |
375 | 375 | // Strip whitespace if it's not default false |
376 | - $this->if = ( isset( $this->atts['if'] ) && is_string( $this->atts['if'] ) ) ? trim( $this->atts['if'] ) : false; |
|
376 | + $this->if = ( isset( $this->atts[ 'if' ] ) && is_string( $this->atts[ 'if' ] ) ) ? trim( $this->atts[ 'if' ] ) : false; |
|
377 | 377 | |
378 | 378 | /** |
379 | 379 | * @action `gravityview/gvlogic/parse_atts/after` Modify shortcode attributes after it's been parsed |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | do_action( 'gravityview/gvlogic/parse_atts/after', $this ); |
385 | 385 | |
386 | 386 | // Make sure the "if" isn't processed in self::setup_operation_and_comparison() |
387 | - unset( $this->atts['if'] ); |
|
387 | + unset( $this->atts[ 'if' ] ); |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | |
43 | 43 | $args = wp_parse_args( $args, $defaults ); |
44 | 44 | |
45 | - $forms = gravityview_get_forms( (bool) $args['active'], (bool) $args['trash'] ); |
|
45 | + $forms = gravityview_get_forms( (bool)$args[ 'active' ], (bool)$args[ 'trash' ] ); |
|
46 | 46 | |
47 | - if( array() === $args['options'] ) { |
|
47 | + if ( array() === $args[ 'options' ] ) { |
|
48 | 48 | foreach ( $forms as $form ) { |
49 | 49 | |
50 | - if ( in_array( $form['id'], $args['exclude'] ) ) { |
|
50 | + if ( in_array( $form[ 'id' ], $args[ 'exclude' ] ) ) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | |
54 | - $args['options'][ $form['id'] ] = esc_html( $form['title'] ); |
|
54 | + $args[ 'options' ][ $form[ 'id' ] ] = esc_html( $form[ 'title' ] ); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -83,15 +83,15 @@ discard block |
||
83 | 83 | |
84 | 84 | $args = wp_parse_args( $args, $defaults ); |
85 | 85 | |
86 | - if( empty( $args['form_id'] ) ) { |
|
86 | + if ( empty( $args[ 'form_id' ] ) ) { |
|
87 | 87 | return ''; |
88 | 88 | } |
89 | 89 | |
90 | - $fields = GVCommon::get_sortable_fields_array( $args['form_id'] ); |
|
90 | + $fields = GVCommon::get_sortable_fields_array( $args[ 'form_id' ] ); |
|
91 | 91 | |
92 | - if( array() === $args['options'] ) { |
|
92 | + if ( array() === $args[ 'options' ] ) { |
|
93 | 93 | foreach ( $fields as $field_id => $field ) { |
94 | - $args['options'][ $field_id ] = esc_html( $field['label'] ); |
|
94 | + $args[ 'options' ][ $field_id ] = esc_html( $field[ 'label' ] ); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -127,43 +127,43 @@ discard block |
||
127 | 127 | $args = wp_parse_args( $args, $defaults ); |
128 | 128 | |
129 | 129 | $data_elements = ''; |
130 | - foreach ( $args['data'] as $key => $value ) { |
|
130 | + foreach ( $args[ 'data' ] as $key => $value ) { |
|
131 | 131 | $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
132 | 132 | } |
133 | 133 | |
134 | - if( $args['multiple'] ) { |
|
134 | + if ( $args[ 'multiple' ] ) { |
|
135 | 135 | $multiple = ' MULTIPLE'; |
136 | 136 | } else { |
137 | 137 | $multiple = ''; |
138 | 138 | } |
139 | 139 | |
140 | - if( $args['placeholder'] ) { |
|
141 | - $placeholder = $args['placeholder']; |
|
140 | + if ( $args[ 'placeholder' ] ) { |
|
141 | + $placeholder = $args[ 'placeholder' ]; |
|
142 | 142 | } else { |
143 | 143 | $placeholder = ''; |
144 | 144 | } |
145 | 145 | |
146 | - $disabled = $args['disabled'] ? ' disabled="disabled"' : ''; |
|
147 | - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); |
|
148 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>'; |
|
146 | + $disabled = $args[ 'disabled' ] ? ' disabled="disabled"' : ''; |
|
147 | + $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args[ 'class' ] ) ) ); |
|
148 | + $output = '<select name="' . esc_attr( $args[ 'name' ] ) . '" id="' . esc_attr( str_replace( '-', '_', $args[ 'id' ] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>'; |
|
149 | 149 | |
150 | - if ( ! empty( $args['options'] ) ) { |
|
150 | + if ( ! empty( $args[ 'options' ] ) ) { |
|
151 | 151 | |
152 | - if ( $args['show_option_none'] ) { |
|
153 | - if( $args['multiple'] ) { |
|
154 | - $selected = selected( true, in_array( -1, $args['selected'] ), false ); |
|
152 | + if ( $args[ 'show_option_none' ] ) { |
|
153 | + if ( $args[ 'multiple' ] ) { |
|
154 | + $selected = selected( true, in_array( -1, $args[ 'selected' ] ), false ); |
|
155 | 155 | } else { |
156 | - $selected = selected( $args['selected'], -1, false ); |
|
156 | + $selected = selected( $args[ 'selected' ], -1, false ); |
|
157 | 157 | } |
158 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
158 | + $output .= '<option value="-1"' . $selected . '>' . esc_html( $args[ 'show_option_none' ] ) . '</option>'; |
|
159 | 159 | } |
160 | 160 | |
161 | - foreach( $args['options'] as $key => $option ) { |
|
161 | + foreach ( $args[ 'options' ] as $key => $option ) { |
|
162 | 162 | |
163 | - if( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
164 | - $selected = selected( true, in_array( $key, $args['selected'], true ), false ); |
|
163 | + if ( $args[ 'multiple' ] && is_array( $args[ 'selected' ] ) ) { |
|
164 | + $selected = selected( true, in_array( $key, $args[ 'selected' ], true ), false ); |
|
165 | 165 | } else { |
166 | - $selected = selected( $args['selected'], $key, false ); |
|
166 | + $selected = selected( $args[ 'selected' ], $key, false ); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | function parse_um_profile_post_content( $args = array() ) { |
44 | 44 | global $ultimatemember; |
45 | 45 | |
46 | - if( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
46 | + if ( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) { |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | 50 | // @todo Support Ultimate Member 2.0 - for now, prevent fatal error |
51 | - if( ! isset( $ultimatemember->profile ) ) { |
|
51 | + if ( ! isset( $ultimatemember->profile ) ) { |
|
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | - GravityView_View_Data::getInstance()->parse_post_content( $active_tab[0]->post_content ); |
|
67 | + GravityView_View_Data::getInstance()->parse_post_content( $active_tab[ 0 ]->post_content ); |
|
68 | 68 | |
69 | 69 | wp_reset_postdata(); |
70 | 70 | } |
@@ -44,20 +44,20 @@ discard block |
||
44 | 44 | function add_meta_keys_from_post( $meta_keys = array(), $post_id = 0 ) { |
45 | 45 | |
46 | 46 | // Can never be too careful: double-check that ACF is active and the function exists |
47 | - if ( ! function_exists( 'get_field_objects' ) || ! class_exists('acf_field_functions' ) ) { |
|
47 | + if ( ! function_exists( 'get_field_objects' ) || ! class_exists( 'acf_field_functions' ) ) { |
|
48 | 48 | return $meta_keys; |
49 | 49 | } |
50 | 50 | |
51 | 51 | $acf_field_functions = new acf_field_functions; |
52 | 52 | |
53 | - remove_action('acf/format_value', array( $acf_field_functions, 'format_value'), 5 ); |
|
53 | + remove_action( 'acf/format_value', array( $acf_field_functions, 'format_value' ), 5 ); |
|
54 | 54 | |
55 | 55 | $acf_keys = get_field_objects( $post_id, array( 'load_value' => false ) ); |
56 | 56 | |
57 | 57 | // Restore existing filters added by format_value |
58 | - add_action('acf/format_value', array( $acf_field_functions, 'format_value'), 5, 3 ); |
|
58 | + add_action( 'acf/format_value', array( $acf_field_functions, 'format_value' ), 5, 3 ); |
|
59 | 59 | |
60 | - if( $acf_keys ) { |
|
60 | + if ( $acf_keys ) { |
|
61 | 61 | return array_merge( array_keys( $acf_keys ), $meta_keys ); |
62 | 62 | } |
63 | 63 | |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | private function fix_posted_fields() { |
75 | - if( is_admin() && isset( $_POST['action'] ) && isset( $_POST['post_type'] ) ) { |
|
76 | - if( 'editpost' === $_POST['action'] && 'gravityview' === $_POST['post_type'] ) { |
|
77 | - $_POST['fields'] = _gravityview_process_posted_fields(); |
|
75 | + if ( is_admin() && isset( $_POST[ 'action' ] ) && isset( $_POST[ 'post_type' ] ) ) { |
|
76 | + if ( 'editpost' === $_POST[ 'action' ] && 'gravityview' === $_POST[ 'post_type' ] ) { |
|
77 | + $_POST[ 'fields' ] = _gravityview_process_posted_fields(); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | } |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $tables = array(); |
43 | 43 | |
44 | 44 | if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) ) { |
45 | - $tables []= GFFormsModel::get_entry_meta_table_name(); |
|
45 | + $tables [ ] = GFFormsModel::get_entry_meta_table_name(); |
|
46 | 46 | } |
47 | - $tables []= GFFormsModel::get_lead_meta_table_name(); |
|
47 | + $tables [ ] = GFFormsModel::get_lead_meta_table_name(); |
|
48 | 48 | |
49 | 49 | $suppress = $wpdb->suppress_errors(); |
50 | 50 | foreach ( $tables as $meta_table ) { |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | $tables = array(); |
71 | 71 | |
72 | 72 | if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) { |
73 | - $tables[] = GFFormsModel::get_entry_notes_table_name(); |
|
73 | + $tables[ ] = GFFormsModel::get_entry_notes_table_name(); |
|
74 | 74 | } |
75 | 75 | |
76 | - $tables[] = GFFormsModel::get_lead_notes_table_name(); |
|
76 | + $tables[ ] = GFFormsModel::get_lead_notes_table_name(); |
|
77 | 77 | |
78 | - $disapproved = __('Disapproved the Entry for GravityView', 'gravityview'); |
|
79 | - $approved = __('Approved the Entry for GravityView', 'gravityview'); |
|
78 | + $disapproved = __( 'Disapproved the Entry for GravityView', 'gravityview' ); |
|
79 | + $approved = __( 'Approved the Entry for GravityView', 'gravityview' ); |
|
80 | 80 | |
81 | 81 | $suppress = $wpdb->suppress_errors(); |
82 | 82 | foreach ( $tables as $notes_table ) { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $default_settings = array( |
36 | 36 | 'id' => array( |
37 | - 'label' => __('View ID', 'gravityview'), |
|
37 | + 'label' => __( 'View ID', 'gravityview' ), |
|
38 | 38 | 'type' => 'number', |
39 | 39 | 'group' => 'default', |
40 | 40 | 'value' => NULL, |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'show_in_shortcode' => false, |
43 | 43 | ), |
44 | 44 | 'page_size' => array( |
45 | - 'label' => __('Number of entries per page', 'gravityview'), |
|
45 | + 'label' => __( 'Number of entries per page', 'gravityview' ), |
|
46 | 46 | 'type' => 'number', |
47 | 47 | 'class' => 'small-text', |
48 | 48 | 'group' => 'default', |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'show_in_shortcode' => true, |
51 | 51 | ), |
52 | 52 | 'offset' => array( |
53 | - 'label' => __('Offset entries starting from', 'gravityview'), |
|
53 | + 'label' => __( 'Offset entries starting from', 'gravityview' ), |
|
54 | 54 | 'type' => 'number', |
55 | 55 | 'class' => 'small-text', |
56 | 56 | 'group' => 'default', |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | ), |
75 | 75 | 'admin_show_all_statuses' => array( |
76 | 76 | 'label' => __( 'Show all entries to administrators', 'gravityview' ), |
77 | - 'desc' => __('Administrators will be able to see entries with any approval status.', 'gravityview'), |
|
78 | - 'tooltip' => __('Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview'), |
|
77 | + 'desc' => __( 'Administrators will be able to see entries with any approval status.', 'gravityview' ), |
|
78 | + 'tooltip' => __( 'Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview' ), |
|
79 | 79 | 'requires' => 'show_only_approved', |
80 | 80 | 'type' => 'checkbox', |
81 | 81 | 'group' => 'default', |
@@ -100,40 +100,40 @@ discard block |
||
100 | 100 | 'user_edit' => array( |
101 | 101 | 'label' => __( 'Allow User Edit', 'gravityview' ), |
102 | 102 | 'group' => 'default', |
103 | - 'desc' => __('Allow logged-in users to edit entries they created.', 'gravityview'), |
|
103 | + 'desc' => __( 'Allow logged-in users to edit entries they created.', 'gravityview' ), |
|
104 | 104 | 'value' => 0, |
105 | - 'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
105 | + 'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
106 | 106 | 'type' => 'checkbox', |
107 | 107 | 'show_in_shortcode' => true, |
108 | 108 | ), |
109 | 109 | 'user_delete' => array( |
110 | 110 | 'label' => __( 'Allow User Delete', 'gravityview' ), |
111 | 111 | 'group' => 'default', |
112 | - 'desc' => __('Allow logged-in users to delete entries they created.', 'gravityview'), |
|
112 | + 'desc' => __( 'Allow logged-in users to delete entries they created.', 'gravityview' ), |
|
113 | 113 | 'value' => 0, |
114 | - 'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
114 | + 'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
115 | 115 | 'type' => 'checkbox', |
116 | 116 | 'show_in_shortcode' => true, |
117 | 117 | ), |
118 | 118 | 'sort_field' => array( |
119 | - 'label' => __('Sort by field', 'gravityview'), |
|
119 | + 'label' => __( 'Sort by field', 'gravityview' ), |
|
120 | 120 | 'type' => 'select', |
121 | 121 | 'value' => '', |
122 | 122 | 'group' => 'sort', |
123 | 123 | 'options' => array( |
124 | - '' => __( 'Default', 'gravityview'), |
|
125 | - 'date_created' => __( 'Date Created', 'gravityview'), |
|
124 | + '' => __( 'Default', 'gravityview' ), |
|
125 | + 'date_created' => __( 'Date Created', 'gravityview' ), |
|
126 | 126 | ), |
127 | 127 | 'show_in_shortcode' => true, |
128 | 128 | ), |
129 | 129 | 'sort_direction' => array( |
130 | - 'label' => __('Sort direction', 'gravityview'), |
|
130 | + 'label' => __( 'Sort direction', 'gravityview' ), |
|
131 | 131 | 'type' => 'select', |
132 | 132 | 'value' => 'ASC', |
133 | 133 | 'group' => 'sort', |
134 | 134 | 'options' => array( |
135 | - 'ASC' => __('ASC', 'gravityview'), |
|
136 | - 'DESC' => __('DESC', 'gravityview'), |
|
135 | + 'ASC' => __( 'ASC', 'gravityview' ), |
|
136 | + 'DESC' => __( 'DESC', 'gravityview' ), |
|
137 | 137 | ), |
138 | 138 | 'show_in_shortcode' => true, |
139 | 139 | ), |
@@ -148,69 +148,69 @@ discard block |
||
148 | 148 | 'show_in_template' => array( 'default_table', 'preset_business_data', 'preset_issue_tracker', 'preset_resume_board', 'preset_job_board' ), |
149 | 149 | ), |
150 | 150 | 'start_date' => array( |
151 | - 'label' => __('Filter by Start Date', 'gravityview'), |
|
151 | + 'label' => __( 'Filter by Start Date', 'gravityview' ), |
|
152 | 152 | 'class' => 'gv-datepicker', |
153 | - 'desc' => __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
153 | + 'desc' => __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
154 | 154 | 'type' => 'text', |
155 | 155 | 'value' => '', |
156 | 156 | 'group' => 'filter', |
157 | 157 | 'show_in_shortcode' => true, |
158 | 158 | ), |
159 | 159 | 'end_date' => array( |
160 | - 'label' => __('Filter by End Date', 'gravityview'), |
|
160 | + 'label' => __( 'Filter by End Date', 'gravityview' ), |
|
161 | 161 | 'class' => 'gv-datepicker', |
162 | - 'desc' => __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
162 | + 'desc' => __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
163 | 163 | 'type' => 'text', |
164 | 164 | 'value' => '', |
165 | 165 | 'group' => 'filter', |
166 | 166 | 'show_in_shortcode' => true, |
167 | 167 | ), |
168 | 168 | 'class' => array( |
169 | - 'label' => __('CSS Class', 'gravityview'), |
|
170 | - 'desc' => __('CSS class to add to the wrapping HTML container.', 'gravityview'), |
|
169 | + 'label' => __( 'CSS Class', 'gravityview' ), |
|
170 | + 'desc' => __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ), |
|
171 | 171 | 'group' => 'default', |
172 | 172 | 'type' => 'text', |
173 | 173 | 'value' => '', |
174 | 174 | 'show_in_shortcode' => false, |
175 | 175 | ), |
176 | 176 | 'search_value' => array( |
177 | - 'label' => __('Search Value', 'gravityview'), |
|
178 | - 'desc' => __('Define a default search value for the View', 'gravityview'), |
|
177 | + 'label' => __( 'Search Value', 'gravityview' ), |
|
178 | + 'desc' => __( 'Define a default search value for the View', 'gravityview' ), |
|
179 | 179 | 'type' => 'text', |
180 | 180 | 'value' => '', |
181 | 181 | 'group' => 'filter', |
182 | 182 | 'show_in_shortcode' => false, |
183 | 183 | ), |
184 | 184 | 'search_field' => array( |
185 | - 'label' => __('Search Field', 'gravityview'), |
|
186 | - 'desc' => __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'), |
|
185 | + 'label' => __( 'Search Field', 'gravityview' ), |
|
186 | + 'desc' => __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ), |
|
187 | 187 | 'type' => 'number', |
188 | 188 | 'value' => '', |
189 | 189 | 'group' => 'filter', |
190 | 190 | 'show_in_shortcode' => false, |
191 | 191 | ), |
192 | 192 | 'single_title' => array( |
193 | - 'label' => __('Single Entry Title', 'gravityview'), |
|
193 | + 'label' => __( 'Single Entry Title', 'gravityview' ), |
|
194 | 194 | 'type' => 'text', |
195 | - 'desc' => __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'), |
|
195 | + 'desc' => __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ), |
|
196 | 196 | 'group' => 'default', |
197 | 197 | 'value' => '', |
198 | 198 | 'show_in_shortcode' => false, |
199 | 199 | 'full_width' => true, |
200 | 200 | ), |
201 | 201 | 'back_link_label' => array( |
202 | - 'label' => __('Back Link Label', 'gravityview'), |
|
202 | + 'label' => __( 'Back Link Label', 'gravityview' ), |
|
203 | 203 | 'group' => 'default', |
204 | - 'desc' => __('The text of the link that returns to the multiple entries view.', 'gravityview'), |
|
204 | + 'desc' => __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ), |
|
205 | 205 | 'type' => 'text', |
206 | 206 | 'value' => '', |
207 | 207 | 'show_in_shortcode' => false, |
208 | 208 | 'full_width' => true, |
209 | 209 | ), |
210 | 210 | 'embed_only' => array( |
211 | - 'label' => __('Prevent Direct Access', 'gravityview'), |
|
211 | + 'label' => __( 'Prevent Direct Access', 'gravityview' ), |
|
212 | 212 | 'group' => 'default', |
213 | - 'desc' => __('Only allow access to this View when embedded using the shortcode.', 'gravityview'), |
|
213 | + 'desc' => __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ), |
|
214 | 214 | 'type' => 'checkbox', |
215 | 215 | 'value' => '', |
216 | 216 | 'tooltip' => false, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ); |
226 | 226 | |
227 | 227 | if ( version_compare( \GFCommon::$version, '2.3-beta-4', '>=' ) ) { |
228 | - $default_settings['sort_direction']['options']['RAND'] = __( 'Random', 'gravityview' ); |
|
228 | + $default_settings[ 'sort_direction' ][ 'options' ][ 'RAND' ] = __( 'Random', 'gravityview' ); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -245,19 +245,19 @@ discard block |
||
245 | 245 | // By default, we only want the key => value pairing, not the whole array. |
246 | 246 | if ( ! $detailed ) { |
247 | 247 | $defaults = array(); |
248 | - foreach( $default_settings as $key => $value ) { |
|
249 | - $defaults[ $key ] = $value['value']; |
|
248 | + foreach ( $default_settings as $key => $value ) { |
|
249 | + $defaults[ $key ] = $value[ 'value' ]; |
|
250 | 250 | } |
251 | 251 | return $defaults; |
252 | 252 | |
253 | 253 | // But sometimes, we want all the details. |
254 | 254 | } else { |
255 | - foreach ($default_settings as $key => $value) { |
|
255 | + foreach ( $default_settings as $key => $value ) { |
|
256 | 256 | |
257 | 257 | // If the $group argument is set for the method, |
258 | 258 | // ignore any settings that aren't in that group. |
259 | 259 | if ( ! empty( $group ) && is_string( $group ) ) { |
260 | - if ( empty( $value['group'] ) || $value['group'] !== $group ) { |
|
260 | + if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) { |
|
261 | 261 | unset( $default_settings[ $key ] ); |
262 | 262 | } |
263 | 263 | } |