Author Archives: PeteMall
WordPress 3.0.1 Release Candidate 1
WordPress 3.0.1 Release Candidate was just tagged and released. You can use Peter Westwood’s Beta Tester Plugin and use “Point Release Nightlies” to upgrade from WordPress 3.0 to the new release candidate.
WordPress 3.0.1 includes several bugfixes. Please consult the changelog on Trac for details on what has changed in this release.
Upgrading WordPress MU 2.9.2 to WordPress 3.0
WordPress 3.0 was officially released today. The main feature of the WordPress 3.0 is the merge of WordPress MU. In this post, I’ll cover upgrading WordPress MU 2.9.2 to WordPress 3.0. You should always backup your databases before attempting to upgrade WordPress. If you are not sure how to backup your database, you can find complete instructions in the WordPress Codex. If you are upgrading from WordPress 2.9.2 standard and want to enable multisite, then follow the instructions on this post instead.
Upgrade WordPress:
You can upgrade WordPress by following the link in the update message at the top or by going to the Upgrade screen under Tools. Return to the dashboard after upgrading. You will have to login again after the upgrade.
Update wp-config.php:
WordPress encrypts cookies but you must add NONCE_SALT code shown at the top of the admin area to wp-config.php. For example: define( 'NONCE_SALT', 'a<u3S[ g<.4I)#p^-iy?sbb3JPu+W~-Zk|aPLMN[TvoiHIKGI_bbB-h?iliBb2ra' ). This code will be unique to your installation. Add it above the line that says: /* That's all, stop editing! Happy blogging. */

define( "WP_USE_MULTIPLE_DB", false );
define( 'NONCE_SALT', 'a<U3S[ g<.4I)#p^-iy?sbb3JPu+W~-Zk|aPLMN[TvoiHIKGI_bbB-h?iliBb2ra' );
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
Update Network:
Follow the link at the top to the Update Network screen or browse to the Update screen under Super Admin to update all sites(blogs) in your network.
Update Rewrite Rules:
The wp-content/blogs.php file was deprecated in WordPress 3.0 and you must update the rewrite rules to use wp-includes/ms-files.php. Replace wp-content/blogs.php with wp-includes/ms-files.php in .htaccess and delete wp-content/blogs.php.
RewriteEngine On
RewriteBase /
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
WordPress 3.0 Released
Happy Thursday and just to make your day a little better WordPress 3.0 “Thelonious”, named in honor of Thelonious Monk, has been released. You can easily upgrade from your dashboard by going to Tools > Upgrade or from the update message at the top of the dashboard.
The single most important feature of WordPress 3.0 is the WPMU merge which allows you to easily manage a network of sites (blogs) on a single WordPress install. You can find the instructions for enabling multisite here.
The WordPress 3.0 development cycle included over 1200 tickets (bugs and enhancements).
You can download WordPress 3.0 here and read the official release announcement on the WordPress Development Blog.
How to Create a WordPress Dashboard Widget
This post is the first in a series that was inspired by my WordPress Chicago presentation titled Beginner’s Plugin Development.
A new Dashboard Widgets API was introduced in WordPress 2.7, which made it easy for developers to create their own widgets for the administration dashboard. Dashboard Widgets are written in PHP and it’s easy to get started if you are familiar with the WordPress Plugin API.
You can add a new widget to the dashboard using the WordPress core function wp_add_dashboard_widget( widget_id, widget_name, callback, control_callback ).
- widget_id: Unique id for your widget. This will be the css class and the array key for the widgets.
- widget_name: Name for your widget that will be displayed as the title.
- callback: The function that will display the content of the widget.
- control_callback: The function that will display the form elements and handle the form submission. This parameter is optional.
In this post, I’ll create a simple dashboard widget that will display some text:
Let’s create a function that will display the contents of our custom dashboard widget:
function devmind_dashboard_widget() {
echo '<p><a href="http://wordpress.org/">WordPress</a> is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.</p>';
}
We need to create another function that will call wp_add_dashboard_widget and register our custom dashboard widget:
function devmind_add_dashboard_widget() {
wp_add_dashboard_widget( 'devmind-custom-widget', 'About WordPress', 'devmind_dashboard_widget' );
}
Now, we need to hook into dashboard setup process and tell WordPress to load our widget. We can do this by hooking into wp_dashboard_setup and adding our custom widget.
add_action( 'wp_dashboard_setup', 'devmind_add_dashboard_widget' );
You can add this code to your theme’s functions.php file or download it as a plugin here.
