Rename file by ACF field, title and ID
-
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.jpgI 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
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Rename file by ACF field, title and ID’ is closed to new replies.