GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Wednesday, March 23, 2011

WP - Write Plugin

<?php
/**
Plugin Name: Lucia Plugin
Plugin URI: http://hohohuhu.blogspot.com
Description: This plugin will do access database and will do what you want here.
Version: 1.0
Author: Irfanudin Ridho
Author URI: http://hohohuhu.blogspot.com
**/





if(!class_exists('LuciaPlugin')){
    class LuciaPlugin{
        function __construct__(){
       
        }
    }
}

if(class_exists('LuciaPlugin')){
    $lp = new LuciaPlugin();
    if(isset($lp)){
   
        // actions
       
        // filters
   
    }
}

// actions
add_action('wp_head', 'print_title');

// filters
add_filter('the_content', 'print_content');

function print_title(){
    echo '<title>Hello World</title>';
}

function print_content($content=''){
    $content .= '<h1>Hello World</h1>';
    return $content;
}

Share/Bookmark

1 comment:

  1. pls read more about wordpress plugin in www.answerglobe.com

    ReplyDelete