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;
}
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.