diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..558c6c4 --- /dev/null +++ b/changelog.md @@ -0,0 +1,9 @@ +# Change Log + +You can see the changes made via the [commit log](https://github.com/themehybrid/hybrid-template/commits/master) for the latest release. + +## [1.0.0] - 2021-08-01 + +### Added + +- Launch. Everything's new! diff --git a/composer.json b/composer.json index c4ac237..6821b7d 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name" : "themehybrid/hybrid-template", - "description" : "Custom template registration system for WordPress.", + "description" : "Template helper functions.", "keywords" : [ "wordpress" ], "homepage" : "https://github.com/themehybrid/hybrid-template", "license" : "GPL-2.0-or-later", diff --git a/contributing.md b/contributing.md index 1d79d82..6637906 100644 --- a/contributing.md +++ b/contributing.md @@ -1,6 +1,6 @@ # Contributing -The code for the this project is handled via its [GitHub Repository](https://github.com/justintadlock/hybrid-theme). You can open tickets, create patches, and send pull requests there. +The code for the this project is handled via its [GitHub Repository](https://github.com/themehybrid/hybrid-template). You can open tickets, create patches, and send pull requests there. ## Pull requests diff --git a/readme.md b/readme.md index 75f63e5..f523801 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,6 @@ # Hybrid\\Template -Hybrid Template is a package for registering custom post templates. Technically, it works for any object type (e.g., post, term, user, etc.), but does not add any UI elements of its own. - -The major difference between this and the typical WordPress page template system is that the template doesn't have to exist for registration. It also defaults to supporting all post types instead of just `page`. +Hybrid Template is a set of helper functions for setting the location, locating, and filtering templates. ## Requirements @@ -10,63 +8,6 @@ The major difference between this and the typical WordPress page template system * PHP 5.6+ (preferably 7+). * [Composer](https://getcomposer.org/) for managing PHP dependencies. -## Documentation - -This project a part of the Hybrid Core framework. It may require other packages, which will be installed via Composer. - -### Installation - -First, you'll need to open your command line tool and change directories to your theme folder. - -```bash -cd path/to/wp-content/themes/ -``` - -Then, use Composer to install the package. - -```bash -composer require themehybrid/hybrid-template -``` - -### Register the Service Provider - -You need to register the service provider during your bootstrapping process. In your bootstrapping code, you should have something like the following: - -```php -$themeslug = new \Hybrid\Core\Application(); -``` - -After that point, you can register the service provider: - -```php -$themeslug->provider( \Hybrid\Template\Provider::class ); -``` - -## Register Templates - -The following registers a custom post template named `template-canvas.html` (or `template-canvas.php` in classic WordPress themes). - -```php -add_action( 'hybrid/templates/register', function( $templates ) { - - $templates->add( 'template-canvas', [ - 'label' => __( 'Canvas' ) - ] ); -} ); -``` - -By default, the system will register the template for every post type. You can limit it to specific post types like so: - -```php -add_action( 'hybrid/templates/register', function( $templates ) { - - $templates->add( 'template-canvas', [ - 'label' => __( 'Canvas' ), - 'post_types' => [ 'page', 'post' ] - ] ); -} ); -``` - ## Copyright and License This project is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.