ondrejd/odwp

Library for rapid development of WordPress plug-ins.

dev-master 2015-10-15 22:27 UTC

This package is not auto-updated.

Last update: 2024-05-11 16:41:20 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();