Wordpress Codex has different number of arguments for get_previous_post and get_next_post functions. Why?

Compare the following two links:

https://codex.wordpress.org/Function_Reference/get_next_post https://codex.wordpress.org/Function_Reference/get_previous_post

The get_previous_post function doesn't have the last $taxonomy parameter, while get_next_post has it listed. I followed those instruction literally, which caused my get_previous_post to break. When I noticed the difference between the two functions, I tried specifying the taxonomy in my get_previous_post function, which fixed the problem. Is this a mistake in the Codex for get_previous_post?

Topic codex Wordpress

Category Web


The Codex does not document the $taxonomy argument. Without digging into it, my assumption would be that maybe it originally was not one of the arguments and no one ever bothered to change the Codex.

The Codex, while still a tremendous resource of information, is (1) user generated/curated content and can be prone to mistakes, and (2) is no longer the "official" documentation of WP core functions, hooks, and APIs. That status belongs to https://developer.wordpress.org/.

On the developer site, the $taxonomy argument IS documented for get_previous_post(). Since that data literally comes from the WP core inline documentation, that right there tells you that the Developer Docs are correct and the Codex is wrong.

See:

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.