Support » Plugin: Advanced Custom Fields: Link » Return empty

  • 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

    (@coreyw)

    @rgbjoy, @zeinnicholas,

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

    Thank you.

    Plugin Author Corey

    (@coreyw)

    IGNORE

    • This reply was modified 3 years, 6 months ago by Corey. 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!

    • This reply was modified 3 years, 5 months ago by zeinnicholas.
    • This reply was modified 3 years, 5 months ago by zeinnicholas.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Return empty’ is closed to new replies.