groundhogg/reset

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Action Hooks

Β»

groundhogg/reset

Fires when the Groundhogg reset tool is triggered from the admin tools page. Use this to also reset your extension’s data when the admin performs a full Groundhogg reset.

do_action( 'groundhogg/reset' );

This hook has no arguments.

Example

add_action( 'groundhogg/reset', 'my_extension_on_reset' );

/**
 * Clear extension data when Groundhogg is reset.
 *
 * @return void
 */
function my_extension_on_reset() {
    global $wpdb;
    $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}my_extension_log" );
    delete_option( 'my_extension_settings' );
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.