Skip to:
Content
Pages
Categories
Search
Top
Bottom

suscribe all my users to a forum

  • @emineminero

    Participant

    Hi, i want to suscribe all my users to my forum (ID = 1687), this is what i have but is not working, what can i do?

    <?php
    $args = array(

    );
    $blogusers = get_users($args);
    echo count($blogusers);
    foreach($blogusers->username as $user){
    $the_user = get_user_by(‘login’, $user);
    $usuario = $the_user->ID;
    bbp_add_user_forum_subscription($usuario ,1687);

    }
    ?>

    Thanks

Viewing 1 replies (of 1 total)
  • @casiepa

    Moderator

    Hi,
    Have a look at the code I used for my bbP Manage Subscriptions plugin (https://wordpress.org/plugins/bbp-manage-subscriptions/). Maybe you find in there what you need.

    Bulk actions are next on the list (hopefully by mid January), but feel free to take part of the code for your own project now.

    Pascal.

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