For a specific development, I had to add a upload form to change the profile photo inside the admin user page.
functions.php
function add_link_avatar( $description, $profileuser ){
$description .= '<form action="#">';
$description .= '<input type="file" name="fileupload" value="fileupload" id="fileupload" accept="image/gif, image/jpeg, image/png">';
$description .= '<input type="submit" value="submit" class="button">';
$description .= '</form>';
echo $description;
}
add_filter( 'user_profile_picture_description' , 'add_link_avatar' , 1 , 2 );
How can I get the $_POST in functions.php
?
What value it needs for the action
attribute ?
$_FILES['fileupload']
in your functions.php to get the files. Also you should addenctype="multipart/form-data"
to your form.edit_user_profile_update
action hook. Here is an example.