Skip to content

Commit

Permalink
Also allow class constants in hook names
Browse files Browse the repository at this point in the history
Further fixes for #51.
  • Loading branch information
anomiex committed Feb 29, 2024
1 parent 693c173 commit c052dfa
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 c052dfa

Please sign in to comment.