- This topic has 3 replies, 2 voices, and was last updated 7 years, 9 months ago by
Jason.
-
AuthorPosts
-
-
April 29, 2014 at 5:21 pm #1673
JasonKeymasterI found a strange bug today. Take a look at this:
piklist('field', array( 'type' => 'number', 'field' => 'price', 'label' => __('Price ($)'), 'attributes'=> array( 'placeholder' => 'Free', 'pattern' => '[0-9]+([\,|\.][0-9]+)?', 'step' => 0.01, 'min' => 0 ) ));So I’m using the number field, which applies a default value of 1 to the step and min attributes. This works fine. But, if I change the min attribute, as I’m doing above, if actually removes the attribute from the element. I’ve checked the inspector. If I remove the ‘min’ => 0 line, it has a min of 1; if I leave it, there’s no min.
After a brief digging, I found line 1741 in class-piklist-form and changed it to the following:
if (isset($value) && ($value !== '') && !in_array($key, $exclude))That made sure it’s not an empty string (which would produce a “=value”), it’s set, and it’s not null. Otherwise it didn’t accept a value of 0.
Hope this helps!
-
April 29, 2014 at 5:27 pm #1674
JasonKeymasterI made a pull request for this.
-
April 29, 2014 at 8:26 pm #1676
-
April 30, 2014 at 9:47 am #1680
JasonKeymasterThanks! Glad to help!
So.. it turns out that the wp-plugins/anything on github is just a mirror of the plugins available from WP. Making a pull-request there does absolutely nothing. 🙂
Is the only way to contribute to Piklist through svn, currently?
-
-
AuthorPosts
- You must be logged in to reply to this topic.