File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ private static function parse_format_args( array $args ): array {
75
75
*/
76
76
private static function get_name_formatter ( array $ args ): Closure {
77
77
if ( \is_callable ( $ args ['formatter ' ] ?? null ) ) {
78
- return $ args ['formatter ' ];
78
+ return static fn ( $ t ) => $ args ['formatter ' ]( $ t ) ;
79
79
}
80
80
81
81
$ formatter ??= $ args ['link_items ' ] && $ args ['link_format ' ]
@@ -101,10 +101,10 @@ private static function get_name_formatter( array $args ): Closure {
101
101
*/
102
102
private static function get_link_formatter ( string |callable |array |bool $ fmt ): ?Closure {
103
103
return match ( true ) {
104
- \is_bool ( $ fmt ) && $ fmt => 'get_term_link ' ,
105
- \is_callable ( $ fmt ) => $ fmt ,
104
+ \is_bool ( $ fmt ) && $ fmt => static fn ( $ t ) => \get_term_link ( $ t ),
106
105
\is_array ( $ fmt ) => static fn ( $ t ) => \call_user_func ( $ fmt , $ t ),
107
106
\is_string ( $ fmt ) => static fn ( $ t ) => \add_query_arg ( $ t ->taxonomy , $ t ->slug , $ fmt ),
107
+ \is_callable ( $ fmt ) => static fn ( $ t ) => $ fmt ( $ t ),
108
108
default => null ,
109
109
};
110
110
}
You can’t perform that action at this time.
0 commit comments