This adds the ability to deactivate/reactivate pledges from the wp-admin list table. Once deactivated, the pledge is removed from the "published" list, as if it were trashed. It is not rendered in the frontend pledge list either. You can still access the edit screen, but no edits can be made (saving the pledge is disabled by JS, as otherwise it would reactivate itself). This way we can remove a pledge, but still see the activity log.
Fixes#112
The docs were not exactly correct for this function, and it is called both on update and creation - causing two emails to go out. The email sent from this function uses the wrong page for a new pledge, so we'll keep the current email in `create_new_pledge`, and only send this email on `updated_postmeta`.
* Add the admin email field to the manage form
* Fix admin email processing: When the email is changed, the pledge needs to be set back to pending, until the email is re-confirmed
* Send confirmation emails for existing pledges to the "Manage Pledge" page
* Process the email confirmation & resending emails actions on both shortcodes
* Add a message for unconfirmed pledges
* Add contributor management to manage form
* Check `pledge_id` to prevent returning all contributors
* Return a plain text error string – this is used in an alert box, so it can't contain HTML
* Hide confirmation when pledge is a draft
* Only enqueue script if the user is authorized
- Add logo display & field to manage form
- Save the new logo if submitted (do nothing if not)
- Delete the original logo when a new one is uploaded, checking that the attachment parent is the pledge (just in case of changes via Media Library)
* Fix issue with fetching data in `get_pledge_meta` when no submission has been POST'd
* Rename to `subset`, since `context` is also used elsewhere
* Show form content when there are form errors
* Fix warnings on new pledge form
* Skip wpautop before save, so editors don’t need to edit HTML unless they want to
* Use a unique text-domain, wporg-5ftf
* Fix plugin i18n strings
* Remove unwanted text-domains from WPCS checks and fix missed old text-domains
* Remove type=array from phpcs
* Re-add type=array
* Small WPCS fix
* WPCS: replace var with
Add an admin-ajax endpoint to request an authorized email to edit an existing pledge. The email submitted needs to match the submitted organizer email for the given pledge. If it does, an email will be sent out with the link to the pledge management form. If not, it will return an error.
See #98.
This updates the display of contributors into a table view, and adds the ability to add and remove contributors to existing pledges.
The display has been refactored to use JS templates & JSON contributor data– the data is output onto the page when loaded from the server, and rendered when the page finishes loading. Adding & removing contributors now submits to an admin-ajax.php endpoint, which, if successful, return the new list of contributors. This ensures the display is always up to date.
Fixes#3
* Split Auth functionality out to new file
* Move email-related code into the email file
* Use `assertFalse` for boolean assertions
* Add `can_manage_pledge` to check user or token against a given pledge
Pulled out of e9763f6678
* Remove duplicate test
* Tests: Move tests infrastructure, set up travis
Consolidates the composer files so we can run install once in travis.
* Return empty array if no values are $_POST'ed to the form
Fixes an issue with tests + null values in logs
* Clean up some naming & create helper functions for tests
* Debug travis
* Remove debug
* Fix notices on form
* Turn on multisite flag
This includes autofixes, along with some manual fixes; mostly syntax-related. Some `phpcs:ignore` comments were added for overzealous rules that don't apply.
`process_my_pledges_form()` is actually called on page load in `render_my_pledges()`.
So to prevent the unnecessary get_post() queries, let’s just return early if the form wasn’t really submitted.
See #87