- Server operating system version
- AlmaLinux 8.9
- Plesk version and microupdate number
- Plesk Obsidian Version 18.0.57 Update #5
Hi,
I need to execute an Event Handler based on the last installed WordPress instance.
The command looks like this:
The Event Parameter list of the "WordPress installed" event doesn't have an instance-id:
WordPress installed
I can get the last instance-id using the command line like this:
But there must be an easier way, right?
I need to execute an Event Handler based on the last installed WordPress instance.
The command looks like this:
Code:
# plesk ext wp-toolkit --wp-cli -instance-id 64 -- <command>
The Event Parameter list of the "WordPress installed" event doesn't have an instance-id:
WordPress installed
Parameter name and description | Environment variable | Notes |
---|---|---|
Client GUID | NEW_CLIENT_GUID | Required |
Domain GUID | NEW_DOMAIN_GUID | Required |
Domain Name | NEW_DOMAIN_NAME | Required |
Site Name | NEW_SITE_NAME | Required |
Installation Path | NEW_INSTALLATION_PATH | Required |
Version | NEW_VERSION | Required |
Main Domain ID | NEW_MAIN_DOMAIN_ID | Required |
I can get the last instance-id using the command line like this:
Code:
# plesk ext wp-toolkit --list 2>/dev/null | awk '{ print $1 }'| grep -o '[0-9]\+' | tail -1
64
But there must be an easier way, right?