Make class option a select for modules

Here is some example code:

add_filter( 'fl_builder_register_settings_form', function( $form, $id ) {
	if ( 'module_advanced' === $id ) {
		$form['sections']['css_selectors']['fields']['class']['type'] = 'select';
		$form['sections']['css_selectors']['fields']['class']['options'] = array(
			'foo' => 'Foo',
			'bar' => 'Bar',
		);
	}
	return $form;
}, 10, 2 );

1 Like