Skip to main content
Easy Digital Downloads Documentation
Documentation, Reference Materials, and Tutorials for Easy Digital Downloads

EDD_HTML_Elements

The EDD_HTML_Elements class provides a series of helper methods for rendering commonly used HTML fields with consistent markup, class names, and attributes.

The class includes methods for the following field types:

product_dropdown()

This method creates a
select html element with products in it. Values are product_ids and the text is Download titles.

Example:

echo EDD()->html->product_dropdown();

This would create a drop down list of products.  The method takes one input, an array, and has these defaults:

$defaults = array(
	'name'        => 'products',
	'id'          => 'products',
	'class'       => '', 
	'multiple'    => false,
	'selected'    => 0,
	'chosen'      => false,
	'number'      => 30, 
	'bundles'     => true,
	'placeholder' => sprintf( __( 'Select a %s', 'easy-digital-downloads' ), edd_get_label_singular() )
);

Here’s a description of what’s in each option:

name

This would be the html “name” property of the form element.  Defaults to ‘products’.

Example:


class

This would be the “class” property of the html element.  Defaults to nothing.

Example: