Home › Forums › Add-ons › Flexible Content Field › Hiding A Field in Screen Options › Reply To: Hiding A Field in Screen Options
I will go ahead and answer my own question.
Instead of adding to screen options I just added a new Boolean field to a theme settings page called “Hide Show Settings”.
I then run the following code
//hide show classes fields
function dd_acf_admin_head() {
if( get_field('hide_show_classes', 'options') ) { ?>
<style>
.acf-flexible-content div[data-name="class"] {
display: none;
}
</style>
<?php }
}
add_action('acf/input/admin_head', 'dd_acf_admin_head');
This accomplishes my goal of hiding this field but not actually removing it. As its still easy to turn on if needed.
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.