becomes possible to translate the credit card form placeholders

This commit is contained in:
claudiosmweb 2014-03-23 19:49:52 -03:00
parent 12d5ffe2a1
commit 7ba14b4bd7
1 changed files with 20 additions and 20 deletions

View File

@ -156,22 +156,22 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
*/
public function validate_fields() { return true; }
/**
* If There are no payment fields show the description if set.
* Override this in your gateway if you have some.
*
* @access public
* @return void
*/
public function payment_fields() {
if ( $description = $this->get_description() ) {
echo wpautop( wptexturize( $description ) );
}
/**
* If There are no payment fields show the description if set.
* Override this in your gateway if you have some.
*
* @access public
* @return void
*/
public function payment_fields() {
if ( $description = $this->get_description() ) {
echo wpautop( wptexturize( $description ) );
}
if ( $this->supports( 'default_credit_card_form' ) ) {
$this->credit_card_form();
}
}
if ( $this->supports( 'default_credit_card_form' ) ) {
$this->credit_card_form();
}
}
/**
* Check if a gateway supports a given feature.
@ -204,16 +204,16 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
$default_fields = array(
'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' : '' ) . '" />
</p>',
'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>
<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' : '' ) . '" />
<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', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
</p>',
'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>
<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' : '' ) . '" />
<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', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
</p>'
);