Developer hooks, filters and the manual trigger
PHP filters and actions for changing the popup data, reacting to events, overriding the visitor IP and controlling crawler checks.
On this page
Change front-end data
avp_frontend_data filters the data passed to the popup before it renders.
add_filter( 'avp_frontend_data', function ( array $data ): array {
$data['minAge'] = 25;
return $data;
} );
React to plugin events
avp_event fires for the same events as webhooks.
add_action( 'avp_event', function ( string $event, array $data ) {
if ( 'identity.approved' === $event ) {
// Your code here.
}
}, 10, 2 );
Override the visitor IP
avp_pro_client_ip lets you supply the real IP in unusual proxy setups.
add_filter( 'avp_pro_client_ip', fn ( string $ip ) => $_SERVER['HTTP_X_REAL_IP'] ?? $ip );
Search crawler verification
avp_pro_verify_crawlers switches reverse-DNS verification of search engine crawlers on or off.
add_filter( 'avp_pro_verify_crawlers', '__return_false' );
Open the gate from your own buttons
Add the class avp-trigger-manual to any button or link to open the gate on click. To hide content until the visitor is verified, wrap it in [age_restricted]…[/age_restricted] — see Restrict content.