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

@pross When using fl_builder_register_settings_form is there such thing as

if ( 'row_advanced' === $id ) {

or

if ( 'column_advanced' === $id ) {

Neither seem to be working for me…?

Try var_dump/error_log/print_r to see what the values are at that point in time.

@pross Or do you just have to do

if('row' === $id ) {
and
if('col' === $id ) {

And then do $form['tabs']['advanced'] to get to the advanced tab?

I dont know without testing, I would add var_dump to see what the variables are and go from there.