Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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