Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save_profile_data(){
- if( $profile = $this->input->post('profile') ){
- $user = $this->input->post('user_id');
- $user = get_userdata($user);
- $profile = $this->data_model->add_profile_meta($profile);
- if(isset($_FILES['member_photo']) && !empty($_FILES['member_photo']['name'] ) ){
- $overrides = array( 'test_form' => false);
- $file=wp_handle_upload($_FILES['member_photo'], $overrides);
- $filename = $file['file'];
- $attachment_id = $this->add_attachment($filename);
- update_user_meta($user->ID, 'member_photo', $attachment_id );
- }
- if(isset($_FILES['company_logo']) && !empty( $_FILES['company_logo']['name'] ) ){
- $overrides = array( 'test_form' => false);
- $file=wp_handle_upload($_FILES['company_logo'], $overrides);
- $filename = $file['file'];
- $attachment_id = $this->add_attachment($filename);
- update_user_meta($user->ID, 'company_logo', $attachment_id );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement