Title: Upload Avatar using PHP
Last modified: January 13, 2023

---

# Upload Avatar using PHP

 *  [msowah](https://wordpress.org/support/users/msowah/)
 * (@msowah)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/upload-avatar-using-php/)
 * Is there hook or function or action I can use to send my avatar using PHP instead
   of rest API.?

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Faisal Alvi](https://wordpress.org/support/users/faisal03/)
 * (@faisal03)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/upload-avatar-using-php/#post-16407710)
 * Hi [@msowah](https://wordpress.org/support/users/msowah/),
 * Thank you for writing to us! Yes, you can do so with a PHP function.
 *     ```wp-block-code
       $sla = new Simple_Local_Avatars();
       $sla->assign_new_user_avatar( $url_or_media_id, $user_id );
       ```
   
 * Where, `$url_or_media_id` is a URL for an image/avatar or an ID of the attachment
   available in the Media Library.

Viewing 1 replies (of 1 total)

The topic ‘Upload Avatar using PHP’ is closed to new replies.

 * ![](https://ps.w.org/simple-local-avatars/assets/icon.svg?rev=2783752)
 * [Simple Local Avatars](https://wordpress.org/plugins/simple-local-avatars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-local-avatars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-local-avatars/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-local-avatars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-local-avatars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-local-avatars/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Faisal Alvi](https://wordpress.org/support/users/faisal03/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/upload-avatar-using-php/#post-16407710)
 * Status: not resolved