@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'page' => '', |
| 46 | 46 | 'class' => 'frm-mt-0', |
| 47 | 47 | ); |
| 48 | - $tip = array_merge( $defaults, $tip ); |
|
| 48 | + $tip = array_merge( $defaults, $tip ); |
|
| 49 | 49 | |
| 50 | 50 | if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { |
| 51 | 51 | $tip['link']['medium'] = 'tip'; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | * @return array |
| 362 | 362 | */ |
| 363 | 363 | public static function get_banner_tip() { |
| 364 | - $tips = array( |
|
| 364 | + $tips = array( |
|
| 365 | 365 | array( |
| 366 | 366 | 'link' => array( |
| 367 | 367 | 'medium' => 'banner', |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | ), |
| 389 | 389 | ); |
| 390 | 390 | $random = rand( 0, count( $tips ) - 1 ); |
| 391 | - $tip = $tips[ $random ]; |
|
| 391 | + $tip = $tips[$random]; |
|
| 392 | 392 | $tip['num'] = $random; |
| 393 | 393 | |
| 394 | 394 | return $tip; |
@@ -397,6 +397,6 @@ discard block |
||
| 397 | 397 | public static function get_random_tip( $tips ) { |
| 398 | 398 | $random = rand( 0, count( $tips ) - 1 ); |
| 399 | 399 | |
| 400 | - return $tips[ $random ]; |
|
| 400 | + return $tips[$random]; |
|
| 401 | 401 | } |
| 402 | 402 | } |
@@ -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 boolean |
| 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 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | if ( $is_custom_template ) { |
| 63 | - $class_names[] = 'frm-form-templates-custom-item'; |
|
| 63 | + $class_names[] = 'frm-form-templates-custom-item'; |
|
| 64 | 64 | $use_template_url = esc_url( $template['url'] ); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
| 148 | 148 | if ( $is_setup_intent ) { |
| 149 | - $errors[ 'field' . $cc_field_id ] = $intent->last_setup_error->message; |
|
| 149 | + $errors['field' . $cc_field_id] = $intent->last_setup_error->message; |
|
| 150 | 150 | } else { |
| 151 | - $errors[ 'field' . $cc_field_id ] = $intent->last_payment_error->message; |
|
| 151 | + $errors['field' . $cc_field_id] = $intent->last_payment_error->message; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | global $frm_vars; |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | $save_draft = ! empty( $form->options['save_draft'] ); |
| 177 | 177 | |
| 178 | 178 | global $frm_vars; |
| 179 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
| 179 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
| 180 | 180 | |
| 181 | - $_POST[ 'frm_page_order_' . $form_id ] = true; // Set to true to get FrmProFieldsHelper::get_page_with_error() run |
|
| 181 | + $_POST['frm_page_order_' . $form_id] = true; // Set to true to get FrmProFieldsHelper::get_page_with_error() run |
|
| 182 | 182 | |
| 183 | 183 | if ( ! $save_draft ) { |
| 184 | 184 | // If draft saving is not on, delete the entry. |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | // If draft saving is on, load the draft entry. |
| 190 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
| 190 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
| 191 | 191 | add_action( |
| 192 | 192 | 'frm_filter_final_form', |
| 193 | 193 | /** |
@@ -391,8 +391,8 @@ |
||
| 391 | 391 | return $values; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
| 395 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
| 394 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
| 395 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | $frm_vars['trans_filled'] = true; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | return $html; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $atts = array( |
|
| 42 | + $atts = array( |
|
| 43 | 43 | 'fields' => FrmFieldsHelper::get_form_fields( $form_id ), |
| 44 | 44 | 'entry' => $details['entry'], |
| 45 | 45 | ); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
| 163 | 163 | $opt = 'success_action'; |
| 164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -238,10 +238,10 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public static function get_payment_intents( $name ) { |
| 240 | 240 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 241 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 241 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 242 | 242 | return array(); |
| 243 | 243 | } |
| 244 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 244 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 245 | 245 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 246 | 246 | return $intents; |
| 247 | 247 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | self::format_form_data( $form ); |
| 269 | 269 | |
| 270 | 270 | $form_id = absint( $form['form_id'] ); |
| 271 | - $intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
| 271 | + $intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array(); |
|
| 272 | 272 | |
| 273 | 273 | if ( empty( $intents ) ) { |
| 274 | 274 | wp_die(); |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | $intents = array( $intents ); |
| 279 | 279 | } else { |
| 280 | 280 | foreach ( $intents as $k => $intent ) { |
| 281 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 282 | - $intents[ $k ] = $intent[ $k ]; |
|
| 281 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 282 | + $intents[$k] = $intent[$k]; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -327,12 +327,12 @@ discard block |
||
| 327 | 327 | continue; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - $saved = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id ); |
|
| 330 | + $saved = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id ); |
|
| 331 | 331 | foreach ( $actions as $action ) { |
| 332 | 332 | if ( $saved->metadata->action != $action->ID ) { |
| 333 | 333 | continue; |
| 334 | 334 | } |
| 335 | - $intents[ $k ] = array( |
|
| 335 | + $intents[$k] = array( |
|
| 336 | 336 | 'id' => $intent, |
| 337 | 337 | 'action' => $action->ID, |
| 338 | 338 | ); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | if ( $k === 'item_meta' ) { |
| 376 | 376 | foreach ( $v as $f => $value ) { |
| 377 | 377 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 378 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 378 | + $entry->metas[absint( $f )] = $value; |
|
| 379 | 379 | } |
| 380 | 380 | } else { |
| 381 | 381 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -399,14 +399,14 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | foreach ( $form as $input ) { |
| 401 | 401 | $key = $input['name']; |
| 402 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 403 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 404 | - $formatted[ $key ][] = $input['value']; |
|
| 402 | + if ( isset( $formatted[$key] ) ) { |
|
| 403 | + if ( is_array( $formatted[$key] ) ) { |
|
| 404 | + $formatted[$key][] = $input['value']; |
|
| 405 | 405 | } else { |
| 406 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 406 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 407 | 407 | } |
| 408 | 408 | } else { |
| 409 | - $formatted[ $key ] = $input['value']; |
|
| 409 | + $formatted[$key] = $input['value']; |
|
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | |
| 543 | 543 | foreach ( $actions as $k => $action ) { |
| 544 | 544 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 545 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 545 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | * @return array|false |
| 24 | 24 | */ |
| 25 | 25 | public static function get_details_for_form( $form_id ) { |
| 26 | - if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
|
| 26 | + if ( ! isset( self::$details_by_form_id[$form_id] ) ) { |
|
| 27 | 27 | self::set_details_for_form( (int) $form_id ); |
| 28 | 28 | } |
| 29 | - return isset( self::$details_by_form_id[ $form_id ] ) ? self::$details_by_form_id[ $form_id ] : false; |
|
| 29 | + return isset( self::$details_by_form_id[$form_id] ) ? self::$details_by_form_id[$form_id] : false; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - self::$details_by_form_id[ $form_id ] = array( |
|
| 90 | + self::$details_by_form_id[$form_id] = array( |
|
| 91 | 91 | 'entry' => $entry, |
| 92 | 92 | 'intent' => $intent, |
| 93 | 93 | 'payment' => $payment, |
@@ -311,10 +311,10 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | // Perform add or remove operation |
| 313 | 313 | if ( 'add' === $operation ) { |
| 314 | - self::$favorite_templates[ $key ][ $template_id ] = $template_id; |
|
| 314 | + self::$favorite_templates[$key][$template_id] = $template_id; |
|
| 315 | 315 | } elseif ( 'remove' === $operation ) { |
| 316 | - if ( isset( self::$favorite_templates[ $key ][ $template_id ] ) ) { |
|
| 317 | - unset( self::$favorite_templates[ $key ][ $template_id ] ); |
|
| 316 | + if ( isset( self::$favorite_templates[$key][$template_id] ) ) { |
|
| 317 | + unset( self::$favorite_templates[$key][$template_id] ); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | foreach ( self::$templates as $key => &$template ) { |
| 397 | 397 | // Skip the template if the categories are not set. |
| 398 | 398 | if ( ! isset( $template['categories'] ) ) { |
| 399 | - unset( self::$templates[ $key ] ); |
|
| 399 | + unset( self::$templates[$key] ); |
|
| 400 | 400 | continue; |
| 401 | 401 | } |
| 402 | 402 | |
@@ -410,14 +410,14 @@ discard block |
||
| 410 | 410 | // Add the slug to the new array. |
| 411 | 411 | $template['category_slugs'][] = $category_slug; |
| 412 | 412 | |
| 413 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 414 | - self::$categories[ $category_slug ] = array( |
|
| 413 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 414 | + self::$categories[$category_slug] = array( |
|
| 415 | 415 | 'name' => $category, |
| 416 | 416 | 'count' => 0, |
| 417 | 417 | ); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | - self::$categories[ $category_slug ]['count']++; |
|
| 420 | + self::$categories[$category_slug]['count'] ++; |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | // Add the 'is_favorite' key |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
| 431 | 431 | foreach ( $redundant_cats as $redundant_cat ) { |
| 432 | 432 | $category_slug = sanitize_title( $redundant_cat ); |
| 433 | - unset( self::$categories[ $category_slug ] ); |
|
| 433 | + unset( self::$categories[$category_slug] ); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | // Sort the categories by keys alphabetically. |
@@ -480,9 +480,9 @@ discard block |
||
| 480 | 480 | */ |
| 481 | 481 | private static function assign_featured_templates() { |
| 482 | 482 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
| 483 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 484 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 485 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 483 | + if ( isset( self::$templates[$key] ) ) { |
|
| 484 | + self::$templates[$key]['is_featured'] = true; |
|
| 485 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 486 | 486 | } |
| 487 | 487 | } |
| 488 | 488 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'class' => '', |
| 29 | 29 | 'inc_children' => 'exclude', |
| 30 | 30 | ); |
| 31 | - $args = wp_parse_args( $args, $defaults ); |
|
| 31 | + $args = wp_parse_args( $args, $defaults ); |
|
| 32 | 32 | |
| 33 | 33 | if ( ! $args['field_id'] ) { |
| 34 | 34 | $args['field_id'] = $field_name; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 72 | 72 | if ( ! empty( $class ) ) { |
| 73 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 73 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | 'description' => '', |
| 294 | 294 | ); |
| 295 | 295 | foreach ( $defaults as $var => $default ) { |
| 296 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 297 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 296 | + if ( ! isset( $values[$var] ) ) { |
|
| 297 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | |
@@ -309,8 +309,8 @@ discard block |
||
| 309 | 309 | 'parent_form_id' => 0, |
| 310 | 310 | ); |
| 311 | 311 | foreach ( $defaults as $var => $default ) { |
| 312 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 313 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 312 | + if ( ! isset( $values[$var] ) ) { |
|
| 313 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | unset( $defaults ); |
@@ -347,16 +347,16 @@ discard block |
||
| 347 | 347 | $defaults = self::get_default_opts(); |
| 348 | 348 | foreach ( $defaults as $var => $default ) { |
| 349 | 349 | if ( is_array( $default ) ) { |
| 350 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 351 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
| 350 | + if ( ! isset( $values[$var] ) ) { |
|
| 351 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | foreach ( $default as $k => $v ) { |
| 355 | - $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 ); |
|
| 355 | + $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 ); |
|
| 356 | 356 | |
| 357 | 357 | if ( is_array( $v ) ) { |
| 358 | 358 | foreach ( $v as $k1 => $v1 ) { |
| 359 | - $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 ); |
|
| 359 | + $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 ); |
|
| 360 | 360 | unset( $k1, $v1 ); |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | unset( $k, $v ); |
| 365 | 365 | } |
| 366 | 366 | } else { |
| 367 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
| 367 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | unset( $var, $default ); |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | public static function fill_form_options( &$options, $values ) { |
| 411 | 411 | $defaults = self::get_default_opts(); |
| 412 | 412 | foreach ( $defaults as $var => $default ) { |
| 413 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
| 413 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
| 414 | 414 | unset( $var, $default ); |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | public static function insert_opt_html( $args ) { |
| 586 | 586 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
| 587 | 587 | $fields = FrmField::all_field_selection(); |
| 588 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
| 588 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
| 589 | 589 | |
| 590 | 590 | self::prepare_field_type( $field ); |
| 591 | 591 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | - $add_order += 2; |
|
| 744 | + $add_order += 2; |
|
| 745 | 745 | $open = false; |
| 746 | 746 | $reset_fields = true; |
| 747 | 747 | } |
@@ -1148,10 +1148,10 @@ discard block |
||
| 1148 | 1148 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
| 1152 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1151 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
| 1152 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
| 1153 | 1153 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1154 | - $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
| 1154 | + $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | $link .= '>' . $label . '</a>'; |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | $status = 'publish'; |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | - $name = $nice_names[ $status ]; |
|
| 1299 | + $name = $nice_names[$status]; |
|
| 1300 | 1300 | |
| 1301 | 1301 | return $name; |
| 1302 | 1302 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | $icon = $icons['']; |
| 1361 | 1361 | if ( count( $categories ) === 1 ) { |
| 1362 | 1362 | $category = reset( $categories ); |
| 1363 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
| 1363 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
| 1364 | 1364 | } elseif ( ! empty( $categories ) ) { |
| 1365 | 1365 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1366 | 1366 | $icon = reset( $icons ); |
@@ -1496,7 +1496,7 @@ discard block |
||
| 1496 | 1496 | |
| 1497 | 1497 | foreach ( $item['categories'] as $k => $category ) { |
| 1498 | 1498 | if ( in_array( $category, $plans, true ) ) { |
| 1499 | - unset( $item['categories'][ $k ] ); |
|
| 1499 | + unset( $item['categories'][$k] ); |
|
| 1500 | 1500 | |
| 1501 | 1501 | if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) { |
| 1502 | 1502 | // Show the current package name. |
@@ -1698,9 +1698,9 @@ discard block |
||
| 1698 | 1698 | } |
| 1699 | 1699 | |
| 1700 | 1700 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1701 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1701 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1702 | 1702 | |
| 1703 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1703 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1704 | 1704 | // Skip if shortcodes. |
| 1705 | 1705 | continue; |
| 1706 | 1706 | } |
@@ -1710,7 +1710,7 @@ discard block |
||
| 1710 | 1710 | continue; |
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1713 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1714 | 1714 | if ( $options ) { |
| 1715 | 1715 | $new_shortcode .= ' ' . $options; |
| 1716 | 1716 | } |