D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
library
/
Feature
/
EventHooks
/
Filename :
README.md
back
Copy
# Hooks for Custom Scripts Server administrators can make WP Toolkit run custom scripts via hooks after performing certain actions. Before using these hooks, make sure you have enabled this feature by adding `exposeEventsFeature = true` to `config.ini`. After the feature is enabled, prepare your script and put it under a specific name corresponding to the desired action in the `%var_dir%/user-hooks` directory (usually it's `usr/local/cpanel/3rdparty/wp-toolkit/var/user-hooks`). You can have one script running for each action. ## Supported actions & their hooks: WP Toolkit will run the following scripts, if it finds them: - `./site-installation-completed` will be run after WP Toolkit finishes installing and configuring a WordPress site. This script will run with the following arguments: `--instance-id=1 /absolute/path/to/wordpress` - `./plugin-installation-completed` will be run after WP Toolkit finishes installing any plugin (including plugins installed via sets). This script will run with the following arguments: `--instance-id=1 --plugin-slug=slug /absolute/path/to/wordpress` - `./theme-installation-completed` will be run after WP Toolkit finishes installing any theme (including themes installed via sets). This script will run with the following arguments: `--instance-id=1 --theme-slug=slug /absolute/path/to/wordpress` - `./set-installation-completed` will be run after WP Toolkit finishes installing any set. This script will run with the following arguments: `--instance-id=1 --set-id=1 /absolute/path/to/wordpress` - `./vulnerability-check-completed` will be run after WP Toolkit finishes scanning for vulnerabilities. This script will run with the following arguments: `--instance-id=1 --old-vulnerabilities=1,2 --new-vulnerabilities=3,4 /absolute/path/to/wordpress` - `./site-cloning-completed` will be run after WP Toolkit finishes site cloning. This script will run with the following arguments: `--source-instance-id=1 --source-site-path=/absolute/path/to/wordpress --target-instance-id=2 --target-site-path=/absolute/path/to/wordpress` - `./site-syncing-completed` will be run after WP Toolkit finishes copying data between sites. This script will run with the following arguments: `--source-instance-id=1 --source-site-path=/absolute/path/to/wordpress --target-instance-id=2 --target-site-path=/absolute/path/to/wordpress`