Skip to content

Commit

Permalink
Fix #51
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Jan 16, 2024
1 parent d286a9f commit c69cd0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ public static function getDynamicHookName( object $arg ) : ?string {
return rtrim( $temp, '}' ) . '[' . $key . ']}';
}

// 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 ) {
return '{$variable}';
}

// other types not supported yet
// add handling if encountered @todo
throw new UnexpectedValueException( 'Unsupported dynamic hook name with type ' . get_class( $arg ), 0 );
Expand Down

0 comments on commit c69cd0b

Please # to comment.