Shortcodes

Prevent Direct Access Gold

The pda_private_link shortcode allows you to create a private link of any file protected by our PDA Gold.

You might want to use our shortcode on your thank you page content or content form email to create private and expiring access to your users. For instance, a private download link to your giveaway ebook, which expires after one click, will be sent to your users after they subscribe to your email newsletter.

[pda_private_link file_id=X download_limit=X download_expiry=X]

* Replace X by a positive integer

  • file_id (required): the id of your protected file
  • download_limit (optional): the number of times (clicks) user can access this private link
  • download_expiry (optional): the number of minutes after that the private download link will expire

If any of the file_id, download_limit or download_expiry attribute is invalid, we will show this error message: [pda_private_link] Invalid attributes or values Invalid attributes or values. Decimal values will automatically be rounded up.

This type of private links don’t show under our file protection popup and will be deleted every 24 hours by our cron job.

For MP3 & MP4 files, you’ll need to set the download limit to the minimum of 2 (clicks). Otherwise, the private links will expire immediately.

Protect WordPress Pages & Posts

The ppp_private_link shortcode is to create private access links from anywhere on your site.

The shortcode follows the format below:

[ppp_private_link post_id=X access_limit=X access_expiry=X]

* Replace X by a positive integer. Decimal values will be rounded up automatically.

  • post_id (required): the id of the protected content
  • access_limit (optional): the number of times (clicks) user can access this private link
  • access_expiry: the number of minutes after that the private link will expire

Since version 2.0.1, private links generated by shortcode will expire after one month by default, even though access_expiry isn’t added to shortcode. You can change this default value by setting our PPP_SC_DEFAULT_TIME_LIMIT constant in wp-config file.

define( 'PPP_SC_DEFAULT_TIME_LIMIT', time-in-munutes);

If you receive this error message: “The private link cannot be generated due to invalid attribute value”, please make sure your post is protected by PPP Gold plugin and you’re using positive integers.

The private links generated by shortcode will not show under plugin’s configuration popup and be deleted fortnightly by our cron job after expiration.
Lasted updated on March 23, 2020