@@ -58,7 +58,7 @@ |
||
| 58 | 58 | protected function get_field_value( $args ) { |
| 59 | 59 | $user_ID = get_current_user_id(); |
| 60 | 60 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 61 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 61 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 62 | 62 | $action = ( isset( $args['action'] ) ? $args['action'] : ( isset( $args['form_action'] ) ? $args['form_action'] : '' ) ); |
| 63 | 63 | $updating = $action === 'update'; |
| 64 | 64 | return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if ( $new_val !== $value ) { |
| 212 | - $new_values[ $key ] = $new_val; |
|
| 212 | + $new_values[$key] = $new_val; |
|
| 213 | 213 | } |
| 214 | 214 | }//end foreach |
| 215 | 215 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | foreach ( $values as $value_key => $value ) { |
| 242 | 242 | if ( $value_key && in_array( $value_key, $form_fields ) ) { |
| 243 | - $new_values[ $value_key ] = $value; |
|
| 243 | + $new_values[$value_key] = $value; |
|
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
@@ -323,15 +323,15 @@ discard block |
||
| 323 | 323 | $existing_keys = array_keys( $values['item_meta'] ); |
| 324 | 324 | foreach ( $all_fields as $fid ) { |
| 325 | 325 | if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) { |
| 326 | - $values['item_meta'][ $fid->id ] = ''; |
|
| 326 | + $values['item_meta'][$fid->id] = ''; |
|
| 327 | 327 | } |
| 328 | - $field_array[ $fid->id ] = $fid; |
|
| 328 | + $field_array[$fid->id] = $fid; |
|
| 329 | 329 | } |
| 330 | 330 | unset( $all_fields ); |
| 331 | 331 | |
| 332 | 332 | foreach ( $values['item_meta'] as $field_id => $default_value ) { |
| 333 | - if ( isset( $field_array[ $field_id ] ) ) { |
|
| 334 | - $field = $field_array[ $field_id ]; |
|
| 333 | + if ( isset( $field_array[$field_id] ) ) { |
|
| 334 | + $field = $field_array[$field_id]; |
|
| 335 | 335 | } else { |
| 336 | 336 | $field = FrmField::getOne( $field_id ); |
| 337 | 337 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | continue; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) ); |
|
| 343 | + $is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) ); |
|
| 344 | 344 | if ( $is_settings_page ) { |
| 345 | 345 | self::get_settings_page_html( $values, $field ); |
| 346 | 346 | |
@@ -356,22 +356,22 @@ discard block |
||
| 356 | 356 | $update_options = apply_filters( 'frm_field_options_to_update', $update_options ); |
| 357 | 357 | |
| 358 | 358 | foreach ( $update_options as $opt => $default ) { |
| 359 | - $field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default; |
|
| 360 | - self::sanitize_field_opt( $opt, $field->field_options[ $opt ] ); |
|
| 359 | + $field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default; |
|
| 360 | + self::sanitize_field_opt( $opt, $field->field_options[$opt] ); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | $field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values ); |
| 364 | 364 | |
| 365 | 365 | $new_field = array( |
| 366 | 366 | 'field_options' => $field->field_options, |
| 367 | - 'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '', |
|
| 367 | + 'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '', |
|
| 368 | 368 | ); |
| 369 | 369 | |
| 370 | - if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) { |
|
| 371 | - foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) { |
|
| 370 | + if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) { |
|
| 371 | + foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) { |
|
| 372 | 372 | if ( is_array( $option ) ) { |
| 373 | 373 | foreach ( $option as $key => $item ) { |
| 374 | - $values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' ); |
|
| 374 | + $values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' ); |
|
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | } |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | private static function maybe_update_max_option( $field, $values, &$new_field ) { |
| 403 | 403 | if ( $field->type === 'textarea' && |
| 404 | - ! empty( $values['field_options'][ 'type_' . $field->id ] ) && |
|
| 405 | - in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) { |
|
| 404 | + ! empty( $values['field_options']['type_' . $field->id] ) && |
|
| 405 | + in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) { |
|
| 406 | 406 | |
| 407 | 407 | $new_field['field_options']['max'] = ''; |
| 408 | 408 | |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads. |
| 411 | 411 | * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting. |
| 412 | 412 | */ |
| 413 | - $_POST['field_options'][ 'max_' . $field->id ] = ''; |
|
| 413 | + $_POST['field_options']['max_' . $field->id] = ''; |
|
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
@@ -486,11 +486,11 @@ discard block |
||
| 486 | 486 | * Updating the settings page |
| 487 | 487 | */ |
| 488 | 488 | private static function get_settings_page_html( $values, &$field ) { |
| 489 | - if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) { |
|
| 489 | + if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) { |
|
| 490 | 490 | $prev_opts = array(); |
| 491 | 491 | $fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type ); |
| 492 | 492 | |
| 493 | - $field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html; |
|
| 493 | + $field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html; |
|
| 494 | 494 | } elseif ( $field->type === 'hidden' || $field->type === 'user_id' ) { |
| 495 | 495 | $prev_opts = $field->field_options; |
| 496 | 496 | } |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | foreach ( $field_cols as $col => $default ) { |
| 517 | 517 | $default = $default === '' ? $field->{$col} : $default; |
| 518 | 518 | |
| 519 | - $new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default; |
|
| 519 | + $new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default; |
|
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | // Don't save the template option. |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | if ( ! isset( $form->options['trash_time'] ) || $form->options['trash_time'] < $delete_timestamp ) { |
| 697 | 697 | self::destroy( $form->id ); |
| 698 | 698 | if ( empty( $form->parent_form_id ) ) { |
| 699 | - ++$count; |
|
| 699 | + ++ $count; |
|
| 700 | 700 | } |
| 701 | 701 | } |
| 702 | 702 | |
@@ -920,16 +920,16 @@ discard block |
||
| 920 | 920 | foreach ( $results as $row ) { |
| 921 | 921 | if ( 'trash' != $row->status ) { |
| 922 | 922 | if ( $row->is_template ) { |
| 923 | - ++$counts['template']; |
|
| 923 | + ++ $counts['template']; |
|
| 924 | 924 | } else { |
| 925 | - ++$counts['published']; |
|
| 925 | + ++ $counts['published']; |
|
| 926 | 926 | } |
| 927 | 927 | } else { |
| 928 | - ++$counts['trash']; |
|
| 928 | + ++ $counts['trash']; |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | if ( 'draft' == $row->status ) { |
| 932 | - ++$counts['draft']; |
|
| 932 | + ++ $counts['draft']; |
|
| 933 | 933 | } |
| 934 | 934 | |
| 935 | 935 | unset( $row ); |
@@ -970,8 +970,8 @@ discard block |
||
| 970 | 970 | self::maybe_get_form( $form ); |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | - if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) { |
|
| 974 | - return $frm_vars['form_params'][ $form->id ]; |
|
| 973 | + if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) { |
|
| 974 | + return $frm_vars['form_params'][$form->id]; |
|
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | $action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1000,15 +1000,15 @@ discard block |
||
| 1000 | 1000 | // If there are two forms on the same page, make sure not to submit both. |
| 1001 | 1001 | foreach ( $default_values as $var => $default ) { |
| 1002 | 1002 | if ( $var === 'action' ) { |
| 1003 | - $values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 1003 | + $values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' ); |
|
| 1004 | 1004 | } else { |
| 1005 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1005 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1006 | 1006 | } |
| 1007 | 1007 | unset( $var, $default ); |
| 1008 | 1008 | } |
| 1009 | 1009 | } else { |
| 1010 | 1010 | foreach ( $default_values as $var => $default ) { |
| 1011 | - $values[ $var ] = $default; |
|
| 1011 | + $values[$var] = $default; |
|
| 1012 | 1012 | unset( $var, $default ); |
| 1013 | 1013 | } |
| 1014 | 1014 | } |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | 'sdir' => '', |
| 1035 | 1035 | ); |
| 1036 | 1036 | foreach ( $defaults as $var => $default ) { |
| 1037 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1037 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | 1040 | return $values; |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | 'keep_post' => '', |
| 1063 | 1063 | ); |
| 1064 | 1064 | foreach ( $defaults as $var => $default ) { |
| 1065 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1065 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 1066 | 1066 | } |
| 1067 | 1067 | |
| 1068 | 1068 | return $values; |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | $form = $atts['form']; |
| 1166 | 1166 | $default = isset( $atts['default'] ) ? $atts['default'] : ''; |
| 1167 | 1167 | |
| 1168 | - return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default; |
|
| 1168 | + return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | /** |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | foreach ( $settings as $setting => $default ) { |
| 232 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
| 233 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
| 232 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
| 233 | + $this->{$setting} = $params['frm_' . $setting]; |
|
| 234 | 234 | } elseif ( ! isset( $this->{$setting} ) ) { |
| 235 | 235 | $this->{$setting} = $default; |
| 236 | 236 | } |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' ); |
| 409 | 409 | foreach ( $checkboxes as $set ) { |
| 410 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0; |
|
| 410 | + $this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0; |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 421 | 421 | $roles = get_editable_roles(); |
| 422 | 422 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 423 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
| 423 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
| 424 | 424 | |
| 425 | 425 | // Make sure administrators always have permissions |
| 426 | 426 | if ( ! in_array( 'administrator', $this->$frm_role, true ) ) { |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | $field_val = ''; |
| 150 | 150 | if ( is_object( $this->field ) ) { |
| 151 | 151 | $field_val = $this->field->{$column}; |
| 152 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
| 153 | - $field_val = $this->field[ $column ]; |
|
| 152 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
| 153 | + $field_val = $this->field[$column]; |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | return $field_val; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | if ( is_object( $this->field ) ) { |
| 165 | 165 | $this->field->{$column} = $value; |
| 166 | 166 | } elseif ( is_array( $this->field ) ) { |
| 167 | - $this->field[ $column ] = $value; |
|
| 167 | + $this->field[$column] = $value; |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | printf( |
| 599 | 599 | /* translators: %s: Field type */ |
| 600 | 600 | esc_html__( '%s Options', 'formidable' ), |
| 601 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
| 601 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
| 602 | 602 | ); |
| 603 | 603 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
| 604 | 604 | ?> |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | * New field |
| 675 | 675 | */ |
| 676 | 676 | public function get_new_field_defaults() { |
| 677 | - $field = array( |
|
| 677 | + $field = array( |
|
| 678 | 678 | 'name' => $this->get_new_field_name(), |
| 679 | 679 | 'description' => '', |
| 680 | 680 | 'type' => $this->type, |
@@ -705,8 +705,8 @@ discard block |
||
| 705 | 705 | |
| 706 | 706 | $fields = array_merge( $fields, $pro_fields ); |
| 707 | 707 | |
| 708 | - if ( isset( $fields[ $this->type ] ) ) { |
|
| 709 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
| 708 | + if ( isset( $fields[$this->type] ) ) { |
|
| 709 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | return $name; |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | * @return array |
| 724 | 724 | */ |
| 725 | 725 | public function get_default_field_options() { |
| 726 | - $opts = array( |
|
| 726 | + $opts = array( |
|
| 727 | 727 | 'size' => '', |
| 728 | 728 | 'max' => '', |
| 729 | 729 | 'label' => '', |
@@ -1144,8 +1144,8 @@ discard block |
||
| 1144 | 1144 | $selected = $values['field_value']; |
| 1145 | 1145 | |
| 1146 | 1146 | if ( isset( $values['combo_name'] ) ) { |
| 1147 | - $options = $options[ $values['combo_name'] ]; |
|
| 1148 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
| 1147 | + $options = $options[$values['combo_name']]; |
|
| 1148 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | $input = $this->select_tag( $values ); |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | 1198 | protected function fill_display_field_values( $args = array() ) { |
| 1199 | - $defaults = array( |
|
| 1199 | + $defaults = array( |
|
| 1200 | 1200 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
| 1201 | 1201 | 'field_id' => $this->get_field_column( 'id' ), |
| 1202 | 1202 | 'field_plus_id' => '', |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | } |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
| 1252 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
| 1253 | 1253 | if ( $error_comes_first ) { |
| 1254 | 1254 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
| 1255 | 1255 | } else { |
@@ -1328,11 +1328,11 @@ discard block |
||
| 1328 | 1328 | |
| 1329 | 1329 | $field_id = $this->get_field_column( 'id' ); |
| 1330 | 1330 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
| 1331 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
| 1331 | + $frm_validated_unique_values[$field_id] = array(); |
|
| 1332 | 1332 | return false; |
| 1333 | 1333 | } |
| 1334 | 1334 | |
| 1335 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
| 1335 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
| 1336 | 1336 | return $already_validated_this_value; |
| 1337 | 1337 | } |
| 1338 | 1338 | |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | private function value_validated_as_unique( $value ) { |
| 1358 | 1358 | global $frm_validated_unique_values; |
| 1359 | 1359 | $field_id = $this->get_field_column( 'id' ); |
| 1360 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
| 1360 | + $frm_validated_unique_values[$field_id][] = $value; |
|
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | public function get_value_to_save( $value, $atts ) { |
@@ -1393,8 +1393,8 @@ discard block |
||
| 1393 | 1393 | $value = $this->prepare_display_value( $value, $atts ); |
| 1394 | 1394 | |
| 1395 | 1395 | if ( is_array( $value ) ) { |
| 1396 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
| 1397 | - $value = $value[ $atts['show'] ]; |
|
| 1396 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
| 1397 | + $value = $value[$atts['show']]; |
|
| 1398 | 1398 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
| 1399 | 1399 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
| 1400 | 1400 | $value = implode( $sep, $value ); |
@@ -1524,8 +1524,8 @@ discard block |
||
| 1524 | 1524 | $saved_entries = $atts['ids']; |
| 1525 | 1525 | $new_value = array(); |
| 1526 | 1526 | foreach ( (array) $value as $old_child_id ) { |
| 1527 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
| 1528 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
| 1527 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
| 1528 | + $new_value[] = $saved_entries[$old_child_id]; |
|
| 1529 | 1529 | } |
| 1530 | 1530 | } |
| 1531 | 1531 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $page = $this->get_pagenum(); |
| 24 | 24 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
| 25 | 25 | |
| 26 | - $mode = self::get_param( |
|
| 26 | + $mode = self::get_param( |
|
| 27 | 27 | array( |
| 28 | 28 | 'param' => 'mode', |
| 29 | 29 | 'default' => 'list', |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | 'default' => 'name', |
| 36 | 36 | ) |
| 37 | 37 | ); |
| 38 | - $order = self::get_param( |
|
| 38 | + $order = self::get_param( |
|
| 39 | 39 | array( |
| 40 | 40 | 'param' => 'order', |
| 41 | 41 | 'default' => 'ASC', |
| 42 | 42 | ) |
| 43 | 43 | ); |
| 44 | - $start = self::get_param( |
|
| 44 | + $start = self::get_param( |
|
| 45 | 45 | array( |
| 46 | 46 | 'param' => 'start', |
| 47 | 47 | 'default' => ( $page - 1 ) * $per_page, |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $counts = FrmForm::get_count(); |
| 174 | 174 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
| 175 | 175 | |
| 176 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
| 176 | + if ( isset( $statuses[$form_type] ) ) { |
|
| 177 | 177 | $counts->$form_type = $this->total_items; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | if ( $counts->{$status} || 'draft' !== $status ) { |
| 196 | 196 | /* translators: %1$s: Status, %2$s: Number of items */ |
| 197 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 197 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | unset( $status, $name ); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | private function get_actions( &$actions, $item, $edit_link ) { |
| 376 | 376 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
| 377 | 377 | foreach ( $new_actions as $link => $action ) { |
| 378 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 378 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | if ( 'trash' === $this->status ) { |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | if ( FrmAppHelper::is_admin_page( 'formidable-settings' ) ) { |
| 1278 | 1278 | add_action( |
| 1279 | 1279 | 'frm_update_settings', |
| 1280 | - function ( $params ) { |
|
| 1280 | + function( $params ) { |
|
| 1281 | 1281 | if ( ! empty( $params['frm_use_html'] ) ) { |
| 1282 | 1282 | $inbox = new FrmInbox(); |
| 1283 | 1283 | $inbox->dismiss( 'deprecated_use_html' ); |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | * @param array $messages |
| 1297 | 1297 | * @return array |
| 1298 | 1298 | */ |
| 1299 | - function ( $messages ) use ( $url ) { |
|
| 1299 | + function( $messages ) use ( $url ) { |
|
| 1300 | 1300 | $messages[] = '<p>The option to use HTML5 in forms is currently disabled. In a future release, this setting will be removed and using HTML5 will be a requirement. <a href="' . esc_url( $url ) . '">Click here to enable it in Global Settings now</a>.</p>'; |
| 1301 | 1301 | return $messages; |
| 1302 | 1302 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param array $keys |
| 39 | 39 | */ |
| 40 | - self::$keys = apply_filters( |
|
| 40 | + self::$keys = apply_filters( |
|
| 41 | 41 | 'frm_application_data_keys', |
| 42 | 42 | array( 'key', 'name', 'description', 'link', 'categories', 'views', 'forms' ) |
| 43 | 43 | ); |
@@ -119,20 +119,20 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $application = array(); |
| 121 | 121 | foreach ( self::$keys as $key ) { |
| 122 | - if ( ! isset( $this->api_data[ $key ] ) ) { |
|
| 122 | + if ( ! isset( $this->api_data[$key] ) ) { |
|
| 123 | 123 | continue; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - $value = $this->api_data[ $key ]; |
|
| 126 | + $value = $this->api_data[$key]; |
|
| 127 | 127 | |
| 128 | 128 | if ( 'icon' === $key ) { |
| 129 | 129 | // Icon is an array. The first array item is the image URL. |
| 130 | - $application[ $key ] = reset( $value ); |
|
| 130 | + $application[$key] = reset( $value ); |
|
| 131 | 131 | } elseif ( 'categories' === $key ) { |
| 132 | - $application[ $key ] = array_values( |
|
| 132 | + $application[$key] = array_values( |
|
| 133 | 133 | array_filter( |
| 134 | 134 | $value, |
| 135 | - function ( $category ) { |
|
| 135 | + function( $category ) { |
|
| 136 | 136 | return false === strpos( $category, '+Views' ); |
| 137 | 137 | } |
| 138 | 138 | ) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | // Strip off the " Template" text at the end of the name as it takes up space. |
| 149 | 149 | $value = substr( $value, 0, -9 ); |
| 150 | 150 | } |
| 151 | - $application[ $key ] = $value; |
|
| 151 | + $application[$key] = $value; |
|
| 152 | 152 | }//end if |
| 153 | 153 | }//end foreach |
| 154 | 154 | |