impress-org/givewp-snippet-library

fix(snippet): update custom field snippet

Closed this issue · 3 comments

User Story

As a Give developer, I want an up-to-date example of how to programmatically add a custom field so that it ends up in post meta like any other custom field.

Acceptance Criteria

  • The add_post_meta call has been changed to give_update_payment_meta in the snippet.
  • The snippet has been tested and confirmed that its post meta is stored correctly in the database.
  • The custom field is visible in Donation Details screen.
  • The custom field appears on Donation Confirmation page.
  • The custom field is available for export in Tools > Exporter
  • The custom field is available for Email Tags
  • Support team has been notified that the snippet is ready.

Related

Tasks

  1. Review the [outdated documentation(https://givewp.com/documentation/developers/how-to-create-custom-form-fields/).
  2. Update the snippet to work with Give 2.0+
  3. Notify support in https://github.com/WordImpress/Give-Docs/issues/166 so the doc can be updated.

Slack Call Summary

Participants: @raftaar1191 @kevinwhoffman
Topic: Discuss the scope of the custom field snippet and where it needs to appear
Result: We have updated the acceptance criteria to reflect where the custom field should appear.

@mathetos @Benunc Would you mind reviewing the Acceptance Criteria from a support perspective in case we have overlooked anything? This updated snippet will become the basis for the updated doc. Thanks.

It looks great to me. I'm happy to test the snippet once it's ready.

@kevinwhoffman Same. That criteria is great.