Skip Navigation

[Resolved] I want to bulk edit custom fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 1 voice.

Last updated by Minesh 3 weeks, 6 days ago.

Assisted by: Minesh.

Author
Posts
#2801154

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.

#2801215

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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

More info:
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data