Automate actions when creating a website with wordpress toolkit.

Cameron Maclean

Registered
Jan 13, 2023
2
0
1
Canada
cPanel Access Level
DataCenter Provider
Hi,

I am currently building a cPanel plugin that works alongside wordpress installations which require data being placed into the databases of the wordpress install.

I have looked at the hook debug logs and I am not seeing any hookable actions being fired with any relevant data when a new wordpress site is being installed.

I came across Cpanel::UAPI::WordPressSite::create which doesn't get fired when using wordpress-toolkit "install website". I have tried looking into the code of wordpress-toolkit plugin but i an unable to find a way to figure.

Any help or guidance is appreciated.
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
13,329
2,102
363
cPanel Access Level
Root Administrator
Hey there! The closest option I would have is the Rest API tools. If you check WHM >> WordPress Toolkit >> Settings, you'll see the following:

Screen Shot 2023-01-13 at 11.05.57 AM.png

And clicking that "Open REST API documentation" link will open a page within WHM that gives you more details.
 

Cameron Maclean

Registered
Jan 13, 2023
2
0
1
Canada
cPanel Access Level
DataCenter Provider
Hi cPRex,

Unfortunately this would not work for our use case, we are looking for an event that lets us know when a new site has been installed so we can add the required data to the install for our wordpress plugin to function correctly. I saw there were custom hooks WHM plugins can create, I hope there are hooks created by the WP toolkit that are documented somewhere that we have missed.

Thanks.