I'm trying to write a shortcode in function.php with a link to share the current page in Twitter. However this link contains some PHP in the href and I can't figure it out how to make it work. Here is the code:
add_shortcode ( "indice", "indice_output" );
function indice_output( $atts, $content="null" ) {
extract( shortcode_atts( array(
'' => ''
), $atts ));
return '<div class="boxed max-width"><div class="indice-title"><span>' . $content . '</span><i class="fa fa-twitter" aria-hidden="true"></i></div></div>';
}
Thanks in advance for the help.
eval('Delete the entire WordPress installation');
into a link? Your website might have the potential to be hacked in 2 seconds. – Jack Johansson♦ Jul 21 '17 at 9:38