Merge pull request #20174 from ChaseWiseman/fix/show-single-payment-methods-pay-page

Only hide .payment_box elements on init for multiple payment methods
This commit is contained in:
Mike Jolley 2018-05-23 11:20:28 +01:00 committed by GitHub
commit 65bbcfee96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -77,8 +77,11 @@ jQuery( function( $ ) {
$payment_methods.eq(0).prop( 'checked', true );
}
// Hide open descriptions.
$( 'div.payment_box' ).filter( ':visible' ).slideUp( 0 );
if ( $payment_methods.length > 1 ) {
// Hide open descriptions.
$( 'div.payment_box' ).filter( ':visible' ).slideUp( 0 );
}
// Trigger click event for selected method
$payment_methods.filter( ':checked' ).eq(0).trigger( 'click' );

File diff suppressed because one or more lines are too long