Developer – How to Programmatically Generate Express Login Link

The plugin provides a filter, using which you can programmatically generate express login link.

The filter


The arguments

  1. The target URL (optional): This should be the URL of the page where the user will be redirected after a successful login. The default value is home page URL
  2. The Email address (required): This should be the Email address of the user for whom you want to generate the express login link.
  3. The validity (optional): The validity of the generated express login link. e.g. 1 day, 5 days, etc. The default value is 1 month.
  4. The link text (optional): When the link text is passed, the return value will be HTML code of the link which you can paste on any webpage. If this is not passed, the return value will be the URL only.

Sample code

$link         = '';
$email        = '';
$valid_for    = '5 days';
$link_text    = 'Express login link';
$express_link = apply_filters( 'sa_express_login_link', $link, $email, $valid_for, $link_text );

Recommended Reading

FAQ 2 from here.