sikovnej filtr pro acf (funkce v popisu)
You could use a filter of ACF via your theme functions.php, something like this:
A field named my_field, insert name at name= in add_filter() line.
A default value of php_default_hack for that field.
function my_acf_load_value( $value, $post_id, $field ) {
if ( $value == 'php_default_hack' ) {
// do your php magic here...
$value = 'this is set from php';
}
return $value;
}
add_filter( 'acf/load_value/name=my_field', 'my_acf_load_value', 10, 3 );
The code does this: If your field has the value php_default_hack during load, the value will be replaced by this is set from php.
See also
http://www.advancedcustomfields.com/resources/filters/acfload_value/
For your example, note that a new created post has no slug = post_name yet.