@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @return void |
| 60 | 60 | */ |
| 61 | 61 | public function set( $key, $value ) { |
| 62 | - $this->state[ $key ] = $value; |
|
| 62 | + $this->state[$key] = $value; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public function get( $key, $default ) { |
| 78 | - if ( isset( $this->state[ $key ] ) ) { |
|
| 79 | - return $this->state[ $key ]; |
|
| 78 | + if ( isset( $this->state[$key] ) ) { |
|
| 79 | + return $this->state[$key]; |
|
| 80 | 80 | } |
| 81 | 81 | return $default; |
| 82 | 82 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | private function compressed_state() { |
| 172 | 172 | $compressed = array(); |
| 173 | 173 | foreach ( $this->state as $key => $value ) { |
| 174 | - $compressed[ self::compressed_key( $key ) ] = $value; |
|
| 174 | + $compressed[self::compressed_key( $key )] = $value; |
|
| 175 | 175 | } |
| 176 | 176 | return $compressed; |
| 177 | 177 | } |
@@ -240,26 +240,26 @@ discard block |
||
| 240 | 240 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
| 241 | 241 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 242 | 242 | if ( ! $action || ! is_object( $action ) ) { |
| 243 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
| 244 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
| 243 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
| 244 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
| 245 | 245 | |
| 246 | 246 | return; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
| 249 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
| 250 | 250 | |
| 251 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
| 251 | + switch ( $form_options[$opt . 'action'] ) { |
|
| 252 | 252 | case 'redirect': |
| 253 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
| 253 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
| 254 | 254 | $form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] ); |
| 255 | 255 | break; |
| 256 | 256 | |
| 257 | 257 | case 'page': |
| 258 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
| 258 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
| 259 | 259 | break; |
| 260 | 260 | |
| 261 | 261 | default: |
| 262 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 262 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
| 263 | 263 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
| 264 | 264 | } |
| 265 | 265 | } |
@@ -348,20 +348,20 @@ discard block |
||
| 348 | 348 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
| 349 | 349 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
| 350 | 350 | $data = array( |
| 351 | - 'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(), |
|
| 351 | + 'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(), |
|
| 352 | 352 | ); |
| 353 | 353 | |
| 354 | 354 | switch ( $data['success_action'] ) { |
| 355 | 355 | case 'redirect': |
| 356 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
| 356 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
| 357 | 357 | break; |
| 358 | 358 | |
| 359 | 359 | case 'page': |
| 360 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
| 360 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
| 361 | 361 | break; |
| 362 | 362 | |
| 363 | 363 | default: |
| 364 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg(); |
|
| 364 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg(); |
|
| 365 | 365 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
| 366 | 366 | } |
| 367 | 367 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - return $addons[ $addon_id ]; |
|
| 79 | + return $addons[$addon_id]; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | 'sort' => '', |
| 101 | 101 | 'sdir' => '', |
| 102 | 102 | ) as $var => $default ) { |
| 103 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default ); |
|
| 103 | + $values[$var] = FrmAppHelper::get_param( $var, $default ); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | return $values; |
@@ -84,8 +84,8 @@ |
||
| 84 | 84 | $settings = $this->default_options(); |
| 85 | 85 | |
| 86 | 86 | foreach ( $settings as $setting => $default ) { |
| 87 | - if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) { |
|
| 88 | - $this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ); |
|
| 87 | + if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) { |
|
| 88 | + $this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) ); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | $has_field = true; |
| 166 | 166 | $key_exists = array_key_exists( $field_atts['name'], $form_atts['form_action']->post_content ); |
| 167 | 167 | ?> |
| 168 | - <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[ $field_atts['name'] ] : 0, $field->id ); ?>> |
|
| 168 | + <option value="<?php echo esc_attr( $field->id ); ?>" <?php selected( $key_exists ? $form_atts['form_action']->post_content[$field_atts['name']] : 0, $field->id ); ?>> |
|
| 169 | 169 | <?php echo esc_attr( FrmAppHelper::truncate( $field->name, 50, 1 ) ); ?> |
| 170 | 170 | </option> |
| 171 | 171 | <?php |
@@ -34,10 +34,10 @@ |
||
| 34 | 34 | * @return string[] An empty array is treated as automatic. |
| 35 | 35 | */ |
| 36 | 36 | public static function get_payment_method_types( $action ) { |
| 37 | - if ( ! isset( self::$types_by_action_id[ $action->ID ] ) ) { |
|
| 38 | - self::$types_by_action_id[ $action->ID ] = self::get_filtered_payment_method_types( $action ); |
|
| 37 | + if ( ! isset( self::$types_by_action_id[$action->ID] ) ) { |
|
| 38 | + self::$types_by_action_id[$action->ID] = self::get_filtered_payment_method_types( $action ); |
|
| 39 | 39 | } |
| 40 | - return self::$types_by_action_id[ $action->ID ]; |
|
| 40 | + return self::$types_by_action_id[$action->ID]; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -261,14 +261,14 @@ |
||
| 261 | 261 | private function fill_values( $values, &$new_values ) { |
| 262 | 262 | $defaults = $this->get_defaults(); |
| 263 | 263 | foreach ( $defaults as $val => $default ) { |
| 264 | - if ( isset( $values[ $val ] ) ) { |
|
| 264 | + if ( isset( $values[$val] ) ) { |
|
| 265 | 265 | if ( $default['sanitize'] === 'float' ) { |
| 266 | - $new_values[ $val ] = (float) $values[ $val ]; |
|
| 266 | + $new_values[$val] = (float) $values[$val]; |
|
| 267 | 267 | } elseif ( ! empty( $default['sanitize'] ) ) { |
| 268 | - $new_values[ $val ] = call_user_func( $default['sanitize'], $values[ $val ] ); |
|
| 268 | + $new_values[$val] = call_user_func( $default['sanitize'], $values[$val] ); |
|
| 269 | 269 | } |
| 270 | 270 | } elseif ( $values['action'] === 'create' ) { |
| 271 | - $new_values[ $val ] = $default['default']; |
|
| 271 | + $new_values[$val] = $default['default']; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'canceled' => __( 'Canceled', 'formidable' ), |
| 70 | 70 | 'confirm' => __( 'Are you sure you want to cancel that subscription?', 'formidable' ), |
| 71 | 71 | ); |
| 72 | - $atts = array_merge( $defaults, $atts ); |
|
| 72 | + $atts = array_merge( $defaults, $atts ); |
|
| 73 | 73 | |
| 74 | 74 | if ( $sub->status === 'active' ) { |
| 75 | 75 | $link = admin_url( 'admin-ajax.php?action=frm_trans_cancel&sub=' . $sub->id . '&nonce=' . wp_create_nonce( 'frm_trans_ajax' ) ); |