Last active
July 31, 2017 21:09
-
-
Save deryckoe/0a442eb0187eed472545e854a1ce3a9c to your computer and use it in GitHub Desktop.
Obtiene la cantidad de usuarios registrado e imprime el mensaje adecuado.
This file contains 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
<?php echo do_shortcode( 'usuarios_registrados' ); ?> |
This file contains 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
<span class="sbs-count-users">12,410</span> |
This file contains 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
<?php | |
/** | |
* Obtiene la cantidad de usuarios registrado e imprime el mensaje adecuado. | |
* | |
* @return string | |
*/ | |
function wpe_get_registered_users() { | |
$count_users = count_users(); | |
$users_count = ( $count_users['total_users'] > 0 ) | |
? $count_users['total_users'] . ' usuarios registrados' | |
: 'No hay usuarios registrados'; | |
return $users_count; | |
} | |
/** | |
* Registra el shortcode que llama la funcion de usuarios regristrados. | |
*/ | |
add_shortcode( 'usuarios_registrados', 'wpe_get_registered_users' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment