Yoast / Yoast/developer

Warning and Fatal error is thrown when code snippet "Manipulate the meta robots tag output" is used

Open
#252 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
15
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Fatal error and warning from the "Manipulate the meta robots tag output"

Please give us a description of the issue

If we add this code snippet on the functions.php file, we face warning and fatal error like below:

Warning: array_map(): Expected parameter 2 to be an array, null given in …… /wp-content/themes/twentytwenty/functions.php on line 1060

Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array

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 with the linked “Manipulate the meta robots tag output” documentation snippet and reproduce its use in a theme’s functions.php. Trace the reported array_map() warning and TypeError, then update the documented snippet so the reported usage no longer produces those errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.