• Hi! How is ->set_min() on a complex field intended to work? Coming from ACF I thought it should “pre-build” as many rows as declared but it doesn’t seem to work as I’m setting it up. An example would be:

    Container::make('post_meta', 'Configuration')
    	->show_on_post_type('whatever_post_type')
    	->add_fields(array(
        	Field::make('complex', 'whatever')
        		->setup_labels(array(
    			'singular_name' => 'whatever rule',
    			'plural_name' => 'whatever rules'
        		))
    	    	->add_fields(array(
    		    	Field::make('select', 'abc', 'ABC' )
    		    		->add_options(array(
    			    		'a' => 'A',
    					'b' => 'B',
    					'c' => 'C',
    				)),
    	    	))
    		->set_min(1)
    	));

    Thanks for your support! Great developer framework!

    https://ww.wp.xz.cn/plugins/carbon-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author htmlBurger

    (@htmlburger)

    Hey @boquiabierto, thanks for the kind words! Glad you like the plugin.

    About the set_min() methods, it doesn’t force the user to add the fields, so it doesn’t pre-populate them, it’s just a limiter, but you can combine it with set_required() to force the user to populate the complex groups.

    Hope this answers your question.

    If you want to make a suggestion or submit a bug report, please open a new Issue in our Github repository.

Viewing 1 replies (of 1 total)

The topic ‘Complex Field’s ->set_min( $num ) working’ is closed to new replies.