wp-scb-framework icon indicating copy to clipboard operation
wp-scb-framework copied to clipboard

Forms: Fix passing extra data to radio and multi checkbox fields

Open meloniq opened this issue 4 years ago • 1 comments

Issue: Currently data passed in the extra argument being ignored/omitted in the radio and multi-checkbox fields.

Example:

$field = array(
	'title'    => __( 'Gender' ),
	'name'     => 'gender',
	'type'     => 'radio',
	'values'   => array(
		'f' => __( 'Female' ),
		'm' => __( 'Male' ),
	),
	'extra' => array( 'disabled' => 'disabled' ),
);

$input = scbForms::input( $field );

Result:

<label><input name="gender" value="f" type="radio"> Female</label>
<label><input name="gender" value="m" type="radio"> Male</label>

Expected result:

<label><input disabled="disabled" name="gender" value="f" type="radio"> Female</label>
<label><input disabled="disabled" name="gender" value="m" type="radio"> Male</label>

meloniq avatar Nov 23 '20 12:11 meloniq

Added to #60

dikiyforester avatar Feb 12 '21 07:02 dikiyforester