Skip to content

Comments

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

Open
meloniq wants to merge 1 commit intoscribu:masterfrom
meloniq:feature/forms-extra-data
Open

Forms: Fix passing extra data to radio and multi checkbox fields#59
meloniq wants to merge 1 commit intoscribu:masterfrom
meloniq:feature/forms-extra-data

Conversation

@meloniq
Copy link
Contributor

@meloniq meloniq commented Nov 23, 2020

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>

@dikiyforester
Copy link
Contributor

Added to #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants