You can use the radio_image_set input field to allow users to select the image as an option. See the below example for how you can use the radio_image_set input field.
ExampleCopy to Clipboardarray(
'type' => 'radio_image_set',
'heading' => esc_attr__( 'Radio Image Test', 'fusion-builder' ),
'description' => esc_attr__( 'Add a short description for the field.', 'fusion-builder' ),
'param_name' => 'images',
'value' => array(
'pattern1' => get_stylesheet_directory_uri(). '/assets/images/patterns/pattern1.png',
'pattern2' => get_stylesheet_directory_uri(). '/assets/images/patterns/pattern2.png',
),
'width' => '48px',
'height' => '48px',
)x 1array(23 'type' => 'radio_image_set',45 'heading' => esc_attr__( 'Radio Image Test', 'fusion-builder' ),67 'description' => esc_attr__( 'Add a short description for the field.', 'fusion-builder' ),89 'param_name' => 'images',1011 'value' => array(1213 'pattern1' => get_stylesheet_directory_uri(). '/assets/images/patterns/pattern1.png',1415 'pattern2' => get_stylesheet_directory_uri(). '/assets/images/patterns/pattern2.png',1617 ),1819 'width' => '48px',2021 'height' => '48px',2223)Parameters type
( string ) input type. heading
( string ) Setting title. description
( string ) Short description about the setting field. param_name
( string ) Attribute name to be used in the shortcode. value
( array ) Array of image id and the image url. Image id from the array will be stored in the shortcode, so you can get the url from it. width
( string ) The width for the image being displayed in the setting field. This is useful if you want to display multiple fields with different image sizes. height
( string ) The height for the image being displayed in the setting field. This is useful if you want to display multiple fields with different image sizes.