Skip to content

Commit 8aa16a0

Browse files
committed
Update do_shortcode sniff
1 parent fb37954 commit 8aa16a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Infinum/Sniffs/Shortcodes/DisallowDoShortcodeSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
3737
$tokens = $phpcsFile->getTokens();
3838
$token = $tokens[ $stackPtr ];
3939

40-
if ( preg_match( '`do_shortcode`im', $token['content'] ) > 0 ) {
40+
if ( preg_match( '`^do_shortcode`i', $token['content'] ) > 0 ) {
4141
$phpcsFile->addWarning( 'Do not include do_shortcode() function in theme files. Use shortcode callback function instead.' , $stackPtr, 'do_shortcodeDetected' );
4242
}
4343
}

0 commit comments

Comments
 (0)