Skip to content

🍬 🍫 A reusable set of clean and "beautified" PHP classes that wrap WordPress features.

License

Notifications You must be signed in to change notification settings

mystroken/wordpruss

Repository files navigation

WordPruss

Build Status Total Downloads License

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.

About

🍬 🍫 A reusable set of clean and "beautified" PHP classes that wrap WordPress features.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages