WordPress as a Framework

Posted by Unknown on Friday, January 31, 2014

WordPress is one of the most popular CMS (Content Management Systems) as far as the user base and ease of access is concerned. Many famous content rich websites use WordPress as their back-end – including SitePoint itself. Regular updates, a larger community, great support forum, rich documentation and many other factors have put WP way ahead of its competitors.


The first thing that comes to most people’s minds when thinking of WordPress is Blog or Content Management Platform, but there is another angle to it. Have you considered that it can act as a full framework for developing web applications as well?


There are various aspects which are taken into consideration before choosing a framework for web development. In this piece, we are going to look into features that WP provides if we treat it as a web development framework.


Community, Support and Documentation


WordPress has a great community and an active support forum. Whether it is an issue with installation, setting up, development or anything else, everything is timely resolved by the support community. The WordPress Codex is a community moderated wiki which is regularly updated. Documentation is the first thing you need when learning any new language or framework, and the codex provides just that. While most, if not all, other frameworks also sport these features, it’s important to note that WP does too, thus not lagging behind.


User Management


WordPress has an excellent user management module which takes care of all the functionality such as user registration and login, user role management, assigning capabilities to different roles and creating new roles. This functionality can be further enhanced by using plugins like the Capability Manager which also provides all the above features without you having to worry about session management or security issues.


If we talk about other frameworks, most provide some sort of User Management solution – for example, Yii provides a user management extension known as Yii-User and similarly for CodeIgniter framework, you`ll find a user management control panel named BackendPro which you can easily integrate into your CI project.


Admin Dashboard


Who wouldn’t love their application having an easy to use admin panel through which the front-end content could be managed? WP provides a ready to use back-end panel which has most of the options you might need. In addition to it, you can create your own custom setting pages for a wide set of requirements. One more perk is that you don`t have to worry about back-end styling at all – WP comes with its own set of styles for the back-end panel.


The Admin Dashboard is the part that lacks in other frameworks. Symfony and Yii provide a couple of extensions for their respective frameworks through which you can generate the Admin UI, but the functionality part is left up to you. This is one area in which having a CMS is advantageous, but can cause significant overhead if it lacks the features you need, and has features you don’t.


CRUD (Create Read Update Delete) Operation


Most people appreciate a framework’s help in performing these basic operations, so picking one that makes it easy is often a deciding factor for many developers.


Lets try to relate this with the real world a bit. As far as WordPress is concerned, everything is a post. A book is a post, a person is a post, and any distinguishable entity is a post. WordPress calls them Custom Post Types.


Let us take an example of Book for now. If you tell WordPress that you want to define a post type named “Book” for your application, you will automatically get all the CRUD bundled with it.



  • Add / Update Book – This will be the default WordPress post edit screen for adding / updating books.

  • View / Delete Books – This will be the book listing page with delete option as well.



add_action( 'init', 'create_post_type' );
function create_post_type() {


Truncated by Planet PHP, read more at the original (another 11012 bytes)




more

{ 0 comments... » WordPress as a Framework read them below or add one }

Post a Comment

Popular Posts