woocommerce_short_description limit

asdriel

Member
Apr 26, 2019
198
17
18
www.bantu-2rsn.com
Hi i have this code, but it's doesn't work
I want to limit user's to use only 4 numbers on short description. any help????

add_filter( 'woocommerce_short_description', 'prefix_filter_woocommerce_short_description' );
function prefix_filter_woocommerce_short_description( $post_post_excerpt ) {
{ ?>
<script>

function Onlyletters(e, t) {
try {
if (window.event) {
var charCode = window.event.keyCode;
} else if (e) {
var charCode = e.which;
} else {
return true;
}
if (
(charCode > 64 && charCode < 91)
(charCode > 96 && charCode < 123)
(charCode > 191 && charCode <= 255)
){
return true;
} else {
return false;
}
} catch (err) {
alert(err.Description);
}
}

</script>
<?php }
}
 

Forum statistics

Threads
69,481
Messages
909,912
Members
239,735
Latest member
jasonli

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu