Order of publishing and image

Home Forums Calendar Products Event Aggregator Order of publishing and image

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1323855
    dswiese
    Participant

    I have a workflow that imports from FB, via EA, then uses a plugin ‘WP to Buffer Pro’ to push events to Buffer on publish, or otherwise manually on updates, etc.
    Its the publishing of events I have a question with.

    The issue has been that when a new event is imported from FB, and subsequently sent to Buffer, there is no “featured image” sent as well.
    This does not occur with updated events, or events that are manually published.

    I reached out the plugin author, and they indicated it may be due to the order that the EA triggers the publish and then attached the featured image?

    Please see their notes below

    This is happening due to their plugin not considering third party plugins. Roughly speaking, on importing an event, their plugin:
    1. Create the Post, using wp_insert_post(), in publish mode. This triggers transition_post_status, which will be ‘publish’ and therefore trigger our plugin.
    2. Assign the Featured Image to the created Post – this is too late, as by then the Post has already been published.

    We can’t control the above process, but can only recommend what we have done for several other third party plugins, which is to adjust their process as follows:
    1. Create the Post, using wp_insert_post(), in draft mode. This doesn’t trigger transition_post_status to be ‘publish, and therefore doesn’t trigger ours (or any other plugins) that might reasonably rely on the publish event.
    2. Assign the Featured Image to the created draft Post
    3. Update the draft Post’s status to Published. This triggers transition_post_status, which will be ‘publish’ and therefore trigger our plugin. As the Post now has the Featured Image, we’ll include it in the status update to Buffer.

    I would at least like to see if this is how the EA publish works and if its possible to change?

    #1325496
    Barry
    Member

    Hi @dswiese,

    Great question!

    What they outlined is indeed a pretty good summary of the order of operations. The event is created and published and after that various other things happen (the import and attachment of a featured image amongst them). It’s possible to configure the importer to make new events drafts, rather than publishing them, however.

    One thing I would take issue with is their assertion that we are “not considering third party plugins”. We always try hard to follow WordPress best practices and use the standard WP API wherever we can (and are doing so here), but naturally enough there will be cases like this one where things don’t mesh.

    We would be up for considering a change to our flow, here, though I can’t guarantee anything – simply because we’d need to pause and ask if it makes sense in all cases. If you’d like us to do this, please propose a new feature over on UserVoice – apart from anything else, this will allow other users to vote on the idea and we’ll have a better sense of how much demand their might be:

    UserVoice (feature requests for The Events Calendar and our other plugins)

    In terms of what you can do right now, it may be possible to create a glue or integration layer via custom snippet. Here’s a possible strategy:

    • Configure Event Aggregator to create new events as drafts
    • Create a a script that periodically looks for drafts imported by Event Aggregator and publishes them (independently of our own processes)

    This is the sort of custom coding task I’m afraid we can only provide high level assistance with, but it might give you a workaround that let’s you integrate both plugins nicely.

    #1335571
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Order of publishing and image’ is closed to new replies.