It’s really strange. After the post is submitted (and as long as status is pending), the topic is included in the users subscriptions: (var_dump on wp_footer)
bbp_get_user_subscribed_topic_ids( $reply_author_id );
bbPress Moderation uses the hook “pending_to_publish” to send an Info to all subscribed users that this new reply is published:
function pending_to_publish( $post )
{
...
bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );
}
If I add this:
bbp_get_user_subscribed_topic_ids( $reply_author_id );
into this function before or below “bbp_notify_topic_subscribers” and write a var_dump to a separate file, the topic-id is still inside the topic-id-array during the publish process ( {old}_to_{new} ).
But if I var_dump this array directly afterwards (frontpage: page reload –> wp_footer ), the id isn’t still in there (email fails if I post with another user).
It seems that anything erase this specific topic-id for this specific reply-author between publish and the next page load. All other topic-ids are still in this array..?
To add it manually to the hook ‘publish_reply’ with this bbp-function doesn’t work:
bbp_add_user_topic_subscription( $reply_author_id, $topic_id );
Has anybody an idea why this can happen?
As long as the reply isn’t publish, everything works right with the subscription. It’s also possible to manually add this user to this specific topic after the reply is published. But if this user send a new post for this topic, the topic-id is erased inside the subscription array after publishing..
No caching is active…