groundhogg/steps/benchmarks/api

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Action Hooks

Β»

groundhogg/steps/benchmarks/api

Fires when do_api_benchmark() is called, allowing extensions to hook into any API benchmark trigger fired anywhere in the system.

do_action( 'groundhogg/steps/benchmarks/api', $call_name, $id_or_email, $by_user_id );

You will receive the benchmark call name string, the contact identifier (email or ID), and a boolean indicating whether the identifier is a WordPress user ID.

Example

add_action( 'groundhogg/steps/benchmarks/api', 'my_extension_log_benchmark_trigger', 10, 3 );

/**
 * Log every API benchmark trigger for debugging.
 *
 * @param string     $call_name
 * @param string|int $id_or_email
 * @param bool       $by_user_id
 *
 * @return void
 */
function my_extension_log_benchmark_trigger( $call_name, $id_or_email, $by_user_id ) {
    my_extension_debug_log( sprintf(
        'Benchmark "%s" triggered for %s',
        $call_name,
        $id_or_email
    ) );
}

Was this helpful?

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