File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ function __action_graphql_register_types()
1919 $ language_codes = [];
2020
2121 foreach (pll_languages_list () as $ lang ) {
22- $ language_codes [strtoupper ($ lang )] = $ lang ;
22+ // Fix: Always use the same format for values
23+ $ language_codes [strtoupper ($ lang )] = [
24+ 'value ' => $ lang ,
25+ ];
2326 }
2427
2528 if (empty ($ language_codes )) {
@@ -47,11 +50,16 @@ function __action_graphql_register_types()
4750 'wp-graphql-polylang '
4851 ),
4952 'values ' => array_merge ($ language_codes , [
50- 'DEFAULT ' => 'default ' ,
51- 'ALL ' => 'all ' ,
53+ 'DEFAULT ' => [
54+ 'value ' => 'default '
55+ ],
56+ 'ALL ' => [
57+ 'value ' => 'all '
58+ ],
5259 ]),
5360 ]);
5461
62+ // Rest of the code remains the same
5563 register_graphql_object_type ('Language ' , [
5664 'description ' => __ ('Language (Polylang) ' , 'wp-graphql-polylang ' ),
5765 'fields ' => [
You can’t perform that action at this time.
0 commit comments