fix(snippet): update custom field snippet
Closed this issue · 3 comments
Benunc commented
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 togive_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
- Snippet URL - https://github.com/WordImpress/Give-Snippet-Library/blob/master/form-customizations/custom-fields-plugin.php
- Outdated doc - https://givewp.com/documentation/developers/how-to-create-custom-form-fields/
- https://github.com/WordImpress/Give-Docs/issues/166
Tasks
- Review the [outdated documentation(https://givewp.com/documentation/developers/how-to-create-custom-form-fields/).
- Update the snippet to work with Give 2.0+
- Notify support in https://github.com/WordImpress/Give-Docs/issues/166 so the doc can be updated.
kevinwhoffman commented
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.
Benunc commented
It looks great to me. I'm happy to test the snippet once it's ready.
mathetos commented
@kevinwhoffman Same. That criteria is great.