Support » Plugin: Arconix Shortcodes » Additional attribute for button-Shortcode

  • Resolved hattl


    i need to add additional code for Google Analytics to the a-Tag. Example <a href="http://link-to-somewhere" onclick="_gaq.push(['_link', this.href]); return false;">touch me</a>

    So i tried to append some code in the file shortcodes.php. But after that, only a white webpage appears. Here is my extended part of the button code, the Attribute ist named mydat:

    function button_shortcode( $atts, $content = null ) {
    $defaults = apply_filters( 'arconix_button_shortcode_args', array(
            'size' => 'medium',
            'color' => 'white',
            'url' => '#',
            'target' => '',
            'rel' => ''
    	'mydat' => ''
        ) );
    	   // Properly escape our data
    	$mydat = esc_attr( $mydat );
    return "<a href='{$url}' '{$mydat}' class='arconix-button arconix-button-{$size} arconix-button-{$color}'{$rel}{$target}>{$content}</a>";

    What can i do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Gardner


    Hi hattl,

    Thanks for using my plugin. A comma should follow every item in an array (optionally on the last item), so assuming nothing else in the function has changed, you’re missing a comma after the 'rel' => '' above your mydat.

    The missing comma was the solution, all works fine. Thanks a lot for your immediate help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Additional attribute for button-Shortcode’ is closed to new replies.