Home › Forums › Front-end Issues › External condition for displaying field › Reply To: External condition for displaying field
I was about to post that you could set the class of wrapper to hidden
and then add some custom CSS when I stumbled upon something that I was unaware of.
Using and acf/load_field filter http://www.advancedcustomfields.com/resources/acfload_field/
add_filter('acf/load_field/name=test_hidden_field', 'load_field_test_hidden_field');
function load_field_test_hidden_field($field) {
$condition = false;
if (!$condition) {
$field['wrapper']['class'] = 'hidden';
}
return $field;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.