Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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.

Assessment

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

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.

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

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

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.

More from Yoast/developer

All issues in Yoast/developer

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.