Support » Plugin: BadgeOS Community Add-on » Showing all achievements in profile

  • Resolved wedgetalon


    I’m trying to modify this plugin to show ALL achievements on the achievements tab in a user’s profile. I then intend to use CSS to highlight the ones that user has actually earned. I’ve almost got it working.

    In this plugin’s bp-members.php, I edited the function bagdeos_bp_member_achievements_content to use the following attributes when echoing badgeos_achievements_list_shortcode:

    $atts = array(
    	'type'        => 'all',
    	'limit'       => '100',
    	'show_filter' => 'true',
    	'show_search' => 'false',
    	'group_id'    => '0',
    	'user_id'     => bp_displayed_user_id(),
    	'wpms'        => badgeos_ms_show_all_achievements(),

    This works to display all the achievements, but the problem now is that the badges seem to be given the “user-has-earned” or “user-has-not-earned” css classes based on the VIEWER’S user id rather than the PROFILE’S user id.

    Any hint as to what I’m missing?

Viewing 1 replies (of 1 total)
  • Honestly, it’s not a good idea to be editing plugins like that, as you’ll have to re-apply the edits each time an update is pushed out.

    From the looks of the source code, bagdeos_bp_member_achievements_content() is simply a callback function that is attached to the bp_template_content action.

    You very likely could unhook the default one, if you so desire, and add your own that is simply a copy of the original function, with your edits. This would go in your theme folder so that it doesn’t get overwritten by future plugin updates.

    Can’t say I can offer a lot of help for that level of customization, but I’m not afraid to throw out ideas to you. I am definitely going to encourage finding a way to not be editing the plugin directly though.

    That said though, it looks like it ends up using badgeos_achievements_list_shortcode() which is a function used with the available shortcodes, and doesn’t offer a filter for the arguments. It simply grabs the global $user_ID, which, at the end of the day, would indicate that this may not be the best function to use for your use case.

Viewing 1 replies (of 1 total)
  • The topic ‘Showing all achievements in profile’ is closed to new replies.