WordPress / WordPress/WordPress-Coding-Standards

get_categories `type => link` argument is deprecated

Open
#1,845 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
2.8k
Forks
521
Avg merge
5d 20h
Merged PRs (30d)
1

Description

Not 100% sure should this go in the DeprecatedParametersSniff or DeprecatedParameterValuesSniff. Basically the get_categories() function has a deprecated argument

array( 'type' => 'link')

Which, if used, will throw a notice to use

array( 'taxonomy' => 'link_category')

instead.

I think this should be added in one of those two but I'm not sure which one tbh 😬

I'm happy to make a PR 🙂 Since I'm making a core patch to change the docblock of that function as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading DeprecatedParametersSniff and DeprecatedParameterValuesSniff and compare how each handles deprecated arguments and values. Determine which sniff fits get_categories()'s type => link case, then verify that the deprecated form is reported with the suggested taxonomy => link_category replacement.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.