Created
January 15, 2024 16:19
-
-
Save contemplate/b0be05bd2b72510e12e5462a75118f35 to your computer and use it in GitHub Desktop.
AffiliateWP: limit leaderbaord to specific affiliate group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'affwp_leaderboard_defaults', 'group_affwp_leaderboard_defaults', 10 ); | |
function group_affwp_leaderboard_defaults( $defaults ) { | |
$defaults['connected_to'] = array( | |
'get_connectable' => 'affiliate', | |
'where_connectable' => 'group', | |
'where_id' => 2, // ID of the affiliate group | |
'where_group_type' => 'affiliate-group', | |
); | |
return $defaults; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment