diff --git a/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php b/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php index 15d58edf9d..67c90225a4 100644 --- a/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +++ b/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php @@ -172,8 +172,8 @@ public function process_parameters( $stackPtr, $group_name, $matched_content, $p ); // Warn for dynamic parts in the slug parameter. - if ( 'T_DOUBLE_QUOTED_STRING' === $this->tokens[ $string_pos ]['type'] - || ( 'T_HEREDOC' === $this->tokens[ $string_pos ]['type'] + if ( \T_DOUBLE_QUOTED_STRING === $this->tokens[ $string_pos ]['code'] + || ( \T_HEREDOC === $this->tokens[ $string_pos ]['code'] && strpos( $this->tokens[ $string_pos ]['content'], '$' ) !== false ) ) { $this->phpcsFile->addWarning(