I added a new custom field. I want to bulk-edit this custom field for some custom posts.
I have added many preschools to my website. A particular chain of schools has the same logo. So, I want to select 50 preschools and add logo instead of editing each.
Hello. Thank you for contacting the Toolset support.
From where you want to do this action - from backend admin or frontend?
However - either you want to do this from backend or frontend there is no such feature available.
If you intended to use the frontend form then maybe you can create a post edit form and then add the logo field you want to edit on that form and use the "cred_save_data" hook where you can add your business logic where you assign the uploaded logo to your desired schools using the above hook.
For example:
add_action('cred_save_data', 'func_update_custom_logo',10,2);
function calculate_days_func($post_id, $form_data) {
if ($form_data["id"]==9999) {
$target_school_ids = array(111,222,333);
foreach($target_school_ids as $k=>$postid):
update_post_meta($postid, 'wpcf-school-logo',$uploaded_school_logo_value);
endforeach;
}
}
Where:
- You can adjust the 9999 with your original edit post form ID
- $target_school_ids will hold the shool ids where you want to update the logo
- adjust the code as required where applicable