Support

Account

Home Forums Feature Requests Hide attachment fields Reply To: Hide attachment fields

  • I ended up by just hiding the fields with CSS.

    Add this to your functions.php to add a custom stylesheet for WP-Admin.

     
    function load_admin_style() {
    	wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
    	wp_enqueue_style( 'admin_css');
    }
    
    add_action( 'admin_enqueue_scripts', 'load_admin_style' );

    Then create a new admin-style.css file in your theme directory. In this file you can hide the fields you want to hide. In my case it was the alt, caption and description tags in the sidebar of a gallery.

    .acf-gallery-side .acf-field[data-name="alt"] {
    	display: none;
    }
    
    .acf-gallery-side .acf-field[data-name="caption"] {
    	display: none;
    }
    
    .acf-gallery-side .acf-field[data-name="description"] {
    	display: none;
    }