I am trying to show an auto-populated field. I have generated it using load_field
filter.
I’ve auto-populated a textfield pmname using User select_a_project_manager field. I retrieved display_name and It auto-populated the pmname field. It’s working. Code below-
function pm_load_field( $field ) {
$user = get_field("select_a_project_manager");
if( $user ): ?>
<div class="author-box">
<h3><?php $user['display_name']; ?></h3>
</div>
<?php endif;
$field['value'] = $user['display_name'];
return $field;
}
add_filter('acf/load_field/name=pmname', 'pm_load_field');
The problem is I cannot show the pmname field in the template (In my case Elementor). It doesn’t return anything. So I assume the the field value is not saved. How can I save it?