<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lester Chan's WordPress Plugins &#187; Sample Plugins</title>
	<atom:link href="http://lesterchan.net/wordpress/category/sample-plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://lesterchan.net/wordpress</link>
	<description>Lester Chan's WordPress Plugins Development Blog</description>
	<lastBuildDate>Sat, 07 Jan 2012 03:01:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dashboard Widget (Without Controls) Sample Plugin</title>
		<link>http://lesterchan.net/wordpress/2008/03/19/dashboard-widget-without-controls-sample-plugin/</link>
		<comments>http://lesterchan.net/wordpress/2008/03/19/dashboard-widget-without-controls-sample-plugin/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 17:46:58 +0000</pubDate>
		<dc:creator>Lester Chan</dc:creator>
				<category><![CDATA[Sample Plugins]]></category>
		<category><![CDATA[2.5]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://lesterchan.net/wordpress/?p=158</guid>
		<description><![CDATA[WordPress 2.5 has the ability to customize your administration dashboard with the help of widgets. After poking around WordPress 2.5 codes, I have come out with this Dashboard Widget Sample Plugin. BUT do note that this plugin does not include &#8230; <a href="http://lesterchan.net/wordpress/2008/03/19/dashboard-widget-without-controls-sample-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.5 has the ability to customize your administration dashboard with the help of widgets.</p>
<p>After poking around WordPress 2.5 codes, I have come out with this Dashboard Widget Sample Plugin. BUT do note that this plugin does not include Dashboard Widget Controls. If I have the time, I will add that in or perhaps I will create another plugin called &#8220;Dashboard Widget (With Controls) Sample Plugin&#8221;.</p>
<p>To get a clearer picture of what this sample plugin does, here is a <a href="http://files.lesterchan.net/viewing/screenshots/dashboard_widget_sample.png/">screenshot of the Dashboard Widget (Without Controls) Sample</a> in action.</p>
<p>Here comes the code:</p>
<pre lang="php" line="1">
<?php
/*
Plugin Name: Dashboard Widget (Without Controls) Sample
Plugin URI: http://lesterchan.net
Description: A sample on how to add widgets on your dashboard easily.
Version: 0.01
Author: Lester 'GaMerZ' Chan
Author URI: http://lesterchan.net
*/

/*

Replace all instances of PLUGINNAME with your nice plugin name something like "polls" or "ratings (without the quotes)

*/

### Function: Register Dashboard Widget
add_action('wp_dashboard_setup', 'PLUGINNAME_register_dashboard_widget');
function PLUGINNAME_register_dashboard_widget() {
	wp_register_sidebar_widget('dashboard_PLUGINNAME', __('Sample Dashboard Widget', 'PLUGINNAME'), 'dashboard_PLUGINNAME',
		array(
		'all_link' => 'Full URL For "See All" link', // Example: 'index.php?page=wp-useronline/wp-useronline.php'
		'feed_link' => 'Full URL For "RSS" link', // Example: 'index.php?page=wp-useronline/wp-useronline-rss.php'
		'width' => 'half', // OR 'fourth', 'third', 'half', 'full' (Default: 'half')
		'height' => 'single', // OR 'single', 'double' (Default: 'single')
		)
	);
}

### Function: Add Dashboard Widget
add_filter('wp_dashboard_widgets', 'PLUGINNAME_add_dashboard_widget');
function PLUGINNAME_add_dashboard_widget($widgets) {
	global $wp_registered_widgets;
	if (!isset($wp_registered_widgets['dashboard_PLUGINNAME'])) {
		return $widgets;
	}
	array_splice($widgets, sizeof($widgets)-1, 0, 'dashboard_PLUGINNAME');
	return $widgets;
}

### Function: Print Dashboard Widget
function dashboard_PLUGINNAME($sidebar_args) {
	global $wpdb;
	extract($sidebar_args, EXTR_SKIP);
	echo $before_widget;
	echo $before_title;
	echo $widget_name;
	echo $after_title;
	echo 'YOUR CONTENT GOES IN HERE';
	echo $after_widget;
}
?>
</pre>
<p>You can also download the file by clicking the link below:<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
<p>Hope this helps some of you guys. =)</p>
]]></content:encoded>
			<wfw:commentRss>http://lesterchan.net/wordpress/2008/03/19/dashboard-widget-without-controls-sample-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Database Caching 1/10 queries in 0.006 seconds using memcached
Object Caching 295/307 objects using xcache
Content Delivery Network via cdn.lesterchan.net

Served from: lesterchan.net @ 2012-02-12 11:02:04 -->
