WordPruss is a reusable set of clean PHP classes that wrap WordPress functions for a fastly plugin or theme development.
It's recommended that you use Composer to install WordPruss.
$ composer require wordpruss/wordpruss "dev-master"
This will install WordPruss and all required dependencies. WordPruss requires PHP 5.6 or newer.
Here is a Basic Example of the library usage:
<?php
/*
* Suppose that we need
* to create an admin panel for our plugin.
* Let's go
*/
require __DIR__. '/vendor/autoload.php';
use \WordPruss\AdminPanel\Menu;
use \WordPruss\AdminPanel\Panel;
// Creates a new admin menu
$adminMenu = new Menu([
'title' => 'My Plugin Name',
'slug' => 'my_plugin_name'
]);
// Create a panel for the menu
$adminPanel = new Panel([
'title' => 'Plugin Name - Welcome to the settings page',
'role' => 'manage_options',
'callback' => function() {
echo '<h1>Hello World !</h1>';
}
]);
$adminMenu
// Links panel to the menu
->setPanel($adminPanel)
// Adds the menu to WordPress admin menus list
->attach();
For more information on how to configure your web server, see the Documentation.
Please see CONTRIBUTING for details.
If you discover security related issues, please email mystroken@gmail.com or use the issue tracker.
WordPruss is an open-sourced library licensed under the MIT license. See License File for more information.