Open jrfnl opened 7 years ago
The same applies to post type names.
It also applies to general form fields. An example is a contact form where the field name for the visitor's name is name
, which causes a conflict with the name
query var in WordPress. No idea how you could approach sniffing that in a reliable manner.
Any sniff like this would greatly benefit from tooling to create the initial lists and allow for updating the lists with ease. See #1803
WordPress has a list of words which are reserved for use as query vars. See: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp.php#L18
If we can gather a list of functions in which these should not be used, I can imagine we could create a sniff to check against this.
One typical function in which they should not be used is
register_taxonomy()
, but I imagine there may be more functions in which these would lead to difficult to debug problems (withregister_taxonomy()
you end up with an unexplained 404). Ref: https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms