Support

Account

Forum Replies Created

  • I changed it too this and it still shows up in “posts”.

  • Yes, the wp_login_hook is what i use for that.

    I cannot, with the DOCs, understand how to attach an image to a user-field….
    Maybe there are somebody with a few pointers here ?
    And is my assumption of doing a User-group with firstname, lastname and image-field correct?

  • function acf_json_ipm($json_acf_url_field, $acf_radio_field) {
            //Make a request
            $json_request = 
            wp_remote_get('https://jsonplaceholder.typicode.com/photos/1');
            if( is_wp_error( $json_request ) ) {
                return false; // Bail early
            }
            
            // Get JSON and Decode        
            $json_body = wp_remote_retrieve_body( $json_request );
            $json_data = json_decode( $json_body );
           
            // Import values from JSON
            $values = array (
                
                    'field_619788e2cde63' =>$json_data,
                    'field_61978bfe4a2c2' =>$json_data,
                    'field_61978c0898706' =>$json_data,
                    'field_61978c4c98707' =>$json_data,
                    'field_61a8c63bea0c0' =>$json_data,
            );
    
            //Update Group field and save1
            update_field('acf_group_field_key', $values);

    I am trying to populate some ACF-fields as you can see above with data coming from a JSON.
    I used your code because it makes alot of sense to me.
    Is this a correct rewrite? Should i create a new thread?.

Viewing 3 posts - 1 through 3 (of 3 total)