Automattic / Automattic/zoninator

Fix legacy use of get_terms()

Open
#111 0 comments 0 reactions 1 assignee Claimed by @GaryJones View on GitHub
type: maintenance
Dominant language
PHP
Stars
86
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Prior to WP 4.5 (no longer supported by this plugin), `get_terms()` function had a signature of `get_terms( $taxonomy, $args )`. Since then, it is now `get_terms( $args )`. The second parameter is deprecated, and the taxonomy is found under the `$args['taxonomy`]` field.

https://github.com/Automattic/zoninator/blob/0b7e9d36c41d02dbf245045d6ebc02ff17a85f64/zoninator.php#L1335 uses the legacy format of the function call, and generates a warning in WordPressCS. This should be updated to use the modern signature. Tests should ideally be written to ensure that the zone_taxonomy class property is merged into the $args for the `get_zones()` function in which the `get_terms()` call is found.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.