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 to modify the custom HTML attributes of each option in FrmAppHelper::images_dropdown() method.
Usage
add_filter( 'frm_images_dropdown_option_html_attrs', 'my_custom_function');
Parameters
- $html_attrs (string): HTML attributes.
- $args (array): The arguments of images_dropdown() method after filling defaults and adding option array.
Examples
Add custom HTML attributes to each option
add_filter( 'frm_images_dropdown_option_html_attrs', 'add_html_attrs_image_dropdown', 10, 2);
function add_html_attrs_image_dropdown( $html_attrs, $args ) {
$html_attrs .= ' data-custom-value="Custom value"';
return $html_attrs;
}