@@ -338,6 +338,7 @@ |
||
| 338 | 338 | * @param string|array $where |
| 339 | 339 | * @param string $order_by |
| 340 | 340 | * @param string $limit |
| 341 | + * @param boolean $unique |
|
| 341 | 342 | */ |
| 342 | 343 | private static function get_ids_query( $where, $order_by, $limit, $unique, $args, array &$query ) { |
| 343 | 344 | global $wpdb; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | global $wpdb; |
| 56 | 56 | |
| 57 | - $values = array( |
|
| 57 | + $values = array( |
|
| 58 | 58 | 'item_id' => $entry_id, |
| 59 | 59 | 'field_id' => $field_id, |
| 60 | 60 | ); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) { |
| 130 | 130 | // remove blank fields |
| 131 | - unset( $values[ $field_id ] ); |
|
| 131 | + unset( $values[$field_id] ); |
|
| 132 | 132 | } else { |
| 133 | 133 | // if value exists, then update it |
| 134 | 134 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public static function get_meta_value( $entry, $field_id ) { |
| 195 | 195 | if ( isset( $entry->metas ) ) { |
| 196 | - return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false; |
|
| 196 | + return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false; |
|
| 197 | 197 | } else { |
| 198 | 198 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
| 199 | 199 | } |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
| 215 | - $result = $cached->metas[ $field_id ]; |
|
| 214 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
| 215 | + $result = $cached->metas[$field_id]; |
|
| 216 | 216 | |
| 217 | 217 | return wp_unslash( $result ); |
| 218 | 218 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | if ( is_numeric( $field_id ) ) { |
| 223 | 223 | $query['field_id'] = $field_id; |
| 224 | 224 | } else { |
| 225 | - $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
| 225 | + $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
| 226 | 226 | $query['fi.field_key'] = $field_id; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | 'stripslashes' => true, |
| 241 | 241 | 'is_draft' => false, |
| 242 | 242 | ); |
| 243 | - $args = wp_parse_args( $args, $defaults ); |
|
| 243 | + $args = wp_parse_args( $args, $defaults ); |
|
| 244 | 244 | |
| 245 | 245 | $query = array(); |
| 246 | 246 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | foreach ( $values as $k => $v ) { |
| 257 | - $values[ $k ] = maybe_unserialize( $v ); |
|
| 257 | + $values[$k] = maybe_unserialize( $v ); |
|
| 258 | 258 | unset( $k, $v ); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | foreach ( $results as $k => $result ) { |
| 313 | - $results[ $k ]->meta_value = wp_unslash( maybe_unserialize( $result->meta_value ) ); |
|
| 313 | + $results[$k]->meta_value = wp_unslash( maybe_unserialize( $result->meta_value ) ); |
|
| 314 | 314 | unset( $k, $result ); |
| 315 | 315 | } |
| 316 | 316 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | 'user_id' => '', |
| 324 | 324 | 'group_by' => '', |
| 325 | 325 | ); |
| 326 | - $args = wp_parse_args( $args, $defaults ); |
|
| 326 | + $args = wp_parse_args( $args, $defaults ); |
|
| 327 | 327 | |
| 328 | 328 | $query = array(); |
| 329 | 329 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -31,6 +31,10 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | protected $option_label = ''; |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $option_key |
|
| 36 | + * @param string $option |
|
| 37 | + */ |
|
| 34 | 38 | public function __construct( $option_key, $option, $args = array() ) { |
| 35 | 39 | $this->option_key = $option_key; |
| 36 | 40 | $this->option = $option; |
@@ -152,6 +152,9 @@ discard block |
||
| 152 | 152 | return $this->add_form( $form ); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | + /** |
|
| 156 | + * @param string $source_form_name |
|
| 157 | + */ |
|
| 155 | 158 | protected function prepare_new_form( $source_id, $source_form_name ) { |
| 156 | 159 | return array( |
| 157 | 160 | 'import_form_id' => $source_id, |
@@ -201,6 +204,11 @@ discard block |
||
| 201 | 204 | // customize this function |
| 202 | 205 | } |
| 203 | 206 | |
| 207 | + /** |
|
| 208 | + * @param string $type |
|
| 209 | + * |
|
| 210 | + * @return string |
|
| 211 | + */ |
|
| 204 | 212 | protected function convert_field_type( $type ) { |
| 205 | 213 | return $type; |
| 206 | 214 | } |
@@ -314,6 +322,9 @@ discard block |
||
| 314 | 322 | return array(); |
| 315 | 323 | } |
| 316 | 324 | |
| 325 | + /** |
|
| 326 | + * @param string $type |
|
| 327 | + */ |
|
| 317 | 328 | private function is_unsupported_field( $type ) { |
| 318 | 329 | $fields = $this->unsupported_field_types(); |
| 319 | 330 | |
@@ -329,6 +340,9 @@ discard block |
||
| 329 | 340 | return array(); |
| 330 | 341 | } |
| 331 | 342 | |
| 343 | + /** |
|
| 344 | + * @param string $type |
|
| 345 | + */ |
|
| 332 | 346 | private function should_skip_field( $type ) { |
| 333 | 347 | $skip_pro_fields = $this->skip_pro_fields(); |
| 334 | 348 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | foreach ( $form['fields'] as $key => $new_field ) { |
| 238 | 238 | $new_field['form_id'] = $form_id; |
| 239 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
| 239 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // create emails |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | if ( $key === 'post_title' ) { |
| 249 | 249 | $new_action->post_title = $value; |
| 250 | 250 | } else { |
| 251 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 251 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $imported = $this->get_tracked_import(); |
| 280 | 280 | |
| 281 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
| 281 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
| 282 | 282 | |
| 283 | 283 | update_option( $this->tracking, $imported, false ); |
| 284 | 284 | } |
@@ -298,8 +298,8 @@ discard block |
||
| 298 | 298 | private function is_imported( $source_id ) { |
| 299 | 299 | $imported = $this->get_tracked_import(); |
| 300 | 300 | $new_form_id = 0; |
| 301 | - if ( isset( $imported[ $this->slug ] ) && in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
| 302 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
| 301 | + if ( isset( $imported[$this->slug] ) && in_array( $source_id, $imported[$this->slug] ) ) { |
|
| 302 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | return $new_form_id; |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | public $id = 0; // the id of the post |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | - * @param int|string $id The id of the stylsheet or 'default' |
|
| 8 | + * @param integer $id The id of the stylsheet or 'default' |
|
| 9 | 9 | */ |
| 10 | 10 | public function __construct( $id = 0 ) { |
| 11 | 11 | $this->id = $id; |
@@ -150,6 +150,9 @@ discard block |
||
| 150 | 150 | set_transient( 'frmpro_css', $css, MONTH_IN_SECONDS ); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | + /** |
|
| 154 | + * @param string $filename |
|
| 155 | + */ |
|
| 153 | 156 | private function get_css_content( $filename ) { |
| 154 | 157 | $css = '/* ' . __( 'WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable' ) . ' */' . "\n"; |
| 155 | 158 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $new_instance = (array) $new_instance; |
| 54 | 54 | $this->id = $new_instance['ID']; |
| 55 | 55 | if ( $id != $this->id || ! $_POST || ! isset( $_POST['frm_style_setting'] ) ) { |
| 56 | - $all_instances[ $number ] = $new_instance; |
|
| 56 | + $all_instances[$number] = $new_instance; |
|
| 57 | 57 | |
| 58 | 58 | if ( $new_instance['menu_order'] && $_POST && empty( $_POST['prev_menu_order'] ) && isset( $_POST['frm_style_setting']['menu_order'] ) ) { |
| 59 | 59 | // this style was set to default, so remove default setting on previous default style |
@@ -81,22 +81,22 @@ discard block |
||
| 81 | 81 | $default_settings = $this->get_defaults(); |
| 82 | 82 | |
| 83 | 83 | foreach ( $default_settings as $setting => $default ) { |
| 84 | - if ( ! isset( $new_instance['post_content'][ $setting ] ) ) { |
|
| 85 | - $new_instance['post_content'][ $setting ] = $default; |
|
| 84 | + if ( ! isset( $new_instance['post_content'][$setting] ) ) { |
|
| 85 | + $new_instance['post_content'][$setting] = $default; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if ( $this->is_color( $setting ) ) { |
| 89 | - $new_instance['post_content'][ $setting ] = str_replace( '#', '', $new_instance['post_content'][ $setting ] ); |
|
| 89 | + $new_instance['post_content'][$setting] = str_replace( '#', '', $new_instance['post_content'][$setting] ); |
|
| 90 | 90 | } elseif ( in_array( $setting, array( 'submit_style', 'important_style', 'auto_width' ) ) |
| 91 | - && ! isset( $new_instance['post_content'][ $setting ] ) |
|
| 91 | + && ! isset( $new_instance['post_content'][$setting] ) |
|
| 92 | 92 | ) { |
| 93 | - $new_instance['post_content'][ $setting ] = 0; |
|
| 93 | + $new_instance['post_content'][$setting] = 0; |
|
| 94 | 94 | } elseif ( $setting == 'font' ) { |
| 95 | - $new_instance['post_content'][ $setting ] = $this->force_balanced_quotation( $new_instance['post_content'][ $setting ] ); |
|
| 95 | + $new_instance['post_content'][$setting] = $this->force_balanced_quotation( $new_instance['post_content'][$setting] ); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - $all_instances[ $number ] = $new_instance; |
|
| 99 | + $all_instances[$number] = $new_instance; |
|
| 100 | 100 | |
| 101 | 101 | $action_ids[] = $this->save( $new_instance ); |
| 102 | 102 | |
@@ -268,13 +268,13 @@ discard block |
||
| 268 | 268 | $style->post_content = $this->override_defaults( $style->post_content ); |
| 269 | 269 | $style->post_content = wp_parse_args( $style->post_content, $default_values ); |
| 270 | 270 | |
| 271 | - $styles[ $style->ID ] = $style; |
|
| 271 | + $styles[$style->ID] = $style; |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | if ( ! $default_style ) { |
| 275 | 275 | $default_style = reset( $styles ); |
| 276 | 276 | |
| 277 | - $styles[ $default_style->ID ]->menu_order = 1; |
|
| 277 | + $styles[$default_style->ID]->menu_order = 1; |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | return $styles; |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function validate( $args ) { |
| 37 | 37 | $errors = array(); |
| 38 | 38 | if ( $args['value'] != '' && ! is_email( $args['value'] ) ) { |
| 39 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 39 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $errors; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'sep' => ', ', |
| 40 | 40 | 'html' => false, |
| 41 | 41 | ); |
| 42 | - $atts = wp_parse_args( $atts, $defaults ); |
|
| 42 | + $atts = wp_parse_args( $atts, $defaults ); |
|
| 43 | 43 | |
| 44 | 44 | if ( $atts['html'] ) { |
| 45 | 45 | $atts['sep'] = ' '; |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // validate the url format |
| 63 | 63 | if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) { |
| 64 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 64 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | 65 | } elseif ( $this->field->required == '1' && empty( $value ) ) { |
| 66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $errors; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | $user_ID = get_current_user_id(); |
| 43 | 43 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 44 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // WPCS: CSRF ok. |
|
| 44 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // WPCS: CSRF ok. |
|
| 45 | 45 | $updating = ( isset( $args['action'] ) && $args['action'] == 'update' ); |
| 46 | 46 | $value = ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID; |
| 47 | 47 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $checked = FrmAppHelper::get_param( 'recaptcha_checked', '', 'post', 'sanitize_text_field' ); |
| 150 | 150 | if ( ! isset( $_POST['recaptcha_checked'] ) || ! wp_verify_nonce( $checked, 'frm_ajax' ) ) { |
| 151 | 151 | // There was no captcha submitted. |
| 152 | - $errors[ 'field' . $args['id'] ] = __( 'The captcha is missing from this form', 'formidable' ); |
|
| 152 | + $errors['field' . $args['id']] = __( 'The captcha is missing from this form', 'formidable' ); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return $errors; |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | if ( isset( $response['success'] ) && ! $response['success'] ) { |
| 164 | 164 | // What happens when the CAPTCHA was entered incorrectly |
| 165 | 165 | $invalid_message = FrmField::get_option( $this->field, 'invalid' ); |
| 166 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
| 166 | + $errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
| 167 | 167 | } elseif ( is_wp_error( $resp ) ) { |
| 168 | 168 | $error_string = $resp->get_error_message(); |
| 169 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
| 170 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
| 169 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
| 170 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | return $errors; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $new_values['field_key'] = FrmAppHelper::get_unique_key( $key, $wpdb->prefix . 'frm_fields', 'field_key' ); |
| 184 | 184 | |
| 185 | 185 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
| 186 | - $new_values[ $col ] = $values[ $col ]; |
|
| 186 | + $new_values[$col] = $values[$col]; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | $new_values['options'] = $values['options']; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
| 196 | 196 | |
| 197 | 197 | if ( isset( $values['id'] ) ) { |
| 198 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
| 198 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
| 199 | 199 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | foreach ( $new_values as $k => $v ) { |
| 205 | 205 | if ( is_array( $v ) ) { |
| 206 | - $new_values[ $k ] = serialize( $v ); |
|
| 206 | + $new_values[$k] = serialize( $v ); |
|
| 207 | 207 | } |
| 208 | 208 | unset( $k, $v ); |
| 209 | 209 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | if ( $query_results ) { |
| 226 | 226 | if ( isset( $values['id'] ) ) { |
| 227 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 227 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return $new_id; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
| 237 | 237 | global $frm_duplicate_ids; |
| 238 | 238 | |
| 239 | - $where = array( |
|
| 239 | + $where = array( |
|
| 240 | 240 | array( |
| 241 | 241 | 'or' => 1, |
| 242 | 242 | 'fi.form_id' => $old_form_id, |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 284 | 284 | $new_id = self::create( $values ); |
| 285 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 286 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 285 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 286 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 287 | 287 | unset( $field ); |
| 288 | 288 | } |
| 289 | 289 | } |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | // serialize array values |
| 316 | 316 | foreach ( array( 'default_value', 'field_options', 'options' ) as $opt ) { |
| 317 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 318 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 317 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 318 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | 'id' => $id, |
| 465 | 465 | 'field_key' => $id, |
| 466 | 466 | ); |
| 467 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
| 467 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | return $type; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | continue; |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | - $fields[ $result->id ] = $result; |
|
| 493 | + $fields[$result->id] = $result; |
|
| 494 | 494 | $count ++; |
| 495 | 495 | if ( $limit == 1 ) { |
| 496 | 496 | $fields = $result; |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | $count = 0; |
| 537 | 537 | foreach ( $results as $result ) { |
| 538 | 538 | $count ++; |
| 539 | - $fields[ $result->id ] = $result; |
|
| 539 | + $fields[$result->id] = $result; |
|
| 540 | 540 | if ( ! empty( $limit ) && $count >= $limit ) { |
| 541 | 541 | break; |
| 542 | 542 | } |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | if ( ! empty( $sub_fields ) ) { |
| 602 | - $index = $k + $index_offset; |
|
| 602 | + $index = $k + $index_offset; |
|
| 603 | 603 | $index_offset += count( $sub_fields ); |
| 604 | 604 | array_splice( $results, $index, 0, $sub_fields ); |
| 605 | 605 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results'; |
| 645 | 645 | |
| 646 | 646 | if ( is_array( $where ) ) { |
| 647 | - $args = array( |
|
| 647 | + $args = array( |
|
| 648 | 648 | 'order_by' => $order_by, |
| 649 | 649 | 'limit' => $limit, |
| 650 | 650 | ); |
@@ -674,9 +674,9 @@ discard block |
||
| 674 | 674 | FrmDb::set_cache( $result->id, $result, 'frm_field' ); |
| 675 | 675 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 676 | 676 | |
| 677 | - $results[ $r_key ]->field_options = maybe_unserialize( $result->field_options ); |
|
| 678 | - $results[ $r_key ]->options = maybe_unserialize( $result->options ); |
|
| 679 | - $results[ $r_key ]->default_value = maybe_unserialize( $result->default_value ); |
|
| 677 | + $results[$r_key]->field_options = maybe_unserialize( $result->field_options ); |
|
| 678 | + $results[$r_key]->options = maybe_unserialize( $result->options ); |
|
| 679 | + $results[$r_key]->default_value = maybe_unserialize( $result->default_value ); |
|
| 680 | 680 | |
| 681 | 681 | unset( $r_key, $result ); |
| 682 | 682 | } |
@@ -873,23 +873,23 @@ discard block |
||
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | public static function is_option_true_in_array( $field, $option ) { |
| 876 | - return isset( $field[ $option ] ) && $field[ $option ]; |
|
| 876 | + return isset( $field[$option] ) && $field[$option]; |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | public static function is_option_true_in_object( $field, $option ) { |
| 880 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
| 880 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
| 881 | 881 | } |
| 882 | 882 | |
| 883 | 883 | public static function is_option_empty_in_array( $field, $option ) { |
| 884 | - return ! isset( $field[ $option ] ) || empty( $field[ $option ] ); |
|
| 884 | + return ! isset( $field[$option] ) || empty( $field[$option] ); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | public static function is_option_empty_in_object( $field, $option ) { |
| 888 | - return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] ); |
|
| 888 | + return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] ); |
|
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | public static function is_option_value_in_object( $field, $option ) { |
| 892 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
| 892 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | /** |
@@ -906,11 +906,11 @@ discard block |
||
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | public static function get_option_in_array( $field, $option ) { |
| 909 | - return isset( $field[ $option ] ) ? $field[ $option ] : ''; |
|
| 909 | + return isset( $field[$option] ) ? $field[$option] : ''; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | public static function get_option_in_object( $field, $option ) { |
| 913 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
| 913 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | /** |