<?php

function gfxbucket_link_func( $atts, $content ) {
	extract(shortcode_atts( array(
        'url' => '',
        'new_window' => 'false'
	), $atts ));

	// If set, wrap target attribute with HTML target attribute

	$target = '';
	if( $new_window == 'true' || $new_window == 'yes' ) {
		$target = ' target="_blank"';
	}

	return '<a href="' . $url . '"' . $target . '>' . do_shortcode($content) . '</a>';
}
add_shortcode( 'link', 'gfxbucket_link_func' );