Thanks so much I’ll take a look
That did it! I had no idea one could do that. Thanks so much for your patience.
Sorry what I meant was, keeping the field as is so its a select field that returns a string of “red” or “white” and then using something like the below to replace “red” with the url of the image
function my_acf_load_value( $value, $post_id, $field ) {
if( is_string($value) ) {
$value = str_replace( ‘Old Company Name’, ‘New Company Name’, $value );
}
return $value;
}
My initial thought was to do something like this https://www.advancedcustomfields.com/resources/acf-load_value/ where I replace the string of the value with the url of the image but wasn’t sure if that would do the trick
The front end requires a choice between two different logo colors depending on the background that the user sets. White logo or red logo. Those are the only two options. Currently I have a select option where the user chooses red or white and then display both using elementor but show/hide one based on what the user chooses but it’s very clunky and doesn’t work well for repeater fields. So the option will always be one of two different images. The problem with letting the user upload or choose the image from the media library is that we’re trying to limit the possibility of human error.
Thanks that did the trick
Thanks yes a mailto: prepend would do this.
So it would look something like this?
add_filter(‘acf/format_value/type=email’, “mailto:”, 10, 3);
Thanks so much
So I’ve figured out #2 but #1 is the tricky part
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.