Skip to content

Instantly share code, notes, and snippets.

View protorob's full-sized avatar

Roberto Enrique Briceño García protorob

View GitHub Profile
@kloon
kloon / functions.php
Created January 22, 2014 07:37
Limit the width and height values customers can enter using Measurement Price calculator
<?php
// Limit the values customer can enter using measurement price calculator area ( LxW ) option
add_action( 'wp_head', 'limit_measurement_values', 99 );
function limit_measurement_values() {
if ( is_product() ) {
?>
<script>
jQuery( document ).ready(function() {
jQuery( '#length_needed' ).change( function() {
if ( jQuery( this ).val() > 100 ) jQuery( this ).val( 100 ).keyup();