i am toying with myCred and would like to reward logged in users for sharing content bringing in visitors. myCred offers affiliate linking by user-id, so I figure, I "only" need to achieve appending the currently logged-in user's user ID to whatever permalink wordpress renders (be they posts, pages, listings, comments, buddypress actions, etc. - wherever a permalink is issued by my site), like so
I've spent the last hours sifting thru many similar Q&As here + trying to adapt what I found to my scenario; alas, I'm rather unskilled at any real programming and hence had no success so far.
I figured out how to check if myCred is active,
if( class_exists( 'myCRED_Core' ) )], how to limit execution to logged in users, how to get the current user's ID [
$current_user_id = get_current_user_id();] and that I'll probably have to do something like
$affiliate_url = add_query_arg('mref', $current_user_id, get_permalink());
but I don't know how to make it apply for all links rendered for my site.
Is there a way? Thank you for what help you can provide. Cheers - LX