Skip to content

Instantly share code, notes, and snippets.

@timersys
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timersys/8b9d6d133bf6a9964d85 to your computer and use it in GitHub Desktop.
Save timersys/8b9d6d133bf6a9964d85 to your computer and use it in GitHub Desktop.
Wordpress Social Invitations share custom url for logged user
add_filter( 'wsi/placeholders/custom_url', 'wsi_my_custom_link' );
function wsi_my_custom_link() {
global $current_user;
get_currentuserinfo();
//return home url with ref username
return site_url('?mref='.$current_user->user_login);
//return the same shortened with goo.gl
//return Wsi_Queue::shortenUrl(site_url('?mref='.$current_user->user_login));
// you can also return ID $current_user->ID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment