WordPress Network (Multisite): Always Specify Full Path for Includes

Recently I’ve been working a lot on network installations of WordPress. During development I won’t always adhere to best practices from the go-get. I’ll use little short-cuts. They let me know if something is going to work or not.

One error that I have come across, is a weird little thing that only happens under certain circumstances:

This happens if you include a plugin file that requires() a file in the same directory, and then browse to network admin. So, it works in normal admin, and it works if you require() a file from a different directory. But not in the same directory. It’s simple to fix, and is something that should be done for any beta or production code anyway..

Broken:

 

Fixed:

 

Simples.

Published by

TCBarrett

Open Source Architect (Web Geek)