-
Notifications
You must be signed in to change notification settings - Fork 92
gw-entry-count-shortcode-advanced.php: Added support for merge tags in field filters.
#1043
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
gw-entry-count-shortcode-advanced.php: Added support for merge tags in field filters.
#1043
Conversation
… in field filters.
saifsultanc
left a comment
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.
Looks great!
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThe pull request enhances the shortcode processing in Changes
Sequence Diagram(s)sequenceDiagram
participant SH as Shortcode Handler
participant GF as GFCommon Utility
SH->>SH: Iterate through each filter pair
alt Merge tag detected?
SH->>GF: has_merge_tag(pair)
GF-->>SH: true
SH->>GF: replace_variables_prepopulate(pair)
GF-->>SH: Return replacement value
else No merge tag
SH->>SH: Continue with standard filter parsing
end
Poem
✨ Finishing Touches
🪧 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-entry-count-shortcode-advanced.php (1)
12-12: Consider updating the documentation.Since merge tag support has been added to field filters, it would be helpful to update this line in the documentation to explicitly mention that field_filters now supports merge tags.
- * - field_filters (string): A comma-separated list of field filters in the format field_id:operator:value. + * - field_filters (string): A comma-separated list of field filters in the format field_id:operator:value. Supports merge tags.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
gravity-forms/gw-entry-count-shortcode-advanced.php(1 hunks)
🔇 Additional comments (1)
gravity-forms/gw-entry-count-shortcode-advanced.php (1)
64-67: Implementation looks good!This change correctly adds support for merge tags in field filters by detecting and replacing them before splitting the filter pair into components. The implementation is consistent with how merge tags are handled for the
valueattribute in lines 49-52.
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2857827771/78525
Summary
This PR supports merge tags in the
field_filtersattribute. That means the following shortcode will work as expected.[gravityforms action="entry_count" id="21" field_filters="31:is:{user:user_login},29:is:"]