• Resolved knaveenchand

    (@knaveenchand)


    The plugin is excellent and does what it says. However, I am using a php script to automate publishing of posts using wp_insert_post and then immediately after the post is published I am using a code to attach image using wp_insert_attachment and set_post_thumbnail

    So what is happening is that your plugin auto publishes to the facebook immediately after the post is created and it is not waiting until the image attachment is inserted and thumbnail is set.

    My guess, correct me if I am wrong, is that your plugin is triggered when publish_post action is triggered. And that is why, your plugin does not wait until the image is set. My observation is based on this line in your plugin file:

    facebook-auto-publish/admin/publish.php

    add_action('publish_post', 'xyz_fbap_link_publish');

    So my question is: how do I make your plugin work after the image is attached and it is triggers only after set_post_thumbnail function is complete. The purpose is to send the correct image to facebook while auto-posting.

    Thanks for your help.

    https://www.ads-software.com/plugins/facebook-auto-publish/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author f1logic

    (@f1logic)

    infact to handle such issues we are supporting scheduled publishing in premium version by which posts can be scheduled to publish sometime after post is published

    Plugin Author f1logic

    (@f1logic)

    or you may save your post as draft initally then attach images and finally do the publish part

    Thread Starter knaveenchand

    (@knaveenchand)

    Brilliant advice. It just works fine now. thanks a ton.

    MESWEB

    (@mesweb)

    I have this same problem. When I publish post with img then I got double images in media library How to change code php?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Images for posts published using wp_insert_post and set_post_thumbnail’ is closed to new replies.