edd(sample)

Display a convenient license activator & plugin update checker for Easy Digital Downloads distributed plugins & themes.

Thank you to Julien Liabeuf @julien731 for creating the EDD License option 🙂

Option Details & Parameters

Type: edd-license

Returns: string

Version Introduced: 1.7, Update checking added on 1.7.2

Can be placed in: Admin Panels , Admin Tabs , Meta Boxes , Theme Customizer

Requirements: You’ll need a live site that has Software Licensing for Easy Digital Downloads running.

Parameter Type Description
name string The name of the option, for display purposes only.
id string A unique ID for this option. This ID will be used to get the value for this option.
desc string The description to display together with this option.
server URL The URL to the site that has the Software Licensing for Easy Digital Downloads plugin installed. The URL should be prefixed with http://.
item_name string The item name of the product to check the license against EDD. This should be exactly the same as the download name on the remote server.
file string The absolute path to either the main plugin file (for plugins), or the style.css file functions.php (for themes). Most of the time, using __FILE__ would be sufficient. This is required for update checking, this was introduced in v1.7.2
is_password boolean (Optional) If true, the field will be displayed as a password field and the value cannot be seen. Defaults to false
placeholder string (Optional) Placeholder text to display inside the field if it’s empty.
default string (Optional) The default value of the option. Defaults to blank

Returned Values

The license code saved

Important Note

As of v1.7.2, this option performs plugin/theme update checking by itself.

Prior to v1.7.2, this option does not perform the plugin/theme update checking. The actual checking was still performed by your plugin/theme.

Examples

Creating an EDD License option – this activates the inputted license key & also checks for updates:

$panel->createOption( array(
'name' => 'EDD License Option',
'id' => 'my_license',
'type' => 'edd-license',
'desc' => 'Please enter your license key to receive updates',
'server' => esc_url( 'http://mycoolsite.com' ),
'file' => __FILE__, // Assuming this was called inside your main plugin script
'item_name' => 'My Product',
) );