moxie-lean/wp-page-templates

A way of registering page templates from a plugin

1.1.0 2017-01-12 20:35 UTC

This package is auto-updated.

Last update: 2024-10-28 11:20:39 UTC


README

Provides functinos for registering a page template in a plugin.

Getting Started

The easiest way to install this package is by using composer from your terminal:

composer require moxie-lean/wp-page-templates --save

Or by adding the following lines on your composer.json file

"require": {
  "moxie-lean/wp-page-templates": "dev-master"
}

This will download the files from the packagist site and set you up with the latest version located on master branch of the repository.

After that you can include the autoload.php file in order to be able to autoload the class during the object creation.

include '/vendor/autoload.php';

Usage

Has just 1 function.

Register

Registers a new template. Takes the slug and name as arguments. Eg:

\Lean\PageTemplates::register('training', 'Training');