Skip to content

Instantly share code, notes, and snippets.

@mrfoxtalbot
Created November 17, 2015 17:08
Show Gist options
  • Save mrfoxtalbot/159046d75d4b9619365b to your computer and use it in GitHub Desktop.
Save mrfoxtalbot/159046d75d4b9619365b to your computer and use it in GitHub Desktop.
Ejemplo de Shortcode concatenando strings y usando funciones
function privateshare() {
$titulo = get_the_title();
$enlace = get_the_permalink();
$loquequiero = '<a href="mailto:?subject=Quiero compartir contigo este artículo&body=' .$titulo. ': ' .$enlace. '"><img src="email-icon.png"></a>';
return $loquequiero;
}
add_shortcode("privateshare", "privateshare");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment