Skip to content

Conversation

@bahiirwa
Copy link
Contributor

REASON:
In PHP 8.5, using null as an array offset is deprecated and will trigger a deprecation notice. Previously, null was silently coerced to an empty string ("") when used as an array key, but this implicit behavior is being phased out to improve consistency with other parts of the language.

Solution
Changing the null to empty strings fixed the issue, as the WordPress function expects strings to be used as URI/URLs. https://developer.wordpress.org/reference/functions/add_query_arg/

image

@bahiirwa bahiirwa changed the base branch from master to develop January 20, 2026 14:53
@bahiirwa bahiirwa force-pushed the feature/laurence/fix-php-85-null-array-message branch from f35d82e to f3ec5b4 Compare January 20, 2026 14:55
Copy link
Contributor

@DanieleFreemius DanieleFreemius left a comment

Choose a reason for hiding this comment

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

LGTM

Passing empty strings to add_query_arg() is acceptable here.
While using add_query_arg( [], admin_url() ) would be semantically cleaner, the current change preserves existing behavior with a minimal diff and avoids the PHP 8.5 deprecation without introducing any functional or stylistic refactors.

Approved.

@DanieleAlessandra DanieleAlessandra self-requested a review January 21, 2026 15:45
Copy link
Collaborator

@DanieleAlessandra DanieleAlessandra left a comment

Choose a reason for hiding this comment

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

LGTM

Passing empty strings to add_query_arg() is acceptable here.
While using add_query_arg( [], admin_url() ) would be semantically cleaner, the current change preserves existing behavior with a minimal diff and avoids the PHP 8.5 deprecation without introducing any functional or stylistic refactors.

Approved.

@DanieleAlessandra DanieleAlessandra merged commit 72ae17f into develop Jan 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants