Replace jQuery.ready function with recommended way since jQuery 3.0 closes #27945

This commit is contained in:
roykho 2020-10-19 06:47:16 -07:00
parent ad59064c69
commit 8c73c5f2f8
No known key found for this signature in database
GPG Key ID: 9B06F996CD4ECB92
2 changed files with 2 additions and 2 deletions

View File

@ -565,7 +565,7 @@ class WC_Shortcodes {
$single_product = new WP_Query( $args ); $single_product = new WP_Query( $args );
?> ?>
<script type="text/javascript"> <script type="text/javascript">
jQuery( document ).ready( function( $ ) { jQuery( function( $ ) {
var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' ); var $variations_form = $( '[data-product-page-preselected-id="<?php echo esc_attr( $preselected_id ); ?>"]' ).find( 'form.variations_form' );
<?php foreach ( $attributes as $attr => $value ) { ?> <?php foreach ( $attributes as $attr => $value ) { ?>

View File

@ -102,7 +102,7 @@ class WC_Shop_Customizer {
$max_notice = __( 'The maximum allowed setting is %d', 'woocommerce' ); $max_notice = __( 'The maximum allowed setting is %d', 'woocommerce' );
?> ?>
<script type="text/javascript"> <script type="text/javascript">
jQuery( document ).ready( function( $ ) { jQuery( function( $ ) {
$( document.body ).on( 'change', '.woocommerce-cropping-control input[type="radio"]', function() { $( document.body ).on( 'change', '.woocommerce-cropping-control input[type="radio"]', function() {
var $wrapper = $( this ).closest( '.woocommerce-cropping-control' ), var $wrapper = $( this ).closest( '.woocommerce-cropping-control' ),
value = $wrapper.find( 'input:checked' ).val(); value = $wrapper.find( 'input:checked' ).val();