Fires just before a Groundhogg plugin or extension is activated. Use this to run pre-activation checks in your own extension.
do_action( 'groundhogg/activating', $installer_name );
You will receive the installer slug as a string (e.g. 'groundhogg' or your extension’s slug).
Example
add_action( 'groundhogg/activating', 'my_extension_pre_activation_check' );
/**
* Check requirements before the extension activates.
*
* @param string $installer_name
*
* @return void
*/
function my_extension_pre_activation_check( $installer_name ) {
if ( $installer_name !== 'my-extension' ) {
return;
}
if ( version_compare( PHP_VERSION, '7.4', '<' ) ) {
wp_die( 'My Extension requires PHP 7.4 or higher.' );
}
}
Was this helpful?
Let us know if this document answered your question. Thatβs the only way we can improve.
