How to write one WordPress Plugin in One minute!

WordPress Plugins are simply fabulous. There are thousands of free plugins available over the Internet that help developers building awesome web applications.
I am just going to show you, how to write one plugin in one minute.

    The first step: write a PHP file ‘init.php’ in ‘wp-content/plugins’ directory through your C-Panel file manager.
file-manager

file-manager

    Here is the code:


/**
* @package Hagudu
* @version 1.0
*/
/*
* Plugin Name: Hagudu
* Plugin URI: http://sanjibsinha.com/howto
* Description: It can do anything!
* Version: 1.0
* Author: Sanjib Sinha
* Author URI: http://sanjibsinha.com/howto
* License: GPLv2 or later
*/

function it_can_anything() {

$content = "It can do anything";

return $content;

}

add_filter('the_content', 'it_can_anything');

Once it’s been written it shows up in your wordpress dashboard:

plugin

plugin

Just activate it! Now you can edit it from the wordpress dashboard itself!

It took actually 45 seconds! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s