-
Notifications
You must be signed in to change notification settings - Fork 91
gw-rich-text-html-fields.php
: Fixed an issue where Rich Text HTML snippet only worked with Gravity Perks active.
#1082
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: master
Are you sure you want to change the base?
Conversation
…nippet only worked with Gravity Perks active.
WalkthroughA new anonymous function was added and hooked to the Changes
Sequence Diagram(s)sequenceDiagram
participant GravityForms
participant Plugin (gw-rich-text-html-fields.php)
participant ActionHandler
GravityForms->>Plugin (gw-rich-text-html-fields.php): Trigger gform_field_standard_settings (with field_id)
Plugin (gw-rich-text-html-fields.php)->>ActionHandler: Check if gform_field_standard_settings_200 fired < 1
alt Not yet fired
ActionHandler->>ActionHandler: Trigger gform_field_standard_settings_200 (with field_id)
else Already fired
ActionHandler-->>ActionHandler: Do nothing
end
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (1)
gravity-forms/gw-rich-text-html-fields.php (1)
22-26
: Excellent fix to remove dependency on Gravity Perks!This change ensures the snippet works independently by triggering the
gform_field_standard_settings_200
action exactly once if it hasn't been triggered already. The approach is appropriate and solves the issue effectively.Consider adding a brief comment explaining the purpose of this hook to improve code clarity:
add_action( 'gform_field_standard_settings', function() { + // Ensure gform_field_standard_settings_200 is triggered once even without Gravity Perks active if ( did_action( 'gform_field_standard_settings_200' ) < 1 ) { do_action( 'gform_field_standard_settings_200', rgget( 'id' ) ); } } );
@saifsultanc A suggestion/explanation: https://www.loom.com/share/cbd4b3190fd04125956cba07917648cd |
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2913661025/82373
Summary
The Rich Text HTML Fields snippet doesn't work as expected unless the Gravity Perks base plugin is installed and active.
This fixes the issue.