@@ -1356,15 +1356,15 @@ discard block |
||
| 1356 | 1356 | global $wp_filter; |
| 1357 | 1357 | |
| 1358 | 1358 | foreach ( $actions as $action ) { |
| 1359 | - if ( empty( $wp_filter[ $action ]->callbacks ) ) { |
|
| 1359 | + if ( empty( $wp_filter[$action]->callbacks ) ) { |
|
| 1360 | 1360 | continue; |
| 1361 | 1361 | } |
| 1362 | - foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) { |
|
| 1362 | + foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) { |
|
| 1363 | 1363 | foreach ( $callbacks as $callback_name => $callback ) { |
| 1364 | 1364 | if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) { |
| 1365 | 1365 | continue; |
| 1366 | 1366 | } |
| 1367 | - unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] ); |
|
| 1367 | + unset( $wp_filter[$action]->callbacks[$priority][$callback_name] ); |
|
| 1368 | 1368 | } |
| 1369 | 1369 | } |
| 1370 | 1370 | } |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | * @return void |
| 1377 | 1377 | */ |
| 1378 | 1378 | private static function remember_custom_sort() { |
| 1379 | - $screen = get_current_screen(); |
|
| 1379 | + $screen = get_current_screen(); |
|
| 1380 | 1380 | if ( ! $screen ) { |
| 1381 | 1381 | return; |
| 1382 | 1382 | } |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | foreach ( $pro_fields as $field_key => $field_type ) { |
| 77 | 77 | |
| 78 | 78 | if ( isset( $field_type['section'] ) ) { |
| 79 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
|
| 80 | - $field_sections[ $field_type['section'] ] = array(); |
|
| 79 | + if ( ! isset( $field_sections[$field_type['section']] ) ) { |
|
| 80 | + $field_sections[$field_type['section']] = array(); |
|
| 81 | 81 | } |
| 82 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
|
| 82 | + $field_sections[$field_type['section']][$field_key] = $field_type; |
|
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -322,11 +322,11 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | // Perform add or remove operation. |
| 324 | 324 | if ( 'add' === $operation ) { |
| 325 | - self::$favorite_templates[ $key ][] = $template_id; |
|
| 325 | + self::$favorite_templates[$key][] = $template_id; |
|
| 326 | 326 | } elseif ( 'remove' === $operation ) { |
| 327 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
| 327 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
| 328 | 328 | if ( $position !== false ) { |
| 329 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
| 329 | + unset( self::$favorite_templates[$key][$position] ); |
|
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | foreach ( self::$templates as $key => &$template ) { |
| 456 | 456 | // Skip the template if the categories are not set. |
| 457 | 457 | if ( ! isset( $template['categories'] ) || ! isset( $template['id'] ) ) { |
| 458 | - unset( self::$templates[ $key ] ); |
|
| 458 | + unset( self::$templates[$key] ); |
|
| 459 | 459 | continue; |
| 460 | 460 | } |
| 461 | 461 | |
@@ -469,14 +469,12 @@ discard block |
||
| 469 | 469 | // Add the slug to the new array. |
| 470 | 470 | $template['category_slugs'][] = $category_slug; |
| 471 | 471 | |
| 472 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 473 | - self::$categories[ $category_slug ] = array( |
|
| 472 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 473 | + self::$categories[$category_slug] = array( |
|
| 474 | 474 | 'name' => $category, |
| 475 | 475 | 'count' => 0, |
| 476 | 476 | ); |
| 477 | - } |
|
| 478 | - |
|
| 479 | - ++self::$categories[ $category_slug ]['count']; |
|
| 477 | + } ++self::$categories[$category_slug]['count']; |
|
| 480 | 478 | } |
| 481 | 479 | |
| 482 | 480 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -491,7 +489,7 @@ discard block |
||
| 491 | 489 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::get_license_types() ); |
| 492 | 490 | foreach ( $redundant_cats as $redundant_cat ) { |
| 493 | 491 | $category_slug = sanitize_title( $redundant_cat ); |
| 494 | - unset( self::$categories[ $category_slug ] ); |
|
| 492 | + unset( self::$categories[$category_slug] ); |
|
| 495 | 493 | } |
| 496 | 494 | |
| 497 | 495 | // Sort the categories by keys alphabetically. |
@@ -516,7 +514,7 @@ discard block |
||
| 516 | 514 | 'count' => 0, |
| 517 | 515 | ); |
| 518 | 516 | } |
| 519 | - $special_categories['all-items'] = array( |
|
| 517 | + $special_categories['all-items'] = array( |
|
| 520 | 518 | 'name' => __( 'All Templates', 'formidable' ), |
| 521 | 519 | 'count' => self::get_template_count(), |
| 522 | 520 | ); |
@@ -539,9 +537,9 @@ discard block |
||
| 539 | 537 | */ |
| 540 | 538 | private static function assign_featured_templates() { |
| 541 | 539 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
| 542 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 543 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 544 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 540 | + if ( isset( self::$templates[$key] ) ) { |
|
| 541 | + self::$templates[$key]['is_featured'] = true; |
|
| 542 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 545 | 543 | } |
| 546 | 544 | } |
| 547 | 545 | } |
@@ -172,7 +172,7 @@ |
||
| 172 | 172 | |
| 173 | 173 | if ( ! $required && empty( $args['value'] ) ) { |
| 174 | 174 | $frm_settings = FrmAppHelper::get_settings(); |
| 175 | - $errors[ 'field' . $args['id'] ] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
| 175 | + $errors['field' . $args['id']] = str_replace( '[field_name]', is_object( $this->field ) ? $this->field->name : $this->field['name'], $frm_settings->blank_msg ); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | foreach ( $skipped_keys as $skipped_key ) { |
| 129 | - unset( $data[ $skipped_key ] ); |
|
| 129 | + unset( $data[$skipped_key] ); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $data; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | foreach ( $pass_settings as $setting ) { |
| 226 | 226 | if ( isset( $settings_list->$setting ) ) { |
| 227 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
| 227 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | $message_settings = array(); |
| 262 | 262 | foreach ( $messages as $message ) { |
| 263 | - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1; |
|
| 263 | + $message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | return $message_settings; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 282 | 282 | if ( isset( $settings_list->$frm_role ) ) { |
| 283 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
| 283 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | foreach ( $settings as $setting ) { |
| 354 | - if ( isset( $form->options[ $setting ] ) ) { |
|
| 354 | + if ( isset( $form->options[$setting] ) ) { |
|
| 355 | 355 | if ( 'custom_style' === $setting ) { |
| 356 | - $style->id = $form->options[ $setting ]; |
|
| 356 | + $style->id = $form->options[$setting]; |
|
| 357 | 357 | |
| 358 | 358 | if ( ! $style->id ) { |
| 359 | 359 | $style_name = 0; |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | $style_name = $style_post ? $style_post->post_name : 'formidable-style'; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - $new_form[ $setting ] = $style_name; |
|
| 367 | + $new_form[$setting] = $style_name; |
|
| 368 | 368 | } else { |
| 369 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
| 369 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $fields = FrmDb::get_results( 'frm_fields', array(), 'id, form_id, name, type, field_options', $args ); |
| 427 | 427 | foreach ( $fields as $k => $field ) { |
| 428 | 428 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
| 429 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
| 429 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
| 430 | 430 | } |
| 431 | 431 | return $fields; |
| 432 | 432 | } |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | * @return object|string |
| 161 | 161 | */ |
| 162 | 162 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 163 | - $body = array( |
|
| 163 | + $body = array( |
|
| 164 | 164 | 'frm_square_api_action' => $action, |
| 165 | 165 | 'frm_square_api_mode' => FrmSquareLiteAppHelper::active_mode(), |
| 166 | 166 | ); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $form = $this->get_form(); |
| 52 | - return ! empty( $form->options[ $key ] ) && 'off' !== $form->options[ $key ]; |
|
| 52 | + return ! empty( $form->options[$key] ) && 'off' !== $form->options[$key]; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | 'default' => 'id', |
| 97 | 97 | ) |
| 98 | 98 | ); |
| 99 | - $order = self::get_param( |
|
| 99 | + $order = self::get_param( |
|
| 100 | 100 | array( |
| 101 | 101 | 'param' => 'order', |
| 102 | 102 | 'default' => 'DESC', |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $form_ids = $this->get_form_ids( $form_id ); |
| 149 | 149 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
| 150 | 150 | } else { |
| 151 | - $s_query[] = array( |
|
| 151 | + $s_query[] = array( |
|
| 152 | 152 | 'or' => 1, |
| 153 | 153 | 'parent_form_id' => null, |
| 154 | 154 | 'parent_form_id <' => 1, |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 317 | 317 | |
| 318 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
| 318 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
| 319 | 319 | $action_col = false; |
| 320 | 320 | $action_columns = $this->get_action_columns(); |
| 321 | 321 | |
@@ -29,10 +29,10 @@ |
||
| 29 | 29 | // This filter hides gateway fields from the entries list. |
| 30 | 30 | add_filter( |
| 31 | 31 | 'frm_fields_in_entries_list_table', |
| 32 | - function ( $form_cols ) { |
|
| 32 | + function( $form_cols ) { |
|
| 33 | 33 | return array_filter( |
| 34 | 34 | $form_cols, |
| 35 | - function ( $form_col ) { |
|
| 35 | + function( $form_col ) { |
|
| 36 | 36 | return 'gateway' !== $form_col->type; |
| 37 | 37 | } |
| 38 | 38 | ); |