@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | private function update_next_execution_time() { |
| 86 | 86 | $config_option_name = $this->config['config-option-name']; |
| 87 | 87 | |
| 88 | - $this->options_data[ $config_option_name ] = $this->get_next_execution(); |
|
| 88 | + $this->options_data[$config_option_name] = $this->get_next_execution(); |
|
| 89 | 89 | $this->update_options_data(); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | * @return bool |
| 105 | 105 | */ |
| 106 | 106 | private function is_time_to_execute() { |
| 107 | - if ( ! isset( $this->options_data[ $this->config['config-option-name'] ] ) ) { |
|
| 107 | + if ( ! isset( $this->options_data[$this->config['config-option-name']] ) ) { |
|
| 108 | 108 | return true; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $options = $this->options_data[ $this->config['config-option-name'] ]; |
|
| 111 | + $options = $this->options_data[$this->config['config-option-name']]; |
|
| 112 | 112 | |
| 113 | 113 | return ! ( isset( $options['timestamp'] ) && (int) $options['timestamp'] > $this->get_time() ); |
| 114 | 114 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args ); |
| 163 | 163 | $to = $this->explode_emails( $to ); |
| 164 | 164 | |
| 165 | - $where = array( |
|
| 165 | + $where = array( |
|
| 166 | 166 | 'it.field_id !' => 0, |
| 167 | 167 | 'it.item_id' => $this->entry->id, |
| 168 | 168 | ); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | 'entry' => $this->entry, |
| 173 | 173 | 'form' => $this->form, |
| 174 | 174 | ); |
| 175 | - $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 175 | + $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 176 | 176 | |
| 177 | 177 | $this->to = array_unique( (array) $to ); |
| 178 | 178 | |
@@ -702,11 +702,11 @@ discard block |
||
| 702 | 702 | $name = trim( str_replace( $email, '', $val ) ); |
| 703 | 703 | } else { |
| 704 | 704 | // If user enters a name without an email |
| 705 | - unset( $recipients[ $key ] ); |
|
| 705 | + unset( $recipients[$key] ); |
|
| 706 | 706 | continue; |
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - $recipients[ $key ] = $this->format_from_email( $name, $email ); |
|
| 709 | + $recipients[$key] = $this->format_from_email( $name, $email ); |
|
| 710 | 710 | }//end foreach |
| 711 | 711 | |
| 712 | 712 | return $recipients; |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | ); |
| 857 | 857 | |
| 858 | 858 | // Remove phone number from to addresses |
| 859 | - unset( $this->to[ $key ] ); |
|
| 859 | + unset( $this->to[$key] ); |
|
| 860 | 860 | }//end if |
| 861 | 861 | }//end foreach |
| 862 | 862 | } |
@@ -113,8 +113,8 @@ |
||
| 113 | 113 | $label = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term'; |
| 114 | 114 | ?> |
| 115 | 115 | <term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php |
| 116 | - if ( ! empty( $parent_slugs[ $term->parent ] ) ) { |
|
| 117 | - echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>'; |
|
| 116 | + if ( ! empty( $parent_slugs[$term->parent] ) ) { |
|
| 117 | + echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>'; |
|
| 118 | 118 | } |
| 119 | 119 | if ( ! empty( $term->name ) ) { |
| 120 | 120 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | private static function has_dark_background( $style ) { |
| 139 | 139 | $key = 'fieldset_bg_color'; |
| 140 | 140 | |
| 141 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
| 141 | + if ( empty( $style->post_content[$key] ) ) { |
|
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $color = $style->post_content[ $key ]; |
|
| 145 | + $color = $style->post_content[$key]; |
|
| 146 | 146 | |
| 147 | 147 | if ( 0 === strpos( $color, 'rgba' ) ) { |
| 148 | 148 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @param stdClass $style_object |
| 202 | 202 | * @param array $style |
| 203 | 203 | */ |
| 204 | - $param_filter = function ( $params, $args ) use ( $style_object, $style ) { |
|
| 204 | + $param_filter = function( $params, $args ) use ( $style_object, $style ) { |
|
| 205 | 205 | if ( $args['style'] !== $style_object ) { |
| 206 | 206 | return $params; |
| 207 | 207 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | ), |
| 215 | 215 | '/style-templates/' . $style['slug'] |
| 216 | 216 | ); |
| 217 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 217 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 218 | 218 | return $params; |
| 219 | 219 | }; |
| 220 | 220 | } else { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @param array $style |
| 226 | 226 | * @return array |
| 227 | 227 | */ |
| 228 | - $param_filter = function ( $params ) use ( $style ) { |
|
| 228 | + $param_filter = function( $params ) use ( $style ) { |
|
| 229 | 229 | $params['data-template-key'] = $style['slug']; |
| 230 | 230 | return $params; |
| 231 | 231 | }; |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | continue; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | - $value = $style->post_content[ $key ]; |
|
| 280 | + $value = $style->post_content[$key]; |
|
| 281 | 281 | |
| 282 | 282 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
| 283 | 283 | if ( $is_hex ) { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | * @param int $count Used for pagination. |
| 397 | 397 | * @return void |
| 398 | 398 | */ |
| 399 | - function ( $style, $key ) { |
|
| 399 | + function( $style, $key ) { |
|
| 400 | 400 | if ( ! is_numeric( $key ) ) { |
| 401 | 401 | // Skip active_sub/expires keys. |
| 402 | 402 | return; |
@@ -423,10 +423,10 @@ discard block |
||
| 423 | 423 | * @param int $count Used for pagination. |
| 424 | 424 | * @return void |
| 425 | 425 | */ |
| 426 | - function ( $style ) use ( &$count ) { |
|
| 426 | + function( $style ) use ( &$count ) { |
|
| 427 | 427 | $hidden = $count > self::PAGE_SIZE - 1; |
| 428 | 428 | $this->echo_style_card( $style, $hidden ); |
| 429 | - ++$count; |
|
| 429 | + ++ $count; |
|
| 430 | 430 | } |
| 431 | 431 | ); |
| 432 | 432 | |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * @param WP_Post $style |
| 485 | 485 | * @return bool |
| 486 | 486 | */ |
| 487 | - function ( $style ) { |
|
| 487 | + function( $style ) { |
|
| 488 | 488 | return $this->default_style->ID !== $style->ID; |
| 489 | 489 | } |
| 490 | 490 | ); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param array|object $field |
| 75 | 75 | * @return string |
| 76 | 76 | */ |
| 77 | - function ( $position, $field ) { |
|
| 77 | + function( $position, $field ) { |
|
| 78 | 78 | if ( is_array( $field ) ) { |
| 79 | 79 | $this->default_label_position_field_ids[] = (int) $field['id']; |
| 80 | 80 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param array|object $field |
| 92 | 92 | * @return string |
| 93 | 93 | */ |
| 94 | - function ( $classes, $field ) { |
|
| 94 | + function( $classes, $field ) { |
|
| 95 | 95 | if ( is_array( $field ) && in_array( (int) $field['id'], $this->default_label_position_field_ids, true ) ) { |
| 96 | 96 | $classes .= ' frm-default-label-position'; |
| 97 | 97 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * @param string $target_field_type |
| 119 | 119 | * @return bool |
| 120 | 120 | */ |
| 121 | - function ( $show, $field_type ) { |
|
| 121 | + function( $show, $field_type ) { |
|
| 122 | 122 | if ( 'captcha' === $field_type ) { |
| 123 | 123 | $show = false; |
| 124 | 124 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @param int $form_id |
| 147 | 147 | * @return stdClass|null |
| 148 | 148 | */ |
| 149 | - function ( $form ) { |
|
| 149 | + function( $form ) { |
|
| 150 | 150 | if ( is_object( $form ) && is_array( $form->options ) ) { |
| 151 | 151 | $form->options['js_validate'] = false; |
| 152 | 152 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $frm_settings = FrmAppHelper::get_settings(); |
| 198 | 198 | if ( 'none' === $frm_settings->load_style ) { |
| 199 | - $notes[] = function () { |
|
| 199 | + $notes[] = function() { |
|
| 200 | 200 | printf( |
| 201 | 201 | // translators: %1$s: Anchor tag open, %2$s: Anchor tag close. |
| 202 | 202 | esc_html__( 'Formidable styles are disabled. This needs to be enabled in %1$sGlobal Settings%2$s.', 'formidable' ), |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | return; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - unset( $dependencies[ $index ] ); |
|
| 357 | + unset( $dependencies[$index] ); |
|
| 358 | 358 | $dependencies = array_values( $dependencies ); |
| 359 | 359 | |
| 360 | 360 | $styles->registered['wp-admin']->deps = $dependencies; |
@@ -14,20 +14,26 @@ |
||
| 14 | 14 | <h4><?php echo esc_html( $counter['heading'] ); ?></h4> |
| 15 | 15 | <?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?> |
| 16 | 16 | <a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_html( $counter['cta']['title'] ); ?></a> |
| 17 | - <?php else : ?> |
|
| 17 | + <?php else { |
|
| 18 | + : ?> |
|
| 18 | 19 | <?php if ( 'currency' === $counter['type'] ) : ?> |
| 19 | 20 | <div class="frm-flex-box frm-gap-md"> |
| 20 | 21 | <?php foreach ( $counter['items'] as $item ) : ?> |
| 21 | 22 | <b> |
| 22 | - <?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?> |
|
| 23 | + <?php echo esc_attr( $item['counter_label']['symbol_left'] ); |
|
| 24 | +} |
|
| 25 | +?> |
|
| 23 | 26 | <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span> |
| 24 | 27 | <?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?> |
| 25 | 28 | </b> |
| 26 | 29 | <?php endforeach; ?> |
| 27 | 30 | </div> |
| 28 | - <?php else : ?> |
|
| 31 | + <?php else { |
|
| 32 | + : ?> |
|
| 29 | 33 | <b> |
| 30 | - <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span> |
|
| 34 | + <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); |
|
| 35 | +} |
|
| 36 | +?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span> |
|
| 31 | 37 | </b> |
| 32 | 38 | <?php endif; ?> |
| 33 | 39 | <?php endif; ?> |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
| 166 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
| 167 | 167 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
| 168 | 168 | return; |
| 169 | 169 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | * @param string $value |
| 179 | 179 | */ |
| 180 | 180 | private static function get_selected_in_form( $form, $value = 'form' ) { |
| 181 | - if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) { |
|
| 182 | - return $form[ $value ]; |
|
| 181 | + if ( ! empty( $form ) && ! empty( $form[$value] ) ) { |
|
| 182 | + return $form[$value]; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return ''; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if ( $for === 'view' ) { |
| 211 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
| 211 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
| 212 | 212 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
| 213 | 213 | } elseif ( $for === 'form' ) { |
| 214 | 214 | $item_key = $form_key; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | continue; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $page_ids[ $for ] = wp_insert_post( |
|
| 226 | + $page_ids[$for] = wp_insert_post( |
|
| 227 | 227 | array( |
| 228 | 228 | 'post_title' => $name, |
| 229 | 229 | 'post_type' => 'page', |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
| 377 | 377 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
| 378 | 378 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
| 379 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
| 379 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
| 380 | 380 | // allow other file types to be imported |
| 381 | 381 | do_action( 'frm_before_import_' . $file_type ); |
| 382 | 382 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | foreach ( $type as $tb_type ) { |
| 471 | 471 | $where = array(); |
| 472 | 472 | $join = ''; |
| 473 | - $table = $tables[ $tb_type ]; |
|
| 473 | + $table = $tables[$tb_type]; |
|
| 474 | 474 | |
| 475 | 475 | $select = $table . '.id'; |
| 476 | 476 | $query_vars = array(); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | $table . '.parent_form_id' => $args['ids'], |
| 486 | 486 | ); |
| 487 | 487 | } else { |
| 488 | - $where[ $table . '.status !' ] = 'draft'; |
|
| 488 | + $where[$table . '.status !'] = 'draft'; |
|
| 489 | 489 | } |
| 490 | 490 | break; |
| 491 | 491 | case 'actions': |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | case 'items': |
| 499 | 499 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
| 500 | 500 | if ( $args['ids'] ) { |
| 501 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
| 501 | + $where[$table . '.form_id'] = $args['ids']; |
|
| 502 | 502 | } |
| 503 | 503 | break; |
| 504 | 504 | case 'styles': |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | } |
| 540 | 540 | }//end switch |
| 541 | 541 | |
| 542 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 542 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 543 | 543 | unset( $tb_type ); |
| 544 | 544 | }//end foreach |
| 545 | 545 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $no_export_fields = FrmField::no_save_fields(); |
| 735 | 735 | foreach ( $csv_fields as $k => $f ) { |
| 736 | 736 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
| 737 | - unset( $csv_fields[ $k ] ); |
|
| 737 | + unset( $csv_fields[$k] ); |
|
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | |
@@ -126,7 +126,8 @@ |
||
| 126 | 126 | |
| 127 | 127 | if ( empty( $imported['form_status'] ) ) { |
| 128 | 128 | // Check for an error message in the XML. |
| 129 | - if ( isset( $xml->Code ) && isset( $xml->Message ) ) { // phpcs:ignore WordPress.NamingConventions |
|
| 129 | + if ( isset( $xml->Code ) && isset( $xml->Message ) ) { |
|
| 130 | +// phpcs:ignore WordPress.NamingConventions |
|
| 130 | 131 | $imported['error'] = (string) $xml->Message; // phpcs:ignore WordPress.NamingConventions |
| 131 | 132 | } |
| 132 | 133 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $content_before_channel_tag, |
| 97 | 97 | 1 |
| 98 | 98 | ); |
| 99 | - $xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position ); |
|
| 99 | + $xml_string = $content_before_channel_tag . substr( $xml_string, $channel_start_position ); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | ); |
| 186 | 186 | |
| 187 | 187 | if ( $term && is_array( $term ) ) { |
| 188 | - ++$imported['imported']['terms']; |
|
| 189 | - $imported['terms'][ (int) $t->term_id ] = $term['term_id']; |
|
| 188 | + ++ $imported['imported']['terms']; |
|
| 189 | + $imported['terms'][(int) $t->term_id] = $term['term_id']; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | unset( $term, $t ); |
@@ -246,11 +246,11 @@ discard block |
||
| 246 | 246 | if ( $form_id ) { |
| 247 | 247 | if ( empty( $form['parent_form_id'] ) ) { |
| 248 | 248 | // Don't include the repeater form in the imported count. |
| 249 | - ++$imported['imported']['forms']; |
|
| 249 | + ++ $imported['imported']['forms']; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // Keep track of whether this specific form was updated or not. |
| 253 | - $imported['form_status'][ $form_id ] = 'imported'; |
|
| 253 | + $imported['form_status'][$form_id] = 'imported'; |
|
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // Update field ids/keys to new ones. |
| 266 | 266 | do_action( 'frm_after_duplicate_form', $form_id, $form, array( 'old_id' => $old_id ) ); |
| 267 | 267 | |
| 268 | - $imported['forms'][ (int) $item->id ] = $form_id; |
|
| 268 | + $imported['forms'][(int) $item->id] = $form_id; |
|
| 269 | 269 | |
| 270 | 270 | // Send pre 2.0 form options through function that creates actions. |
| 271 | 271 | self::migrate_form_settings_to_actions( $form['options'], $form_id, $imported, true ); |
@@ -335,19 +335,19 @@ discard block |
||
| 335 | 335 | FrmForm::update( $form_id, $form ); |
| 336 | 336 | if ( empty( $form['parent_form_id'] ) ) { |
| 337 | 337 | // Don't include the repeater form in the updated count. |
| 338 | - ++$imported['updated']['forms']; |
|
| 338 | + ++ $imported['updated']['forms']; |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | // Keep track of whether this specific form was updated or not |
| 342 | - $imported['form_status'][ $form_id ] = 'updated'; |
|
| 342 | + $imported['form_status'][$form_id] = 'updated'; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | private static function get_form_fields( $form_id ) { |
| 346 | 346 | $form_fields = FrmField::get_all_for_form( $form_id, '', 'exclude', 'exclude' ); |
| 347 | 347 | $old_fields = array(); |
| 348 | 348 | foreach ( $form_fields as $f ) { |
| 349 | - $old_fields[ $f->id ] = $f; |
|
| 350 | - $old_fields[ $f->field_key ] = $f->id; |
|
| 349 | + $old_fields[$f->id] = $f; |
|
| 350 | + $old_fields[$f->field_key] = $f->id; |
|
| 351 | 351 | unset( $f ); |
| 352 | 352 | } |
| 353 | 353 | $form_fields = $old_fields; |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | */ |
| 408 | 408 | private static function track_imported_child_forms( $form_id, $parent_form_id, &$child_forms ) { |
| 409 | 409 | if ( $parent_form_id ) { |
| 410 | - $child_forms[ $form_id ] = $parent_form_id; |
|
| 410 | + $child_forms[$form_id] = $parent_form_id; |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -422,9 +422,9 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | private static function maybe_update_child_form_parent_id( $imported_forms, $child_forms ) { |
| 424 | 424 | foreach ( $child_forms as $child_form_id => $old_parent_form_id ) { |
| 425 | - if ( isset( $imported_forms[ $old_parent_form_id ] ) && (int) $imported_forms[ $old_parent_form_id ] !== (int) $old_parent_form_id ) { |
|
| 425 | + if ( isset( $imported_forms[$old_parent_form_id] ) && (int) $imported_forms[$old_parent_form_id] !== (int) $old_parent_form_id ) { |
|
| 426 | 426 | // Update all children with this old parent_form_id |
| 427 | - $new_parent_form_id = (int) $imported_forms[ $old_parent_form_id ]; |
|
| 427 | + $new_parent_form_id = (int) $imported_forms[$old_parent_form_id]; |
|
| 428 | 428 | FrmForm::update( $child_form_id, array( 'parent_form_id' => $new_parent_form_id ) ); |
| 429 | 429 | do_action( 'frm_update_child_form_parent_id', $child_form_id, $new_parent_form_id ); |
| 430 | 430 | } |
@@ -460,34 +460,34 @@ discard block |
||
| 460 | 460 | |
| 461 | 461 | if ( ! empty( $this_form ) ) { |
| 462 | 462 | // check for field to edit by field id |
| 463 | - if ( isset( $form_fields[ $f['id'] ] ) ) { |
|
| 463 | + if ( isset( $form_fields[$f['id']] ) ) { |
|
| 464 | 464 | FrmField::update( $f['id'], $f ); |
| 465 | - ++$imported['updated']['fields']; |
|
| 465 | + ++ $imported['updated']['fields']; |
|
| 466 | 466 | |
| 467 | - unset( $form_fields[ $f['id'] ] ); |
|
| 467 | + unset( $form_fields[$f['id']] ); |
|
| 468 | 468 | |
| 469 | 469 | // Unset old field key. |
| 470 | - if ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
| 471 | - unset( $form_fields[ $f['field_key'] ] ); |
|
| 470 | + if ( isset( $form_fields[$f['field_key']] ) ) { |
|
| 471 | + unset( $form_fields[$f['field_key']] ); |
|
| 472 | 472 | } |
| 473 | - } elseif ( isset( $form_fields[ $f['field_key'] ] ) ) { |
|
| 474 | - $keys_by_original_field_id[ $f['id'] ] = $f['field_key']; |
|
| 473 | + } elseif ( isset( $form_fields[$f['field_key']] ) ) { |
|
| 474 | + $keys_by_original_field_id[$f['id']] = $f['field_key']; |
|
| 475 | 475 | |
| 476 | 476 | $old_field_id = $f['id']; |
| 477 | 477 | |
| 478 | 478 | // check for field to edit by field key |
| 479 | 479 | unset( $f['id'] ); |
| 480 | 480 | |
| 481 | - FrmField::update( $form_fields[ $f['field_key'] ], $f ); |
|
| 482 | - ++$imported['updated']['fields']; |
|
| 481 | + FrmField::update( $form_fields[$f['field_key']], $f ); |
|
| 482 | + ++ $imported['updated']['fields']; |
|
| 483 | 483 | |
| 484 | 484 | self::do_after_field_imported_action( $f, $form_fields, $old_field_id ); |
| 485 | 485 | |
| 486 | 486 | // Unset old field id. |
| 487 | - unset( $form_fields[ $form_fields[ $f['field_key'] ] ] ); |
|
| 487 | + unset( $form_fields[$form_fields[$f['field_key']]] ); |
|
| 488 | 488 | |
| 489 | 489 | // Unset old field key. |
| 490 | - unset( $form_fields[ $f['field_key'] ] ); |
|
| 490 | + unset( $form_fields[$f['field_key']] ); |
|
| 491 | 491 | } else { |
| 492 | 492 | // If no matching field id or key in this form, create the field. |
| 493 | 493 | self::create_imported_field( $f, $imported ); |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | */ |
| 528 | 528 | private static function do_after_field_imported_action( $field_array, $form_fields, $old_field_id ) { |
| 529 | 529 | // Assign field array the update field's ID. |
| 530 | - $field_array['id'] = $form_fields[ $field_array['field_key'] ]; |
|
| 530 | + $field_array['id'] = $form_fields[$field_array['field_key']]; |
|
| 531 | 531 | |
| 532 | 532 | /** |
| 533 | 533 | * Fires when an existing field is imported. |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * @param int $field_id |
| 539 | 539 | * @param int $old_field_id |
| 540 | 540 | */ |
| 541 | - do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[ $field_array['field_key'] ], $old_field_id ); |
|
| 541 | + do_action( 'frm_after_existing_field_is_imported', $field_array, $form_fields[$field_array['field_key']], $old_field_id ); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | private static function fill_field( $field, $form_id ) { |
@@ -641,8 +641,8 @@ discard block |
||
| 641 | 641 | if ( $f['type'] === 'form' || ( $f['type'] === 'divider' && FrmField::is_option_true( $f['field_options'], 'repeat' ) ) ) { |
| 642 | 642 | if ( FrmField::is_option_true( $f['field_options'], 'form_select' ) ) { |
| 643 | 643 | $form_select = (int) $f['field_options']['form_select']; |
| 644 | - if ( isset( $imported['forms'][ $form_select ] ) ) { |
|
| 645 | - $f['field_options']['form_select'] = $imported['forms'][ $form_select ]; |
|
| 644 | + if ( isset( $imported['forms'][$form_select] ) ) { |
|
| 645 | + $f['field_options']['form_select'] = $imported['forms'][$form_select]; |
|
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | } |
@@ -664,8 +664,8 @@ discard block |
||
| 664 | 664 | |
| 665 | 665 | if ( FrmField::is_option_true_in_array( $f['field_options'], 'get_values_form' ) ) { |
| 666 | 666 | $old_form = $f['field_options']['get_values_form']; |
| 667 | - if ( isset( $imported['forms'][ $old_form ] ) ) { |
|
| 668 | - $f['field_options']['get_values_form'] = $imported['forms'][ $old_form ]; |
|
| 667 | + if ( isset( $imported['forms'][$old_form] ) ) { |
|
| 668 | + $f['field_options']['get_values_form'] = $imported['forms'][$old_form]; |
|
| 669 | 669 | } |
| 670 | 670 | } |
| 671 | 671 | } |
@@ -692,12 +692,12 @@ discard block |
||
| 692 | 692 | private static function migrate_placeholders( &$f ) { |
| 693 | 693 | $update_values = self::migrate_field_placeholder( $f, 'clear_on_focus' ); |
| 694 | 694 | foreach ( $update_values as $k => $v ) { |
| 695 | - $f[ $k ] = $v; |
|
| 695 | + $f[$k] = $v; |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | $update_values = self::migrate_field_placeholder( $f, 'default_blank' ); |
| 699 | 699 | foreach ( $update_values as $k => $v ) { |
| 700 | - $f[ $k ] = $v; |
|
| 700 | + $f[$k] = $v; |
|
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | public static function migrate_field_placeholder( $field, $type ) { |
| 716 | 716 | $field = (array) $field; |
| 717 | 717 | $field_options = $field['field_options']; |
| 718 | - if ( empty( $field_options[ $type ] ) || empty( $field['default_value'] ) ) { |
|
| 718 | + if ( empty( $field_options[$type] ) || empty( $field['default_value'] ) ) { |
|
| 719 | 719 | return array(); |
| 720 | 720 | } |
| 721 | 721 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | if ( $opt == $default_value ) { |
| 744 | - unset( $options[ $opt_key ] ); |
|
| 744 | + unset( $options[$opt_key] ); |
|
| 745 | 745 | break; |
| 746 | 746 | } |
| 747 | 747 | } |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | |
| 770 | 770 | $new_id = FrmField::create( $f ); |
| 771 | 771 | if ( $new_id != false ) { |
| 772 | - ++$imported['imported']['fields']; |
|
| 772 | + ++ $imported['imported']['fields']; |
|
| 773 | 773 | do_action( 'frm_after_field_is_imported', $f, $new_id ); |
| 774 | 774 | } |
| 775 | 775 | } |
@@ -798,10 +798,10 @@ discard block |
||
| 798 | 798 | |
| 799 | 799 | $image_id = FrmProFileImport::import_attachment( $option['src'], $field_object ); |
| 800 | 800 | // Remove the src from options as it isn't required after import. |
| 801 | - unset( $field['options'][ $key ]['src'] ); |
|
| 801 | + unset( $field['options'][$key]['src'] ); |
|
| 802 | 802 | |
| 803 | 803 | if ( is_numeric( $image_id ) ) { |
| 804 | - $field['options'][ $key ]['image'] = $image_id; |
|
| 804 | + $field['options'][$key]['image'] = $image_id; |
|
| 805 | 805 | } |
| 806 | 806 | } |
| 807 | 807 | |
@@ -988,8 +988,8 @@ discard block |
||
| 988 | 988 | } else { |
| 989 | 989 | if ( $post['post_type'] === 'frm_display' ) { |
| 990 | 990 | $post['post_content'] = self::maybe_prepare_json_view_content( $post['post_content'] ); |
| 991 | - } elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][ $post['post_parent'] ] ) ) { |
|
| 992 | - $post['post_parent'] = $imported['posts'][ $post['post_parent'] ]; |
|
| 991 | + } elseif ( 'page' === $post['post_type'] && isset( $imported['posts'][$post['post_parent']] ) ) { |
|
| 992 | + $post['post_parent'] = $imported['posts'][$post['post_parent']]; |
|
| 993 | 993 | } |
| 994 | 994 | // Create/update post now |
| 995 | 995 | $post_id = wp_insert_post( $post ); |
@@ -1000,27 +1000,27 @@ discard block |
||
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | 1002 | if ( false !== strpos( $post['post_content'], '[display-frm-data' ) || false !== strpos( $post['post_content'], '[formidable' ) ) { |
| 1003 | - $posts_with_shortcodes[ $post_id ] = $post; |
|
| 1003 | + $posts_with_shortcodes[$post_id] = $post; |
|
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | self::update_postmeta( $post, $post_id ); |
| 1007 | 1007 | self::update_layout( $post, $post_id ); |
| 1008 | 1008 | |
| 1009 | 1009 | $this_type = 'posts'; |
| 1010 | - if ( isset( $post_types[ $post['post_type'] ] ) ) { |
|
| 1011 | - $this_type = $post_types[ $post['post_type'] ]; |
|
| 1010 | + if ( isset( $post_types[$post['post_type']] ) ) { |
|
| 1011 | + $this_type = $post_types[$post['post_type']]; |
|
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 | if ( isset( $post['ID'] ) && $post_id == $post['ID'] ) { |
| 1015 | - ++$imported['updated'][ $this_type ]; |
|
| 1015 | + ++ $imported['updated'][$this_type]; |
|
| 1016 | 1016 | } else { |
| 1017 | - ++$imported['imported'][ $this_type ]; |
|
| 1017 | + ++ $imported['imported'][$this_type]; |
|
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | - $imported['posts'][ $old_id ] = $post_id; |
|
| 1020 | + $imported['posts'][$old_id] = $post_id; |
|
| 1021 | 1021 | |
| 1022 | 1022 | if ( $post['post_type'] === 'frm_display' ) { |
| 1023 | - $view_ids[ $old_id ] = $post_id; |
|
| 1023 | + $view_ids[$old_id] = $post_id; |
|
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | do_action( 'frm_after_import_view', $post_id, $post ); |
@@ -1182,9 +1182,9 @@ discard block |
||
| 1182 | 1182 | $post['attachment_url'] = (string) $item->attachment_url; |
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | - if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][ (int) $post['menu_order'] ] ) ) { |
|
| 1185 | + if ( $post['post_type'] == FrmFormActionsController::$action_post_type && isset( $imported['forms'][(int) $post['menu_order']] ) ) { |
|
| 1186 | 1186 | // update to new form id |
| 1187 | - $post['menu_order'] = $imported['forms'][ (int) $post['menu_order'] ]; |
|
| 1187 | + $post['menu_order'] = $imported['forms'][(int) $post['menu_order']]; |
|
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | // Don't allow default styles to take over a site's default style |
@@ -1221,8 +1221,8 @@ discard block |
||
| 1221 | 1221 | ); |
| 1222 | 1222 | |
| 1223 | 1223 | // Switch old form and field ids to new ones. |
| 1224 | - if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][ (int) $m['value'] ] ) ) { |
|
| 1225 | - $m['value'] = $imported['forms'][ (int) $m['value'] ]; |
|
| 1224 | + if ( 'frm_form_id' === $m['key'] && isset( $imported['forms'][(int) $m['value']] ) ) { |
|
| 1225 | + $m['value'] = $imported['forms'][(int) $m['value']]; |
|
| 1226 | 1226 | } else { |
| 1227 | 1227 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
| 1228 | 1228 | |
@@ -1233,23 +1233,23 @@ discard block |
||
| 1233 | 1233 | } elseif ( 'frm_options' === $m['key'] ) { |
| 1234 | 1234 | |
| 1235 | 1235 | foreach ( array( 'date_field_id', 'edate_field_id' ) as $setting_name ) { |
| 1236 | - if ( isset( $m['value'][ $setting_name ] ) && is_numeric( $m['value'][ $setting_name ] ) && isset( $frm_duplicate_ids[ $m['value'][ $setting_name ] ] ) ) { |
|
| 1237 | - $m['value'][ $setting_name ] = $frm_duplicate_ids[ $m['value'][ $setting_name ] ]; |
|
| 1236 | + if ( isset( $m['value'][$setting_name] ) && is_numeric( $m['value'][$setting_name] ) && isset( $frm_duplicate_ids[$m['value'][$setting_name]] ) ) { |
|
| 1237 | + $m['value'][$setting_name] = $frm_duplicate_ids[$m['value'][$setting_name]]; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | 1241 | if ( ! empty( $m['value']['map_address_fields'] ) ) { |
| 1242 | 1242 | foreach ( $m['value']['map_address_fields'] as $address_field_key => $address_field_id ) { |
| 1243 | - if ( isset( $frm_duplicate_ids[ $address_field_id ] ) ) { |
|
| 1244 | - $m['value']['map_address_fields'][ $address_field_key ] = $frm_duplicate_ids[ $address_field_id ]; |
|
| 1243 | + if ( isset( $frm_duplicate_ids[$address_field_id] ) ) { |
|
| 1244 | + $m['value']['map_address_fields'][$address_field_key] = $frm_duplicate_ids[$address_field_id]; |
|
| 1245 | 1245 | } |
| 1246 | 1246 | } |
| 1247 | 1247 | } |
| 1248 | 1248 | |
| 1249 | 1249 | if ( ! empty( $m['value']['calendar_options'] ) ) { |
| 1250 | 1250 | foreach ( $m['value']['calendar_options'] as $calendar_option_group_key => $calendar_option ) { |
| 1251 | - if ( isset( $frm_duplicate_ids[ $calendar_option['value'] ] ) ) { |
|
| 1252 | - $m['value']['calendar_options'][ $calendar_option_group_key ]['value'] = $frm_duplicate_ids[ $calendar_option['value'] ]; |
|
| 1251 | + if ( isset( $frm_duplicate_ids[$calendar_option['value']] ) ) { |
|
| 1252 | + $m['value']['calendar_options'][$calendar_option_group_key]['value'] = $frm_duplicate_ids[$calendar_option['value']]; |
|
| 1253 | 1253 | } |
| 1254 | 1254 | } |
| 1255 | 1255 | } |
@@ -1257,8 +1257,8 @@ discard block |
||
| 1257 | 1257 | if ( ! empty( $m['value']['timeline_options'] ) ) { |
| 1258 | 1258 | foreach ( $m['value']['timeline_options'] as $timeline_option_group_key => $timeline_group_option ) { |
| 1259 | 1259 | foreach ( $timeline_group_option as $timeline_option_key => $timeline_option ) { |
| 1260 | - if ( isset( $frm_duplicate_ids[ $timeline_option ] ) ) { |
|
| 1261 | - $m['value']['timeline_options'][ $timeline_option_group_key ][ $timeline_option_key ] = $frm_duplicate_ids[ $timeline_option ]; |
|
| 1260 | + if ( isset( $frm_duplicate_ids[$timeline_option] ) ) { |
|
| 1261 | + $m['value']['timeline_options'][$timeline_option_group_key][$timeline_option_key] = $frm_duplicate_ids[$timeline_option]; |
|
| 1262 | 1262 | } |
| 1263 | 1263 | } |
| 1264 | 1264 | } |
@@ -1266,8 +1266,8 @@ discard block |
||
| 1266 | 1266 | |
| 1267 | 1267 | $check_dup_array = array(); |
| 1268 | 1268 | if ( ! empty( $m['value']['order_by'] ) ) { |
| 1269 | - if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[ $m['value']['order_by'] ] ) ) { |
|
| 1270 | - $m['value']['order_by'] = $frm_duplicate_ids[ $m['value']['order_by'] ]; |
|
| 1269 | + if ( is_numeric( $m['value']['order_by'] ) && isset( $frm_duplicate_ids[$m['value']['order_by']] ) ) { |
|
| 1270 | + $m['value']['order_by'] = $frm_duplicate_ids[$m['value']['order_by']]; |
|
| 1271 | 1271 | } elseif ( is_array( $m['value']['order_by'] ) ) { |
| 1272 | 1272 | $check_dup_array[] = 'order_by'; |
| 1273 | 1273 | } |
@@ -1278,9 +1278,9 @@ discard block |
||
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | 1280 | foreach ( $check_dup_array as $check_k ) { |
| 1281 | - foreach ( (array) $m['value'][ $check_k ] as $mk => $mv ) { |
|
| 1282 | - if ( isset( $frm_duplicate_ids[ $mv ] ) ) { |
|
| 1283 | - $m['value'][ $check_k ][ $mk ] = $frm_duplicate_ids[ $mv ]; |
|
| 1281 | + foreach ( (array) $m['value'][$check_k] as $mk => $mv ) { |
|
| 1282 | + if ( isset( $frm_duplicate_ids[$mv] ) ) { |
|
| 1283 | + $m['value'][$check_k][$mk] = $frm_duplicate_ids[$mv]; |
|
| 1284 | 1284 | } |
| 1285 | 1285 | unset( $mk, $mv ); |
| 1286 | 1286 | } |
@@ -1293,11 +1293,11 @@ discard block |
||
| 1293 | 1293 | $m['value'] = FrmAppHelper::maybe_json_decode( $m['value'] ); |
| 1294 | 1294 | } |
| 1295 | 1295 | |
| 1296 | - $post['postmeta'][ (string) $meta->meta_key ] = $m['value']; |
|
| 1296 | + $post['postmeta'][(string) $meta->meta_key] = $m['value']; |
|
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | 1299 | private static function populate_layout( &$post, $layout ) { |
| 1300 | - $post['layout'][ (string) $layout->type ] = (string) $layout->data; |
|
| 1300 | + $post['layout'][(string) $layout->type] = (string) $layout->data; |
|
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | /** |
@@ -1325,11 +1325,11 @@ discard block |
||
| 1325 | 1325 | $name = (string) $c; |
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - if ( ! isset( $post['tax_input'][ $taxonomy ] ) ) { |
|
| 1329 | - $post['tax_input'][ $taxonomy ] = array(); |
|
| 1328 | + if ( ! isset( $post['tax_input'][$taxonomy] ) ) { |
|
| 1329 | + $post['tax_input'][$taxonomy] = array(); |
|
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | - $post['tax_input'][ $taxonomy ][] = $name; |
|
| 1332 | + $post['tax_input'][$taxonomy][] = $name; |
|
| 1333 | 1333 | unset( $name ); |
| 1334 | 1334 | }//end foreach |
| 1335 | 1335 | } |
@@ -1473,7 +1473,7 @@ discard block |
||
| 1473 | 1473 | |
| 1474 | 1474 | $message = '<ul>'; |
| 1475 | 1475 | foreach ( $result as $type => $results ) { |
| 1476 | - if ( ! isset( $t_strings[ $type ] ) ) { |
|
| 1476 | + if ( ! isset( $t_strings[$type] ) ) { |
|
| 1477 | 1477 | // only print imported and updated |
| 1478 | 1478 | continue; |
| 1479 | 1479 | } |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | if ( ! empty( $s_message ) ) { |
| 1488 | - $message .= '<li><strong>' . $t_strings[ $type ] . ':</strong> '; |
|
| 1488 | + $message .= '<li><strong>' . $t_strings[$type] . ':</strong> '; |
|
| 1489 | 1489 | $message .= implode( ', ', $s_message ); |
| 1490 | 1490 | $message .= '</li>'; |
| 1491 | 1491 | } |
@@ -1537,8 +1537,8 @@ discard block |
||
| 1537 | 1537 | 'actions' => sprintf( _n( '%1$s Form Action', '%1$s Form Actions', $m, 'formidable' ), $m ), |
| 1538 | 1538 | ); |
| 1539 | 1539 | |
| 1540 | - if ( isset( $strings[ $type ] ) ) { |
|
| 1541 | - $s_message[] = $strings[ $type ]; |
|
| 1540 | + if ( isset( $strings[$type] ) ) { |
|
| 1541 | + $s_message[] = $strings[$type]; |
|
| 1542 | 1542 | } else { |
| 1543 | 1543 | $string = ' ' . $m . ' ' . ucfirst( $type ); |
| 1544 | 1544 | |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | |
| 1694 | 1694 | foreach ( $options as $key => $option ) { |
| 1695 | 1695 | if ( is_array( $option ) && ! empty( $option['image'] ) ) { |
| 1696 | - $options[ $key ]['src'] = wp_get_attachment_url( $option['image'] ); |
|
| 1696 | + $options[$key]['src'] = wp_get_attachment_url( $option['image'] ); |
|
| 1697 | 1697 | $updated = true; |
| 1698 | 1698 | } |
| 1699 | 1699 | } |
@@ -1731,8 +1731,8 @@ discard block |
||
| 1731 | 1731 | */ |
| 1732 | 1732 | private static function remove_defaults( $defaults, &$saved ) { |
| 1733 | 1733 | foreach ( $saved as $key => $value ) { |
| 1734 | - if ( isset( $defaults[ $key ] ) && $defaults[ $key ] === $value ) { |
|
| 1735 | - unset( $saved[ $key ] ); |
|
| 1734 | + if ( isset( $defaults[$key] ) && $defaults[$key] === $value ) { |
|
| 1735 | + unset( $saved[$key] ); |
|
| 1736 | 1736 | } |
| 1737 | 1737 | } |
| 1738 | 1738 | } |
@@ -1749,14 +1749,14 @@ discard block |
||
| 1749 | 1749 | * @return void |
| 1750 | 1750 | */ |
| 1751 | 1751 | private static function remove_default_html( $html_name, $defaults, &$options ) { |
| 1752 | - if ( ! isset( $options[ $html_name ] ) || ! isset( $defaults[ $html_name ] ) ) { |
|
| 1752 | + if ( ! isset( $options[$html_name] ) || ! isset( $defaults[$html_name] ) ) { |
|
| 1753 | 1753 | return; |
| 1754 | 1754 | } |
| 1755 | 1755 | |
| 1756 | - $old_html = str_replace( "\r\n", "\n", $options[ $html_name ] ); |
|
| 1757 | - $default_html = $defaults[ $html_name ]; |
|
| 1756 | + $old_html = str_replace( "\r\n", "\n", $options[$html_name] ); |
|
| 1757 | + $default_html = $defaults[$html_name]; |
|
| 1758 | 1758 | if ( $old_html == $default_html ) { |
| 1759 | - unset( $options[ $html_name ] ); |
|
| 1759 | + unset( $options[$html_name] ); |
|
| 1760 | 1760 | |
| 1761 | 1761 | return; |
| 1762 | 1762 | } |
@@ -1764,7 +1764,7 @@ discard block |
||
| 1764 | 1764 | // Account for some of the older field default HTML. |
| 1765 | 1765 | $default_html = str_replace( ' id="frm_desc_field_[key]"', '', $default_html ); |
| 1766 | 1766 | if ( $old_html === $default_html ) { |
| 1767 | - unset( $options[ $html_name ] ); |
|
| 1767 | + unset( $options[$html_name] ); |
|
| 1768 | 1768 | } |
| 1769 | 1769 | } |
| 1770 | 1770 | |
@@ -1872,8 +1872,8 @@ discard block |
||
| 1872 | 1872 | ); |
| 1873 | 1873 | |
| 1874 | 1874 | foreach ( $post_settings as $post_setting ) { |
| 1875 | - if ( isset( $form_options[ $post_setting ] ) ) { |
|
| 1876 | - $new_action['post_content'][ $post_setting ] = $form_options[ $post_setting ]; |
|
| 1875 | + if ( isset( $form_options[$post_setting] ) ) { |
|
| 1876 | + $new_action['post_content'][$post_setting] = $form_options[$post_setting]; |
|
| 1877 | 1877 | } |
| 1878 | 1878 | unset( $post_setting ); |
| 1879 | 1879 | } |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | if ( ! $exists ) { |
| 1912 | 1912 | // this isn't an email, but we need to use a class that will always be included |
| 1913 | 1913 | FrmDb::save_json_post( $new_action ); |
| 1914 | - ++$imported['imported']['actions']; |
|
| 1914 | + ++ $imported['imported']['actions']; |
|
| 1915 | 1915 | } |
| 1916 | 1916 | } |
| 1917 | 1917 | |
@@ -1944,11 +1944,11 @@ discard block |
||
| 1944 | 1944 | foreach ( $post_content as $key => $setting ) { |
| 1945 | 1945 | if ( ! is_array( $setting ) && in_array( $key, $basic_fields ) ) { |
| 1946 | 1946 | // Replace old IDs with new IDs |
| 1947 | - $post_content[ $key ] = str_replace( $old, $new, $setting ); |
|
| 1947 | + $post_content[$key] = str_replace( $old, $new, $setting ); |
|
| 1948 | 1948 | } elseif ( is_array( $setting ) && in_array( $key, $array_fields ) ) { |
| 1949 | 1949 | foreach ( $setting as $k => $val ) { |
| 1950 | 1950 | // Replace old IDs with new IDs |
| 1951 | - $post_content[ $key ][ $k ] = str_replace( $old, $new, $val ); |
|
| 1951 | + $post_content[$key][$k] = str_replace( $old, $new, $val ); |
|
| 1952 | 1952 | } |
| 1953 | 1953 | } |
| 1954 | 1954 | unset( $key, $setting ); |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | |
| 2017 | 2017 | if ( empty( $exists ) ) { |
| 2018 | 2018 | FrmDb::save_json_post( $new_notification ); |
| 2019 | - ++$imported['imported']['actions']; |
|
| 2019 | + ++ $imported['imported']['actions']; |
|
| 2020 | 2020 | } |
| 2021 | 2021 | unset( $new_notification ); |
| 2022 | 2022 | }//end foreach |
@@ -2037,8 +2037,8 @@ discard block |
||
| 2037 | 2037 | private static function remove_deprecated_notification_settings( $form_id, $form_options ) { |
| 2038 | 2038 | $delete_settings = array( 'notification', 'autoresponder', 'email_to' ); |
| 2039 | 2039 | foreach ( $delete_settings as $index ) { |
| 2040 | - if ( isset( $form_options[ $index ] ) ) { |
|
| 2041 | - unset( $form_options[ $index ] ); |
|
| 2040 | + if ( isset( $form_options[$index] ) ) { |
|
| 2041 | + unset( $form_options[$index] ); |
|
| 2042 | 2042 | } |
| 2043 | 2043 | } |
| 2044 | 2044 | FrmForm::update( $form_id, array( 'options' => $form_options ) ); |
@@ -2108,12 +2108,12 @@ discard block |
||
| 2108 | 2108 | 'reply_to_name' => '', |
| 2109 | 2109 | ); |
| 2110 | 2110 | foreach ( $reply_fields as $f => $val ) { |
| 2111 | - if ( isset( $notification[ $f ] ) ) { |
|
| 2112 | - $atts[ $f ] = $notification[ $f ]; |
|
| 2113 | - if ( 'custom' == $notification[ $f ] ) { |
|
| 2114 | - $atts[ $f ] = $notification[ 'cust_' . $f ]; |
|
| 2115 | - } elseif ( is_numeric( $atts[ $f ] ) && ! empty( $atts[ $f ] ) ) { |
|
| 2116 | - $atts[ $f ] = '[' . $atts[ $f ] . ']'; |
|
| 2111 | + if ( isset( $notification[$f] ) ) { |
|
| 2112 | + $atts[$f] = $notification[$f]; |
|
| 2113 | + if ( 'custom' == $notification[$f] ) { |
|
| 2114 | + $atts[$f] = $notification['cust_' . $f]; |
|
| 2115 | + } elseif ( is_numeric( $atts[$f] ) && ! empty( $atts[$f] ) ) { |
|
| 2116 | + $atts[$f] = '[' . $atts[$f] . ']'; |
|
| 2117 | 2117 | } |
| 2118 | 2118 | } |
| 2119 | 2119 | unset( $f, $val ); |
@@ -2152,13 +2152,13 @@ discard block |
||
| 2152 | 2152 | foreach ( $atts['email_to'] as $key => $email_field ) { |
| 2153 | 2153 | |
| 2154 | 2154 | if ( is_numeric( $email_field ) ) { |
| 2155 | - $atts['email_to'][ $key ] = '[' . $email_field . ']'; |
|
| 2155 | + $atts['email_to'][$key] = '[' . $email_field . ']'; |
|
| 2156 | 2156 | } |
| 2157 | 2157 | |
| 2158 | 2158 | if ( strpos( $email_field, '|' ) ) { |
| 2159 | 2159 | $email_opt = explode( '|', $email_field ); |
| 2160 | 2160 | if ( isset( $email_opt[0] ) ) { |
| 2161 | - $atts['email_to'][ $key ] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
| 2161 | + $atts['email_to'][$key] = '[' . $email_opt[0] . ' show=' . $email_opt[1] . ']'; |
|
| 2162 | 2162 | } |
| 2163 | 2163 | unset( $email_opt ); |
| 2164 | 2164 | } |
@@ -2188,12 +2188,12 @@ discard block |
||
| 2188 | 2188 | // Add more fields to the new notification |
| 2189 | 2189 | $add_fields = array( 'email_message', 'email_subject', 'plain_text', 'inc_user_info', 'conditions' ); |
| 2190 | 2190 | foreach ( $add_fields as $add_field ) { |
| 2191 | - if ( isset( $notification[ $add_field ] ) ) { |
|
| 2192 | - $new_notification['post_content'][ $add_field ] = $notification[ $add_field ]; |
|
| 2191 | + if ( isset( $notification[$add_field] ) ) { |
|
| 2192 | + $new_notification['post_content'][$add_field] = $notification[$add_field]; |
|
| 2193 | 2193 | } elseif ( in_array( $add_field, array( 'plain_text', 'inc_user_info' ) ) ) { |
| 2194 | - $new_notification['post_content'][ $add_field ] = 0; |
|
| 2194 | + $new_notification['post_content'][$add_field] = 0; |
|
| 2195 | 2195 | } else { |
| 2196 | - $new_notification['post_content'][ $add_field ] = ''; |
|
| 2196 | + $new_notification['post_content'][$add_field] = ''; |
|
| 2197 | 2197 | } |
| 2198 | 2198 | unset( $add_field ); |
| 2199 | 2199 | } |
@@ -2219,7 +2219,7 @@ discard block |
||
| 2219 | 2219 | if ( isset( $post_content['conditions'] ) && is_array( $post_content['conditions'] ) ) { |
| 2220 | 2220 | foreach ( $post_content['conditions'] as $email_key => $val ) { |
| 2221 | 2221 | if ( is_numeric( $email_key ) ) { |
| 2222 | - $post_content['conditions'][ $email_key ] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
| 2222 | + $post_content['conditions'][$email_key] = self::switch_action_field_ids( $val, array( 'hide_field' ) ); |
|
| 2223 | 2223 | } |
| 2224 | 2224 | unset( $email_key, $val ); |
| 2225 | 2225 | } |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | * @return array |
| 178 | 178 | */ |
| 179 | 179 | private function prepare_array_property( $index, $atts ) { |
| 180 | - if ( ! empty( $atts[ $index ] ) ) { |
|
| 180 | + if ( ! empty( $atts[$index] ) ) { |
|
| 181 | 181 | |
| 182 | - if ( is_array( $atts[ $index ] ) ) { |
|
| 183 | - $property = $atts[ $index ]; |
|
| 182 | + if ( is_array( $atts[$index] ) ) { |
|
| 183 | + $property = $atts[$index]; |
|
| 184 | 184 | } else { |
| 185 | - $property = explode( ',', $atts[ $index ] ); |
|
| 185 | + $property = explode( ',', $atts[$index] ); |
|
| 186 | 186 | } |
| 187 | 187 | } else { |
| 188 | 188 | $property = array(); |
@@ -262,11 +262,11 @@ discard block |
||
| 262 | 262 | ); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - $ip = array( |
|
| 265 | + $ip = array( |
|
| 266 | 266 | 'label' => __( 'IP Address', 'formidable' ), |
| 267 | 267 | 'value' => $this->entry->ip, |
| 268 | 268 | ); |
| 269 | - $browser = array( |
|
| 269 | + $browser = array( |
|
| 270 | 270 | 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ), |
| 271 | 271 | 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '', |
| 272 | 272 | ); |
@@ -353,6 +353,6 @@ discard block |
||
| 353 | 353 | * @return void |
| 354 | 354 | */ |
| 355 | 355 | protected function add_field_values( $field ) { |
| 356 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
| 356 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
| 357 | 357 | } |
| 358 | 358 | } |