Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to force change avatar photo via php


  • merce01
    Participant

    @merce01

    I will use a file outside of WordPress in php to change the photo via ajax using a url

    how to proceed?

    
     $res = bp_attachments_create_item_type( 'avatar', [
        'item_id'   => 1,
        'object'    => 'user',
        'component' => '',
        'image'     => "https://meydomain.com.br/wp-content/uploads/avatars/11/1680022705-bpthumb.jpg",
        'crop_w'    => 300,
        'crop_h'    => 300,
        'crop_x'    => 0,
        'crop_y'    => 0,
        ] );
        
        if($res) {
            echo 'ok';
        }else echo 'not ';
        print_r($res);
    

    return : not

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar