Radio Button
ACF
Last Upated: Thursday, Feb 1, 2024
radio_button
The Radio Button field type is native to ACF (free) and provides a list of select-able inputs.
Resolve Type
Fields of the "radio_button" field type resolve to a "String" in the GraphQL Schema. (even if the choice values are integers or booleans)
Field Settings
Field Configuration
<?phpadd_action( 'acf/include_fields', function() { if ( ! function_exists( 'acf_add_local_field_group' ) ) { return; } acf_add_local_field_group( [ { "key": "my_field_group_", "title": "My Field Group with radio", "show_in_graphql": 1, "graphql_field_name": "myFieldGroupWithRadio", "map_graphql_types_from_location_rules": 0, "graphql_types": [ "Page" ], "fields": [ { "key": "my_field_", "label": "My Field", "name": "my_field", "type": "radio", "show_in_graphql": 1, "graphql_field_name": "myFieldWithRadio" } ], "location": [ [ { "param": "post_type", "operator": "==", "value": "page" } ] ] } ] );});