Skip to content

ContextHelper::is_in_function_call(): handle $valid_functions keys case-insensitively#2706

Merged
dingo-d merged 1 commit intoWordPress:developfrom
rodrigoprimo:is-in-function-call-case-insensitive
Mar 5, 2026
Merged

ContextHelper::is_in_function_call(): handle $valid_functions keys case-insensitively#2706
dingo-d merged 1 commit intoWordPress:developfrom
rodrigoprimo:is-in-function-call-case-insensitive

Conversation

@rodrigoprimo
Copy link
Copy Markdown
Collaborator

Description

Follow-up to #2626 as discussed during code review.

The ContextHelper::is_in_function_call() method already lowercased the token content before matching, but required callers to pass $valid_functions keys in lowercase. This normalizes the keys internally using array_change_key_case(), so callers no longer need to worry about passing lowercase function names.

Suggested changelog entry

  • ContextHelper::is_in_function_call(): the $valid_functions parameter keys are now matched case-insensitively. Previously, keys had to be lowercase.

Related issues/external references

Follow-up to #2626.

…se-insensitively

The method already lowercased the token content before matching, but
required callers to pass $valid_functions keys in lowercase. This
normalizes the keys internally using array_change_key_case(), so callers
no longer need to worry about passing lowercase function names.
Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @rodrigoprimo !

@jrfnl jrfnl added this to the 3.4.0 milestone Mar 5, 2026
@dingo-d dingo-d merged commit fc69a87 into WordPress:develop Mar 5, 2026
31 checks passed
@rodrigoprimo rodrigoprimo deleted the is-in-function-call-case-insensitive branch March 5, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants