Automattic / VIP-Coding-Standards

PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/
Other
236 stars 40 forks source link

get_parent_theme_file_path() is not a custom function #462

Closed rebeccahum closed 4 years ago

rebeccahum commented 4 years ago

Bug Description

get_parent_theme_file_path() is not a custom function and therefore shouldn't be flagged as one: https://developer.wordpress.org/reference/functions/get_parent_theme_file_path/

  48 | WARNING | File inclusion using custom function ( `get_parent_theme_file_path()` ). Must return local file source, as external URLs are prohibited on WordPress VIP. Probably needs manual inspection.

Minimal Code Snippet

require_once get_parent_theme_file_path( "/includes/blocks/file.php" );

Error Code

WordPressVIPMinimum.Files.IncludingFile.UsingCustomFunction

Environment

Use php -v and composer show to get versions.

Question Answer
PHP version x.y.z
PHP_CodeSniffer version x.y.z
VIPCS version x.y.z

Tested Against master branch?

GaryJones commented 4 years ago

Should just need that function name adding to this array.