Home / Admin / Add the “input hidden” field type to the EDD settings
Duplicate Snippet

Embed Snippet on Your Site

Add the “input hidden” field type to the EDD settings

Add 'input type="hidden"' to the type of input fields available when setting up your plugin's EDD settings

Code Preview
php
<?php
function edd_hidden_callback( $args ) {
	global $edd_options;
	if ( isset( $edd_options[ $args['id'] ] ) )
		$value = $edd_options[ $args['id'] ];
	else
		$value = isset( $args['std'] ) ? $args['std'] : '';
	$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
	$html = '<input type="hidden" class="' . $size . '-text" id="edd_settings[' . $args['id'] . ']" name="edd_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
	echo $html;
}

Comments

Add a Comment