Created
November 2, 2017 19:46
-
-
Save acanza/b8a998a4900a81cef8934b87a092991c to your computer and use it in GitHub Desktop.
Personaliza el texto por defecto en la página de pedido recibido de WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Personaliza el texto por defecto en la página de pedido recibido de WooCommerce | |
| if ( in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ) ) ){ | |
| add_filter( 'gettext', 'customize_default_text_in_thank_you_page', 20 ); | |
| function customize_default_text_in_thank_you_page( $translated ) { | |
| $text = array( | |
| 'Texto original 1' => 'Nuevo texto 1', | |
| 'Texto original 2' => 'Nuevo texto 2' | |
| ); | |
| // Comprueba que la página sea la de pedido recibido | |
| if ( is_wc_endpoint_url( 'order-received' ) ) { | |
| $translated = str_ireplace( array_keys($text), $text, $translated ); | |
| } | |
| return $translated; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment