 uabP
|
Hello, I am using wpgraphql plugin with advanced custom fields (ACF). It works correctly only in default language.
Is there a possibility to get information by specifying language code?
From documentation, it seems it works only with posts, since I am not able to use "where" argument - (where: {language: "en"})
ACF field is registered in functions.php
function register_acf_options_pages() {
// check function exists
if ( ! function_exists( 'acf_add_options_page' ) ) {
return;
}
// register options page
$my_options_page = acf_add_options_page(
array(
'page_title' => __( 'Team Option Page' ),
'menu_title' => __( 'Team Option Page' ),
'menu_slug' => 'team-options-page',
'capability' => 'edit_posts',
'show_in_graphql' => true,
'type' => "Post",
)
);
};
add_action( 'acf/init', 'register_acf_options_pages' );
Example query:
query members {
teamOptionsPage {
teamMembers {
member {
memberName
memberDescription
}
}
}
}
|
 Bigul
WPML Supporter since 01/2013
Languages:
English (English )
Timezone:
Europe/Vienna (GMT+02:00)
|
Hello,
Welcome to the WPML support forum. I will do my best to help you to resolve the issue.
We hope you are using WPML GraphQL with Gatsby and ACF. Just to make sure, have you tried the steps described in this article - https://wpml.org/documentation/related-projects/wpml-graphql/#using-wpml-graphql-with-gatsby-and-acf
Normally we can retrieve the values of ACF Options Page fields like the following. Refer to this article for more details - hidden link
$variable = get_field('field_name', 'option');
--
Thanks!
Bigul
|