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

Cannot set custom HTML attributes for the min and step attributes #227

Open
3 tasks done
ipokkel opened this issue Dec 15, 2021 · 0 comments
Open
3 tasks done

Cannot set custom HTML attributes for the min and step attributes #227

ipokkel opened this issue Dec 15, 2021 · 0 comments

Comments

@ipokkel
Copy link
Member

ipokkel commented Dec 15, 2021

Describe the bug
When setting html_attributes options for min and step these attribute values are not set for the element as per field creation code.

To Reproduce
Steps to reproduce the behavior:

  1. Create a code snippet for the site that creates a number field and add min and step to the html_attributes option.
$fields[] = new PMProRH_Field(
	'test_number_min_step', // input field name, used as meta key
	'number',         // field type
	array(
		'label'           => 'Number Test', // display custom label, if not used field name will be used
		'html_attributes' => array(
			'min'  => '5',
			'step' => '5',
		), // add valid html input field attributes
		'hint'            => 'This is a test of html attributes for a number field', // display a hint under field
		'profile'         => true, // show on profile
	)
);
  1. Navigate to the Membership Checkout page on the frontend.
  2. Inspect rendered HTML for the number field.
  3. See error
<input type="number" min="0" step="1" pattern="\d+" id="test_number_min_step" name="test_number_min_step" value="" size="5" class="input ">

Expected behavior
That HTML attributes created for a field to be set in the rendered HTML for the element

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.
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 a pull request may close this issue.

1 participant