Site docs are currently being updated 🚧 Thank you for your patience! 🙏

Image Sizes

ACF Extended Pro
Last Upated: Thursday, Feb 1, 2024

acfe_image_sizes

The Image Sizes field is made available by the Advanced Custom Fields Extended PRO plugin and provides an Image Sizes selector as radio, checkbox or select field type.

Types Added to the Schema

To support the Image Selector field type in the GraphQL Schema, an additional GraphQL Object Type is added to the Schema:

  • ACFE_Image_Size (object type): An object type representing a registered image size in WordPress, with fields such as height, width, name and crop.

Resolve Type

Fields of the acfe_image_sizes type will resolve to a "List of ACFE_Image_Size" in the GraphQL Schema.

The Image Sizes field can return one or more than one value.

Field Settings

Field Configuration

<?php
add_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 acfe_image_sizes",
"show_in_graphql": 1,
"graphql_field_name": "myFieldGroupWithAcfeImageSizes",
"map_graphql_types_from_location_rules": 0,
"graphql_types": [
"Page"
],
"fields": [
{
"key": "my_field_",
"label": "My Field",
"name": "my_field",
"type": "acfe_image_sizes",
"show_in_graphql": 1,
"graphql_field_name": "myFieldWithAcfeImageSizes"
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "page"
}
]
]
}
]
);
});

Querying the Image Sizes field