Home › Forums › General Issues › Add Image Size to another ACF Field › Reply To: Add Image Size to another ACF Field
Hi thanks for this,
I am using
function my_acf_save_post( $post_id ) {
// get image id
$image = get_field('fl_image', $post_id);
// set the thumbnail URL field key
$thumbnail_url_field_key = 'fl_afeat';
// set the value of the thumbnail URL field
update_field($thumbnail_url_field_key, $image['sizes']['medium'], $post_id);
}
// run after ACF saves the $_POST['acf'] data
add_action('acf/save_post', 'my_acf_save_post', 20);
but nothing happens when I click on “Update Post”.
Both fields: fl_image and fl_afeat are image fields with the Image URL option set.
What would be wrong?
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.