Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #419
What Changed
Adds a new Image field type to WP User Manager custom fields, powered by the FilePond uploader.
How It Works
This PR adds a new Image field type to WPUM using FilePond to replace the default file input with a much better upload experience.
Files Changes
includes/assets.php- Enqueues all the FilePond scripts and styles so the uploader works properly.includes/fields/class-wpum-fields.php- Registers the new image field type so it shows up in WPUM custom fields.Gruntfile.js- Updated to bundle FilePond and its plugins into one build.Files Added
includes/fields/types/class-wpum-field-image.php- Main logic for the image field.templates/form-fields/image-field.php- Outputs the field markup and passes data needed for FilePond.JS
assets/js/src/wpum-filepond.js - Initializes FilePond, handles default images, and keeps things in sync when users add/remove images.
FilePond assets (local copies)
CSS:
assets/css/vendor/filepond.cssassets/css/vendor/filepond/filepond-plugin-image-preview.min.cssassets/css/vendor/filepond/filepond.min.cssJS:
assets/js/vendor/filepond/filepond.min.jsassets/js/vendor/filepond/filepond.jquery.jsassets/js/vendor/filepond/filepond-plugin-file-validate-type.min.jsassets/js/vendor/filepond/filepond-plugin-image-preview.min.jsassets/js/vendor/filepond/filepond-plugin-image-validate-size.min.jsTesting Instructions
Steps for a reviewer to verify this works:
Users -> Custom FieldsPrimary FieldsAdd new custom fieldAdvanced Fieldstab, enter field and click,ImageSave ChangesUsers -> Registration Forms, editDefault Registration FormImagefield to form fields.Registerpage (http://domain.com/register) and register new user.Note:
When testing on the #419-Image-Field branch, you may notice that in step 4 the image does not have a name. This is expected and is caused by the updated field naming implementation introduced in #405 to fix the translation issue.
Test Coverage
tests/wpunit/vendor/bin/codecept run wpunitorvendor/bin/phpunit)Tests Performed
Screenshots
If this changes any UI, add before/after screenshots.
Pre-merge Checklist