| @@ -58,9 +58,9 @@ | ||
| 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 | 61 | $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 62 | - $action = ( $args['action'] ?? $args['form_action'] ?? '' ); | |
| 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; |
| 65 | 65 | } |
| 66 | 66 | |
| @@ -133,11 +133,7 @@ | ||
| 133 | 133 | * |
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | 136 | public function sanitize_value( &$value ) { |
| 137 | - if ( '' === $value ) { | |
| 138 | - // Allow for an empty User ID. Return early to prevent it from getting set to 0. | |
| 139 | - return; | |
| 140 | - } | |
| 141 | 137 | FrmAppHelper::sanitize_value( 'intval', $value ); |
| 142 | 138 | } |
| 143 | 139 | } |