Support

Account

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.