How To: Add A Link to the WordPress Multisite Network Admin Sites List

The other day I was working on a plugin for a client when I needed to add a link to the WordPress Multisite Network Admin Sites list. This is the list of sites in your WordPress Multisite network. The links I am referring to are the action links that appear when you hover over a site in the list as shown below.

WordPress Multisite Network Sites ListTo add a link, or modify any of the existing action links, we’re going to use the manage_sites_action_links action filter in WordPress. This filter will allow us to modify the action links before they are displayed on the screen. This means you can add, or remove, any links you want.

Let’s look at the code:

add_filter( 'manage_sites_action_links', 'my_plugin_network_list_action', null, 2 );

function my_plugin_network_list_action( $actions, $blog_id ) {

    $actions = array_merge( $actions, array(
	'custom_link' => '<a href="'. network_admin_url( 'sites.php' ).'">My Custom Link</a>'
    ));

    return $actions;

}

First we call the manage_sites_action_links filter hook which executes our custom function my_plugin_network_list_action(). Our function accepts two parameters: The $actions array which contains all action links and the $blog_id which stores the site ID of the site we are hovering in the list.

To add a link we are going to use the PHP function array_merge() to merge our link into the array of existing links. In this example I added a link named “My Custom Link” which links to the Network Admin sites list. The final step is to return the $actions variable. Simple as that!

For more awesome WordPress plugin goodies check out my new book: Professional WordPress Plugin Development

WPClassroom.com Is Back! New WordPress Training Classes Scheduled

WordPress Training LogoThe WordPress Classroom is back with new classes scheduled! If you’ve ever wanted to learn WordPress, or expand your knowledge, WPClassroom.com is for you! We offer the best value ($25/class!) and the best instructors!

WordPress for Beginners is set for September 28th at 7pm ET. This class is for beginners with a focus on content. Learn how to create posts, pages, links. Also learn the ins and outs of comment and discussion moderation. The class will even cover tips and tricks including automated backups, scheduled posting, security plugins, and more!

Extending WordPress for Beginners is set for September 30th at 7pm ET. This class is for WP site administrators with a focus on customizing WordPress. Learn how to install and configure themes and plugins. The class will also cover menu management, user accounts and roles, and WordPress settings.

Both courses run 1 hour in length with a 1 hour question and answer session. That’s TWO hours of WordPress training for $25! You can also register for both classes for $40. All WPClassroom.com classes use the most powerful online training tools provided by Cisco WebEx. Training is even recorded for later playback!

I couldn’t recommend these courses enough for people who want to truly understand everything that WordPress has to offer.

How To: Move a WordPress Blog to a New Hosting Account

By StrangeWork.com. So you’ve decided to move your WordPress blog to a new hosting account, but need to know the proper steps to accomplish the transfer seamlessly. WordPress does have some tools available to help you move your blog, but I’m going to show you a much simpler approach.

I’ve broken this tutorial down so even a novice user can understand the steps involved.

Export your entire WordPress database using phpMyAdmin.

1. Login to cPanel on your OLD hosting account. Your login credentials should have been supplied to you when you created your hosting account.
2. Click the MySQL Databases icon listed on your cPanel home screen.
3. Scroll to the bottom of the screen and click on the phpMyAdmin link.
4. Click the Databases link and select your WordPress blog database. The default naming convention is username_wrdp1.
5. Click the Check All link to select all of your WordPress tables.
6. Click the Export link at the top of the page to export your data.
7. Verify that SQL export is selected and click the Go button to export your database into a SQL file.

This will generate a textbox containing all of the SQL code you need to recreate your WordPress database. Copy this code to a textfile on your computer and save it. You will need it later.

Install WordPress on your new hosting account
Next you need to install WordPress on your new hosting account. The easiest way to do this is using Fantastico, which is a typical component of cPanel.

1. Login to cPanel on your NEW hosting account.
2. Click the Fantastico icon listed on your cPanel home screen.
3. Click the WordPress link under Blogs to begin the WordPress installation.
4. Click New Installation and fill out the required installation information.
5. Install WordPress

Import your WordPress data in to your new WordPress installation
Now we need to import the SQL code from earlier into your new WordPress database

1. Login to cPanel on your NEW hosting account. Your login credentials should have been supplied to you when you created your hosting account.
2. Click the MySQL Databases icon listed on your cPanel home screen.
3. Scroll to the bottom of the screen and click on the phpMyAdmin link.
4. Click the Databases link and select your WordPress blog database. The default naming convention is username_wrdp1.
5. Click the Check All link to select all of your WordPress tables.
6. Select Drop from the With Selected drop down list.
7. Confirm you want to delete the selected tables. These tables are from your new installation of WordPress and contain no data.
8. Click the SQL link at the top of the page
9. Copy and paste the SQL code from earlier in to the SQL textbox and click Go to execute the query.

Your data has now been imported in to your new WordPress database on your new hosting account.

Copy themes and components to your new hosting account
Your database has all of your settings saved and knows what components and themes you have installed. Simply copy the themes and plugins folder (located in wp-content) over to your new hosting account and your all set!