Skip to content

Instantly share code, notes, and snippets.

@hchouhan
Created October 3, 2013 06:48
Show Gist options
  • Select an option

  • Save hchouhan/6806022 to your computer and use it in GitHub Desktop.

Select an option

Save hchouhan/6806022 to your computer and use it in GitHub Desktop.
MPI - 01
<?php
/*
Plugin Name: My Plugin Info
Plugin URI: http://myplugininfo.com
Description: Communicate with WordPress.org Plugins API to retrive your Plugin Information
Version: 0.1
Author: Harish
Author Email: mye@email.com
License: GPL3
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'DOT_MyPluginInfo' ) )
{
class DOT_MyPluginInfo {
/**
* Constructor
*/
function __construct() {
//Hook up to the init action
add_action( 'init', array( &$this, 'init_my_plugin_info' ) );
}
/**
* Runs when the plugin is initialized
*/
function init_my_plugin_info() {
// Register the shortcode [mpi slug='my-plugin-info' field='version']
add_shortcode( 'mpi', array( &$this, 'render_mpi' ) );
}
function render_mpi($atts) {
}
} // end class
new DOT_MyPluginInfo();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment