-
Notifications
You must be signed in to change notification settings - Fork 0
feat: custom fields and form plugins integration #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds frontend asset enqueuing by registering Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/admin/js/media-manager/select-files.js`:
- Around line 52-56: The Gravity Forms selector in the event target check inside
select-files.js uses a trailing space (' .gfield--type-fileupload ') so
event.target.closest('.gfield--type-fileupload ') never matches; update the
condition that calls event.target.closest to use the correct selector string
'.gfield--type-fileupload' (remove the trailing space) so Gravity Forms file
upload elements are properly detected while leaving the other closest checks
('.moxie-shim' and '.rwmb-meta-box') unchanged.
🧹 Nitpick comments (1)
src/admin/class-script-loader.php (1)
30-31: Consider conditional loading to avoid unnecessary frontend overhead.This enqueues assets on every frontend page regardless of whether a Gravity Forms file upload field exists. For sites with many pages, this adds unnecessary script/style overhead.
Consider conditionally loading only when needed, for example by checking if the current page contains a Gravity Form with file upload fields using
GFAPI::get_forms()or hooking intogform_enqueue_scriptsinstead.♻️ Alternative approach using Gravity Forms hook
// Enqueue for the admin area in general. add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_cimo_assets' ] ); - // Enqueue in frontend for forms plugin - add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_cimo_assets' ] ); + // Enqueue for Gravity Forms frontend file uploads. + add_action( 'gform_enqueue_scripts', [ $this, 'enqueue_cimo_assets' ] );
fixes #24
Summary by CodeRabbit
New Features
Bug Fixes