https://github.com/dhurlburtusa/wpx-scripts
WordPress scripts.
https://github.com/dhurlburtusa/wpx-scripts
scripts wordpress
Last synced: 3 months ago
JSON representation
WordPress scripts.
- Host: GitHub
- URL: https://github.com/dhurlburtusa/wpx-scripts
- Owner: dhurlburtusa
- License: mit
- Created: 2019-11-25T02:26:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-01T04:25:32.000Z (over 6 years ago)
- Last Synced: 2026-01-03T06:13:11.230Z (6 months ago)
- Topics: scripts, wordpress
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WPX Scripts
A set of scripts to help make using/managing a WordPress instance easier.
## Warning
WPX Scripts is in alpha version. Breaking changes are possible and likely.
More thorough documentation will begin in the alpha version when the shape of this project is closer to being finalized. Please stay tuned as more improvements are made. Make a PR if you want to contribute.
## Installation
This package is installed like any other Composer package.
```sh
composer require --dev wpx/scripts
```
## Usage
**Composer Callbacks**
Composer fires various named events during its execution process. Callbacks to these events can be set up in the root `composer.json` file. This is done by using specific script names under the `"scripts"` key.
See https://getcomposer.org/doc/articles/scripts.md for details.
The following snippet demonstrates how to add a `post-install-cmd` and a `post-update-cmd` callback using the single-string method and the array method. Because `composer.json` is in the JSON format, backslashes must be escaped.
```
{
"extra": {
"wordpress-install-dir": "wp",
"wpx-skeleton-dir": "skel",
"wpx-skeleton-destination-dir": null,
},
"scripts": {
"post-install-cmd": "Wpx\\Scripts\\v0\\ComposerCallbacks::onPostInstall",
"post-update-cmd": [
"Wpx\\Scripts\\v0\\ComposerCallbacks::onPostUpdate"
]
}
}
```