Images for posts published using wp_insert_post and set_post_thumbnail
-
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 usingwp_insert_attachment
andset_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.
- The topic ‘Images for posts published using wp_insert_post and set_post_thumbnail’ is closed to new replies.