Add guardrails to ‘Image CSS Class’ field when inserting images

[ad_1]

I’m building a website for a client, and they are looking for a way to add a standard border to some of the images within their posts.

One easy way to do this would be to create a CSS class called ‘image-border’ or something, and then tell my client to add that class to the ‘Image CSS Class’ field under ‘Advanced Options’ when inserting images into their posts if they want the image to have a border.

But I don’t want to make them remember the class name. I’d rather have a ‘Has Border’ checkbox, or change the ‘Image CSS Class’ field so that, rather than being a free text field, it would have a multi-select box of allowed classes. Or something along those lines.

I’m looking for the most low code, standard way of doing this that I can find. Does anyone have any suggestions?

Note that I am using ACF, and most of the images in question will be entered within an ACF WYSIWYG field.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer