@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | private function prepare_user_info_attribute( $atts ) { |
| 115 | 115 | if (isset( $atts['show'] )) { |
| 116 | - $user_info = $atts['show'] === 'id' ? 'ID' : $atts['show']; |
|
| 116 | + $user_info = $atts['show'] === 'id' ? 'ID' : $atts['show']; |
|
| 117 | 117 | } else { |
| 118 | 118 | $user_info = apply_filters( 'frm_user_id_display', 'display_name' ); |
| 119 | 119 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | protected function get_field_value( $args ) { |
| 66 | 66 | $user_ID = get_current_user_id(); |
| 67 | 67 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 68 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 68 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 69 | 69 | $action = ( $args['action'] ?? $args['form_action'] ?? '' ); |
| 70 | 70 | $updating = $action === 'update'; |
| 71 | 71 | return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | 114 | private function prepare_user_info_attribute( $atts ) { |
| 115 | - if (isset( $atts['show'] )) { |
|
| 115 | + if ( isset( $atts['show'] ) ) { |
|
| 116 | 116 | $user_info = $atts['show'] === 'id' ? 'ID' : $atts['show']; |
| 117 | 117 | } else { |
| 118 | 118 | $user_info = apply_filters( 'frm_user_id_display', 'display_name' ); |
@@ -376,16 +376,16 @@ |
||
| 376 | 376 | if ( $this->column_name === 'cb' ) { |
| 377 | 377 | $r .= "<th scope='row' class='check-column'>$checkbox</th>"; |
| 378 | 378 | } else { |
| 379 | - $val = in_array( $column_name, $hidden, true ) ? '' : $this->column_value( $item ); |
|
| 380 | - $r .= "<td $attributes>"; |
|
| 381 | - if ( $column_name == $action_col ) { |
|
| 379 | + $val = in_array( $column_name, $hidden, true ) ? '' : $this->column_value( $item ); |
|
| 380 | + $r .= "<td $attributes>"; |
|
| 381 | + if ( $column_name == $action_col ) { |
|
| 382 | 382 | $edit_link = admin_url( 'admin.php?page=formidable-entries&frm_action=edit&id=' . $item->id ); |
| 383 | 383 | $r .= '<a href="' . esc_url( isset( $actions['edit'] ) ? $edit_link : $view_link ) . '" class="row-title" >' . $val . '</a> '; |
| 384 | 384 | $r .= $action_links; |
| 385 | 385 | } else { |
| 386 | 386 | $r .= $val; |
| 387 | 387 | } |
| 388 | - $r .= '</td>'; |
|
| 388 | + $r .= '</td>'; |
|
| 389 | 389 | }//end if |
| 390 | 390 | unset( $val ); |
| 391 | 391 | }//end foreach |
@@ -2657,11 +2657,11 @@ |
||
| 2657 | 2657 | if ( $user_id === 'current' ) { |
| 2658 | 2658 | $user_id = get_current_user_id(); |
| 2659 | 2659 | } else { |
| 2660 | - $user = is_email( $user_id ) ? get_user_by( 'email', $user_id ) : get_user_by( 'login', $user_id ); |
|
| 2661 | - if ( $user ) { |
|
| 2660 | + $user = is_email( $user_id ) ? get_user_by( 'email', $user_id ) : get_user_by( 'login', $user_id ); |
|
| 2661 | + if ( $user ) { |
|
| 2662 | 2662 | $user_id = $user->ID; |
| 2663 | 2663 | } |
| 2664 | - unset( $user ); |
|
| 2664 | + unset( $user ); |
|
| 2665 | 2665 | } |
| 2666 | 2666 | |
| 2667 | 2667 | return $user_id; |
@@ -685,9 +685,9 @@ |
||
| 685 | 685 | $i = count( $matches['browser'] ); |
| 686 | 686 | |
| 687 | 687 | if ($i > 1) { |
| 688 | - // We will have two since we are not using 'other' argument yet |
|
| 689 | - // see if version is before or after the name. |
|
| 690 | - $version = strripos( $u_agent, 'Version' ) < strripos( $u_agent, $ub ) ? $matches['version'][0] : $matches['version'][1]; |
|
| 688 | + // We will have two since we are not using 'other' argument yet |
|
| 689 | + // see if version is before or after the name. |
|
| 690 | + $version = strripos( $u_agent, 'Version' ) < strripos( $u_agent, $ub ) ? $matches['version'][0] : $matches['version'][1]; |
|
| 691 | 691 | } elseif ( $i === 1 ) { |
| 692 | 692 | $version = $matches['version'][0]; |
| 693 | 693 | } else { |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
| 154 | 154 | |
| 155 | 155 | if ( $repeating ) { |
| 156 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 156 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 157 | 157 | $value_is_posted = true; |
| 158 | 158 | } |
| 159 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 159 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 160 | 160 | $value_is_posted = true; |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -200,14 +200,14 @@ discard block |
||
| 200 | 200 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 201 | 201 | |
| 202 | 202 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 203 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 203 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 204 | 204 | |
| 205 | 205 | $this_atts = ! empty( $add_atts ) ? array_merge( $atts, $add_atts ) : $atts; |
| 206 | 206 | |
| 207 | 207 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 208 | 208 | |
| 209 | 209 | // Add the default message. |
| 210 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 210 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return $message; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * @return string |
| 222 | 222 | */ |
| 223 | 223 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 224 | - $field_value = $entry->metas[ $field->id ] ?? false; |
|
| 224 | + $field_value = $entry->metas[$field->id] ?? false; |
|
| 225 | 225 | |
| 226 | 226 | if ( FrmAppHelper::pro_is_installed() ) { |
| 227 | 227 | $empty = empty( $field_value ); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 252 | 252 | } else { |
| 253 | 253 | // Get all values for this field. |
| 254 | - $child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false; |
|
| 254 | + $child_values = $entry->metas[$atts['embedded_field_id']] ?? false; |
|
| 255 | 255 | |
| 256 | 256 | if ( $child_values ) { |
| 257 | 257 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | if ( empty( $args['parent_field_id'] ) ) { |
| 386 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 386 | + $_POST['item_meta'][$field->id] = $value; |
|
| 387 | 387 | } else { |
| 388 | 388 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 389 | 389 | } |
@@ -401,17 +401,17 @@ discard block |
||
| 401 | 401 | * @return void |
| 402 | 402 | */ |
| 403 | 403 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 404 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 405 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 406 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 404 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 405 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 406 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 407 | 407 | } |
| 408 | 408 | } else { |
| 409 | 409 | // All of the section was probably removed. |
| 410 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 411 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 410 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 411 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 414 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | /** |
@@ -458,9 +458,9 @@ discard block |
||
| 458 | 458 | private static function get_posted_meta( $field_id, $args ) { |
| 459 | 459 | if ( empty( $args['parent_field_id'] ) ) { |
| 460 | 460 | // Sanitizing is done next. |
| 461 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 461 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 462 | 462 | } else { |
| 463 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 463 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 464 | 464 | } |
| 465 | 465 | return $value; |
| 466 | 466 | } |
@@ -494,14 +494,14 @@ discard block |
||
| 494 | 494 | self::set_other_repeating_vals( $field, $value, $args ); |
| 495 | 495 | |
| 496 | 496 | // Check if there are any posted "Other" values. |
| 497 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 497 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 498 | 498 | |
| 499 | 499 | // Save original value. |
| 500 | 500 | $args['temp_value'] = $value; |
| 501 | 501 | $args['other'] = true; |
| 502 | 502 | |
| 503 | 503 | // Sanitizing is done next. |
| 504 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 504 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 505 | 505 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 506 | 506 | |
| 507 | 507 | // Set the validation value now |
@@ -526,12 +526,12 @@ discard block |
||
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | // Check if there are any other posted "other" values for this field. |
| 529 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 529 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 530 | 530 | // Save original value |
| 531 | 531 | $args['temp_value'] = $value; |
| 532 | 532 | $args['other'] = true; |
| 533 | 533 | |
| 534 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 534 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 535 | 535 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 536 | 536 | |
| 537 | 537 | // Set the validation value now. |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 561 | 561 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 562 | 562 | foreach ( $other_vals as $k => $v ) { |
| 563 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 563 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 564 | 564 | // If the other box is checked, but doesn't have a value. |
| 565 | 565 | $value = ''; |
| 566 | 566 | break; |
@@ -577,26 +577,26 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | // Multi-select dropdown. |
| 579 | 579 | if ( is_array( $value ) ) { |
| 580 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 580 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 581 | 581 | |
| 582 | 582 | if ( $o_key !== false ) { |
| 583 | 583 | // Modify the original value so other key will be preserved. |
| 584 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 584 | + $value[$other_key] = $value[$o_key]; |
|
| 585 | 585 | |
| 586 | 586 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 587 | 587 | // If going backwards and forwards between pages, the array key will match the other key. |
| 588 | 588 | if ( $o_key !== $other_key ) { |
| 589 | - unset( $value[ $o_key ] ); |
|
| 589 | + unset( $value[$o_key] ); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | $args['temp_value'] = $value; |
| 593 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 593 | + $value[$other_key] = reset( $other_vals ); |
|
| 594 | 594 | |
| 595 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 596 | - unset( $value[ $other_key ] ); |
|
| 595 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 596 | + unset( $value[$other_key] ); |
|
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 599 | + } elseif ( $field->options[$other_key] == $value ) { |
|
| 600 | 600 | $value = $other_vals; |
| 601 | 601 | }//end if |
| 602 | 602 | }//end if |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | // see how many we have |
| 685 | 685 | $i = count( $matches['browser'] ); |
| 686 | 686 | |
| 687 | - if ($i > 1) { |
|
| 687 | + if ( $i > 1 ) { |
|
| 688 | 688 | // We will have two since we are not using 'other' argument yet |
| 689 | 689 | // see if version is before or after the name. |
| 690 | 690 | $version = strripos( $u_agent, 'Version' ) < strripos( $u_agent, $ub ) ? $matches['version'][0] : $matches['version'][1]; |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | * @return void |
| 856 | 856 | */ |
| 857 | 857 | public static function maybe_render_captcha_score( $entry_id ) { |
| 858 | - $query = array( |
|
| 858 | + $query = array( |
|
| 859 | 859 | 'item_id' => (int) $entry_id, |
| 860 | 860 | 'field_id' => 0, |
| 861 | 861 | ); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | public static function get_entry_status_label( $status ) { |
| 911 | 911 | $statuses = self::get_entry_statuses(); |
| 912 | 912 | |
| 913 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 913 | + return $statuses[self::get_entry_status( $status )]; |
|
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | /** |
@@ -499,7 +499,7 @@ |
||
| 499 | 499 | |
| 500 | 500 | // Use the "This value"/"This field" placeholder strings if field name is empty. |
| 501 | 501 | if (! $field_name) { |
| 502 | - $field_name = 'unique_msg' === $error ? __( 'This value', 'formidable' ) : __( 'This field', 'formidable' ); |
|
| 502 | + $field_name = 'unique_msg' === $error ? __( 'This value', 'formidable' ) : __( 'This field', 'formidable' ); |
|
| 503 | 503 | } |
| 504 | 504 | return str_replace( $substrings, $field_name, $msg ); |
| 505 | 505 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if ( in_array( $type, array( 'data', 'lookup' ), true ) ) { |
| 45 | 45 | $values['field_options']['data_type'] = $setting; |
| 46 | 46 | } else { |
| 47 | - $values['field_options'][ $setting ] = 1; |
|
| 47 | + $values['field_options'][$setting] = 1; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | foreach ( $defaults as $opt => $default ) { |
| 212 | - $values[ $opt ] = $field->field_options[ $opt ] ?? $default; |
|
| 212 | + $values[$opt] = $field->field_options[$opt] ?? $default; |
|
| 213 | 213 | |
| 214 | 214 | if ( $check_post ) { |
| 215 | - self::get_posted_field_setting( $opt . '_' . $field->id, $values[ $opt ] ); |
|
| 215 | + self::get_posted_field_setting( $opt . '_' . $field->id, $values[$opt] ); |
|
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | return self::$context_is_safe_to_load_field_options_from_request_data; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - $function = function () { |
|
| 232 | + $function = function() { |
|
| 233 | 233 | if ( ! FrmAppHelper::is_admin_page() ) { |
| 234 | 234 | return false; |
| 235 | 235 | } |
@@ -341,12 +341,12 @@ discard block |
||
| 341 | 341 | * @return void |
| 342 | 342 | */ |
| 343 | 343 | private static function get_posted_field_setting( $setting, &$value ) { |
| 344 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 344 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 345 | 345 | return; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | if ( strpos( $setting, 'html' ) !== false ) { |
| 349 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 349 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 350 | 350 | |
| 351 | 351 | // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. |
| 352 | 352 | if ( ! FrmAppHelper::allow_unfiltered_html() ) { |
@@ -354,9 +354,9 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 356 | 356 | // TODO: Remove stripslashes on output, and use on input only. |
| 357 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 357 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 358 | 358 | } else { |
| 359 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 359 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 360 | 360 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 440 | 440 | |
| 441 | 441 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 442 | - $values[ $col ] = $field->{$col}; |
|
| 442 | + $values[$col] = $field->{$col}; |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | ); |
| 478 | 478 | |
| 479 | 479 | $msg = FrmField::get_option( $field, $error ); |
| 480 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 480 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 481 | 481 | $msg = do_shortcode( $msg ); |
| 482 | 482 | |
| 483 | 483 | return self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | $substrings = self::get_substrings_to_replace_with_field_name( $field_name, compact( 'msg', 'error', 'field' ) ); |
| 499 | 499 | |
| 500 | 500 | // Use the "This value"/"This field" placeholder strings if field name is empty. |
| 501 | - if (! $field_name) { |
|
| 501 | + if ( ! $field_name ) { |
|
| 502 | 502 | $field_name = 'unique_msg' === $error ? __( 'This value', 'formidable' ) : __( 'This field', 'formidable' ); |
| 503 | 503 | } |
| 504 | 504 | return str_replace( $substrings, $field_name, $msg ); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | 'inside_class' => 'inside', |
| 807 | 807 | 'dismiss-icon' => true, |
| 808 | 808 | ); |
| 809 | - $args = array_merge( $defaults, $args ); |
|
| 809 | + $args = array_merge( $defaults, $args ); |
|
| 810 | 810 | |
| 811 | 811 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 812 | 812 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | continue; |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 1093 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 1094 | 1094 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 1095 | 1095 | |
| 1096 | 1096 | $atts['entry'] = $entry; |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | if ( $replace_with !== null ) { |
| 1101 | 1101 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 1102 | 1102 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 1103 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 1103 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | unset( $atts, $replace_with ); |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 1121 | 1121 | |
| 1122 | 1122 | foreach ( $included_atts as $included_att ) { |
| 1123 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 1123 | + if ( '0' === $atts[$included_att] ) { |
|
| 1124 | 1124 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 1125 | 1125 | continue; |
| 1126 | 1126 | } |
@@ -1203,8 +1203,8 @@ discard block |
||
| 1203 | 1203 | |
| 1204 | 1204 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
| 1205 | 1205 | |
| 1206 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 1207 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 1206 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 1207 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 1208 | 1208 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
| 1209 | 1209 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 1210 | 1210 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1453,8 +1453,8 @@ discard block |
||
| 1453 | 1453 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1454 | 1454 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1455 | 1455 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1456 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1457 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1456 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1457 | + $field_types[$type] = $field_selection[$type]; |
|
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | 1460 | return apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | foreach ( $inputs as $input ) { |
| 1498 | 1498 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
| 1499 | 1499 | if ( array_key_exists( $input, $fields ) ) { |
| 1500 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1500 | + $field_types[$input] = $fields[$input]; |
|
| 1501 | 1501 | } |
| 1502 | 1502 | unset( $input ); |
| 1503 | 1503 | } |
@@ -1532,7 +1532,7 @@ discard block |
||
| 1532 | 1532 | 'parent' => false, |
| 1533 | 1533 | 'pointer' => false, |
| 1534 | 1534 | ); |
| 1535 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1535 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1536 | 1536 | |
| 1537 | 1537 | $opt_key = $args['opt_key']; |
| 1538 | 1538 | $field = $args['field']; |
@@ -1548,25 +1548,25 @@ discard block |
||
| 1548 | 1548 | |
| 1549 | 1549 | // Check posted vals before checking saved values |
| 1550 | 1550 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1551 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1551 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1552 | 1552 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1553 | 1553 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1554 | - $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 ] ) ) : ''; |
|
| 1554 | + $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] ) ) : ''; |
|
| 1555 | 1555 | } else { |
| 1556 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1556 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | 1559 | return $other_val; |
| 1560 | 1560 | } |
| 1561 | 1561 | |
| 1562 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1562 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1563 | 1563 | // For normal fields |
| 1564 | 1564 | |
| 1565 | 1565 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1566 | 1566 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1567 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1567 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1568 | 1568 | } else { |
| 1569 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1569 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | return $other_val; |
@@ -1576,8 +1576,8 @@ discard block |
||
| 1576 | 1576 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1577 | 1577 | // Check if there is an "other" val in saved value and make sure the |
| 1578 | 1578 | // "other" val is not equal to the Other checkbox option |
| 1579 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1580 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1579 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1580 | + $other_val = $field['value'][$opt_key]; |
|
| 1581 | 1581 | } |
| 1582 | 1582 | } else { |
| 1583 | 1583 | /** |
@@ -1591,8 +1591,8 @@ discard block |
||
| 1591 | 1591 | if ( is_array( $field['value'] ) ) { |
| 1592 | 1592 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1593 | 1593 | |
| 1594 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1595 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1594 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1595 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1596 | 1596 | } |
| 1597 | 1597 | } elseif ( $temp_val == $field['value'] ) { |
| 1598 | 1598 | // For radio and regular dropdowns |
@@ -1820,11 +1820,11 @@ discard block |
||
| 1820 | 1820 | foreach ( $val as $k => $v ) { |
| 1821 | 1821 | if ( is_string( $v ) ) { |
| 1822 | 1822 | if ( 'custom_html' === $k ) { |
| 1823 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1823 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1824 | 1824 | unset( $k, $v ); |
| 1825 | 1825 | continue; |
| 1826 | 1826 | } |
| 1827 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1827 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1828 | 1828 | unset( $k, $v ); |
| 1829 | 1829 | } |
| 1830 | 1830 | } |
@@ -1854,8 +1854,8 @@ discard block |
||
| 1854 | 1854 | if ( false === $index ) { |
| 1855 | 1855 | continue; |
| 1856 | 1856 | } |
| 1857 | - unset( $replace[ $index ] ); |
|
| 1858 | - unset( $replace_with[ $index ] ); |
|
| 1857 | + unset( $replace[$index] ); |
|
| 1858 | + unset( $replace_with[$index] ); |
|
| 1859 | 1859 | } |
| 1860 | 1860 | return str_replace( $replace, $replace_with, $value ); |
| 1861 | 1861 | } |
@@ -2213,7 +2213,7 @@ discard block |
||
| 2213 | 2213 | $countries['class'] = 'frm-countries-opts'; |
| 2214 | 2214 | } |
| 2215 | 2215 | |
| 2216 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 2216 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 2217 | 2217 | |
| 2218 | 2218 | // State abv. |
| 2219 | 2219 | $states = self::get_us_states(); |
@@ -2224,7 +2224,7 @@ discard block |
||
| 2224 | 2224 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 2227 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 2228 | 2228 | |
| 2229 | 2229 | // States. |
| 2230 | 2230 | $states = array_values( $states ); |
@@ -2234,7 +2234,7 @@ discard block |
||
| 2234 | 2234 | $states['class'] = 'frm-states-opts'; |
| 2235 | 2235 | } |
| 2236 | 2236 | |
| 2237 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 2237 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 2238 | 2238 | unset( $state_abv, $states ); |
| 2239 | 2239 | |
| 2240 | 2240 | // Age. |
@@ -2253,7 +2253,7 @@ discard block |
||
| 2253 | 2253 | $ages['class'] = 'frm-age-opts'; |
| 2254 | 2254 | } |
| 2255 | 2255 | |
| 2256 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 2256 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 2257 | 2257 | |
| 2258 | 2258 | // Satisfaction. |
| 2259 | 2259 | $satisfaction = array( |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 2270 | 2270 | } |
| 2271 | 2271 | |
| 2272 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 2272 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 2273 | 2273 | |
| 2274 | 2274 | // Importance. |
| 2275 | 2275 | $importance = array( |
@@ -2285,7 +2285,7 @@ discard block |
||
| 2285 | 2285 | $importance['class'] = 'frm-importance-opts'; |
| 2286 | 2286 | } |
| 2287 | 2287 | |
| 2288 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 2288 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 2289 | 2289 | |
| 2290 | 2290 | // Agreement. |
| 2291 | 2291 | $agreement = array( |
@@ -2301,7 +2301,7 @@ discard block |
||
| 2301 | 2301 | $agreement['class'] = 'frm-agreement-opts'; |
| 2302 | 2302 | } |
| 2303 | 2303 | |
| 2304 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 2304 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 2305 | 2305 | |
| 2306 | 2306 | // Likely. |
| 2307 | 2307 | $likely = array( |
@@ -2317,7 +2317,7 @@ discard block |
||
| 2317 | 2317 | $likely['class'] = 'frm-likely-opts'; |
| 2318 | 2318 | } |
| 2319 | 2319 | |
| 2320 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 2320 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 2321 | 2321 | |
| 2322 | 2322 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 2323 | 2323 | } |
@@ -2567,17 +2567,17 @@ discard block |
||
| 2567 | 2567 | */ |
| 2568 | 2568 | private static function fill_image_setting_options( $options, &$args ) { |
| 2569 | 2569 | foreach ( $options as $key => $option ) { |
| 2570 | - $args['options'][ $key ] = $option; |
|
| 2570 | + $args['options'][$key] = $option; |
|
| 2571 | 2571 | |
| 2572 | 2572 | if ( ! empty( $option['addon'] ) ) { |
| 2573 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2573 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2574 | 2574 | } |
| 2575 | 2575 | |
| 2576 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2576 | + unset( $args['options'][$key]['addon'] ); |
|
| 2577 | 2577 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2578 | 2578 | |
| 2579 | 2579 | foreach ( $fill as $f ) { |
| 2580 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2580 | + unset( $args['options'][$key][$f], $f ); |
|
| 2581 | 2581 | } |
| 2582 | 2582 | } |
| 2583 | 2583 | } |
@@ -2601,8 +2601,8 @@ discard block |
||
| 2601 | 2601 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2602 | 2602 | |
| 2603 | 2603 | foreach ( $fill as $f ) { |
| 2604 | - if ( isset( $option[ $f ] ) ) { |
|
| 2605 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2604 | + if ( isset( $option[$f] ) ) { |
|
| 2605 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2606 | 2606 | } |
| 2607 | 2607 | } |
| 2608 | 2608 | |
@@ -2667,7 +2667,7 @@ discard block |
||
| 2667 | 2667 | |
| 2668 | 2668 | return array_filter( |
| 2669 | 2669 | $rows, |
| 2670 | - function ( $row ) { |
|
| 2670 | + function( $row ) { |
|
| 2671 | 2671 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2672 | 2672 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2673 | 2673 | } |
@@ -2737,7 +2737,7 @@ discard block |
||
| 2737 | 2737 | unset( $data['plugin-status'] ); |
| 2738 | 2738 | |
| 2739 | 2739 | foreach ( $data as $key => $value ) { |
| 2740 | - $attributes[ 'data-' . $key ] = $value; |
|
| 2740 | + $attributes['data-' . $key] = $value; |
|
| 2741 | 2741 | } |
| 2742 | 2742 | } |
| 2743 | 2743 | |
@@ -1392,7 +1392,7 @@ |
||
| 1392 | 1392 | if ( 'trash' === $status ) { |
| 1393 | 1393 | $info = $labels['restore']; |
| 1394 | 1394 | } elseif (current_user_can( 'frm_delete_forms' )) { |
| 1395 | - $info = EMPTY_TRASH_DAYS ? $labels['trash'] : $labels['delete']; |
|
| 1395 | + $info = EMPTY_TRASH_DAYS ? $labels['trash'] : $labels['delete']; |
|
| 1396 | 1396 | } else { |
| 1397 | 1397 | $info = array(); |
| 1398 | 1398 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'class' => '', |
| 52 | 52 | 'inc_children' => 'exclude', |
| 53 | 53 | ); |
| 54 | - $args = wp_parse_args( $args, $defaults ); |
|
| 54 | + $args = wp_parse_args( $args, $defaults ); |
|
| 55 | 55 | |
| 56 | 56 | if ( ! $args['field_id'] ) { |
| 57 | 57 | $args['field_id'] = $field_name; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 98 | 98 | if ( ! empty( $class ) ) { |
| 99 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 99 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -351,8 +351,8 @@ discard block |
||
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | foreach ( $defaults as $var => $default ) { |
| 354 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 355 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 354 | + if ( ! isset( $values[$var] ) ) { |
|
| 355 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | ); |
| 369 | 369 | |
| 370 | 370 | foreach ( $defaults as $var => $default ) { |
| 371 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 372 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 371 | + if ( ! isset( $values[$var] ) ) { |
|
| 372 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | unset( $defaults ); |
@@ -420,16 +420,16 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | foreach ( $defaults as $var => $default ) { |
| 422 | 422 | if ( is_array( $default ) ) { |
| 423 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 424 | - $values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array(); |
|
| 423 | + if ( ! isset( $values[$var] ) ) { |
|
| 424 | + $values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array(); |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | foreach ( $default as $k => $v ) { |
| 428 | - $values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v ); |
|
| 428 | + $values[$var][$k] = $post_values && isset( $post_values[$var][$k] ) ? $post_values[$var][$k] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ? $record->options[$var][$k] : $v ); |
|
| 429 | 429 | |
| 430 | 430 | if ( is_array( $v ) ) { |
| 431 | 431 | foreach ( $v as $k1 => $v1 ) { |
| 432 | - $values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); |
|
| 432 | + $values[$var][$k][$k1] = $post_values && isset( $post_values[$var][$k][$k1] ) ? $post_values[$var][$k][$k1] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ? $record->options[$var][$k][$k1] : $v1 ); |
|
| 433 | 433 | unset( $k1, $v1 ); |
| 434 | 434 | } |
| 435 | 435 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | unset( $k, $v ); |
| 438 | 438 | } |
| 439 | 439 | } else { |
| 440 | - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); |
|
| 440 | + $values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default ); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | unset( $var, $default ); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $defaults = self::get_default_opts(); |
| 487 | 487 | |
| 488 | 488 | foreach ( $defaults as $var => $default ) { |
| 489 | - $options[ $var ] = $values['options'][ $var ] ?? $default; |
|
| 489 | + $options[$var] = $values['options'][$var] ?? $default; |
|
| 490 | 490 | unset( $var, $default ); |
| 491 | 491 | } |
| 492 | 492 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | public static function insert_opt_html( $args ) { |
| 684 | 684 | $class = $args['class'] ?? ''; |
| 685 | 685 | $fields = self::get_field_type_data_for_insert_opt_html(); |
| 686 | - $field = $fields[ $args['type'] ] ?? array(); |
|
| 686 | + $field = $fields[$args['type']] ?? array(); |
|
| 687 | 687 | |
| 688 | 688 | self::prepare_field_type( $field ); |
| 689 | 689 | |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | foreach ( $fields as $field ) { |
| 826 | 826 | if ( $prev_order === $field->field_order ) { |
| 827 | - ++$add_order; |
|
| 827 | + ++ $add_order; |
|
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | if ( $add_order ) { |
@@ -1365,9 +1365,9 @@ discard block |
||
| 1365 | 1365 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1366 | 1366 | } |
| 1367 | 1367 | |
| 1368 | - $label = ( $link_details[ $length ] ?? $link_details['label'] ); |
|
| 1368 | + $label = ( $link_details[$length] ?? $link_details['label'] ); |
|
| 1369 | 1369 | |
| 1370 | - if ( $length === 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1370 | + if ( $length === 'icon' && isset( $link_details[$length] ) ) { |
|
| 1371 | 1371 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1372 | 1372 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1373 | 1373 | } |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | |
| 1392 | 1392 | if ( 'trash' === $status ) { |
| 1393 | 1393 | $info = $labels['restore']; |
| 1394 | - } elseif (current_user_can( 'frm_delete_forms' )) { |
|
| 1394 | + } elseif ( current_user_can( 'frm_delete_forms' ) ) { |
|
| 1395 | 1395 | $info = EMPTY_TRASH_DAYS ? $labels['trash'] : $labels['delete']; |
| 1396 | 1396 | } else { |
| 1397 | 1397 | $info = array(); |
@@ -1535,7 +1535,7 @@ discard block |
||
| 1535 | 1535 | $status = 'publish'; |
| 1536 | 1536 | } |
| 1537 | 1537 | |
| 1538 | - return $nice_names[ $status ]; |
|
| 1538 | + return $nice_names[$status]; |
|
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | /** |
@@ -1599,7 +1599,7 @@ discard block |
||
| 1599 | 1599 | |
| 1600 | 1600 | if ( count( $categories ) === 1 ) { |
| 1601 | 1601 | $category = reset( $categories ); |
| 1602 | - $icon = $icons[ $category ] ?? $icon; |
|
| 1602 | + $icon = $icons[$category] ?? $icon; |
|
| 1603 | 1603 | } elseif ( ! empty( $categories ) ) { |
| 1604 | 1604 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1605 | 1605 | $icon = reset( $icons ); |
@@ -1731,7 +1731,7 @@ discard block |
||
| 1731 | 1731 | |
| 1732 | 1732 | foreach ( $item['categories'] as $k => $category ) { |
| 1733 | 1733 | if ( in_array( $category, $plans, true ) ) { |
| 1734 | - unset( $item['categories'][ $k ] ); |
|
| 1734 | + unset( $item['categories'][$k] ); |
|
| 1735 | 1735 | |
| 1736 | 1736 | return self::convert_legacy_package_names( $category ); |
| 1737 | 1737 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
| 1771 | 1771 | 'include_all' => true, |
| 1772 | 1772 | 'case_lower' => false, |
| 1773 | 1773 | ); |
| 1774 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1774 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1775 | 1775 | |
| 1776 | 1776 | $license_types = array( 'Basic', 'Plus', 'Business', 'Elite' ); |
| 1777 | 1777 | |
@@ -1978,9 +1978,9 @@ discard block |
||
| 1978 | 1978 | } |
| 1979 | 1979 | |
| 1980 | 1980 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1981 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1981 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1982 | 1982 | |
| 1983 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1983 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1984 | 1984 | // Skip if shortcodes. |
| 1985 | 1985 | continue; |
| 1986 | 1986 | } |
@@ -1990,7 +1990,7 @@ discard block |
||
| 1990 | 1990 | continue; |
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1993 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1994 | 1994 | |
| 1995 | 1995 | if ( $options ) { |
| 1996 | 1996 | $new_shortcode .= ' ' . $options; |
@@ -109,8 +109,8 @@ |
||
| 109 | 109 | $response['redirect'] = get_permalink( $post_id ); |
| 110 | 110 | } |
| 111 | 111 | } else { |
| 112 | - $message = $imported['error'] ?? __( 'There was an error importing form', 'formidable' ); |
|
| 113 | - $response = array( |
|
| 112 | + $message = $imported['error'] ?? __( 'There was an error importing form', 'formidable' ); |
|
| 113 | + $response = array( |
|
| 114 | 114 | 'message' => $message, |
| 115 | 115 | ); |
| 116 | 116 | }//end if |