becomes possible to translate the credit card form placeholders
This commit is contained in:
parent
12d5ffe2a1
commit
7ba14b4bd7
|
@ -156,22 +156,22 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
|
||||||
*/
|
*/
|
||||||
public function validate_fields() { return true; }
|
public function validate_fields() { return true; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If There are no payment fields show the description if set.
|
* If There are no payment fields show the description if set.
|
||||||
* Override this in your gateway if you have some.
|
* Override this in your gateway if you have some.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function payment_fields() {
|
public function payment_fields() {
|
||||||
if ( $description = $this->get_description() ) {
|
if ( $description = $this->get_description() ) {
|
||||||
echo wpautop( wptexturize( $description ) );
|
echo wpautop( wptexturize( $description ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->supports( 'default_credit_card_form' ) ) {
|
if ( $this->supports( 'default_credit_card_form' ) ) {
|
||||||
$this->credit_card_form();
|
$this->credit_card_form();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a gateway supports a given feature.
|
* Check if a gateway supports a given feature.
|
||||||
|
@ -204,16 +204,16 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
|
||||||
|
|
||||||
$default_fields = array(
|
$default_fields = array(
|
||||||
'card-number-field' => '<p class="form-row form-row-wide">
|
'card-number-field' => '<p class="form-row form-row-wide">
|
||||||
<label for="' . esc_attr( $this->id ) . '-card-number">' . __( "Card Number", 'woocommerce' ) . ' <span class="required">*</span></label>
|
<label for="' . esc_attr( $this->id ) . '-card-number">' . __( 'Card Number', 'woocommerce' ) . ' <span class="required">*</span></label>
|
||||||
<input id="' . esc_attr( $this->id ) . '-card-number" class="input-text wc-credit-card-form-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="' . ( $args['fields_have_names'] ? $this->id . '-card-number' : '' ) . '" />
|
<input id="' . esc_attr( $this->id ) . '-card-number" class="input-text wc-credit-card-form-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="' . ( $args['fields_have_names'] ? $this->id . '-card-number' : '' ) . '" />
|
||||||
</p>',
|
</p>',
|
||||||
'card-expiry-field' => '<p class="form-row form-row-first">
|
'card-expiry-field' => '<p class="form-row form-row-first">
|
||||||
<label for="' . esc_attr( $this->id ) . '-card-expiry">' . __( "Expiry (MM/YY)", 'woocommerce' ) . ' <span class="required">*</span></label>
|
<label for="' . esc_attr( $this->id ) . '-card-expiry">' . __( 'Expiry (MM/YY)', 'woocommerce' ) . ' <span class="required">*</span></label>
|
||||||
<input id="' . esc_attr( $this->id ) . '-card-expiry" class="input-text wc-credit-card-form-card-expiry" type="text" autocomplete="off" placeholder="MM / YY" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
|
<input id="' . esc_attr( $this->id ) . '-card-expiry" class="input-text wc-credit-card-form-card-expiry" type="text" autocomplete="off" placeholder="' . __( 'MM / YY', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
|
||||||
</p>',
|
</p>',
|
||||||
'card-cvc-field' => '<p class="form-row form-row-last">
|
'card-cvc-field' => '<p class="form-row form-row-last">
|
||||||
<label for="' . esc_attr( $this->id ) . '-card-cvc">' . __( "Card Code", 'woocommerce' ) . ' <span class="required">*</span></label>
|
<label for="' . esc_attr( $this->id ) . '-card-cvc">' . __( 'Card Code', 'woocommerce' ) . ' <span class="required">*</span></label>
|
||||||
<input id="' . esc_attr( $this->id ) . '-card-cvc" class="input-text wc-credit-card-form-card-cvc" type="text" autocomplete="off" placeholder="CVC" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
|
<input id="' . esc_attr( $this->id ) . '-card-cvc" class="input-text wc-credit-card-form-card-cvc" type="text" autocomplete="off" placeholder="' . __( 'CVC', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
|
||||||
</p>'
|
</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue