Location: PHPKode > scripts > Flat UI Button > flat-ui-button/flatbtn.php
<?php
/*
Plugin Name: Flat UI Button
Plugin URI: http://www.tiandiyoyo.com
Description: Display the Flat UI Button by shortcode.
Version: 1.0
Author: Tiandi
Author URI: http://www.tiandiyoyo.com
*/
function FlatUIbtn() { ?>
	<div class="wrap">
	    <?php screen_icon(); ?>
	    <h2>About Flat UI Button</h2>	
		<p><div style="background:#5CA12F; border:1px solid gray;width: 800px; padding:5px; color:#fff;">Flat UI Button is a plugin which can show some good UI button/field on your blog. Please visit <a href="http://www.tiandiyoyo.com" target=_blank>http://www.tiandiyoyo.com</a> for more information.</div><p>How to use: Please insert the below shortcode to your post or page.<br><br>    
		For button:<br>
		[flatbtn url="xxx"]xxxx[/flatbtn] (default size = normal type = default)<br>
		[flatbtn url="xxx" size = small/normal/large]xxxx[/flatbtn]<br>
		[flatbtn url="xxx" type = red/yellow/blue/green/cyan/gray]xxxx[/flatbtn] (default size = normal)<br>
		[flatbtn url="xxx" size = small/normal/large type = red/yellow/blue/green/cyan/gray]xxxx[/flatbtn]<br>
		<p>For field:<br>
		[flatbtn type = field/fieldred/fieldyellow/fieldblue/fieldgreen/fieldcyan/fieldgray]xxxx[/flatbtn] (default size = normal)<br>
		[flatbtn size = small/normal/large type = field/fieldred/fieldyellow/fieldblue/fieldgreen/fieldcyan/fieldgray]xxxx[/flatbtn]<br>
		<p>The screenshot of final effect is as below:<br>
		<img src= <?php echo WP_PLUGIN_URL."/".dirname(plugin_basename(__FILE__))."/screenshot-1.png"; ?> >
	</div>
	<?php
}

function insert_flatbtn($atts,$content = null) {
	extract(shortcode_atts(array(
    'url' => 'none',
	'size' => 'normal',
	'type' => 'default'),$atts));

	wp_register_style('flatbtnscss', WP_PLUGIN_URL . '/flat-ui-button/flatbtn.css');
    wp_enqueue_style('flatbtnscss');
	if(stristr($type,'field')) {
		return "<a href='#' class = 'btnflat " . $size ." ". $type . "' onclick='return false' target=_blank>" . $content ."</a>";
	}
	elseif($url == '') {
		return "<a href='#' class = 'btnflat " . $size ." ". $type . "' target=_blank>" . $content ."</a>";
	}
	else {
		return "<a href=". $url ." class = 'btnflat " . $size ." ". $type . "' target=_blank>" . $content ."</a>";
	}
}
add_shortcode('flatbtn','insert_flatbtn');


function flatbtn_admin_actions() {
    add_options_page("Flat UI Button", "Flat UI Button", 1, "flatbtninfo", "FlatUIbtn"); 
}

add_action('admin_menu', 'flatbtn_admin_actions');  
?>
Return current item: Flat UI Button