I would like to have the option for a single line text field with basic styling too. For now I’ll use the acf-medium-editor plugin. Would be nice to see this integrated in ACF or ACF Pro.
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;
}
I would like to know this as well. I have added some custom fields to attachments and it would be very nice to remove the caption, alt and description fields.
Any updates on this?
Thanks for the quick reply!
I think I’ve spoken to soon. The keyword I was searching for in phpMyAdmin was also part of a instructions field.
So field entries do get deleted when a post is deleted I guess?
Would really like to see this as well. Isn’t this just a matter of assigning a unique ID to each custom field and it’s entries? I think you already thought of that, but it would be very nice to see the entries removed when a field is removed. I like to keep the database nice and clean.
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.