WordPress filter hook

wp_get_consent_type

Fired by 5 WordPress plugins, running on 3.3M+ sites between them.

How to use wp_get_consent_type

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_get_consent_type', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

5 plugins that fire wp_get_consent_type

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'wp_get_consent_type', '' ) jetpack_vendor/automattic/jetpack-premium-analytics/src/class-stats-settings.php:379
  2. WP Consent API icon WP Consent API300,000+ installs apply_filters( 'wp_get_consent_type', '' ) inc/api-functions.php:162
  3. Axeptio icon Axeptio8,000+ installs apply_filters( 'wp_get_consent_type', false ) includes/classes/models/class-wp-consent-api-settings.php:33
  4. Trackdolphin icon TrackdolphinFewer than 10 installs apply_filters( 'wp_get_consent_type', '' ) includes/class-td-cmp.php:451
  5. Datoden Cookie Consent icon Datoden Cookie ConsentFewer than 10 installs apply_filters( 'wp_get_consent_type', '' ) includes/dt-consent-api-lib.php:75

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.