@@ -80,20 +80,20 @@ discard block |
||
| 80 | 80 | 'name' => sprintf( |
| 81 | 81 | /* translators: Formidable addon name */ |
| 82 | 82 | esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ), |
| 83 | - $addon_list[ $matching_addon ]['name'] |
|
| 83 | + $addon_list[$matching_addon]['name'] |
|
| 84 | 84 | ), |
| 85 | - 'addon' => $addon_list[ $matching_addon ]['slug'], |
|
| 86 | - 'short_description' => $addon_list[ $matching_addon ]['excerpt'], |
|
| 85 | + 'addon' => $addon_list[$matching_addon]['slug'], |
|
| 86 | + 'short_description' => $addon_list[$matching_addon]['excerpt'], |
|
| 87 | 87 | 'slug' => self::$slug, |
| 88 | - 'version' => $addon_list[ $matching_addon ]['version'], |
|
| 88 | + 'version' => $addon_list[$matching_addon]['version'], |
|
| 89 | 89 | ); |
| 90 | 90 | |
| 91 | - if ( ! empty( $addon_list[ $matching_addon ]['external'] ) ) { |
|
| 91 | + if ( ! empty( $addon_list[$matching_addon]['external'] ) ) { |
|
| 92 | 92 | unset( $overrides['name'] ); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Splice in the base addon data. |
| 96 | - $inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides ); |
|
| 96 | + $inject = array_merge( $inject, $addon_list[$matching_addon], $overrides ); |
|
| 97 | 97 | |
| 98 | 98 | // Add it to the top of the list. |
| 99 | 99 | array_unshift( $result->plugins, $inject ); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | // Plugin installed, active, feature not enabled; prompt to enable. |
| 309 | 309 | if ( ! $is_active && $is_installed ) { |
| 310 | 310 | if ( current_user_can( 'activate_plugins' ) ) { |
| 311 | - $activate_url = add_query_arg( |
|
| 311 | + $activate_url = add_query_arg( |
|
| 312 | 312 | array( |
| 313 | 313 | 'action' => 'activate', |
| 314 | 314 | '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin['plugin'] ), |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | */ |
| 353 | 353 | protected function is_installed( $plugin ) { |
| 354 | 354 | $all_plugins = FrmAppHelper::get_plugins(); |
| 355 | - return isset( $all_plugins[ $plugin ] ); |
|
| 355 | + return isset( $all_plugins[$plugin] ); |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $templates = $this->get_api_info(); |
| 96 | 96 | $contact_form = 20872734; |
| 97 | - return isset( $templates[ $contact_form ] ) && ! empty( $templates[ $contact_form ]['url'] ); |
|
| 97 | + return isset( $templates[$contact_form] ) && ! empty( $templates[$contact_form]['url'] ); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -169,15 +169,15 @@ discard block |
||
| 169 | 169 | continue; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - $data['urlByKey'][ $template['key'] ] = $template['url']; |
|
| 172 | + $data['urlByKey'][$template['key']] = $template['url']; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - if ( ! isset( $data['urlByKey'][ $key ] ) ) { |
|
| 175 | + if ( ! isset( $data['urlByKey'][$key] ) ) { |
|
| 176 | 176 | $error = new WP_Error( 400, 'We were unable to retrieve the template' ); |
| 177 | 177 | wp_send_json_error( $error ); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $data['url'] = $data['urlByKey'][ $key ]; |
|
| 180 | + $data['url'] = $data['urlByKey'][$key]; |
|
| 181 | 181 | }//end if |
| 182 | 182 | |
| 183 | 183 | wp_send_json_success( $data ); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
| 81 | 81 | $field_metas = array(); |
| 82 | 82 | foreach ( $metas as $meta ) { |
| 83 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
| 83 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | $reduced = array(); |
| 137 | 137 | foreach ( $filter_vals as $field_id => $value ) { |
| 138 | 138 | $field = FrmFieldFactory::get_field_object( $field_id ); |
| 139 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 140 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
| 141 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
| 142 | - unset( $reduced[ $field_id ] ); |
|
| 139 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
| 140 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
| 141 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
| 142 | + unset( $reduced[$field_id] ); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | return $reduced; |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | private static function prepare_entries( &$entries ) { |
| 402 | 402 | foreach ( $entries as $k => $entry ) { |
| 403 | 403 | self::prepare_entry( $entry ); |
| 404 | - $entries[ $k ] = $entry; |
|
| 404 | + $entries[$k] = $entry; |
|
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | |
@@ -427,19 +427,19 @@ discard block |
||
| 427 | 427 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 428 | 428 | |
| 429 | 429 | if ( $meta_val->item_id == $entry->id ) { |
| 430 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 430 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 431 | 431 | if ( $include_key ) { |
| 432 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
| 432 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
| 433 | 433 | } |
| 434 | 434 | continue; |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | // include sub entries in an array |
| 438 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
| 439 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
| 438 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
| 439 | + $entry->metas[$meta_val->field_id] = array(); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
| 442 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
| 443 | 443 | |
| 444 | 444 | unset( $meta_val ); |
| 445 | 445 | } |
@@ -534,16 +534,16 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | foreach ( $metas as $m_key => $meta_val ) { |
| 537 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
| 537 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
| 538 | 538 | continue; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
| 542 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
| 541 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
| 542 | + $entries[$meta_val->item_id]->metas = array(); |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | FrmFieldsHelper::prepare_field_value( $meta_val->meta_value, $meta_val->type ); |
| 546 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
| 546 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
| 547 | 547 | unset( $m_key, $meta_val ); |
| 548 | 548 | } |
| 549 | 549 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | private static function get_entry_value( $values, $name, $default ) { |
| 728 | - return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
|
| 728 | + return isset( $values[$name] ) ? $values[$name] : $default; |
|
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | /** |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | private static function maybe_add_captcha_meta( $form_id, $entry_id ) { |
| 911 | 911 | global $frm_vars; |
| 912 | 912 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
| 913 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
| 913 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
| 914 | 914 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
| 915 | 915 | } |
| 916 | 916 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | private function update_next_execution_time() { |
| 86 | 86 | $config_option_name = $this->config['config-option-name']; |
| 87 | 87 | |
| 88 | - $this->options_data[ $config_option_name ] = $this->get_next_execution(); |
|
| 88 | + $this->options_data[$config_option_name] = $this->get_next_execution(); |
|
| 89 | 89 | $this->update_options_data(); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | * @return bool |
| 105 | 105 | */ |
| 106 | 106 | private function is_time_to_execute() { |
| 107 | - if ( ! isset( $this->options_data[ $this->config['config-option-name'] ] ) ) { |
|
| 107 | + if ( ! isset( $this->options_data[$this->config['config-option-name']] ) ) { |
|
| 108 | 108 | return true; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $options = $this->options_data[ $this->config['config-option-name'] ]; |
|
| 111 | + $options = $this->options_data[$this->config['config-option-name']]; |
|
| 112 | 112 | |
| 113 | 113 | return ! ( isset( $options['timestamp'] ) && (int) $options['timestamp'] > $this->get_time() ); |
| 114 | 114 | } |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | $groups = FrmFormActionsController::form_action_groups(); |
| 209 | 209 | $group = 'misc'; |
| 210 | 210 | |
| 211 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
| 211 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
| 212 | 212 | $group = $action_options['group']; |
| 213 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
| 213 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
| 214 | 214 | $group = $this->id_base; |
| 215 | 215 | } else { |
| 216 | 216 | foreach ( $groups as $name => $check_group ) { |
@@ -221,8 +221,8 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | - $groups[ $group ]['id'] = $group; |
|
| 225 | - return $groups[ $group ]; |
|
| 224 | + $groups[$group]['id'] = $group; |
|
| 225 | + return $groups[$group]; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | * @return int $post_id |
| 334 | 334 | */ |
| 335 | 335 | public function maybe_create_action( $action, $forms ) { |
| 336 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) { |
|
| 336 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) { |
|
| 337 | 337 | // Update action only |
| 338 | 338 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
| 339 | 339 | $post_id = $this->save_settings( $action ); |
@@ -356,18 +356,18 @@ discard block |
||
| 356 | 356 | $switch = $this->get_global_switch_fields(); |
| 357 | 357 | |
| 358 | 358 | foreach ( (array) $action->post_content as $key => $val ) { |
| 359 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
| 360 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
| 359 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
| 360 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
| 361 | 361 | } elseif ( ! is_array( $val ) ) { |
| 362 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 363 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
| 362 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
| 363 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
| 364 | 364 | // loop through each value if empty |
| 365 | - if ( empty( $switch[ $key ] ) ) { |
|
| 366 | - $switch[ $key ] = array_keys( $val ); |
|
| 365 | + if ( empty( $switch[$key] ) ) { |
|
| 366 | + $switch[$key] = array_keys( $val ); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - foreach ( $switch[ $key ] as $subkey ) { |
|
| 370 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
| 369 | + foreach ( $switch[$key] as $subkey ) { |
|
| 370 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
@@ -385,20 +385,20 @@ discard block |
||
| 385 | 385 | foreach ( $subkey as $subkey2 ) { |
| 386 | 386 | foreach ( (array) $val as $ck => $cv ) { |
| 387 | 387 | if ( is_array( $cv ) ) { |
| 388 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
| 389 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
| 390 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
| 388 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
| 389 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
| 390 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | } else { |
| 395 | 395 | foreach ( (array) $val as $ck => $cv ) { |
| 396 | 396 | if ( is_array( $cv ) ) { |
| 397 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
| 398 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
| 399 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
| 397 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
| 398 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
| 399 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
| 400 | 400 | } elseif ( $ck == $subkey ) { |
| 401 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
| 401 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | }//end if |
@@ -422,10 +422,10 @@ discard block |
||
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 425 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
| 425 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
| 426 | 426 | // Sanitizing removes scripts and <email> type of values. |
| 427 | 427 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 428 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
| 428 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
| 429 | 429 | } else { |
| 430 | 430 | return; |
| 431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | foreach ( $settings as $number => $new_instance ) { |
| 436 | 436 | $this->_set( $number ); |
| 437 | 437 | |
| 438 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
| 438 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
| 439 | 439 | |
| 440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
| 441 | 441 | $new_instance['post_status'] = 'draft'; |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
| 474 | 474 | |
| 475 | 475 | if ( false !== $instance ) { |
| 476 | - $all_instances[ $number ] = $instance; |
|
| 476 | + $all_instances[$number] = $instance; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | $action_ids[] = $this->save_settings( $instance ); |
@@ -555,12 +555,12 @@ discard block |
||
| 555 | 555 | // some plugins/themes are formatting the post_excerpt |
| 556 | 556 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
| 557 | 557 | |
| 558 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
| 558 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
| 559 | 559 | continue; |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
| 563 | - $settings[ $action->ID ] = $action; |
|
| 562 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
| 563 | + $settings[$action->ID] = $action; |
|
| 564 | 564 | |
| 565 | 565 | if ( count( $settings ) >= $limit ) { |
| 566 | 566 | break; |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | 'limit' => 99, |
| 594 | 594 | 'post_status' => $default_status, |
| 595 | 595 | ); |
| 596 | - $args = wp_parse_args( $args, $defaults ); |
|
| 596 | + $args = wp_parse_args( $args, $defaults ); |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | $action = $this->prepare_action( $action ); |
| 661 | 661 | |
| 662 | - $settings[ $action->ID ] = $action; |
|
| 662 | + $settings[$action->ID] = $action; |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | if ( 1 === $limit ) { |
@@ -702,10 +702,10 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | foreach ( $default_values as $k => $vals ) { |
| 704 | 704 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
| 705 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
| 705 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
| 706 | 706 | continue; |
| 707 | 707 | } |
| 708 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
| 708 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | |
@@ -793,9 +793,9 @@ discard block |
||
| 793 | 793 | |
| 794 | 794 | // fill with existing options |
| 795 | 795 | foreach ( $action->post_content as $name => $val ) { |
| 796 | - if ( isset( $form->options[ $name ] ) ) { |
|
| 797 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
| 798 | - unset( $form->options[ $name ] ); |
|
| 796 | + if ( isset( $form->options[$name] ) ) { |
|
| 797 | + $action->post_content[$name] = $form->options[$name]; |
|
| 798 | + unset( $form->options[$name] ); |
|
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | $stop = $stop ? false : true; |
| 862 | 862 | } |
| 863 | 863 | |
| 864 | - $met[ $stop ] = $stop; |
|
| 864 | + $met[$stop] = $stop; |
|
| 865 | 865 | }//end foreach |
| 866 | 866 | |
| 867 | 867 | if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) { |
@@ -915,8 +915,8 @@ discard block |
||
| 915 | 915 | private static function get_value_from_entry( $entry, $field_id ) { |
| 916 | 916 | $observed_value = ''; |
| 917 | 917 | |
| 918 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
| 919 | - $observed_value = $entry->metas[ $field_id ]; |
|
| 918 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
| 919 | + $observed_value = $entry->metas[$field_id]; |
|
| 920 | 920 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
| 921 | 921 | $field = FrmField::getOne( $field_id ); |
| 922 | 922 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args ); |
| 163 | 163 | $to = $this->explode_emails( $to ); |
| 164 | 164 | |
| 165 | - $where = array( |
|
| 165 | + $where = array( |
|
| 166 | 166 | 'it.field_id !' => 0, |
| 167 | 167 | 'it.item_id' => $this->entry->id, |
| 168 | 168 | ); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | 'entry' => $this->entry, |
| 173 | 173 | 'form' => $this->form, |
| 174 | 174 | ); |
| 175 | - $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 175 | + $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 176 | 176 | |
| 177 | 177 | $this->to = array_unique( (array) $to ); |
| 178 | 178 | |
@@ -702,11 +702,11 @@ discard block |
||
| 702 | 702 | $name = trim( str_replace( $email, '', $val ) ); |
| 703 | 703 | } else { |
| 704 | 704 | // If user enters a name without an email |
| 705 | - unset( $recipients[ $key ] ); |
|
| 705 | + unset( $recipients[$key] ); |
|
| 706 | 706 | continue; |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - $recipients[ $key ] = $this->format_from_email( $name, $email ); |
|
| 709 | + $recipients[$key] = $this->format_from_email( $name, $email ); |
|
| 710 | 710 | }//end foreach |
| 711 | 711 | |
| 712 | 712 | return $recipients; |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | ); |
| 857 | 857 | |
| 858 | 858 | // Remove phone number from to addresses |
| 859 | - unset( $this->to[ $key ] ); |
|
| 859 | + unset( $this->to[$key] ); |
|
| 860 | 860 | }//end if |
| 861 | 861 | }//end foreach |
| 862 | 862 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | global $wpdb; |
| 60 | 60 | |
| 61 | - $values = array( |
|
| 61 | + $values = array( |
|
| 62 | 62 | 'item_id' => $entry_id, |
| 63 | 63 | 'field_id' => $field_id, |
| 64 | 64 | ); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) { |
| 134 | 134 | // remove blank fields |
| 135 | - unset( $values[ $field_id ] ); |
|
| 135 | + unset( $values[$field_id] ); |
|
| 136 | 136 | } else { |
| 137 | 137 | // if value exists, then update it |
| 138 | 138 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public static function get_meta_value( $entry, $field_id ) { |
| 212 | 212 | if ( isset( $entry->metas ) ) { |
| 213 | - return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false; |
|
| 213 | + return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false; |
|
| 214 | 214 | } |
| 215 | 215 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
| 216 | 216 | } |
@@ -227,8 +227,8 @@ discard block |
||
| 227 | 227 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
| 231 | - $result = $cached->metas[ $field_id ]; |
|
| 230 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
| 231 | + $result = $cached->metas[$field_id]; |
|
| 232 | 232 | |
| 233 | 233 | return wp_unslash( $result ); |
| 234 | 234 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | 'stripslashes' => true, |
| 257 | 257 | 'is_draft' => false, |
| 258 | 258 | ); |
| 259 | - $args = wp_parse_args( $args, $defaults ); |
|
| 259 | + $args = wp_parse_args( $args, $defaults ); |
|
| 260 | 260 | |
| 261 | 261 | $query = array(); |
| 262 | 262 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | foreach ( $values as $k => $v ) { |
| 273 | 273 | FrmAppHelper::unserialize_or_decode( $v ); |
| 274 | - $values[ $k ] = $v; |
|
| 274 | + $values[$k] = $v; |
|
| 275 | 275 | unset( $k, $v ); |
| 276 | 276 | } |
| 277 | 277 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | foreach ( $results as $k => $result ) { |
| 340 | 340 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
| 341 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
| 341 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
| 342 | 342 | unset( $k, $result ); |
| 343 | 343 | } |
| 344 | 344 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | 'user_id' => '', |
| 352 | 352 | 'group_by' => '', |
| 353 | 353 | ); |
| 354 | - $args = wp_parse_args( $args, $defaults ); |
|
| 354 | + $args = wp_parse_args( $args, $defaults ); |
|
| 355 | 355 | |
| 356 | 356 | $query = array(); |
| 357 | 357 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | } elseif ( false !== strpos( $args['is_draft'], ',' ) ) { |
| 419 | 419 | $is_draft = array_reduce( |
| 420 | 420 | explode( ',', $args['is_draft'] ), |
| 421 | - function ( $total, $current ) { |
|
| 421 | + function( $total, $current ) { |
|
| 422 | 422 | if ( is_numeric( $current ) ) { |
| 423 | 423 | $total[] = absint( $current ); |
| 424 | 424 | } |
@@ -228,7 +228,8 @@ discard block |
||
| 228 | 228 | * @param mixed $value |
| 229 | 229 | */ |
| 230 | 230 | private static function get_posted_field_setting( $setting, &$value ) { |
| 231 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 231 | + if ( ! isset( $_POST['field_options'][ $setting ] ) ) { |
|
| 232 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 232 | 233 | return; |
| 233 | 234 | } |
| 234 | 235 | |
@@ -1251,7 +1252,8 @@ discard block |
||
| 1251 | 1252 | |
| 1252 | 1253 | // Check posted vals before checking saved values |
| 1253 | 1254 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1254 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1255 | + if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
| 1256 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1255 | 1257 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1256 | 1258 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1257 | 1259 | $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
@@ -1262,7 +1264,8 @@ discard block |
||
| 1262 | 1264 | return $other_val; |
| 1263 | 1265 | } |
| 1264 | 1266 | |
| 1265 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1267 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
| 1268 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1266 | 1269 | // For normal fields |
| 1267 | 1270 | |
| 1268 | 1271 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
| 32 | 32 | $values['field_options']['data_type'] = $setting; |
| 33 | 33 | } else { |
| 34 | - $values['field_options'][ $setting ] = 1; |
|
| 34 | + $values['field_options'][$setting] = 1; |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | foreach ( $defaults as $opt => $default ) { |
| 152 | - $values[ $opt ] = isset( $field->field_options[ $opt ] ) ? $field->field_options[ $opt ] : $default; |
|
| 152 | + $values[$opt] = isset( $field->field_options[$opt] ) ? $field->field_options[$opt] : $default; |
|
| 153 | 153 | |
| 154 | 154 | if ( $check_post ) { |
| 155 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 155 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | unset( $opt, $default ); |
@@ -228,18 +228,18 @@ discard block |
||
| 228 | 228 | * @param mixed $value |
| 229 | 229 | */ |
| 230 | 230 | private static function get_posted_field_setting( $setting, &$value ) { |
| 231 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 231 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 232 | 232 | return; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | if ( strpos( $setting, 'html' ) !== false ) { |
| 236 | 236 | // Strip slashes from HTML but not regex or script tags. |
| 237 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 237 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 238 | 238 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 239 | 239 | // TODO: Remove stripslashes on output, and use on input only. |
| 240 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 240 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 241 | 241 | } else { |
| 242 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 242 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 243 | 243 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 313 | 313 | |
| 314 | 314 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 315 | - $values[ $col ] = $field->{$col}; |
|
| 315 | + $values[$col] = $field->{$col}; |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | $msg = FrmField::get_option( $field, $error ); |
| 354 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 354 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 355 | 355 | $msg = do_shortcode( $msg ); |
| 356 | 356 | |
| 357 | 357 | $msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | 'title' => '', |
| 620 | 620 | 'inside_class' => 'inside', |
| 621 | 621 | ); |
| 622 | - $args = array_merge( $defaults, $args ); |
|
| 622 | + $args = array_merge( $defaults, $args ); |
|
| 623 | 623 | |
| 624 | 624 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 625 | 625 | } |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | continue; |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 857 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 858 | 858 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 859 | 859 | |
| 860 | 860 | $atts['entry'] = $entry; |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | if ( $replace_with !== null ) { |
| 865 | 865 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 866 | 866 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 867 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 867 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | unset( $atts, $replace_with ); |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | $supported_atts = array( 'remove_accents', 'sanitize', 'sanitize_url' ); |
| 883 | 883 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 884 | 884 | foreach ( $included_atts as $included_att ) { |
| 885 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 885 | + if ( '0' === $atts[$included_att] ) { |
|
| 886 | 886 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 887 | 887 | continue; |
| 888 | 888 | } |
@@ -955,8 +955,8 @@ discard block |
||
| 955 | 955 | |
| 956 | 956 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get' ); |
| 957 | 957 | |
| 958 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 959 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 958 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 959 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 960 | 960 | } elseif ( in_array( $atts['tag'], $dynamic_default ) ) { |
| 961 | 961 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 962 | 962 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1173,8 +1173,8 @@ discard block |
||
| 1173 | 1173 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1174 | 1174 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1175 | 1175 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1176 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1177 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1176 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1177 | + $field_types[$type] = $field_selection[$type]; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | |
| 1208 | 1208 | private static function field_types_for_input( $inputs, $fields, &$field_types ) { |
| 1209 | 1209 | foreach ( $inputs as $input ) { |
| 1210 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1210 | + $field_types[$input] = $fields[$input]; |
|
| 1211 | 1211 | unset( $input ); |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | 'parent' => false, |
| 1240 | 1240 | 'pointer' => false, |
| 1241 | 1241 | ); |
| 1242 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1242 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1243 | 1243 | |
| 1244 | 1244 | $opt_key = $args['opt_key']; |
| 1245 | 1245 | $field = $args['field']; |
@@ -1255,25 +1255,25 @@ discard block |
||
| 1255 | 1255 | |
| 1256 | 1256 | // Check posted vals before checking saved values |
| 1257 | 1257 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1258 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1258 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1259 | 1259 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1260 | 1260 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1261 | - $other_val = isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1261 | + $other_val = isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1262 | 1262 | } else { |
| 1263 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1263 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | return $other_val; |
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1269 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1270 | 1270 | // For normal fields |
| 1271 | 1271 | |
| 1272 | 1272 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1273 | 1273 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1274 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1274 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1275 | 1275 | } else { |
| 1276 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1276 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | return $other_val; |
@@ -1283,8 +1283,8 @@ discard block |
||
| 1283 | 1283 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1284 | 1284 | // Check if there is an "other" val in saved value and make sure the |
| 1285 | 1285 | // "other" val is not equal to the Other checkbox option |
| 1286 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1287 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1286 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1287 | + $other_val = $field['value'][$opt_key]; |
|
| 1288 | 1288 | } |
| 1289 | 1289 | } else { |
| 1290 | 1290 | /** |
@@ -1296,8 +1296,8 @@ discard block |
||
| 1296 | 1296 | // Multi-select dropdowns - key is not preserved |
| 1297 | 1297 | if ( is_array( $field['value'] ) ) { |
| 1298 | 1298 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1299 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1300 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1299 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1300 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1301 | 1301 | } |
| 1302 | 1302 | } elseif ( $temp_val == $field['value'] ) { |
| 1303 | 1303 | // For radio and regular dropdowns |
@@ -1507,7 +1507,7 @@ discard block |
||
| 1507 | 1507 | if ( is_array( $val ) ) { |
| 1508 | 1508 | foreach ( $val as $k => $v ) { |
| 1509 | 1509 | if ( is_string( $v ) ) { |
| 1510 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1510 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1511 | 1511 | unset( $k, $v ); |
| 1512 | 1512 | } |
| 1513 | 1513 | } |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | $countries['class'] = 'frm-countries-opts'; |
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 1863 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 1864 | 1864 | |
| 1865 | 1865 | // State abv. |
| 1866 | 1866 | $states = self::get_us_states(); |
@@ -1870,7 +1870,7 @@ discard block |
||
| 1870 | 1870 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 1871 | 1871 | } |
| 1872 | 1872 | |
| 1873 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 1873 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 1874 | 1874 | |
| 1875 | 1875 | // States. |
| 1876 | 1876 | $states = array_values( $states ); |
@@ -1879,7 +1879,7 @@ discard block |
||
| 1879 | 1879 | $states['class'] = 'frm-states-opts'; |
| 1880 | 1880 | } |
| 1881 | 1881 | |
| 1882 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 1882 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 1883 | 1883 | unset( $state_abv, $states ); |
| 1884 | 1884 | |
| 1885 | 1885 | // Age. |
@@ -1897,7 +1897,7 @@ discard block |
||
| 1897 | 1897 | $ages['class'] = 'frm-age-opts'; |
| 1898 | 1898 | } |
| 1899 | 1899 | |
| 1900 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 1900 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 1901 | 1901 | |
| 1902 | 1902 | // Satisfaction. |
| 1903 | 1903 | $satisfaction = array( |
@@ -1912,7 +1912,7 @@ discard block |
||
| 1912 | 1912 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 1913 | 1913 | } |
| 1914 | 1914 | |
| 1915 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 1915 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 1916 | 1916 | |
| 1917 | 1917 | // Importance. |
| 1918 | 1918 | $importance = array( |
@@ -1927,7 +1927,7 @@ discard block |
||
| 1927 | 1927 | $importance['class'] = 'frm-importance-opts'; |
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 1930 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 1931 | 1931 | |
| 1932 | 1932 | // Agreement. |
| 1933 | 1933 | $agreement = array( |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | $agreement['class'] = 'frm-agreement-opts'; |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 1945 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 1946 | 1946 | |
| 1947 | 1947 | // Likely. |
| 1948 | 1948 | $likely = array( |
@@ -1957,7 +1957,7 @@ discard block |
||
| 1957 | 1957 | $likely['class'] = 'frm-likely-opts'; |
| 1958 | 1958 | } |
| 1959 | 1959 | |
| 1960 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 1960 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 1961 | 1961 | |
| 1962 | 1962 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 1963 | 1963 | } |
@@ -2178,16 +2178,16 @@ discard block |
||
| 2178 | 2178 | */ |
| 2179 | 2179 | private static function fill_image_setting_options( $options, &$args ) { |
| 2180 | 2180 | foreach ( $options as $key => $option ) { |
| 2181 | - $args['options'][ $key ] = $option; |
|
| 2181 | + $args['options'][$key] = $option; |
|
| 2182 | 2182 | |
| 2183 | 2183 | if ( ! empty( $option['addon'] ) ) { |
| 2184 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2184 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2185 | 2185 | } |
| 2186 | 2186 | |
| 2187 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2187 | + unset( $args['options'][$key]['addon'] ); |
|
| 2188 | 2188 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2189 | 2189 | foreach ( $fill as $f ) { |
| 2190 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2190 | + unset( $args['options'][$key][$f], $f ); |
|
| 2191 | 2191 | } |
| 2192 | 2192 | } |
| 2193 | 2193 | } |
@@ -2208,8 +2208,8 @@ discard block |
||
| 2208 | 2208 | |
| 2209 | 2209 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2210 | 2210 | foreach ( $fill as $f ) { |
| 2211 | - if ( isset( $option[ $f ] ) ) { |
|
| 2212 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2211 | + if ( isset( $option[$f] ) ) { |
|
| 2212 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2213 | 2213 | } |
| 2214 | 2214 | } |
| 2215 | 2215 | |
@@ -2274,7 +2274,7 @@ discard block |
||
| 2274 | 2274 | |
| 2275 | 2275 | return array_filter( |
| 2276 | 2276 | $rows, |
| 2277 | - function ( $row ) { |
|
| 2277 | + function( $row ) { |
|
| 2278 | 2278 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2279 | 2279 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2280 | 2280 | } |
@@ -113,8 +113,8 @@ |
||
| 113 | 113 | $label = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term'; |
| 114 | 114 | ?> |
| 115 | 115 | <term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php |
| 116 | - if ( ! empty( $parent_slugs[ $term->parent ] ) ) { |
|
| 117 | - echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>'; |
|
| 116 | + if ( ! empty( $parent_slugs[$term->parent] ) ) { |
|
| 117 | + echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>'; |
|
| 118 | 118 | } |
| 119 | 119 | if ( ! empty( $term->name ) ) { |
| 120 | 120 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |