You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using phpcs with standard WordPress. I have defined the domain globally in my class as a variable. Then using the same variable to pass the domain to all escaping functions. But it is throwing error saying The $domain parameter must be a single text string literal. Found: self::$text_domain which is not correct
Minimal Code Snippet
// Defined variable public static $text_domain = 'my-plugins-domain';
The text domain should never be passed as a variable. Because having it as a variable will not allow the parsing tools to differentiate between text domains.
Bug Description
I am using phpcs with standard WordPress. I have defined the domain globally in my class as a variable. Then using the same variable to pass the domain to all escaping functions. But it is throwing error saying
The $domain parameter must be a single text string literal. Found: self::$text_domain
which is not correctMinimal Code Snippet
// Defined variable
public static $text_domain = 'my-plugins-domain';
The issue happens when running this command:
... over a file containing this code:
The file was not auto-fixed via
phpcbf
Error Code
Environment
Tested Against
develop
Branch?develop
branch of WordPressCS.The text was updated successfully, but these errors were encountered: