ACF pro auto populated field is not saving

admin2025-01-07  4

I have auto-generated a text field value from another field in ACF pro. The field is showing the data but I can't use it anywhere. I assume it doesn't save or update. Here are my code

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');

How can I show it in the template?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736259755a613.html

最新回复(0)