Support

Account

Home Forums Backend Issues (wp-admin) Minimum Rows 0

Solved

Minimum Rows 0

  • Hello ACF Team,

    i want to set the minimum rows to 0. I use a repeater field in the backend that is NOT required. So the default would be 0 rows. But actually, that is not possible. If i give in 2 or 1 as minimum row, it is working as expected. The Repeater Field in the backend gives me 1 or 2 rows as default. But i want as default 0 rows, so if the user clicks to add row, 1 row will be appear.

    Is there a solution to realise this ? For example with filter hooks? And if yes, how can i realise it?

    
    function my_acf_load_value( $value, $post_id, $field )
    {
    	// run the_content filter on all textarea values
    	$value = apply_filters('the_content',$value);
    
    	return $value;
    }
    
    add_filter('acf/load_value/name=my_acf_field_name', 'my_acf_load_value', 10, 3);
    
    

    I already try it with this code. First i expected it works but it doesnt. With that code i become 0 rows minimum but when i already created a entrie field and saved it, it doensn’t exist anymore on the frontend.

    Thanks !

  • Hi @tolga

    the code posted is in no way related to the repeater field, so let’s not talk about the filter as it will never do what you want it to.

    I don’t quite understand what the issue is.

    You say that a min rows of 0 doesn’t work. What do you mean by this? What does it look like? What are you expecting? What isn’t it doing?

    How does this differ from a min rows of 1 or 2?

    Thanks
    E

  • Hi Elliot,

    thanks for the answer. A other user had the same problem as I.
    http://support.advancedcustomfields.com/forums/topic/starting-of-rows-in-repeater-field/

    Thanks for the answer!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Minimum Rows 0’ is closed to new replies.