BuddyDev

Search

Buddypress – Block update notifications?

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #11823

    Hi Brajesh Singh,

    I need your help again.

    I am using this custom notification code. It works perfectly.
    https://gist.github.com/himurajutsu/eb5737baf229e73460d6a88e67dee62c

    When I open a new blog post, all users are notified. (True)

    But when I update the post, all users are notified again. (False)

    How do I prevent this?

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #11834

    Hi Ekiz,
    Instead of publish post, you should add notification on transition_post_status and make sure to change that the status transition is from non published to publish.

    Please see an example here
    https://codex.wordpress.org/Post_Status_Transitions

    Hope that helps.
    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #11852

    add_action( 'transition_post_status', 'bp_post_published_notification', 99, 2 );

    Sorry. It did not work

  • Participant
    Level: Initiated
    Posts: 16
    Ekiz on #11865

    Please, can you give a more detailed explanation?

You must be logged in to reply to this topic.

This topic is: not resolved