Skip to content

Commit

Permalink
Merge pull request #54 from anomiex/fix/class-constants-in-hook-names
Browse files Browse the repository at this point in the history
Also allow class constants in hook names
  • Loading branch information
kkmuffme authored Feb 29, 2024
2 parents 227ac13 + c052dfa commit 8fd59d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public static function getDynamicHookName( object $arg ) : ?string {

// isn't actually supported by the wp-hooks-generator yet and will be handled as regular string there
// just handle it generically here for the time being
if ( $arg instanceof PhpParser\Node\Expr\ConstFetch ) {
if ( $arg instanceof PhpParser\Node\Expr\ConstFetch || $arg instanceof PhpParser\Node\Expr\ClassConstFetch ) {
return '{$variable}';
}

Expand Down

0 comments on commit 8fd59d6

Please # to comment.