Home Forums ACF PRO Can I have a repeater field with NO rows Reply To: Can I have a repeater field with NO rows

  • Hi James,

    Yes, it does show 1 (empty) row on the post edit screen, even though I have the minimum set to ‘0’. I don’t know how to make it NOT show a row, but instead just show the “Add Rows” button.

    The problem is that *because* it shows one row, whether or not that row is used, when I look at that post in my database via phpMyAdmin, it shows a value of ‘1’ (1 row) – it should either show ‘0’ or not even be there at all (no meta key field) IF the post author does not fill in anything on that row.

    But because it shows ‘1’ I can’t use that in my query, because the post author *could* use that row so ‘1’ could mean that there are sub-fields, or not. If I use ‘1’ to determine if the section with it’s header should be shown, it will always be shown, even when it hasn’t been used, so I get just the header, no links below, which is not what I want.

    Ideally it should behave as any other custom field – available to use on the Post, but not added to the database as a ‘key’ for that post unless it’s actually used.

    But for now I would be happy if I could just figure out how to query for that metadata, and show the header/section ONLY if data has been filled into the row – my test for data in a sub-field isn’t working. If the row isn’t filled in, I still see the two sub-fields in the database attached to that post, but they are blank….so in theory I could check for that, and if NOT blank, show the header and section, but it they ARE blank, don’t show it. It just isn’t working as I have it.