WordPress 2.8 Beta 2 has been released. Here is a link to the changelog from beta 1 to beta 2.
Download: WordPress 2.8 Beta 2
Lester Chan's WordPress Plugins
Lester Chan's WordPress Plugins Development Blog
WordPress 2.8 Beta 2 has been released. Here is a link to the changelog from beta 1 to beta 2.
Download: WordPress 2.8 Beta 2
WordPress 2.8 Beta 1 has been released. For all the new features, refer to the WordPress 2.8 in Codex. I am going to upgrade this site now.
This site is running the development versions of all my plugins, so it should work with WordPress 2.8. Please let me know if you encounter any bug.
Download: WordPress 2.8 Beta 1
In WordPress 2.8, there is a new WP_Widget class, which personally I like it very much as now the multi-instances of widgets is handled by WordPress, all you need to do is just to extends the WP_Widget class and overwrite 3 of the functions namely widgets(), update() and form();
Below is a sample code taken from my WP-Polls that displays Polls Widget. It is tested and it works perfectly. Hope it is useful for plugin authors.
__('Put a poll that you have added in WP-Polls on your sidebar', 'wp-polls'));
$this->WP_Widget('polls', __('Polls'), $widget_ops);
}
// Display Widget
function widget($args, $instance) {
extract($args);
$title = esc_attr($instance['title']);
$poll_id = intval($instance['poll_id']);
$display_pollarchive = intval($instance['display_pollarchive']);
echo $before_widget.$before_title.$title.$after_title;
get_poll($poll_id);
if($display_pollarchive) {
display_polls_archive_link();
}
echo $after_widget;
}
// When Widget Control Form Is Posted
function update($new_instance, $old_instance) {
if (!isset($new_instance['submit'])) {
return false;
}
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['poll_id'] = intval($new_instance['poll_id']);
$instance['display_pollarchive'] = intval($new_instance['display_pollarchive']);
return $instance;
}
// DIsplay Widget Control Form
function form($instance) {
global $wpdb;
$instance = wp_parse_args((array) $instance, array('title' => __('Polls', 'wp-polls'), 'poll_id' => 0, 'display_pollarchive' => 1));
$title = esc_attr($instance['title']);
$poll_id = intval($instance['poll_id']);
$display_pollarchive = intval($instance['display_pollarchive']);
?>
I presented about WordPress as a Blogging Tool during BlogOut! 2009 earlier today. I have uploaded my slides to SlideShare. Feel free to take a look at it =D