Add file / Custom Field / Register form

I'm using thememylogin plug-in to register the user of my website. I would like to add a custom field with input-type="file" but i need that the uploaded pictures have to store into my wordpress database to display them in their profile page.

Here is the code for the register.php

    <p >     <label for="drivelicence<?php $template->the_instance(); ?>"><?php _e( 'Télécharger votre permis de conduire', 'theme-my-login' ) ?></label>     <input type="file" accept="application/pdf, image/jpeg, image/png" name="drivelicence"  id="drivelicence<?php $template->the_instance(); ?>" class="input" value="<?php $template->the_posted_value( 'drivelicence' ); ?>"/> </p> 

And here is how i wanted to display the image in User-edit.php ( user profil backend )

    <input  type="file" name="drivelicence" id="drivelicence" value="<?php echo esc_attr( get_the_author_meta( 'drivelicence', $user->ID ) ); ?>" class="regular-text" /> 

functions.php

add_action('show_user_profile', 'numediaweb_custom_user_profile_fields'); add_action('edit_user_profile', 'numediaweb_custom_user_profile_fields');  function save_extra_user_profile_fields( $user_id ) {     if ( !current_user_can( 'edit_user', $user_id ) ) {          return false;      }             update_user_meta( $user_id, 'drivelicence', $_POST['drivelicence'] );  } 

How can i store the image in the database and show it in user-edit.php

Replay

Category: custom field Time: 2016-07-29 Views: 0
Tags: custom field

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.194 (s). 12 q(s)