Skip to:
Content
Pages
Categories
Search
Top
Bottom

Function to check if user is subscribes to a current forum

  • @babblebey

    Participant

    Hello there,

    Thank you for viewing this thread.

    I am trying to set a button for based on users current forum subscription status

    When a User “is not Subcribed” to Current Forum

     
    <button type="button" class="btn-lg omna-btn-green shadow-sm" id="forum-subscription-btn"><i class="fa fa-bell"></i> <?php bbp_forum_subscription_link(); ?></button>
    <p>Subscribe to this forum and get updates on latest topics</p>
    

    screenshot-localhost-2019-11-01-17-05-28

    When a User “is Subscribed” to Current Forum

     
    <button type="button" class="btn-lg omna-btn-green shadow-sm" id="forum-subscription-btn"><i class="fa fa-bell-slash"></i> <?php bbp_forum_subscription_link(); ?></button>
    <p>Unsubscribe from this forum and stop receiving updates on latest topics</p>
    

    screenshot-localhost-2019-11-01-17-09-06

    So My Code is suppose to look something like

    
    <?php if (user_is_subcribed_to_this_forum): ?>
        <button type="button" class="btn-lg omna-btn-green shadow-sm" id="forum-subscription-btn"><i class="fa fa-bell-slash"></i> <?php bbp_forum_subscription_link(); ?></button>
        <p>Unsubscribe from this forum and stop receiving updates on latest topics</p>
    <?php else: ?>
        <button type="button" class="btn-lg omna-btn-green shadow-sm" id="forum-subscription-btn"><i class="fa fa-bell"></i> <?php bbp_forum_subscription_link(); ?></button>
        <p>Subscribe to this forum and get updates on latest topics</p>
    <?php endif; ?>
    

    The right function to use in-place of user_is_subcribed_to_this_forum is what i seek.

    Thanking you in anticipation of a working response.

Viewing 5 replies - 1 through 5 (of 5 total)
  • @robin-w

    Moderator

    bbp_is_user_subscribed_to_forum($forum)

    @babblebey

    Participant

    Thank you very much.

    If only the codex https://codex.bbpress.org/developer/ was completed.

    Please, I might need the same for if A TOPIC is Favourited and if a TOPIC is Subscribed to

    @robin-w

    Moderator

    bbp_is_user_subscribed_to_topic()

    bbp_is_user_favorite( $user_id, $topic_id );

    @babblebey

    Participant

    Thank you Robin, You are the best!

    @robin-w

    Moderator

    great – glad you are fixed

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar