library odwp
Library for rapid development of WordPress plug-ins.
ondrejd/odwp
Library for rapid development of WordPress plug-ins.
- Friday, October 16, 2015
- by ondrejd
- Repository
- 1 Watchers
- 0 Stars
- 17 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 1 Open issues
- 1 Versions
- 0 % Grown
odwp
Library for rapid development of WordPress plug-ins., (*1)
Usage
Usage is simple:, (*2)
/**
* My simple plug-in.
*/
class MySimplePlugin extends \odwp\SimplePlugin {
protected $id = 'my-simple-plugin';
protected $version = '0.1';
protected $texdomain = 'my-simple-plugin';
public function get_title($suffix = '', $sep = ' - ') {
if (empty($suffix)) {
return __('My Simple Plugin', $this->get_textdomain());
}
return sprintf(
__('My Simple Plugin%s%s', $this->get_textdomain()),
$sep,
$suffix
);
}
} // End of MySimplePlugin
// ===========================================================================
// Plugin initialization
global $my_plugin;
$my_plugin = new MySimplePlugin();