wordpruss / wordpruss
A reusable set of clean and beautified PHP classes that wrap WordPress functionalities.
Requires
- php: >= 5.6
Requires (Dev)
- phpunit/phpunit: 5.7
This package is not auto-updated.
Last update: 2024-06-23 01:27:35 UTC
README
WordPruss
WordPruss is a reusable set of clean PHP classes that wrap WordPress functions for a fastly plugin or theme development.
Installation
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.
Usage
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.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover security related issues, please email mystroken@gmail.com or use the issue tracker.
License
WordPruss is an open-sourced library licensed under the MIT license. See License File for more information.