diff --git a/Plugin.php b/Plugin.php index 2073c1e..725c607 100644 --- a/Plugin.php +++ b/Plugin.php @@ -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 );