In part one of the Creating a User Follow System tutorial series, we are going to take a quick look at how our final product may be implemented into a real live site, and the basic functionality it will contain.
Watch the video above for a demonstration of a live site utilizing the final product of this series.
Once complete, the plugin will give us the ability to follow and unfollow users, view content from the users we are following, view the total number of users we (or anyone) else is following, and the total number of users following any particular user. We will also be implementing ajax in the complete plugin so that everything works smoothly without page reloads.
File and Folder Structure
If you have watched or read any of my other extended tutorials about create complete plugins, you will know that I always advocate a good file/folder structure for your plugin files. Tom McFarlin recently wrote a great article on WP Tuts+ that covers the importance of file organization, and I’d highly recommend that you read it.
Main Plugin File
Every plugin has a “main” file, which is usually named the same thing as the plugin’s folder. In this case, our main plugin file will be called user-following.php. Inside of this file we will have our plugin headers (used to make WordPress recognize it as a plugin), a couple of constants, initialization for plugin translation, and also some file includes.
The complete contents of our file are below: