Create a post or page link to an e-commerce post then use short-codes in the post to access any field or meta information from the e-commerce post such as the excerpt, thumbnail and title.
- Select the linked post using a meta-box dropdown from within the post definition
- Over 40 shortcodes to access download information
- Access any post meta value by meta key
The plugin requires PHP 5.3 or later. It is tested with WordPress up to 4.6.1Download from the WordPress plugin store
So what’s the point?
On our site we use Easy Digital Downloads. Once an EDD download (e-commerce product) definition has been created it is usually supported by other posts that provide additional information – help or tutorial information for example. Ideally, these posts will have a similar style, use similar words and need to reference the same core information about the download such a the current version number, the slug, the excerpt, etc..
One way is to cut-and-past information from a download in to each post. But this means that when download details change, its essential to remember to update any related posts. This plugin provides another way: a set of plugins that allow you to reference post and page link details from an e-commerce post and in this way remove the need to update related posts.
Post field short-codes
The following are short-codes made available by the plugin to access the fields of a download or post:
id, author, date, date_gmt, content, title, excerpt, status, comment_status, ping_status, password, name, slug, to_ping, pinged, modified, modified_gmt, content_filtered, parent, guid, menu_order, type, mime_type
Post meta short-codes
The following are short-codes made available by the plugin to access meta values associated with a post or page link:
earnings, sales, price, sku, limit, version, changelog, thumbnail_id, licensing_enabled, product_license, doc_link, license_expiry_unit, license_expiry_length, license_keys, download_terms
All short-code will default to access the property of the same name from the download linked to the current post. But, each short-code takes an ‘id’ parameter that can be used to specify the id of any post and so allow access to the named field or meta value from that post.
The short-codes listed are usually contractions of the real post field or meta value and the list does not cover all possible meta values in which you might be interested. The plugin includes another short-code called dpp_link that allows you to access the value associated with any meta key.
The dpp_link short-code has two parameters. One is ‘id’ which is the id of another post and which defaults to the linked download. The other is ‘field’ which can be used to specify any meta key.
[dpp_link id=1234 field=_thumnail_id]
The plugin supports three other special short-codes: permalink, thumbnail and show.
[permalink] returns the permalink associated with the linked download.
[thumbnail] returns an ‘img’ tag that references the thumbnail aassociated with the linked download. This shortcode supports an extra optional parameter called ‘size’ which provides an opportunity to specify one of the valid theme sizes.
[show] creates an anchor link to the the linked download page. This short-code has two extra optional parameters. One is called ‘class’ and can be used to specify one or more CSS classes for the link. The other is called ‘target’ and should contain a valid target name for an anchor tag.