• Resolved roblund

    (@roblund)


    Is there something I can add to theme functions that will automatically add the Earned User Achievement Widget to new sites registered on a Multi site install? If this is possible, can the default widget title, number of achievements and the points total be set in theme functions as well? I’m a bit of a php noob, any help would be much appreciated.

    https://www.ads-software.com/plugins/badgeos/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    At the moment, there’s no easy or great way to set some default widgets and widget values. This is the case with WordPress in general, and not just BadgeOS’ plugin.

    That said, I think some filters applied to the default values for the widgets is not a bad idea. I’ve talked with our other developers and they’re fine with the idea. So hopefully in a future release we’ll be able to let users set default values that way.

    If you’re not familiar with hooks and filters, you can read up on them at https://codex.www.ads-software.com/Plugin_API

    Thread Starter roblund

    (@roblund)

    Thanks Michael, I found something that works for my situation. I am able to display the users earned badges from the main site on new sites and change the default widget title using the following code in the appropriate template file:

    <?php switch_to_blog(1);
              get_sidebar();
              the_widget( 'earned_user_achievements_widget', 'title=My Latest Badges', 'before_title=<h3 class="style-sidebar">&after_title=</h3>' );
              restore_current_blog();
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Earned User Achievement Widget’ is closed to new replies.