I’m using an add to calendar widget from dynamic.ooo and for the event’s location, I need to pull in the post url/permalink. But that field does not exist in dynamic’s data function. But I can pull in any ACF field, including a URL field.
So I thought of creating an ACF that would be automatically generated/populated using the post’s permalink.
I searched through different ideas but couldn’t find anything. Is this possible?
https://www.advancedcustomfields.com/resources/acf-save_post/
add_filter('acf/save_post', 'post_permalink_to_field');
function post_permalink_to_field($post_id) {
$permalink = get_permalink($post_id);
update_field('acf_permalink_field', $permalink, $post_id);
}