How to define the avatar for posting on facebook?

When posting to facebook using the post_to_facebook() function with the FB-ID of the user (not of the blog) the avatar of the latest added admin user of the app is shown and sometimes no avatar at all. One should think that they should use the avatar you upload in the app settings on facebook, but that is not the case here. So can I do something programatically about it?

  • 3SixtyEvolve
    • New Recruit

    Hi @mediaempire

    I agree with you that the avatar uploaded in the app settings on FB should show up when posting to Facebook via the post_to_facebook() function, however, you mentioned that you’re using the FB-ID of the user and not of the blog and here is where the difference might come in.

    I would have to ask the Developer @vebailovity whether there is a workaround for this. Will ping him and wait for his input.

    In the meantime, if there is anything else we can assist with, please don’t hesitate to be in touch.

    Have a good day!

    Gina

  • mediaempire
    • WPMU DEV Initiate

    No thank you. This is my last question for this project :slight_smile:

    I have to emphasize again that not just the avatar of the user specified is used like in a normal facebook post, but additionally the avatar of the last added admin of the FB app is shown which is not very applicable. The second one is what I am talking about.

    Greetings

  • Vladislav
    • Dead Eye Dev

    Hi,

    I think I understand what happens – the plugin is actually trying to pull your featured image first and, if that fails, it then parses your post for images, then on failure uses whatever you set as fallback image in OpenGraph settings. Lastly, Facebook might try to fetch an image for your link if no image was found.

    To fix the issue, setting fallback image URL in plugin OpenGraph settings should help. If you’re comfortable with the code, you may want to add some more logic to your image choosing by hooking up to, say, “wdfb-opengraph-image” filter.

  • mediaempire
    • WPMU DEV Initiate

    Yes, thank you. I finished the project :slight_smile:

    Here is the solution: Vladislav said something about the “wdfb-opengraph-image” filter. I did not use the filter, but hardcoded it in wdfb_get_og_image() in wdfb_utilities.php. I commented out all lines from

    // Try to find featured image

    to the end where the applied filter is returned and replaced the returning line with

    return apply_filters(‘wdfb-opengraph-image’, ‘http://url.to/the/image.png’:wink:;

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.