[ad_1]
Hi Jordy,
This is how I want to rename the files after uploading them (and in bulk):
ACF field – Title – ID
For example:
sale-this-is-property-title-1458__01.jpg
I tried to use this code:
function custom_filter_filename($new, $old, $post) {
$p_id = $post['ID'];
$p_title = $post['post_name'];
$buy_rent = get_field('buy_rent', $p_id);
return $buy_rent.'-'.$p_title.'-'.$p_id.'.jpg';
}
add_filter('mfrh_new_filename', 'custom_filter_filename', 10, 3);I use the PRO version.
Best regards,
Peter
