* 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
* Allow image uploads
* Add the logo as "generated" meta
This will be attached after we've processed the `$_FILES` object into an upload.
* Load image into media library, attach to the submitted pledge as a featured image.
* Move where image handling happens so we can pass back errors
* Pass back error if upload fails
* Create a validation function to do basic checking of form data
* Move logo uploading to a separate function, and rely on core checks for mime & filesize checking
* Tweak function name to be more clear
* Remove bmp, tiff, and ico file types
This will be more accurate and avoid confusion that could arise if the self-reported "Number of Employees Being Sponsored" didn't match the number of confirmed contributors listed on the pledge.
Having that counted number stored in post meta is still useful, though, so this also adds/updates that number for a pledge whenever a Contributor post changes its status.
Fixes#48
This broadly enables & styles the pledge forms across the frontend and wp-admin.
- Switches field `readonly` control to a variable called `$readonly`
- Create `PledgeMeta\get_pledge_meta()` which will fetch data from `$_POST`, a pledge post, or defaults.
- Add Number of Employees field
- Update form content to match mockup:
- fields now have help text
- success message uses content from mockup
- logo field is moved to the "org info" section
- Style form in theme, add some similar styles to the admin
Fixes#7, fixes#28
This starts to address several items in the roadmap, but probably doesn't fully address any of them. It takes the plugin code that was written several months ago, before the scope of this project was fully sorted out, and refactors it to be a starting point for the roadmap.
* Adds template files for form inputs that can be used to both create new pledges and manage existing pledges
* Does some validation and sanitization work on form submissions
* Adds a custom post status for deactivated pledges