Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This hook allows modifying the arguments before passing them to the FrmAppHelper::images_dropdown() method.
Usage
add_filter( 'frm_radio_display_format_args', 'custom_radio_display_attribute');
Parameters
- $args (array): The arguments will be passed to FrmAppHelper::images_dropdown()
- $method_args (array): Includes `field` and `options` from the FrmFieldsHelper::show_radio_display_format()
Examples
Add custom attribute to radio images dropdown
add_filter( 'frm_radio_display_format_args', 'custom_radio_display_attribute', 10, 2 );
function custom_radio_display_attribute( $args, $method_args ) {
$args['input_attrs']['data-custom-value'] = 'Custom value';
return $args;
}