Skip to content

WPQueryParams.PostNotIn_exclude: False positive outside get_posts context #672

@rebeccahum

Description

@rebeccahum

Bug Description

We started flagging for exclude since it's an alias of post__not_in in #589. Unfortunately, when used outside of a get_posts() or WP_Query context, it's a false positive.

Minimal Code Snippet

	$users = get_users(
		array(
			'blog_id'        => false,
			'include'        => $include_blog_users,
			'exclude'        => $exclude_blog_users,
		)
	);

Error Code

WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude

Environment

Question Answer
PHP version 7.4
PHP_CodeSniffer version 3.6
VIPCS version 2.3

Tested Against master branch?

  • I have verified the issue still exists in the master branch of VIPCS.
  • I have verified the issue still exists in the develop branch of VIPCS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions