Additional Shortcodes adds some additional shortcodes to the Easy Digital Downloads plugin. The shortcodes supplied allow showing or hiding content based the following conditions:
- If the cart contains specific products
- If the cart is empty
- If the current user has made previous purchases
- If the current user has no made no previous purchases
- If the visitor is logged in
- If the visitor is logged out
- If the user has active licenses (Software Licensing required)
- If the user has expired licenses (Software Licensing required)
Shortcode Examples
Show only if the cart has items in it
[edd_cart_has_contents]Content Here[/edd_cart_has_contents]
Show only if the cart contains specific items
[edd_items_in_cart ids="20"]Content Here[/edd_items_in_cart]
[edd_items_in_cart ids="20,34,25:1"]Content Here[/edd_items_in_cart]
[edd_items_in_cart ids="20,34,25:1" match="all"]Content Here[/edd_items_in_cart]
[edd_items_in_cart ids="20,34,25:1" match="any"]Content Here[/edd_items_in_cart]
Show only if the cart is empty
[edd_cart_is_empty]Content Here[/edd_cart_is_empty]
Show if the user has made previous purchases (will always be hidden if logged out)
[edd_user_has_purchases]Content Here[/edd_user_has_purchases]
Show only if the user has no purchases. Includes the ‘loggedout’ parameter to specify if logged out users should be included in seeing the content. (Default true)
[edd_user_has_no_purchases loggedout=true]Content Here[/edd_user_has_no_purchases]
Show content only if a user is logged in
[edd_is_user_logged_in]Content Here[/edd_is_user_logged_in]
Show content only if a user has purchased any of the specified download ids. Supports multiple IDs. If a download has variable pricing, you can pass just the ID for all options, or : for a specific variable pricing option.
[edd_user_has_purchased ids="20,34,25:1"]Content Here[/edd_user_has_purchased]
Software Licensing Support
Show if the logged in user has active licenses
[edd_has_active_licenses]Content Here[/edd_has_active_licenses]
Show if the logged in user has expired licenses
[edd_has_expired_licenses]Content Here[/edd_has_expired_licenses]