Skip to content

Instantly share code, notes, and snippets.

@oldquest
Created January 25, 2013 16:56
Show Gist options
  • Save oldquest/4636041 to your computer and use it in GitHub Desktop.
Save oldquest/4636041 to your computer and use it in GitHub Desktop.
function pt_framework_button($atts = NULL, $content = NULL )
{
// form - link - big_link - custom
extract( shortcode_atts( array(
'type' => '',
'href' => '',
'icon' => '',
'class' => '',
'target' => ''
), $atts ) );
switch($type)
{
case 'form';
return '<button class="bt-form">'.$content.'</button>';
break;
case 'custom';
return '<a href="'.esc_attr($href).'" class="button '.esc_attr($class).'">'.$content.'</a>';
break;
case 'link';
if ($icon == "")
return '<a href="'.esc_attr($href).'" class="link-1">'.$content.'</a>';
else
return '<a href="'.esc_attr($href).'" class="link-1 medium"><i class="'.esc_attr($icon).'"></i>'.$content.'</a>';
break;
case 'big_link';
return '<a href="'.esc_attr($href).'" class="link-2" ' . ($target!='' ? 'target="' . $target . '" ' : '') . '>'.$content.'</a>';
break;
default;
return '';
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment