@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
| 42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
| 43 | 43 | |
| 44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
| 44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
| 45 | 45 | $sub_field_class .= ' frm_blank_field'; |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Don't show individual field errors when there is a combo field error. |
| 73 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 73 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
| 74 | 74 | ?> |
| 75 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
| 75 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | </div> |
| 78 | 78 | <?php |
@@ -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 | ); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $values_indexed_by_field_id[ $field_id ] = $meta_value; |
|
| 141 | + $values_indexed_by_field_id[$field_id] = $meta_value; |
|
| 142 | 142 | |
| 143 | 143 | self::get_value_to_save( compact( 'field', 'field_id', 'entry_id' ), $meta_value ); |
| 144 | 144 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) === '' ) ) { |
| 148 | 148 | // Remove blank fields. |
| 149 | - unset( $values_indexed_by_field_id[ $field_id ] ); |
|
| 149 | + unset( $values_indexed_by_field_id[$field_id] ); |
|
| 150 | 150 | } else { |
| 151 | 151 | // if value exists, then update it |
| 152 | 152 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public static function get_meta_value( $entry, $field_id ) { |
| 226 | 226 | if ( isset( $entry->metas ) ) { |
| 227 | - return $entry->metas[ $field_id ] ?? false; |
|
| 227 | + return $entry->metas[$field_id] ?? false; |
|
| 228 | 228 | } |
| 229 | 229 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
| 230 | 230 | } |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
| 250 | - $result = $cached->metas[ $field_id ]; |
|
| 249 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
| 250 | + $result = $cached->metas[$field_id]; |
|
| 251 | 251 | |
| 252 | 252 | return wp_unslash( $result ); |
| 253 | 253 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | 'stripslashes' => true, |
| 281 | 281 | 'is_draft' => false, |
| 282 | 282 | ); |
| 283 | - $args = wp_parse_args( $args, $defaults ); |
|
| 283 | + $args = wp_parse_args( $args, $defaults ); |
|
| 284 | 284 | |
| 285 | 285 | $query = array(); |
| 286 | 286 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | foreach ( $values as $k => $v ) { |
| 297 | 297 | FrmAppHelper::unserialize_or_decode( $v ); |
| 298 | - $values[ $k ] = $v; |
|
| 298 | + $values[$k] = $v; |
|
| 299 | 299 | unset( $k, $v ); |
| 300 | 300 | } |
| 301 | 301 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | foreach ( $results as $k => $result ) { |
| 364 | 364 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
| 365 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
| 365 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
| 366 | 366 | unset( $k, $result ); |
| 367 | 367 | } |
| 368 | 368 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | 'user_id' => '', |
| 376 | 376 | 'group_by' => '', |
| 377 | 377 | ); |
| 378 | - $args = wp_parse_args( $args, $defaults ); |
|
| 378 | + $args = wp_parse_args( $args, $defaults ); |
|
| 379 | 379 | |
| 380 | 380 | $query = array(); |
| 381 | 381 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | } elseif ( false !== strpos( $args['is_draft'], ',' ) ) { |
| 479 | 479 | $is_draft = array_reduce( |
| 480 | 480 | explode( ',', $args['is_draft'] ), |
| 481 | - function ( $total, $current ) { |
|
| 481 | + function( $total, $current ) { |
|
| 482 | 482 | if ( is_numeric( $current ) ) { |
| 483 | 483 | $total[] = absint( $current ); |
| 484 | 484 | } |
@@ -133,19 +133,19 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | foreach ( $action_controls as $action ) { |
| 136 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 136 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 137 | 137 | continue; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $this_group = $action->action_options['group']; |
| 141 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 141 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 142 | 142 | $this_group = 'misc'; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 146 | - $groups[ $this_group ]['actions'] = array(); |
|
| 145 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 146 | + $groups[$this_group]['actions'] = array(); |
|
| 147 | 147 | } |
| 148 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 148 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 149 | 149 | |
| 150 | 150 | unset( $action ); |
| 151 | 151 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return $a; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $actions[ $a->id_base ] = $a; |
|
| 322 | + $actions[$a->id_base] = $a; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | return $actions; |
@@ -358,18 +358,18 @@ discard block |
||
| 358 | 358 | $action_map = array(); |
| 359 | 359 | |
| 360 | 360 | foreach ( $action_controls as $key => $control ) { |
| 361 | - $action_map[ $control->id_base ] = $key; |
|
| 361 | + $action_map[$control->id_base] = $key; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | self::maybe_show_limit_warning( $form->id, $form_actions ); |
| 365 | 365 | |
| 366 | 366 | foreach ( $form_actions as $action ) { |
| 367 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 367 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 368 | 368 | // don't try and show settings if action no longer exists |
| 369 | 369 | continue; |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 372 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | |
@@ -681,8 +681,8 @@ discard block |
||
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | // Store actions so they can be triggered with the correct priority. |
| 684 | - $stored_actions[ $action->ID ] = $action; |
|
| 685 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 684 | + $stored_actions[$action->ID] = $action; |
|
| 685 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 686 | 686 | |
| 687 | 687 | unset( $action ); |
| 688 | 688 | }//end foreach |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | new FrmNotification(); |
| 695 | 695 | |
| 696 | 696 | foreach ( $action_priority as $action_id => $priority ) { |
| 697 | - $action = $stored_actions[ $action_id ]; |
|
| 697 | + $action = $stored_actions[$action_id]; |
|
| 698 | 698 | |
| 699 | 699 | /** |
| 700 | 700 | * Allows custom form action trigger. |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | * @return void |
| 792 | 792 | */ |
| 793 | 793 | public function register( $action_class ) { |
| 794 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 794 | + $this->actions[$action_class] = new $action_class(); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -800,8 +800,8 @@ discard block |
||
| 800 | 800 | * @return void |
| 801 | 801 | */ |
| 802 | 802 | public function unregister( $action_class ) { |
| 803 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 804 | - unset( $this->actions[ $action_class ] ); |
|
| 803 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 804 | + unset( $this->actions[$action_class] ); |
|
| 805 | 805 | } |
| 806 | 806 | } |
| 807 | 807 | |
@@ -810,8 +810,8 @@ discard block |
||
| 810 | 810 | |
| 811 | 811 | foreach ( $keys as $key ) { |
| 812 | 812 | // don't register new action if old action with the same id is already registered |
| 813 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 814 | - $this->actions[ $key ]->_register(); |
|
| 813 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 814 | + $this->actions[$key]->_register(); |
|
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | } |
@@ -593,7 +593,8 @@ |
||
| 593 | 593 | * @return void |
| 594 | 594 | */ |
| 595 | 595 | private function is_license_revoked() { |
| 596 | - if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 596 | + if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { |
|
| 597 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 597 | 598 | return; |
| 598 | 599 | } |
| 599 | 600 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @return array |
| 140 | 140 | */ |
| 141 | 141 | public function insert_installed_addon( $plugins ) { |
| 142 | - $plugins[ $this->plugin_slug ] = $this; |
|
| 142 | + $plugins[$this->plugin_slug] = $this; |
|
| 143 | 143 | |
| 144 | 144 | return $plugins; |
| 145 | 145 | } |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
| 154 | 154 | $plugin = false; |
| 155 | 155 | |
| 156 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
| 157 | - $plugin = $plugins[ $plugin_slug ]; |
|
| 156 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
| 157 | + $plugin = $plugins[$plugin_slug]; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return $plugin; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } else { |
| 220 | 220 | $api = new FrmFormApi( $this->license ); |
| 221 | 221 | $plugins = $api->get_api_info(); |
| 222 | - $_data = $plugins[ $item_id ]; |
|
| 222 | + $_data = $plugins[$item_id]; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $_data['sections'] = array( |
@@ -520,19 +520,19 @@ discard block |
||
| 520 | 520 | |
| 521 | 521 | if ( $this->is_current_version( $transient ) ) { |
| 522 | 522 | // Make sure it doesn't show there is an update if plugin is up-to-date. |
| 523 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 524 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 523 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 524 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 525 | 525 | } |
| 526 | - } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 527 | - $this->prepare_update_details( $transient->response[ $this->plugin_folder ] ); |
|
| 526 | + } elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 527 | + $this->prepare_update_details( $transient->response[$this->plugin_folder] ); |
|
| 528 | 528 | |
| 529 | 529 | // if the transient has expired, clear the update and trigger it again |
| 530 | - if ( $transient->response[ $this->plugin_folder ] === false ) { |
|
| 530 | + if ( $transient->response[$this->plugin_folder] === false ) { |
|
| 531 | 531 | if ( ! $this->has_been_cleared() ) { |
| 532 | 532 | $this->cleared_plugins(); |
| 533 | 533 | $this->manually_queue_update(); |
| 534 | 534 | } |
| 535 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 535 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 536 | 536 | } |
| 537 | 537 | } |
| 538 | 538 | |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | * @return bool |
| 646 | 646 | */ |
| 647 | 647 | private function is_current_version( $transient ) { |
| 648 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
| 648 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
| 649 | 649 | return false; |
| 650 | 650 | } |
| 651 | 651 | |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | return true; |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; |
|
| 658 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version; |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | /** |
@@ -826,8 +826,8 @@ discard block |
||
| 826 | 826 | } else { |
| 827 | 827 | $messages = $this->get_messages(); |
| 828 | 828 | |
| 829 | - if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) { |
|
| 830 | - $response['message'] = $messages[ $response['status'] ]; |
|
| 829 | + if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) { |
|
| 830 | + $response['message'] = $messages[$response['status']]; |
|
| 831 | 831 | } else { |
| 832 | 832 | $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) ); |
| 833 | 833 | } |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | 'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ), |
| 1011 | 1011 | ); |
| 1012 | 1012 | |
| 1013 | - $resp = wp_remote_post( |
|
| 1013 | + $resp = wp_remote_post( |
|
| 1014 | 1014 | $this->store_url . '?l=' . urlencode( base64_encode( $this->license ) ), |
| 1015 | 1015 | $arg_array |
| 1016 | 1016 | ); |
@@ -231,7 +231,8 @@ discard block |
||
| 231 | 231 | return false; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 234 | + if ( ! $_POST || ! isset( $_POST['field_options'] ) ) { |
|
| 235 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 235 | 236 | return false; |
| 236 | 237 | } |
| 237 | 238 | |
@@ -338,7 +339,8 @@ discard block |
||
| 338 | 339 | * @return void |
| 339 | 340 | */ |
| 340 | 341 | private static function get_posted_field_setting( $setting, &$value ) { |
| 341 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 342 | + if ( ! isset( $_POST['field_options'][ $setting ] ) ) { |
|
| 343 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 342 | 344 | return; |
| 343 | 345 | } |
| 344 | 346 | |
@@ -1531,7 +1533,8 @@ discard block |
||
| 1531 | 1533 | |
| 1532 | 1534 | // Check posted vals before checking saved values |
| 1533 | 1535 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1534 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1536 | + if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { |
|
| 1537 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1535 | 1538 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1536 | 1539 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1537 | 1540 | $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 ] ) ) : ''; |
@@ -1542,7 +1545,8 @@ discard block |
||
| 1542 | 1545 | return $other_val; |
| 1543 | 1546 | } |
| 1544 | 1547 | |
| 1545 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1548 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { |
|
| 1549 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1546 | 1550 | // For normal fields |
| 1547 | 1551 | |
| 1548 | 1552 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
@@ -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 | } |
@@ -343,12 +343,12 @@ discard block |
||
| 343 | 343 | * @return void |
| 344 | 344 | */ |
| 345 | 345 | private static function get_posted_field_setting( $setting, &$value ) { |
| 346 | - if ( ! isset( $_POST['field_options'][ $setting ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 346 | + if ( ! isset( $_POST['field_options'][$setting] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 347 | 347 | return; |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | if ( strpos( $setting, 'html' ) !== false ) { |
| 351 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 351 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 352 | 352 | |
| 353 | 353 | // Conditionally strip script tags if the user sending $_POST data is not allowed to use unfiltered HTML. |
| 354 | 354 | if ( ! FrmAppHelper::allow_unfiltered_html() ) { |
@@ -356,9 +356,9 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | } elseif ( strpos( $setting, 'format_' ) === 0 ) { |
| 358 | 358 | // TODO: Remove stripslashes on output, and use on input only. |
| 359 | - $value = sanitize_text_field( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 359 | + $value = sanitize_text_field( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
|
| 360 | 360 | } else { |
| 361 | - $value = wp_unslash( $_POST['field_options'][ $setting ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 361 | + $value = wp_unslash( $_POST['field_options'][$setting] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 362 | 362 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 363 | 363 | } |
| 364 | 364 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $values['default_value'] = FrmAppHelper::maybe_json_encode( $field->default_value ); |
| 443 | 443 | |
| 444 | 444 | foreach ( array( 'name', 'description', 'type', 'field_order', 'field_options', 'required' ) as $col ) { |
| 445 | - $values[ $col ] = $field->{$col}; |
|
| 445 | + $values[$col] = $field->{$col}; |
|
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | ); |
| 481 | 481 | |
| 482 | 482 | $msg = FrmField::get_option( $field, $error ); |
| 483 | - $msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg; |
|
| 483 | + $msg = empty( $msg ) ? $defaults[$error]['part'] : $msg; |
|
| 484 | 484 | $msg = do_shortcode( $msg ); |
| 485 | 485 | |
| 486 | 486 | $msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field ); |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | 'inside_class' => 'inside', |
| 818 | 818 | 'dismiss-icon' => true, |
| 819 | 819 | ); |
| 820 | - $args = array_merge( $defaults, $args ); |
|
| 820 | + $args = array_merge( $defaults, $args ); |
|
| 821 | 821 | |
| 822 | 822 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 823 | 823 | } |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | continue; |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 1111 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 1112 | 1112 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 1113 | 1113 | |
| 1114 | 1114 | $atts['entry'] = $entry; |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | if ( $replace_with !== null ) { |
| 1119 | 1119 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 1120 | 1120 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 1121 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 1121 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | 1124 | unset( $atts, $replace_with ); |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 1139 | 1139 | |
| 1140 | 1140 | foreach ( $included_atts as $included_att ) { |
| 1141 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 1141 | + if ( '0' === $atts[$included_att] ) { |
|
| 1142 | 1142 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 1143 | 1143 | continue; |
| 1144 | 1144 | } |
@@ -1221,8 +1221,8 @@ discard block |
||
| 1221 | 1221 | |
| 1222 | 1222 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
| 1223 | 1223 | |
| 1224 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 1225 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 1224 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 1225 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 1226 | 1226 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
| 1227 | 1227 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 1228 | 1228 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1471,8 +1471,8 @@ discard block |
||
| 1471 | 1471 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1472 | 1472 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1473 | 1473 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1474 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1475 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1474 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1475 | + $field_types[$type] = $field_selection[$type]; |
|
| 1476 | 1476 | } |
| 1477 | 1477 | |
| 1478 | 1478 | $field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1517,7 +1517,7 @@ discard block |
||
| 1517 | 1517 | foreach ( $inputs as $input ) { |
| 1518 | 1518 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
| 1519 | 1519 | if ( array_key_exists( $input, $fields ) ) { |
| 1520 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1520 | + $field_types[$input] = $fields[$input]; |
|
| 1521 | 1521 | } |
| 1522 | 1522 | unset( $input ); |
| 1523 | 1523 | } |
@@ -1552,7 +1552,7 @@ discard block |
||
| 1552 | 1552 | 'parent' => false, |
| 1553 | 1553 | 'pointer' => false, |
| 1554 | 1554 | ); |
| 1555 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1555 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1556 | 1556 | |
| 1557 | 1557 | $opt_key = $args['opt_key']; |
| 1558 | 1558 | $field = $args['field']; |
@@ -1568,25 +1568,25 @@ discard block |
||
| 1568 | 1568 | |
| 1569 | 1569 | // Check posted vals before checking saved values |
| 1570 | 1570 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1571 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1571 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1572 | 1572 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1573 | 1573 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1574 | - $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 ] ) ) : ''; |
|
| 1574 | + $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] ) ) : ''; |
|
| 1575 | 1575 | } else { |
| 1576 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1576 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1577 | 1577 | } |
| 1578 | 1578 | |
| 1579 | 1579 | return $other_val; |
| 1580 | 1580 | } |
| 1581 | 1581 | |
| 1582 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1582 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1583 | 1583 | // For normal fields |
| 1584 | 1584 | |
| 1585 | 1585 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1586 | 1586 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1587 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1587 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1588 | 1588 | } else { |
| 1589 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1589 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | return $other_val; |
@@ -1596,8 +1596,8 @@ discard block |
||
| 1596 | 1596 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1597 | 1597 | // Check if there is an "other" val in saved value and make sure the |
| 1598 | 1598 | // "other" val is not equal to the Other checkbox option |
| 1599 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1600 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1599 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1600 | + $other_val = $field['value'][$opt_key]; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | } else { |
| 1603 | 1603 | /** |
@@ -1611,8 +1611,8 @@ discard block |
||
| 1611 | 1611 | if ( is_array( $field['value'] ) ) { |
| 1612 | 1612 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1613 | 1613 | |
| 1614 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1615 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1614 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1615 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1616 | 1616 | } |
| 1617 | 1617 | } elseif ( $temp_val == $field['value'] ) { |
| 1618 | 1618 | // For radio and regular dropdowns |
@@ -1842,11 +1842,11 @@ discard block |
||
| 1842 | 1842 | foreach ( $val as $k => $v ) { |
| 1843 | 1843 | if ( is_string( $v ) ) { |
| 1844 | 1844 | if ( 'custom_html' === $k ) { |
| 1845 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1845 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1846 | 1846 | unset( $k, $v ); |
| 1847 | 1847 | continue; |
| 1848 | 1848 | } |
| 1849 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1849 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1850 | 1850 | unset( $k, $v ); |
| 1851 | 1851 | } |
| 1852 | 1852 | } |
@@ -1876,8 +1876,8 @@ discard block |
||
| 1876 | 1876 | if ( false === $index ) { |
| 1877 | 1877 | continue; |
| 1878 | 1878 | } |
| 1879 | - unset( $replace[ $index ] ); |
|
| 1880 | - unset( $replace_with[ $index ] ); |
|
| 1879 | + unset( $replace[$index] ); |
|
| 1880 | + unset( $replace_with[$index] ); |
|
| 1881 | 1881 | } |
| 1882 | 1882 | |
| 1883 | 1883 | $value = str_replace( $replace, $replace_with, $value ); |
@@ -2237,7 +2237,7 @@ discard block |
||
| 2237 | 2237 | $countries['class'] = 'frm-countries-opts'; |
| 2238 | 2238 | } |
| 2239 | 2239 | |
| 2240 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 2240 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 2241 | 2241 | |
| 2242 | 2242 | // State abv. |
| 2243 | 2243 | $states = self::get_us_states(); |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 2249 | 2249 | } |
| 2250 | 2250 | |
| 2251 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 2251 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 2252 | 2252 | |
| 2253 | 2253 | // States. |
| 2254 | 2254 | $states = array_values( $states ); |
@@ -2258,7 +2258,7 @@ discard block |
||
| 2258 | 2258 | $states['class'] = 'frm-states-opts'; |
| 2259 | 2259 | } |
| 2260 | 2260 | |
| 2261 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 2261 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 2262 | 2262 | unset( $state_abv, $states ); |
| 2263 | 2263 | |
| 2264 | 2264 | // Age. |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | $ages['class'] = 'frm-age-opts'; |
| 2278 | 2278 | } |
| 2279 | 2279 | |
| 2280 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 2280 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 2281 | 2281 | |
| 2282 | 2282 | // Satisfaction. |
| 2283 | 2283 | $satisfaction = array( |
@@ -2293,7 +2293,7 @@ discard block |
||
| 2293 | 2293 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 2294 | 2294 | } |
| 2295 | 2295 | |
| 2296 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 2296 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 2297 | 2297 | |
| 2298 | 2298 | // Importance. |
| 2299 | 2299 | $importance = array( |
@@ -2309,7 +2309,7 @@ discard block |
||
| 2309 | 2309 | $importance['class'] = 'frm-importance-opts'; |
| 2310 | 2310 | } |
| 2311 | 2311 | |
| 2312 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 2312 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 2313 | 2313 | |
| 2314 | 2314 | // Agreement. |
| 2315 | 2315 | $agreement = array( |
@@ -2325,7 +2325,7 @@ discard block |
||
| 2325 | 2325 | $agreement['class'] = 'frm-agreement-opts'; |
| 2326 | 2326 | } |
| 2327 | 2327 | |
| 2328 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 2328 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 2329 | 2329 | |
| 2330 | 2330 | // Likely. |
| 2331 | 2331 | $likely = array( |
@@ -2341,7 +2341,7 @@ discard block |
||
| 2341 | 2341 | $likely['class'] = 'frm-likely-opts'; |
| 2342 | 2342 | } |
| 2343 | 2343 | |
| 2344 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 2344 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 2345 | 2345 | |
| 2346 | 2346 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 2347 | 2347 | } |
@@ -2591,17 +2591,17 @@ discard block |
||
| 2591 | 2591 | */ |
| 2592 | 2592 | private static function fill_image_setting_options( $options, &$args ) { |
| 2593 | 2593 | foreach ( $options as $key => $option ) { |
| 2594 | - $args['options'][ $key ] = $option; |
|
| 2594 | + $args['options'][$key] = $option; |
|
| 2595 | 2595 | |
| 2596 | 2596 | if ( ! empty( $option['addon'] ) ) { |
| 2597 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2597 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2598 | 2598 | } |
| 2599 | 2599 | |
| 2600 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2600 | + unset( $args['options'][$key]['addon'] ); |
|
| 2601 | 2601 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2602 | 2602 | |
| 2603 | 2603 | foreach ( $fill as $f ) { |
| 2604 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2604 | + unset( $args['options'][$key][$f], $f ); |
|
| 2605 | 2605 | } |
| 2606 | 2606 | } |
| 2607 | 2607 | } |
@@ -2625,8 +2625,8 @@ discard block |
||
| 2625 | 2625 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2626 | 2626 | |
| 2627 | 2627 | foreach ( $fill as $f ) { |
| 2628 | - if ( isset( $option[ $f ] ) ) { |
|
| 2629 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2628 | + if ( isset( $option[$f] ) ) { |
|
| 2629 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2630 | 2630 | } |
| 2631 | 2631 | } |
| 2632 | 2632 | |
@@ -2695,7 +2695,7 @@ discard block |
||
| 2695 | 2695 | |
| 2696 | 2696 | return array_filter( |
| 2697 | 2697 | $rows, |
| 2698 | - function ( $row ) { |
|
| 2698 | + function( $row ) { |
|
| 2699 | 2699 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2700 | 2700 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2701 | 2701 | } |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | unset( $data['plugin-status'] ); |
| 2763 | 2763 | |
| 2764 | 2764 | foreach ( $data as $key => $value ) { |
| 2765 | - $attributes[ 'data-' . $key ] = $value; |
|
| 2765 | + $attributes['data-' . $key] = $value; |
|
| 2766 | 2766 | } |
| 2767 | 2767 | } |
| 2768 | 2768 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | * @return void |
| 47 | 47 | */ |
| 48 | 48 | private function _set( $param, $atts ) { |
| 49 | - if ( isset( $atts[ $param ] ) ) { |
|
| 50 | - $this->{$param} = $atts[ $param ]; |
|
| 49 | + if ( isset( $atts[$param] ) ) { |
|
| 50 | + $this->{$param} = $atts[$param]; |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $exclude = array( 'field_obj', 'html' ); |
| 99 | 99 | foreach ( $exclude as $ex ) { |
| 100 | - if ( isset( $atts[ $ex ] ) ) { |
|
| 101 | - unset( $this->pass_args[ $ex ] ); |
|
| 100 | + if ( isset( $atts[$ex] ) ) { |
|
| 101 | + unset( $this->pass_args[$ex] ); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @return void |
| 113 | 113 | */ |
| 114 | 114 | private function set_from_field( $atts, $set ) { |
| 115 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
| 116 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
| 115 | + if ( isset( $atts[$set['param']] ) ) { |
|
| 116 | + $this->{$set['param']} = $atts[$set['param']]; |
|
| 117 | 117 | } else { |
| 118 | 118 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
| 119 | 119 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | private function replace_error_shortcode() { |
| 266 | 266 | $this->maybe_add_error_id(); |
| 267 | - $error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false; |
|
| 267 | + $error = $this->pass_args['errors']['field' . $this->field_id] ?? false; |
|
| 268 | 268 | |
| 269 | 269 | if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { |
| 270 | 270 | $error_body = self::get_error_body( $this->html ); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @return void |
| 308 | 308 | */ |
| 309 | 309 | private function maybe_add_error_id() { |
| 310 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 310 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 311 | 311 | return; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 400 | 400 | |
| 401 | 401 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 402 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 402 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 403 | 403 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 404 | 404 | |
| 405 | 405 | $replace_with = ''; |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 413 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | */ |
| 433 | 433 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 434 | 434 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 435 | - --$shortcode_atts['opt']; |
|
| 435 | + -- $shortcode_atts['opt']; |
|
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | */ |
| 503 | 503 | private function get_field_div_classes() { |
| 504 | 504 | // Add error class |
| 505 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 505 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 506 | 506 | |
| 507 | 507 | // Add label position class |
| 508 | 508 | $settings = $this->field_obj->display_field_settings(); |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 586 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 586 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 587 | 587 | $attributes['aria-invalid'] = 'true'; |
| 588 | 588 | } |
| 589 | 589 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' ); |
| 171 | 171 | foreach ( $conditionally_add as $index ) { |
| 172 | - if ( isset( $atts[ $index ] ) ) { |
|
| 173 | - $entry_atts[ $index ] = $atts[ $index ]; |
|
| 172 | + if ( isset( $atts[$index] ) ) { |
|
| 173 | + $entry_atts[$index] = $atts[$index]; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $unset = array( 'id', 'form_id', 'format' ); |
| 378 | 378 | foreach ( $unset as $param ) { |
| 379 | - if ( isset( $atts[ $param ] ) ) { |
|
| 380 | - unset( $atts[ $param ] ); |
|
| 379 | + if ( isset( $atts[$param] ) ) { |
|
| 380 | + unset( $atts[$param] ); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -553,11 +553,11 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
| 555 | 555 | |
| 556 | - $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value; |
|
| 556 | + $output[$this->get_key_or_id( $field_value )] = $displayed_value; |
|
| 557 | 557 | |
| 558 | 558 | $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' ); |
| 559 | 559 | if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) { |
| 560 | - $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value(); |
|
| 560 | + $output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value(); |
|
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | 563 | } |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | if ( $this->is_plain_text ) { |
| 976 | 976 | if ( is_array( $value ) ) { |
| 977 | 977 | foreach ( $value as $key => $single_value ) { |
| 978 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
| 978 | + $value[$key] = $this->strip_html( $single_value ); |
|
| 979 | 979 | } |
| 980 | 980 | } elseif ( $this->is_plain_text && ! is_array( $value ) ) { |
| 981 | 981 | if ( strpos( $value, '<img' ) !== false ) { |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | /** |
| 34 | 34 | * @var int |
| 35 | 35 | */ |
| 36 | - public $chmod_dir = 0755; |
|
| 36 | + public $chmod_dir = 0755; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var int |
| 40 | 40 | */ |
| 41 | - public $chmod_file = 0644; |
|
| 41 | + public $chmod_file = 0644; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @var bool |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'page' => '', |
| 46 | 46 | 'class' => 'frm-mt-0', |
| 47 | 47 | ); |
| 48 | - $tip = array_merge( $defaults, $tip ); |
|
| 48 | + $tip = array_merge( $defaults, $tip ); |
|
| 49 | 49 | |
| 50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
| 51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | $random = random_int( 0, $count - 1 ); |
| 405 | - return $tips[ $random ]; |
|
| 405 | + return $tips[$random]; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /** |