# give/4.16.9/src/FormBuilder/Actions/UpdateDonorCommentsMeta.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 24 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/FormBuilder/Actions/UpdateDonorCommentsMeta.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/FormBuilder/Actions/UpdateDonorCommentsMeta.php
- Modified: 2023-10-16T17:55:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/FormBuilder/Actions/UpdateDonorCommentsMeta.php#L10-L20`.

```php
<?php

namespace Give\FormBuilder\Actions;

use Give\DonationForms\Models\DonationForm;

/**
 * Update donor comments meta on backwards compatible form meta.
 *
 * @since 3.0.0
 */
class UpdateDonorCommentsMeta
{
    /**
     * @since 3.0.0
     */
    public function __invoke(DonationForm $form)
    {
        if ($form->blocks->findByName('givewp/donor-comments') && !give_is_donor_comment_field_enabled($form->id)) {
            give()->form_meta->update_meta($form->id, '_give_donor_comment', 'enabled');
        }
    }
}

```
