changing function to post array of data

Question

I’ve made function to add data to database but I need to add array of data instead of single insert.

add_action( 'dokan_store_profile_saved', 'save_categories_field', 15 );
function save_categories_field( $store_id ) {
    $dokan_settings = dokan_get_store_info($store_id);
    if ( isset( $_POST['seller_categories'] ) ) {
        $dokan_settings['seller_categories'] = $_POST['seller_categories'];
    }
update_user_meta( $store_id, 'dokan_profile_settings', $dokan_settings );
}

anyway to change it to add array?

0
Hossam Hamdi 1 year 2022-02-01T04:52:57-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse