Skip to content

Instantly share code, notes, and snippets.

@OscarAbadFolgueira
Last active March 15, 2016 16:21
Show Gist options
  • Save OscarAbadFolgueira/16bb073e7c8f32f3966a to your computer and use it in GitHub Desktop.
Save OscarAbadFolgueira/16bb073e7c8f32f3966a to your computer and use it in GitHub Desktop.
WordPress Snippet que cambia la palabra "Hola" de saludo al usuario logueado.
<?php
/**
* Este WordPress Snippet cambia la palabra "Hola" de saludo al usuario logueado. Parte superior derecha de la pantalla.
*
* Author: Oscar Abad Folgueira
* Author URI: http://www.oscarabadfolgueira.com
*
* You can copy this snippet and paste in your functions.php or you can build your own plugin
*
* Change the text to replace to your needs.
*/
// Reemplazar el texto "Hola"
function oaf_wp_reemplazar_hola( $saludo ) {
$nuevo_saludo = 'Que pasa';
if ( is_user_logged_in() ) {
$text = str_replace( 'Hola', $nuevo_saludo, $saludo );
}
return $saludo;
}
add_filter( 'gettext', 'oaf_wp_reemplazar_hola' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment