• Can you make it not output an array if the field is empty? Just so I can just use:

    get_sub_field('link')

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I need this too, please!

    Thanks!

    Plugin Author Corey Worrell

    (@coreyw)

    @rgbjoy, @zeinnicholas,

    Sorry, could you please explain your use case more in-depth?

    Thank you.

    Plugin Author Corey Worrell

    (@coreyw)

    IGNORE

    • This reply was modified 8 years, 1 month ago by Corey Worrell. Reason: wp.org double post

    Corey, sorry for the wait.

    in my case the problem is, when the field is empty I cannot make it disappear using if get_field('field_name') or if the_field('field_name') because it will output an array (even if it’s empty). So, my field label keeps showing even if it hasn’t any values.

    I could hide it using Javascript, but the function is already there in ACF. It would be a lot more straight forward.

    Thanks any way. I ended up using the relational field type. But your plugin is very useful!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Return empty’ is closed to new replies.