@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if ( $intent_is_processing ) { |
| 63 | 63 | // Append an additional processing message to the end of the success message. |
| 64 | - $filter = function ( $message ) { |
|
| 64 | + $filter = function( $message ) { |
|
| 65 | 65 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
| 66 | 66 | return $message . ( '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>' ); |
| 67 | 67 | }; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 171 | 171 | $atts['entry_id'] = $atts['entry']->id; |
| 172 | 172 | $opt = 'success_action'; |
| 173 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 173 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 174 | 174 | |
| 175 | 175 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
| 176 | 176 | |
@@ -268,11 +268,11 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public static function get_payment_intents( $name ) { |
| 270 | 270 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 271 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 271 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 272 | 272 | return array(); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 275 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 276 | 276 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 277 | 277 | return $intents; |
| 278 | 278 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | self::format_form_data( $form ); |
| 301 | 301 | |
| 302 | 302 | $form_id = absint( $form['form_id'] ); |
| 303 | - $intents = $form[ 'frmintent' . $form_id ] ?? array(); |
|
| 303 | + $intents = $form['frmintent' . $form_id] ?? array(); |
|
| 304 | 304 | |
| 305 | 305 | if ( empty( $intents ) ) { |
| 306 | 306 | wp_die(); |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | $intents = array( $intents ); |
| 311 | 311 | } else { |
| 312 | 312 | foreach ( $intents as $k => $intent ) { |
| 313 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 314 | - $intents[ $k ] = $intent[ $k ]; |
|
| 313 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 314 | + $intents[$k] = $intent[$k]; |
|
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ( $saved->metadata->action != $action->ID ) { |
| 374 | 374 | continue; |
| 375 | 375 | } |
| 376 | - $intents[ $k ] = array( |
|
| 376 | + $intents[$k] = array( |
|
| 377 | 377 | 'id' => $intent, |
| 378 | 378 | 'action' => $action->ID, |
| 379 | 379 | ); |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | if ( $k === 'item_meta' ) { |
| 421 | 421 | foreach ( $v as $f => $value ) { |
| 422 | 422 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 423 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 423 | + $entry->metas[absint( $f )] = $value; |
|
| 424 | 424 | } |
| 425 | 425 | } else { |
| 426 | 426 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -446,14 +446,14 @@ discard block |
||
| 446 | 446 | foreach ( $form as $input ) { |
| 447 | 447 | $key = $input['name']; |
| 448 | 448 | |
| 449 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 450 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 451 | - $formatted[ $key ][] = $input['value']; |
|
| 449 | + if ( isset( $formatted[$key] ) ) { |
|
| 450 | + if ( is_array( $formatted[$key] ) ) { |
|
| 451 | + $formatted[$key][] = $input['value']; |
|
| 452 | 452 | } else { |
| 453 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 453 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 454 | 454 | } |
| 455 | 455 | } else { |
| 456 | - $formatted[ $key ] = $input['value']; |
|
| 456 | + $formatted[$key] = $input['value']; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | |
| 706 | 706 | foreach ( $actions as $k => $action ) { |
| 707 | 707 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 708 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 708 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'user_id' => get_current_user_id(), |
| 109 | 109 | 'frm_strp_connect_mode' => $mode, |
| 110 | 110 | ); |
| 111 | - $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 111 | + $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 112 | 112 | |
| 113 | 113 | if ( is_string( $data ) ) { |
| 114 | 114 | return $data; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * @return object|string |
| 146 | 146 | */ |
| 147 | 147 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 148 | - $body = array( |
|
| 148 | + $body = array( |
|
| 149 | 149 | 'frm_strp_connect_action' => $action, |
| 150 | 150 | 'frm_strp_connect_mode' => FrmStrpLiteAppHelper::active_mode(), |
| 151 | 151 | ); |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | * @return bool |
| 891 | 891 | */ |
| 892 | 892 | public static function update_intent( $intent_id, $data ) { |
| 893 | - $data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) ); |
|
| 893 | + $data = self::post_with_authenticated_body( 'update_intent', compact( 'intent_id', 'data' ) ); |
|
| 894 | 894 | return false !== $data; |
| 895 | 895 | } |
| 896 | 896 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'payments' => $frm_payment->get_count(), |
| 129 | 129 | 'subscriptions' => $frm_sub->get_count(), |
| 130 | 130 | ); |
| 131 | - $type = FrmAppHelper::get_simple_request( |
|
| 131 | + $type = FrmAppHelper::get_simple_request( |
|
| 132 | 132 | array( |
| 133 | 133 | 'param' => 'trans_type', |
| 134 | 134 | 'type' => 'request', |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | $class = ''; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
| 147 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 146 | + if ( $counts[$status] || 'published' === $status ) { |
|
| 147 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 148 | 148 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %4$s: Span close tag. |
| 149 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
| 149 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
| 150 | 150 | . '</a>'; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
| 227 | 227 | |
| 228 | 228 | $is_alternate = 0 === $alt % 2; |
| 229 | - ++$alt; |
|
| 229 | + ++ $alt; |
|
| 230 | 230 | |
| 231 | 231 | if ( $is_alternate ) { |
| 232 | 232 | echo 'class="alternate"'; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $form_ids = array(); |
| 322 | 322 | |
| 323 | 323 | foreach ( $forms as $form ) { |
| 324 | - $form_ids[ $form->id ] = $form; |
|
| 324 | + $form_ids[$form->id] = $form; |
|
| 325 | 325 | unset( $form ); |
| 326 | 326 | } |
| 327 | 327 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | 'href' => esc_url( $link ), |
| 375 | 375 | 'title' => __( 'View', 'formidable' ), |
| 376 | 376 | ); |
| 377 | - $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
| 377 | + $link = '<a ' . FrmAppHelper::array_to_html_params( $link_params ) . '>' |
|
| 378 | 378 | . $item->{$field} |
| 379 | 379 | . '</a>'; |
| 380 | 380 | |
@@ -432,8 +432,8 @@ discard block |
||
| 432 | 432 | * @return mixed |
| 433 | 433 | */ |
| 434 | 434 | private function get_form_id_column( $item, $atts ) { |
| 435 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
| 436 | - return FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
| 435 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
| 436 | + return FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | return ''; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | */ |
| 516 | 516 | private function get_processing_tooltip() { |
| 517 | 517 | return FrmAppHelper::clip( |
| 518 | - function () { |
|
| 518 | + function() { |
|
| 519 | 519 | FrmAppHelper::tooltip_icon( __( 'This payment method may take between 4-5 business days to process.', 'formidable' ) ); |
| 520 | 520 | } |
| 521 | 521 | ); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function show_status( $status ) { |
| 71 | 71 | $statuses = array_merge( self::get_payment_statuses(), self::get_subscription_statuses() ); |
| 72 | - return $statuses[ $status ] ?? $status; |
|
| 72 | + return $statuses[$status] ?? $status; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public static function get_action_setting( $option, $atts ) { |
| 161 | 161 | $settings = self::get_action_settings( $atts ); |
| 162 | - return $settings[ $option ] ?? ''; |
|
| 162 | + return $settings[$option] ?? ''; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | public static function get_repeat_label_from_value( $value, $number ) { |
| 272 | 272 | $times = self::get_plural_repeat_times( $number ); |
| 273 | 273 | |
| 274 | - if ( isset( $times[ $value ] ) ) { |
|
| 275 | - $value = $times[ $value ]; |
|
| 274 | + if ( isset( $times[$value] ) ) { |
|
| 275 | + $value = $times[$value]; |
|
| 276 | 276 | } |
| 277 | 277 | return $value; |
| 278 | 278 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | foreach ( $payments as $payment ) { |
| 543 | 543 | if ( $payment->status === 'complete' ) { |
| 544 | - $count++; |
|
| 544 | + $count ++; |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
@@ -569,8 +569,8 @@ discard block |
||
| 569 | 569 | $gateway = reset( $gateway ); |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if ( isset( $gateways[ $gateway ] ) ) { |
|
| 573 | - $value = $gateways[ $gateway ][ $setting ]; |
|
| 572 | + if ( isset( $gateways[$gateway] ) ) { |
|
| 573 | + $value = $gateways[$gateway][$setting]; |
|
| 574 | 574 | } |
| 575 | 575 | return $value; |
| 576 | 576 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | if ( is_object( $this->field ) ) { |
| 175 | 175 | $field_val = $this->field->{$column}; |
| 176 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
| 177 | - $field_val = $this->field[ $column ]; |
|
| 176 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
| 177 | + $field_val = $this->field[$column]; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | return $field_val; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | if ( is_object( $this->field ) ) { |
| 191 | 191 | $this->field->{$column} = $value; |
| 192 | 192 | } elseif ( is_array( $this->field ) ) { |
| 193 | - $this->field[ $column ] = $value; |
|
| 193 | + $this->field[$column] = $value; |
|
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | printf( |
| 743 | 743 | /* translators: %s: Field type */ |
| 744 | 744 | esc_html__( '%s Options', 'formidable' ), |
| 745 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
| 745 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
| 746 | 746 | ); |
| 747 | 747 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); |
| 748 | 748 | ?> |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | * @return array |
| 858 | 858 | */ |
| 859 | 859 | public function get_new_field_defaults() { |
| 860 | - $field = array( |
|
| 860 | + $field = array( |
|
| 861 | 861 | 'name' => $this->get_new_field_name(), |
| 862 | 862 | 'description' => '', |
| 863 | 863 | 'type' => $this->type, |
@@ -888,8 +888,8 @@ discard block |
||
| 888 | 888 | |
| 889 | 889 | $fields = array_merge( $fields, $pro_fields ); |
| 890 | 890 | |
| 891 | - if ( isset( $fields[ $this->type ] ) ) { |
|
| 892 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
| 891 | + if ( isset( $fields[$this->type] ) ) { |
|
| 892 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | return $name; |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | * @return array |
| 907 | 907 | */ |
| 908 | 908 | public function get_default_field_options() { |
| 909 | - $opts = array( |
|
| 909 | + $opts = array( |
|
| 910 | 910 | 'size' => '', |
| 911 | 911 | 'max' => '', |
| 912 | 912 | 'label' => '', |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | * @return void |
| 1166 | 1166 | */ |
| 1167 | 1167 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
| 1168 | - $shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
| 1168 | + $shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | /** |
@@ -1358,11 +1358,11 @@ discard block |
||
| 1358 | 1358 | |
| 1359 | 1359 | $options = array_values( $this->field['options'] ); |
| 1360 | 1360 | |
| 1361 | - if ( ! isset( $options[ $opt ] ) ) { |
|
| 1361 | + if ( ! isset( $options[$opt] ) ) { |
|
| 1362 | 1362 | return $hidden; |
| 1363 | 1363 | } |
| 1364 | 1364 | |
| 1365 | - $option = $options[ $opt ]; |
|
| 1365 | + $option = $options[$opt]; |
|
| 1366 | 1366 | |
| 1367 | 1367 | if ( is_array( $option ) ) { |
| 1368 | 1368 | $option = $option['value']; |
@@ -1448,8 +1448,8 @@ discard block |
||
| 1448 | 1448 | $selected = $values['field_value']; |
| 1449 | 1449 | |
| 1450 | 1450 | if ( isset( $values['combo_name'] ) ) { |
| 1451 | - $options = $options[ $values['combo_name'] ]; |
|
| 1452 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
| 1451 | + $options = $options[$values['combo_name']]; |
|
| 1452 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | $input = $this->select_tag( $values ); |
@@ -1520,7 +1520,7 @@ discard block |
||
| 1520 | 1520 | * @return array |
| 1521 | 1521 | */ |
| 1522 | 1522 | protected function fill_display_field_values( $args = array() ) { |
| 1523 | - $defaults = array( |
|
| 1523 | + $defaults = array( |
|
| 1524 | 1524 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
| 1525 | 1525 | 'field_id' => $this->get_field_column( 'id' ), |
| 1526 | 1526 | 'field_plus_id' => '', |
@@ -1585,7 +1585,7 @@ discard block |
||
| 1585 | 1585 | } |
| 1586 | 1586 | } |
| 1587 | 1587 | |
| 1588 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
| 1588 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
| 1589 | 1589 | if ( $error_comes_first ) { |
| 1590 | 1590 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
| 1591 | 1591 | } else { |
@@ -1671,10 +1671,10 @@ discard block |
||
| 1671 | 1671 | $field_id = $this->get_field_column( 'id' ); |
| 1672 | 1672 | |
| 1673 | 1673 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
| 1674 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
| 1674 | + $frm_validated_unique_values[$field_id] = array(); |
|
| 1675 | 1675 | return false; |
| 1676 | 1676 | } |
| 1677 | - return in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
| 1677 | + return in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | 1680 | /** |
@@ -1702,7 +1702,7 @@ discard block |
||
| 1702 | 1702 | private function value_validated_as_unique( $value ) { |
| 1703 | 1703 | global $frm_validated_unique_values; |
| 1704 | 1704 | $field_id = $this->get_field_column( 'id' ); |
| 1705 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
| 1705 | + $frm_validated_unique_values[$field_id][] = $value; |
|
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | 1708 | /** |
@@ -1748,8 +1748,8 @@ discard block |
||
| 1748 | 1748 | $value = $this->prepare_display_value( $value, $atts ); |
| 1749 | 1749 | |
| 1750 | 1750 | if ( is_array( $value ) ) { |
| 1751 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
| 1752 | - $value = $value[ $atts['show'] ]; |
|
| 1751 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
| 1752 | + $value = $value[$atts['show']]; |
|
| 1753 | 1753 | } elseif ( empty( $atts['return_array'] ) ) { |
| 1754 | 1754 | $sep = $atts['sep'] ?? ', '; |
| 1755 | 1755 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1885,8 +1885,8 @@ discard block |
||
| 1885 | 1885 | $new_value = array(); |
| 1886 | 1886 | |
| 1887 | 1887 | foreach ( (array) $value as $old_child_id ) { |
| 1888 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
| 1889 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
| 1888 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
| 1889 | + $new_value[] = $saved_entries[$old_child_id]; |
|
| 1890 | 1890 | } |
| 1891 | 1891 | } |
| 1892 | 1892 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | unset( $filename ); |
| 157 | 157 | |
| 158 | - $comment_count = FrmDb::get_count( |
|
| 158 | + $comment_count = FrmDb::get_count( |
|
| 159 | 159 | 'frm_item_metas', |
| 160 | 160 | array( |
| 161 | 161 | 'item_id' => $atts['entry_ids'], |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | private static function prepare_csv_headings() { |
| 321 | 321 | $headings = array(); |
| 322 | 322 | self::csv_headings( $headings ); |
| 323 | - $headings = apply_filters( |
|
| 323 | + $headings = apply_filters( |
|
| 324 | 324 | 'frm_csv_columns', |
| 325 | 325 | $headings, |
| 326 | 326 | self::$form_id, |
@@ -351,13 +351,13 @@ discard block |
||
| 351 | 351 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 352 | 352 | |
| 353 | 353 | if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) { |
| 354 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 354 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - if ( ! empty( $field_headings[ $col->id . '_label' ] ) ) { |
|
| 358 | - $field_headings[ $col->id ] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 357 | + if ( ! empty( $field_headings[$col->id . '_label'] ) ) { |
|
| 358 | + $field_headings[$col->id] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 359 | 359 | } else { |
| 360 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 360 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | return apply_filters( |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 384 | 384 | $repeater_id = $col->field_options['in_section']; |
| 385 | 385 | // Set a placeholder to maintain order for repeater fields. |
| 386 | - $headings[ 'repeater' . $repeater_id ] = array(); |
|
| 386 | + $headings['repeater' . $repeater_id] = array(); |
|
| 387 | 387 | |
| 388 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 389 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
| 388 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
| 389 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
| 390 | 390 | $repeater_ids[] = $repeater_id; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
| 393 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
| 394 | 394 | |
| 395 | 395 | continue; |
| 396 | 396 | } |
@@ -409,8 +409,8 @@ discard block |
||
| 409 | 409 | $end = strpos( $row->meta_value, ':{' ); |
| 410 | 410 | $length = substr( $row->meta_value, $start, $end - $start ); |
| 411 | 411 | |
| 412 | - if ( $length > $max[ $row->field_id ] ) { |
|
| 413 | - $max[ $row->field_id ] = $length; |
|
| 412 | + if ( $length > $max[$row->field_id] ) { |
|
| 413 | + $max[$row->field_id] = $length; |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | $repeater_headings = array(); |
| 425 | 425 | |
| 426 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
| 426 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
| 427 | 427 | $repeater_headings += self::field_headings( $col ); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i++ ) { |
|
| 430 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
| 431 | 431 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
| 432 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
| 432 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | } else { |
| 436 | - $flat[ $key ] = $heading; |
|
| 436 | + $flat[$key] = $heading; |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
@@ -446,10 +446,10 @@ discard block |
||
| 446 | 446 | }//end if |
| 447 | 447 | |
| 448 | 448 | if ( self::$comment_count ) { |
| 449 | - for ( $i = 0; $i < self::$comment_count; $i++ ) { |
|
| 450 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 451 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 452 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 449 | + for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
|
| 450 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 451 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 452 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 453 | 453 | } |
| 454 | 454 | unset( $i ); |
| 455 | 455 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | */ |
| 505 | 505 | private static function prepare_next_csv_rows( $next_set ) { |
| 506 | 506 | if ( FrmAppHelper::pro_is_installed() ) { |
| 507 | - $where = array( |
|
| 507 | + $where = array( |
|
| 508 | 508 | 'or' => 1, |
| 509 | 509 | 'id' => $next_set, |
| 510 | 510 | 'parent_item_id' => $next_set, |
@@ -569,32 +569,32 @@ discard block |
||
| 569 | 569 | continue; |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) { |
|
| 573 | - $entries[ self::$entry->parent_item_id ] = new stdClass(); |
|
| 574 | - $entries[ self::$entry->parent_item_id ]->metas = array(); |
|
| 572 | + if ( ! isset( $entries[self::$entry->parent_item_id] ) ) { |
|
| 573 | + $entries[self::$entry->parent_item_id] = new stdClass(); |
|
| 574 | + $entries[self::$entry->parent_item_id]->metas = array(); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 578 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 579 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 577 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 578 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 579 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 580 | 580 | // if the data is here, it should be an array but if this field has collected data |
| 581 | 581 | // both while inside and outside of the repeating section, it's possible this is a string. |
| 582 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 582 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | // Add the repeated values. |
| 586 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 586 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 587 | 587 | }//end foreach |
| 588 | 588 | |
| 589 | 589 | self::$entry->metas = self::fill_missing_repeater_metas( self::$entry->metas, $entries ); |
| 590 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 590 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 591 | 591 | }//end if |
| 592 | 592 | |
| 593 | 593 | // add the embedded form id |
| 594 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 595 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 594 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 595 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 596 | 596 | } |
| 597 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 597 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /** |
@@ -617,19 +617,19 @@ discard block |
||
| 617 | 617 | |
| 618 | 618 | $repeater_id = $field->field_options['in_section']; |
| 619 | 619 | |
| 620 | - if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 620 | + if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) { |
|
| 621 | 621 | return $metas; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) { |
|
| 625 | - if ( ! isset( $metas[ $repeater_child->id ] ) ) { |
|
| 626 | - $metas[ $repeater_child->id ] = ''; |
|
| 624 | + foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) { |
|
| 625 | + if ( ! isset( $metas[$repeater_child->id] ) ) { |
|
| 626 | + $metas[$repeater_child->id] = ''; |
|
| 627 | 627 | |
| 628 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { |
|
| 629 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array(); |
|
| 628 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) { |
|
| 629 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array(); |
|
| 630 | 630 | } |
| 631 | 631 | |
| 632 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = ''; |
|
| 632 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = ''; |
|
| 633 | 633 | } |
| 634 | 634 | } |
| 635 | 635 | |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | */ |
| 660 | 660 | private static function add_field_values_to_csv( &$row ) { |
| 661 | 661 | foreach ( self::$fields as $col ) { |
| 662 | - $field_value = self::$entry->metas[ $col->id ] ?? false; |
|
| 662 | + $field_value = self::$entry->metas[$col->id] ?? false; |
|
| 663 | 663 | |
| 664 | 664 | FrmFieldsHelper::prepare_field_value( $field_value, $col->type ); |
| 665 | 665 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -679,20 +679,20 @@ discard block |
||
| 679 | 679 | $label_key = $col->id . '_label'; |
| 680 | 680 | |
| 681 | 681 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 682 | - $row[ $label_key ] = array(); |
|
| 682 | + $row[$label_key] = array(); |
|
| 683 | 683 | |
| 684 | 684 | if ( is_array( $field_value ) ) { |
| 685 | 685 | foreach ( $field_value as $value ) { |
| 686 | - $row[ $label_key ][] = self::get_separate_value_label( $value, $col ); |
|
| 686 | + $row[$label_key][] = self::get_separate_value_label( $value, $col ); |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | } else { |
| 690 | - $row[ $label_key ] = self::get_separate_value_label( $field_value, $col ); |
|
| 690 | + $row[$label_key] = self::get_separate_value_label( $field_value, $col ); |
|
| 691 | 691 | } |
| 692 | 692 | unset( $label_key ); |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - $row[ $col->id ] = $field_value; |
|
| 695 | + $row[$col->id] = $field_value; |
|
| 696 | 696 | |
| 697 | 697 | unset( $col, $field_value ); |
| 698 | 698 | }//end foreach |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | 'show_icon' => false, |
| 717 | 717 | 'entry_id' => self::$entry->id, |
| 718 | 718 | 'sep' => self::$separator, |
| 719 | - 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, |
|
| 719 | + 'embedded_field_id' => isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0, |
|
| 720 | 720 | ) |
| 721 | 721 | ); |
| 722 | 722 | } |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | foreach ( $sub_value as $sub_key => $sub_sub_value ) { |
| 738 | 738 | $column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']'; |
| 739 | 739 | |
| 740 | - if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 741 | - $row[ $column_key ] = $sub_sub_value; |
|
| 740 | + if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) { |
|
| 741 | + $row[$column_key] = $sub_sub_value; |
|
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | |
@@ -747,8 +747,8 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | $column_key = $atts['col']->id . '_' . $key; |
| 749 | 749 | |
| 750 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 751 | - $row[ $column_key ] = $sub_value; |
|
| 750 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 751 | + $row[$column_key] = $sub_value; |
|
| 752 | 752 | } |
| 753 | 753 | } |
| 754 | 754 | }//end if |
@@ -784,19 +784,19 @@ discard block |
||
| 784 | 784 | $echo = 'echo' === self::$mode; |
| 785 | 785 | |
| 786 | 786 | foreach ( self::$headings as $k => $heading ) { |
| 787 | - if ( isset( $rows[ $k ] ) ) { |
|
| 788 | - $row = $rows[ $k ]; |
|
| 787 | + if ( isset( $rows[$k] ) ) { |
|
| 788 | + $row = $rows[$k]; |
|
| 789 | 789 | } else { |
| 790 | 790 | $row = ''; |
| 791 | 791 | |
| 792 | 792 | // array indexed data is not at $rows[ $k ] |
| 793 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
| 793 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
| 794 | 794 | $start = strrpos( $k, '[' ); |
| 795 | - $key = substr( $k, 0, $start++ ); |
|
| 795 | + $key = substr( $k, 0, $start ++ ); |
|
| 796 | 796 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
| 797 | 797 | |
| 798 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
| 799 | - $row = $rows[ $key ][ $index ]; |
|
| 798 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
| 799 | + $row = $rows[$key][$index]; |
|
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | unset( $start, $key, $index ); |
@@ -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 ); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | 'inside_class' => 'inside', |
| 811 | 811 | 'dismiss-icon' => true, |
| 812 | 812 | ); |
| 813 | - $args = array_merge( $defaults, $args ); |
|
| 813 | + $args = array_merge( $defaults, $args ); |
|
| 814 | 814 | |
| 815 | 815 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/inline-modal.php'; |
| 816 | 816 | } |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | continue; |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | - $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][ $short_key ] ); |
|
| 1101 | + $atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[3][$short_key] ); |
|
| 1102 | 1102 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 1103 | 1103 | |
| 1104 | 1104 | $atts['entry'] = $entry; |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | if ( $replace_with !== null ) { |
| 1109 | 1109 | $replace_with = self::trigger_shortcode_atts( $replace_with, $atts ); |
| 1110 | 1110 | self::sanitize_embedded_shortcodes( compact( 'entry' ), $replace_with ); |
| 1111 | - $content = str_replace( $shortcodes[0][ $short_key ], $replace_with, $content ); |
|
| 1111 | + $content = str_replace( $shortcodes[0][$short_key], $replace_with, $content ); |
|
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | unset( $atts, $replace_with ); |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | $included_atts = array_intersect( $supported_atts, array_keys( $atts ) ); |
| 1129 | 1129 | |
| 1130 | 1130 | foreach ( $included_atts as $included_att ) { |
| 1131 | - if ( '0' === $atts[ $included_att ] ) { |
|
| 1131 | + if ( '0' === $atts[$included_att] ) { |
|
| 1132 | 1132 | // Skip any option that uses 0 so sanitize_url=0 does not encode. |
| 1133 | 1133 | continue; |
| 1134 | 1134 | } |
@@ -1211,8 +1211,8 @@ discard block |
||
| 1211 | 1211 | |
| 1212 | 1212 | $dynamic_default = array( 'admin_email', 'siteurl', 'frmurl', 'sitename', 'get', 'default-email', 'default-from-email' ); |
| 1213 | 1213 | |
| 1214 | - if ( isset( $shortcode_values[ $atts['tag'] ] ) ) { |
|
| 1215 | - $replace_with = $shortcode_values[ $atts['tag'] ]; |
|
| 1214 | + if ( isset( $shortcode_values[$atts['tag']] ) ) { |
|
| 1215 | + $replace_with = $shortcode_values[$atts['tag']]; |
|
| 1216 | 1216 | } elseif ( in_array( $atts['tag'], $dynamic_default, true ) ) { |
| 1217 | 1217 | $replace_with = self::dynamic_default_values( $atts['tag'], $atts ); |
| 1218 | 1218 | } elseif ( $clean_tag === 'user_agent' ) { |
@@ -1461,8 +1461,8 @@ discard block |
||
| 1461 | 1461 | self::field_types_for_input( $single_input, $field_selection, $field_types ); |
| 1462 | 1462 | } elseif ( in_array( $type, $multiple_input, true ) ) { |
| 1463 | 1463 | self::field_types_for_input( $multiple_input, $field_selection, $field_types ); |
| 1464 | - } elseif ( isset( $field_selection[ $type ] ) ) { |
|
| 1465 | - $field_types[ $type ] = $field_selection[ $type ]; |
|
| 1464 | + } elseif ( isset( $field_selection[$type] ) ) { |
|
| 1465 | + $field_types[$type] = $field_selection[$type]; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | return apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) ); |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | foreach ( $inputs as $input ) { |
| 1506 | 1506 | // This may not be set if a field type was removed using the frm_available_fields or frm_pro_available_fields filters. |
| 1507 | 1507 | if ( array_key_exists( $input, $fields ) ) { |
| 1508 | - $field_types[ $input ] = $fields[ $input ]; |
|
| 1508 | + $field_types[$input] = $fields[$input]; |
|
| 1509 | 1509 | } |
| 1510 | 1510 | unset( $input ); |
| 1511 | 1511 | } |
@@ -1540,7 +1540,7 @@ discard block |
||
| 1540 | 1540 | 'parent' => false, |
| 1541 | 1541 | 'pointer' => false, |
| 1542 | 1542 | ); |
| 1543 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1543 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1544 | 1544 | |
| 1545 | 1545 | $opt_key = $args['opt_key']; |
| 1546 | 1546 | $field = $args['field']; |
@@ -1556,25 +1556,25 @@ discard block |
||
| 1556 | 1556 | |
| 1557 | 1557 | // Check posted vals before checking saved values |
| 1558 | 1558 | // For fields inside repeating sections - note, don't check if $pointer is true because it will often be zero |
| 1559 | - if ( $parent && isset( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1559 | + if ( $parent && isset( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1560 | 1560 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1561 | 1561 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1562 | - $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 ] ) ) : ''; |
|
| 1562 | + $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] ) ) : ''; |
|
| 1563 | 1563 | } else { |
| 1564 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][ $parent ][ $pointer ]['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1564 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta'][$parent][$pointer]['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | return $other_val; |
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | - if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][ $field['id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1570 | + if ( isset( $field['id'] ) && isset( $_POST['item_meta']['other'][$field['id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1571 | 1571 | // For normal fields |
| 1572 | 1572 | |
| 1573 | 1573 | if ( FrmField::is_field_with_multiple_values( $field ) ) { |
| 1574 | 1574 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 1575 | - $other_val = isset( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ][ $opt_key ] ) ) : ''; |
|
| 1575 | + $other_val = isset( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ? sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']][$opt_key] ) ) : ''; |
|
| 1576 | 1576 | } else { |
| 1577 | - $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][ $field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1577 | + $other_val = sanitize_text_field( wp_unslash( $_POST['item_meta']['other'][$field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 1578 | 1578 | } |
| 1579 | 1579 | |
| 1580 | 1580 | return $other_val; |
@@ -1584,8 +1584,8 @@ discard block |
||
| 1584 | 1584 | if ( $field['type'] === 'checkbox' && is_array( $field['value'] ) ) { |
| 1585 | 1585 | // Check if there is an "other" val in saved value and make sure the |
| 1586 | 1586 | // "other" val is not equal to the Other checkbox option |
| 1587 | - if ( isset( $field['value'][ $opt_key ] ) && $field['options'][ $opt_key ] != $field['value'][ $opt_key ] ) { |
|
| 1588 | - $other_val = $field['value'][ $opt_key ]; |
|
| 1587 | + if ( isset( $field['value'][$opt_key] ) && $field['options'][$opt_key] != $field['value'][$opt_key] ) { |
|
| 1588 | + $other_val = $field['value'][$opt_key]; |
|
| 1589 | 1589 | } |
| 1590 | 1590 | } else { |
| 1591 | 1591 | /** |
@@ -1599,8 +1599,8 @@ discard block |
||
| 1599 | 1599 | if ( is_array( $field['value'] ) ) { |
| 1600 | 1600 | $o_key = array_search( $temp_val, $field['value'] ); |
| 1601 | 1601 | |
| 1602 | - if ( isset( $field['value'][ $o_key ] ) ) { |
|
| 1603 | - unset( $field['value'][ $o_key ], $o_key ); |
|
| 1602 | + if ( isset( $field['value'][$o_key] ) ) { |
|
| 1603 | + unset( $field['value'][$o_key], $o_key ); |
|
| 1604 | 1604 | } |
| 1605 | 1605 | } elseif ( $temp_val == $field['value'] ) { |
| 1606 | 1606 | // For radio and regular dropdowns |
@@ -1828,11 +1828,11 @@ discard block |
||
| 1828 | 1828 | foreach ( $val as $k => $v ) { |
| 1829 | 1829 | if ( is_string( $v ) ) { |
| 1830 | 1830 | if ( 'custom_html' === $k ) { |
| 1831 | - $val[ $k ] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1831 | + $val[$k] = self::switch_ids_except_strings( $replace, $replace_with, array( '[if description]', '[description]', '[/if description]' ), $v ); |
|
| 1832 | 1832 | unset( $k, $v ); |
| 1833 | 1833 | continue; |
| 1834 | 1834 | } |
| 1835 | - $val[ $k ] = str_replace( $replace, $replace_with, $v ); |
|
| 1835 | + $val[$k] = str_replace( $replace, $replace_with, $v ); |
|
| 1836 | 1836 | unset( $k, $v ); |
| 1837 | 1837 | } |
| 1838 | 1838 | } |
@@ -1862,8 +1862,8 @@ discard block |
||
| 1862 | 1862 | if ( false === $index ) { |
| 1863 | 1863 | continue; |
| 1864 | 1864 | } |
| 1865 | - unset( $replace[ $index ] ); |
|
| 1866 | - unset( $replace_with[ $index ] ); |
|
| 1865 | + unset( $replace[$index] ); |
|
| 1866 | + unset( $replace_with[$index] ); |
|
| 1867 | 1867 | } |
| 1868 | 1868 | return str_replace( $replace, $replace_with, $value ); |
| 1869 | 1869 | } |
@@ -2221,7 +2221,7 @@ discard block |
||
| 2221 | 2221 | $countries['class'] = 'frm-countries-opts'; |
| 2222 | 2222 | } |
| 2223 | 2223 | |
| 2224 | - $prepop[ __( 'Countries', 'formidable' ) ] = $countries; |
|
| 2224 | + $prepop[__( 'Countries', 'formidable' )] = $countries; |
|
| 2225 | 2225 | |
| 2226 | 2226 | // State abv. |
| 2227 | 2227 | $states = self::get_us_states(); |
@@ -2232,7 +2232,7 @@ discard block |
||
| 2232 | 2232 | $state_abv['class'] = 'frm-state-abv-opts'; |
| 2233 | 2233 | } |
| 2234 | 2234 | |
| 2235 | - $prepop[ __( 'U.S. State Abbreviations', 'formidable' ) ] = $state_abv; |
|
| 2235 | + $prepop[__( 'U.S. State Abbreviations', 'formidable' )] = $state_abv; |
|
| 2236 | 2236 | |
| 2237 | 2237 | // States. |
| 2238 | 2238 | $states = array_values( $states ); |
@@ -2242,7 +2242,7 @@ discard block |
||
| 2242 | 2242 | $states['class'] = 'frm-states-opts'; |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | - $prepop[ __( 'U.S. States', 'formidable' ) ] = $states; |
|
| 2245 | + $prepop[__( 'U.S. States', 'formidable' )] = $states; |
|
| 2246 | 2246 | unset( $state_abv, $states ); |
| 2247 | 2247 | |
| 2248 | 2248 | // Age. |
@@ -2261,7 +2261,7 @@ discard block |
||
| 2261 | 2261 | $ages['class'] = 'frm-age-opts'; |
| 2262 | 2262 | } |
| 2263 | 2263 | |
| 2264 | - $prepop[ __( 'Age', 'formidable' ) ] = $ages; |
|
| 2264 | + $prepop[__( 'Age', 'formidable' )] = $ages; |
|
| 2265 | 2265 | |
| 2266 | 2266 | // Satisfaction. |
| 2267 | 2267 | $satisfaction = array( |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | $satisfaction['class'] = 'frm-satisfaction-opts'; |
| 2278 | 2278 | } |
| 2279 | 2279 | |
| 2280 | - $prepop[ __( 'Satisfaction', 'formidable' ) ] = $satisfaction; |
|
| 2280 | + $prepop[__( 'Satisfaction', 'formidable' )] = $satisfaction; |
|
| 2281 | 2281 | |
| 2282 | 2282 | // Importance. |
| 2283 | 2283 | $importance = array( |
@@ -2293,7 +2293,7 @@ discard block |
||
| 2293 | 2293 | $importance['class'] = 'frm-importance-opts'; |
| 2294 | 2294 | } |
| 2295 | 2295 | |
| 2296 | - $prepop[ __( 'Importance', 'formidable' ) ] = $importance; |
|
| 2296 | + $prepop[__( 'Importance', 'formidable' )] = $importance; |
|
| 2297 | 2297 | |
| 2298 | 2298 | // Agreement. |
| 2299 | 2299 | $agreement = array( |
@@ -2309,7 +2309,7 @@ discard block |
||
| 2309 | 2309 | $agreement['class'] = 'frm-agreement-opts'; |
| 2310 | 2310 | } |
| 2311 | 2311 | |
| 2312 | - $prepop[ __( 'Agreement', 'formidable' ) ] = $agreement; |
|
| 2312 | + $prepop[__( 'Agreement', 'formidable' )] = $agreement; |
|
| 2313 | 2313 | |
| 2314 | 2314 | // Likely. |
| 2315 | 2315 | $likely = array( |
@@ -2325,7 +2325,7 @@ discard block |
||
| 2325 | 2325 | $likely['class'] = 'frm-likely-opts'; |
| 2326 | 2326 | } |
| 2327 | 2327 | |
| 2328 | - $prepop[ __( 'Likely', 'formidable' ) ] = $likely; |
|
| 2328 | + $prepop[__( 'Likely', 'formidable' )] = $likely; |
|
| 2329 | 2329 | |
| 2330 | 2330 | $prepop = apply_filters( 'frm_bulk_field_choices', $prepop ); |
| 2331 | 2331 | } |
@@ -2575,17 +2575,17 @@ discard block |
||
| 2575 | 2575 | */ |
| 2576 | 2576 | private static function fill_image_setting_options( $options, &$args ) { |
| 2577 | 2577 | foreach ( $options as $key => $option ) { |
| 2578 | - $args['options'][ $key ] = $option; |
|
| 2578 | + $args['options'][$key] = $option; |
|
| 2579 | 2579 | |
| 2580 | 2580 | if ( ! empty( $option['addon'] ) ) { |
| 2581 | - $args['options'][ $key ]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2581 | + $args['options'][$key]['custom_attrs'] = self::fill_image_setting_addon_link( $option ); |
|
| 2582 | 2582 | } |
| 2583 | 2583 | |
| 2584 | - unset( $args['options'][ $key ]['addon'] ); |
|
| 2584 | + unset( $args['options'][$key]['addon'] ); |
|
| 2585 | 2585 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2586 | 2586 | |
| 2587 | 2587 | foreach ( $fill as $f ) { |
| 2588 | - unset( $args['options'][ $key ][ $f ], $f ); |
|
| 2588 | + unset( $args['options'][$key][$f], $f ); |
|
| 2589 | 2589 | } |
| 2590 | 2590 | } |
| 2591 | 2591 | } |
@@ -2609,8 +2609,8 @@ discard block |
||
| 2609 | 2609 | $fill = array( 'upgrade', 'message', 'content' ); |
| 2610 | 2610 | |
| 2611 | 2611 | foreach ( $fill as $f ) { |
| 2612 | - if ( isset( $option[ $f ] ) ) { |
|
| 2613 | - $custom_attrs[ 'data-' . $f ] = $option[ $f ]; |
|
| 2612 | + if ( isset( $option[$f] ) ) { |
|
| 2613 | + $custom_attrs['data-' . $f] = $option[$f]; |
|
| 2614 | 2614 | } |
| 2615 | 2615 | } |
| 2616 | 2616 | |
@@ -2679,7 +2679,7 @@ discard block |
||
| 2679 | 2679 | |
| 2680 | 2680 | return array_filter( |
| 2681 | 2681 | $rows, |
| 2682 | - function ( $row ) { |
|
| 2682 | + function( $row ) { |
|
| 2683 | 2683 | FrmAppHelper::unserialize_or_decode( $row->field_options ); |
| 2684 | 2684 | return is_array( $row->field_options ) && ! empty( $row->field_options['draft'] ); |
| 2685 | 2685 | } |
@@ -2749,7 +2749,7 @@ discard block |
||
| 2749 | 2749 | unset( $data['plugin-status'] ); |
| 2750 | 2750 | |
| 2751 | 2751 | foreach ( $data as $key => $value ) { |
| 2752 | - $attributes[ 'data-' . $key ] = $value; |
|
| 2752 | + $attributes['data-' . $key] = $value; |
|
| 2753 | 2753 | } |
| 2754 | 2754 | } |
| 2755 | 2755 | |
@@ -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 | |
@@ -363,8 +363,8 @@ discard block |
||
| 363 | 363 | ); |
| 364 | 364 | |
| 365 | 365 | foreach ( $defaults as $var => $default ) { |
| 366 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 367 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 366 | + if ( ! isset( $values[$var] ) ) { |
|
| 367 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
@@ -380,8 +380,8 @@ discard block |
||
| 380 | 380 | ); |
| 381 | 381 | |
| 382 | 382 | foreach ( $defaults as $var => $default ) { |
| 383 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 384 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 383 | + if ( ! isset( $values[$var] ) ) { |
|
| 384 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | unset( $defaults ); |
@@ -432,16 +432,16 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | foreach ( $defaults as $var => $default ) { |
| 434 | 434 | if ( is_array( $default ) ) { |
| 435 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 436 | - $values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array(); |
|
| 435 | + if ( ! isset( $values[$var] ) ) { |
|
| 436 | + $values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array(); |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | foreach ( $default as $k => $v ) { |
| 440 | - $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 ); |
|
| 440 | + $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 ); |
|
| 441 | 441 | |
| 442 | 442 | if ( is_array( $v ) ) { |
| 443 | 443 | foreach ( $v as $k1 => $v1 ) { |
| 444 | - $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 ); |
|
| 444 | + $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 ); |
|
| 445 | 445 | unset( $k1, $v1 ); |
| 446 | 446 | } |
| 447 | 447 | } |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | unset( $k, $v ); |
| 450 | 450 | } |
| 451 | 451 | } else { |
| 452 | - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); |
|
| 452 | + $values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default ); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | unset( $var, $default ); |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | $defaults = self::get_default_opts(); |
| 499 | 499 | |
| 500 | 500 | foreach ( $defaults as $var => $default ) { |
| 501 | - $options[ $var ] = $values['options'][ $var ] ?? $default; |
|
| 501 | + $options[$var] = $values['options'][$var] ?? $default; |
|
| 502 | 502 | unset( $var, $default ); |
| 503 | 503 | } |
| 504 | 504 | } |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | public static function insert_opt_html( $args ) { |
| 696 | 696 | $class = $args['class'] ?? ''; |
| 697 | 697 | $fields = self::get_field_type_data_for_insert_opt_html(); |
| 698 | - $field = $fields[ $args['type'] ] ?? array(); |
|
| 698 | + $field = $fields[$args['type']] ?? array(); |
|
| 699 | 699 | |
| 700 | 700 | self::prepare_field_type( $field ); |
| 701 | 701 | |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | |
| 837 | 837 | foreach ( $fields as $field ) { |
| 838 | 838 | if ( $prev_order === $field->field_order ) { |
| 839 | - ++$add_order; |
|
| 839 | + ++ $add_order; |
|
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | if ( $add_order ) { |
@@ -1382,9 +1382,9 @@ discard block |
||
| 1382 | 1382 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1383 | 1383 | } |
| 1384 | 1384 | |
| 1385 | - $label = ( $link_details[ $length ] ?? $link_details['label'] ); |
|
| 1385 | + $label = ( $link_details[$length] ?? $link_details['label'] ); |
|
| 1386 | 1386 | |
| 1387 | - if ( $length === 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1387 | + if ( $length === 'icon' && isset( $link_details[$length] ) ) { |
|
| 1388 | 1388 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1389 | 1389 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1390 | 1390 | } |
@@ -1556,7 +1556,7 @@ discard block |
||
| 1556 | 1556 | $status = 'publish'; |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | - return $nice_names[ $status ]; |
|
| 1559 | + return $nice_names[$status]; |
|
| 1560 | 1560 | } |
| 1561 | 1561 | |
| 1562 | 1562 | /** |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | |
| 1621 | 1621 | if ( count( $categories ) === 1 ) { |
| 1622 | 1622 | $category = reset( $categories ); |
| 1623 | - $icon = $icons[ $category ] ?? $icon; |
|
| 1623 | + $icon = $icons[$category] ?? $icon; |
|
| 1624 | 1624 | } elseif ( ! empty( $categories ) ) { |
| 1625 | 1625 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1626 | 1626 | $icon = reset( $icons ); |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | |
| 1753 | 1753 | foreach ( $item['categories'] as $k => $category ) { |
| 1754 | 1754 | if ( in_array( $category, $plans, true ) ) { |
| 1755 | - unset( $item['categories'][ $k ] ); |
|
| 1755 | + unset( $item['categories'][$k] ); |
|
| 1756 | 1756 | |
| 1757 | 1757 | return self::convert_legacy_package_names( $category ); |
| 1758 | 1758 | } |
@@ -1792,7 +1792,7 @@ discard block |
||
| 1792 | 1792 | 'include_all' => true, |
| 1793 | 1793 | 'case_lower' => false, |
| 1794 | 1794 | ); |
| 1795 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1795 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1796 | 1796 | |
| 1797 | 1797 | $license_types = array( 'Basic', 'Plus', 'Business', 'Elite' ); |
| 1798 | 1798 | |
@@ -1999,9 +1999,9 @@ discard block |
||
| 1999 | 1999 | } |
| 2000 | 2000 | |
| 2001 | 2001 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 2002 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 2002 | + $options = trim( $shortcodes[3][$key] ); |
|
| 2003 | 2003 | |
| 2004 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 2004 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 2005 | 2005 | // Skip if shortcodes. |
| 2006 | 2006 | continue; |
| 2007 | 2007 | } |
@@ -2011,7 +2011,7 @@ discard block |
||
| 2011 | 2011 | continue; |
| 2012 | 2012 | } |
| 2013 | 2013 | |
| 2014 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 2014 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 2015 | 2015 | |
| 2016 | 2016 | if ( $options ) { |
| 2017 | 2017 | $new_shortcode .= ' ' . $options; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | return; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
| 178 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
| 179 | 179 | |
| 180 | 180 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
| 181 | 181 | return; |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | * @return string |
| 194 | 194 | */ |
| 195 | 195 | private static function get_selected_in_form( $form, $value = 'form' ) { |
| 196 | - if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) { |
|
| 197 | - return $form[ $value ]; |
|
| 196 | + if ( ! empty( $form ) && ! empty( $form[$value] ) ) { |
|
| 197 | + return $form[$value]; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | return ''; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if ( $for === 'view' ) { |
| 227 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
| 227 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
| 228 | 228 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
| 229 | 229 | } elseif ( $for === 'form' ) { |
| 230 | 230 | $item_key = $form_key; |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | continue; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - $page_ids[ $for ] = wp_insert_post( |
|
| 242 | + $page_ids[$for] = wp_insert_post( |
|
| 243 | 243 | array( |
| 244 | 244 | 'post_title' => $name, |
| 245 | 245 | 'post_type' => 'page', |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
| 399 | 399 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
| 400 | 400 | |
| 401 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
| 401 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
| 402 | 402 | // allow other file types to be imported |
| 403 | 403 | do_action( 'frm_before_import_' . $file_type ); |
| 404 | 404 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | foreach ( $type as $tb_type ) { |
| 501 | 501 | $where = array(); |
| 502 | 502 | $join = ''; |
| 503 | - $table = $tables[ $tb_type ]; |
|
| 503 | + $table = $tables[$tb_type]; |
|
| 504 | 504 | |
| 505 | 505 | $select = $table . '.id'; |
| 506 | 506 | $query_vars = array(); |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | $table . '.parent_form_id' => $args['ids'], |
| 516 | 516 | ); |
| 517 | 517 | } else { |
| 518 | - $where[ $table . '.status !' ] = 'draft'; |
|
| 518 | + $where[$table . '.status !'] = 'draft'; |
|
| 519 | 519 | } |
| 520 | 520 | break; |
| 521 | 521 | case 'actions': |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | case 'items': |
| 530 | 530 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
| 531 | 531 | if ( $args['ids'] ) { |
| 532 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
| 532 | + $where[$table . '.form_id'] = $args['ids']; |
|
| 533 | 533 | } |
| 534 | 534 | break; |
| 535 | 535 | case 'styles': |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | }//end switch |
| 575 | 575 | |
| 576 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 576 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 577 | 577 | unset( $tb_type ); |
| 578 | 578 | }//end foreach |
| 579 | 579 | |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | return $parent_slugs; |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | - $results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' ); |
|
| 607 | + $results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' ); |
|
| 608 | 608 | |
| 609 | 609 | return wp_list_pluck( $results, 'slug', 'term_id' ); |
| 610 | 610 | } |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | |
| 786 | 786 | foreach ( $csv_fields as $k => $f ) { |
| 787 | 787 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
| 788 | - unset( $csv_fields[ $k ] ); |
|
| 788 | + unset( $csv_fields[$k] ); |
|
| 789 | 789 | } |
| 790 | 790 | } |
| 791 | 791 | |