ondrejd / odwp
Library for rapid development of WordPress plug-ins.
dev-master
2015-10-15 22:27 UTC
Requires
- php: >=5.3.1
- twig/twig: ~1.0
This package is not auto-updated.
Last update: 2025-02-01 21:19:46 UTC
README
Library for rapid development of WordPress plug-ins.
Usage
Usage is simple:
/** * 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();