https://github.com/hellofromtonya/theme-api
WordPress Theme API - Adds additional functionality currently missing from Core
https://github.com/hellofromtonya/theme-api
Last synced: 8 months ago
JSON representation
WordPress Theme API - Adds additional functionality currently missing from Core
- Host: GitHub
- URL: https://github.com/hellofromtonya/theme-api
- Owner: hellofromtonya
- License: other
- Created: 2016-07-11T23:32:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-12T00:09:50.000Z (almost 10 years ago)
- Last Synced: 2025-03-29T22:41:22.531Z (about 1 year ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Theme API Plugin
This plugin adds functionality and features for themes which is currently missing in WordPress core.
## Features
It's really quite simply as it adds the following functionality:
### Update/upgrade - Customization folder handling
Currently, if a theme is customized, there is no automatic means for the themer or theme shop to push an update to the site without blowing away all of the customizations. This API provides the means for themers:
- to specify a customization folder, where all customization can be placed and loaded from a bootstrap
- push updates and not overwrite the customization folder
#### Update Request Packet - New Parameter Required
Within the upgrade request packet, the themer will specify an array of `customization` parameters in the `hook_extras` parameter. Currently, the packet is as follows:
```
$args = array(
'source' => '',
'destination' => '',
'clear_destination' => false,
'clear_working' => false,
'abort_if_destination_exists' => true,
'hook_extra' => array(
'theme' => 'your theme name',
'type' => 'theme',
'action' => 'update',
),
);
```
To use a customization folder and preserve it, the themer will add the following new parameters to the `hook_extra` parameter:
```
'hook_extra' => array(
'theme' => 'your theme name',
'type' => 'theme',
'action' => 'update',
// this is the new parameter when you want to preserve a customization bucket
// for developers to do their thang
'customization' => array(
'preserve' => true,
'folder_name' => 'customization', // name of the customization folder
'path' => '', // path to the customization folder
),
),
```
## Installation
To install this plugin, you can either download or clone the GitHub repository onto your local machine.
Installation from GitHub is as simple as cloning the repo onto your local machine. To clone the repo, do the following:
1. Using PhpStorm, open your project and navigate to `wp-content/plugins/`. (Or open terminal and navigate there).
2. Then type: `git clone https://github.com/hellofromtonya/Theme-API.git`.
3. Make sure you that you rename the folder to just `theme-api`.
## Configuration
Everything is configurable using the configuration files found in the `config` folder.
## Contributions
All feedback, bug reports, and pull requests are welcome.
## Status
This plugin is in development and is not ready to use just yet.