Skip to content

Commit 4376fd9

Browse files
committed
fix: PHP Compatibility fix
1 parent 2f9ed12 commit 4376fd9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Term.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function format_hierarhical_name( WP_Term|int|string|null|array|\W
3333
}
3434

3535
$formatter = self::get_name_formatter( $args );
36-
$formatted = \array_map( \get_term( ... ), \get_ancestors( $term->term_id, $term->taxonomy ) );
36+
$formatted = \array_map( 'get_term', \get_ancestors( $term->term_id, $term->taxonomy ) );
3737
$formatted = \array_map( $formatter, \array_reverse( $formatted ) );
3838
$formatted[] = $args['link_final'] ? $formatter( $term ) : $term->name;
3939

@@ -75,7 +75,7 @@ private static function parse_format_args( array $args ): array {
7575
*/
7676
private static function get_name_formatter( array $args ): Closure {
7777
if ( \is_callable( $args['formatter'] ?? null ) ) {
78-
return $args['formatter']( ... );
78+
return $args['formatter'];
7979
}
8080

8181
$formatter ??= $args['link_items'] && $args['link_format']
@@ -101,8 +101,8 @@ private static function get_name_formatter( array $args ): Closure {
101101
*/
102102
private static function get_link_formatter( string|callable|array|bool $fmt ): ?Closure {
103103
return match ( true ) {
104-
\is_bool( $fmt ) && $fmt => \get_term_link( ... ),
105-
\is_callable( $fmt ) => $fmt( ... ),
104+
\is_bool( $fmt ) && $fmt => 'get_term_link',
105+
\is_callable( $fmt ) => $fmt,
106106
\is_array( $fmt ) => static fn( $t ) => \call_user_func( $fmt, $t ),
107107
\is_string( $fmt ) => static fn( $t ) => \add_query_arg( $t->taxonomy, $t->slug, $fmt ),
108108
default => null,

0 commit comments

Comments
 (0)