• Resolved Rasetsukoku

    (@rasetsukoku)


    Hi, I’m trying to run several functions on transition_post_status when the post status goes from future to publish, but the function is never executed when the scheduled post is published.

    I write to a file every time transition_post_status is called, but the file has never been modified when a scheduled post becomes public, like it doesn’t leave a trace, I’m not sure how else to check it.

    -It will catch everything else except future->publish. If I do draft->immediate publish, my intended things work fine. But not when scheduled.
    -The same happens with publish_post too.
    -I disabled all my plugins, but it is still not firing on future->pulish.
    -I’m on a multisite and this is in a plugin for all sites.

    What can I do? I’m a bit at my wit’s end for how to get things to happen when a scheduled post becomes published.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Using such hooks is not a problem on my site. How and where are you adding the action hook?

    Thread Starter Rasetsukoku

    (@rasetsukoku)

    It is in a plugin, which is network enabled on all sites on multisite.

    However, I did a fresh WordPress install and added the hook into functions.php and the same thing happened,
    transition_post_status catches every post status change other than future->publish.

    This is the hook:
    add_action( ‘transition_post_status’, ‘TEMP_MAIL_ON_PUBLISH’, 10, 3 );

    I have tried:
    publish_post, future_to_publish, transition_post_status … none of them fire.

    Thread Starter Rasetsukoku

    (@rasetsukoku)

    So I disabled WP cron and enabled system cron instead, and now my posts are caught and working correctly. Very strange.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘transition_post_status not firing from future->published’ is closed to new replies.