WP Consent API 2.1.0 has 1 actions and 13 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when WP Consent API fires an action
add_action( 'wp_consent_api_status_change_service', function( $service, $consented ) {
// Your code runs here.
}, 10, 2 );
// Change a value WP Consent API is about to use
add_filter( 'wp_consent_api_cookie_expiration', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
apply_filters( 'wp_consent_api_cookie_expiration', WP_Consent_API::$config->cookie_expiration_days() ); -
apply_filters( "wp_consent_api_registered_{$plugin}", false ); -
do_action( 'wp_consent_api_status_change_service', $service, $consented ); -
apply_filters( 'wp_consent_api_waitfor_consent_hook', false ); -
wp_consent_categories
filterapply_filters( 'wp_consent_categories', array( 'functional', 'preferences', 'statistics', 'statistics-anonymous', 'marketing', ) ); -
wp_consent_cookie_prefix
filterapply_filters( 'wp_consent_cookie_prefix', 'wp_consent' ); -
wp_consent_types
filterapply_filters( 'wp_consent_types', array( 'optin', 'optout', ) ); -
wp_consent_values
filterapply_filters( 'wp_consent_values', array( 'allow', 'deny', ) ); -
wp_cookie_expiration
filterapply_filters( 'wp_cookie_expiration', 30 ); -
wp_get_consent_type
filterapply_filters( 'wp_get_consent_type', '' ); -
wp_has_consent
filterapply_filters( 'wp_has_consent', $has_consent, $category, $requested_by ); -
wp_has_service_consent
filterapply_filters( 'wp_has_service_consent', $has_consent, $service, $requested_by ); -
wp_is_service_denied
filterapply_filters( 'wp_is_service_denied', $is_denied, $service, $requested_by ); -
wp_set_consent_value
filterapply_filters( 'wp_set_consent_value', $value );
Generated from WP Consent API's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: