Skip to content

Actions and filters

Helpers: 28 hooks.

Every hook here has a description in the source.

2 actions26 filters

filter

davo_accessible_post_types

Filter: 'davo_accessible_post_types' - Allow changing the accessible post types.

Parameters of davo_accessible_post_types
ParameterTypeDescription
$post_typesarrayThe public post types.
add_filter
add_filter( 'davo_accessible_post_types', 'my_filter_callback', 10, 1 );

/**
 * @param array $post_types
 */
function my_filter_callback( $post_types ) {
	// Change $post_types as needed, then return it.
	return $post_types;
}

src/helpers/post-type-helper.php:61

filter

davo_cookie_consent_categories

Filter the cookie consent categories metadata and storage inventory shown in the preferences dialog.

Parameters of davo_cookie_consent_categories
ParameterTypeDescription
$categoriesarray<int, array<string, mixed>>Categories metadata array.
add_filter
add_filter( 'davo_cookie_consent_categories', 'my_filter_callback', 10, 1 );

/**
 * @param array<int, array<string, mixed>> $categories
 */
function my_filter_callback( $categories ) {
	// Change $categories as needed, then return it.
	return $categories;
}

src/helpers/cookie-consent-helper.php:564

filter

davo_cookie_consent_effective_mode

Filter the resolved cookie consent mode for the current request.

Parameters of davo_cookie_consent_effective_mode
ParameterTypeDescription
$effectivestringResolved mode ('opt_in' or 'opt_out').
$configuredstringConfigured mode ('opt_in', 'opt_out', or 'auto_region').
add_filter
add_filter( 'davo_cookie_consent_effective_mode', 'my_filter_callback', 10, 2 );

/**
 * @param string $effective
 * @param string $configured
 */
function my_filter_callback( $effective, $configured ) {
	// Change $effective as needed, then return it.
	return $effective;
}

src/helpers/cookie-consent-helper.php:254

filter

davo_cookie_consent_enabled

Filter whether Davo's native cookie consent system is active.

Parameters of davo_cookie_consent_enabled
ParameterTypeDescription
$enabledboolWhether the native banner and consent engine should run.
add_filter
add_filter( 'davo_cookie_consent_enabled', 'my_filter_callback', 10, 1 );

/**
 * @param bool $enabled
 */
function my_filter_callback( $enabled ) {
	// Change $enabled as needed, then return it.
	return $enabled;
}

src/helpers/cookie-consent-helper.php:170

filter

davo_cookie_consent_external_cmp_detected

Filter whether an external cookie consent management platform (CMP) is active.

Parameters of davo_cookie_consent_external_cmp_detected
ParameterTypeDescription
$detectedboolWhether a third-party CMP was detected.
add_filter
add_filter( 'davo_cookie_consent_external_cmp_detected', 'my_filter_callback', 10, 1 );

/**
 * @param bool $detected
 */
function my_filter_callback( $detected ) {
	// Change $detected as needed, then return it.
	return $detected;
}

src/helpers/cookie-consent-helper.php:150

filter

davo_cookie_consent_frontend_config

Filter the frontend cookie consent configuration object.

Parameters of davo_cookie_consent_frontend_config
ParameterTypeDescription
$configarray<string, mixed>Frontend configuration payload.
add_filter
add_filter( 'davo_cookie_consent_frontend_config', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, mixed> $config
 */
function my_filter_callback( $config ) {
	// Change $config as needed, then return it.
	return $config;
}

src/helpers/cookie-consent-helper.php:623

filter

davo_cookie_consent_has_consent

Filter whether consent is granted for a category.

Parameters of davo_cookie_consent_has_consent
ParameterTypeDescription
$grantedboolWhether consent is granted.
$categorystringConsent category slug.
add_filter
add_filter( 'davo_cookie_consent_has_consent', 'my_filter_callback', 10, 2 );

/**
 * @param bool $granted
 * @param string $category
 */
function my_filter_callback( $granted, $category ) {
	// Change $granted as needed, then return it.
	return $granted;
}

src/helpers/cookie-consent-helper.php:407, and 2 more places

filter

davo_cookie_consent_script_handles

Filter the map of WordPress script handles to Davo cookie consent categories.

Example: array( 'ga4-gtag' => 'analytics', 'youtube-embed' => 'marketing' )

Parameters of davo_cookie_consent_script_handles
ParameterTypeDescription
$handle_maparray<string, string>Map of script handle => consent category.
add_filter
add_filter( 'davo_cookie_consent_script_handles', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, string> $handle_map
 */
function my_filter_callback( $handle_map ) {
	// Change $handle_map as needed, then return it.
	return $handle_map;
}

src/helpers/cookie-consent-helper.php:654

filter

davo_cookie_consent_strict_opt_in_countries

Filter the list of country codes that require strict opt-in consent.

Parameters of davo_cookie_consent_strict_opt_in_countries
ParameterTypeDescription
$countriesstring[]List of uppercase ISO 3166-1 alpha-2 country codes.
add_filter
add_filter( 'davo_cookie_consent_strict_opt_in_countries', 'my_filter_callback', 10, 1 );

/**
 * @param string[] $countries
 */
function my_filter_callback( $countries ) {
	// Change $countries as needed, then return it.
	return $countries;
}

src/helpers/cookie-consent-helper.php:234

filter

davo_cookie_consent_visitor_country

Filter the detected two-letter visitor country code used for regional privacy rules.

Parameters of davo_cookie_consent_visitor_country
ParameterTypeDescription
$countrystringUppercase ISO 3166-1 alpha-2 code or empty string.
add_filter
add_filter( 'davo_cookie_consent_visitor_country', 'my_filter_callback', 10, 1 );

/**
 * @param string $country
 */
function my_filter_callback( $country ) {
	// Change $country as needed, then return it.
	return $country;
}

src/helpers/cookie-consent-helper.php:208

filter

davo_create_page_id

Filters the ID of an existing page found for a slug before a new page is created. Return a page ID to reuse that page.

Parameters of davo_create_page_id
ParameterTypeDescription
$page_idint|string|nullThe existing page ID, or null if none was found.
$slugstringPage slug.
$page_contentstringContent the new page would have.

Returns int|string|null

add_filter
add_filter( 'davo_create_page_id', 'my_filter_callback', 10, 3 );

/**
 * @param int|string|null $page_id
 * @param string $slug
 * @param string $page_content
 */
function my_filter_callback( $page_id, $slug, $page_content ) {
	// Change $page_id as needed, then return it.
	return $page_id;
}

src/helpers/page-helper.php:209

filter

davo_create_pages

Determines which pages are created during install.

Parameters of davo_create_pages
ParameterTypeDescription
$pagesarray<string, array<string, mixed>>Page definitions keyed by page key.
add_filter
add_filter( 'davo_create_pages', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, array<string, mixed>> $pages
 */
function my_filter_callback( $pages ) {
	// Change $pages as needed, then return it.
	return $pages;
}

src/helpers/page-helper.php:289

filter

davo_frontend_page_type_simple_page_id

Filter: Modify the default page ID for simple pages.

Parameters of davo_frontend_page_type_simple_page_id
ParameterTypeDescription
$page_idintThe default page ID.
add_filter
add_filter( 'davo_frontend_page_type_simple_page_id', 'my_filter_callback', 10, 1 );

/**
 * @param int $page_id
 */
function my_filter_callback( $page_id ) {
	// Change $page_id as needed, then return it.
	return $page_id;
}

src/helpers/current-page-helper.php:80

filter

davo_get_{suffix}

Filters the stored ID of a Davo page. The hook name is davo_get_{$page}_page_id, where $page is the page slug.

The name is built at runtime: davo_get_ followed by a suffix.

Parameters of davo_get_…
ParameterTypeDescription
$page_idmixedThe stored page ID option value.

Returns mixed

add_filter
// $suffix is the part of the name that varies.
add_filter( 'davo_get_' . $suffix, 'my_filter_callback', 10, 1 );

/**
 * @param mixed $page_id
 */
function my_filter_callback( $page_id ) {
	// Change $page_id as needed, then return it.
	return $page_id;
}

src/helpers/page-helper.php:577

filter

davo_google_fonts_choices

Filter Google Fonts choices.

Allows modification of the Google Fonts choices before they are returned.

Parameters of davo_google_fonts_choices
ParameterTypeDescription
$choicesarrayGoogle Fonts choices.
add_filter
add_filter( 'davo_google_fonts_choices', 'my_filter_callback', 10, 1 );

/**
 * @param array $choices
 */
function my_filter_callback( $choices ) {
	// Change $choices as needed, then return it.
	return $choices;
}

src/helpers/google-fonts-helper.php:111

filter

davo_google_fonts_list

Filter Google Fonts list.

Parameters of davo_google_fonts_list
ParameterTypeDescription
$listarrayGoogle Fonts list.
add_filter
add_filter( 'davo_google_fonts_list', 'my_filter_callback', 10, 1 );

/**
 * @param array $list
 */
function my_filter_callback( $list ) {
	// Change $list as needed, then return it.
	return $list;
}

src/helpers/google-fonts-helper.php:71

filter

davo_google_fonts_url

Filter Google Fonts URL.

Parameters of davo_google_fonts_url
ParameterTypeDescription
$fonts_urlstringFonts URL.
$font_familiesarrayFont families map (empty when served from URL cache).
add_filter
add_filter( 'davo_google_fonts_url', 'my_filter_callback', 10, 2 );

/**
 * @param string $fonts_url
 * @param array $font_families
 */
function my_filter_callback( $fonts_url, $font_families ) {
	// Change $fonts_url as needed, then return it.
	return $fonts_url;
}

src/helpers/google-fonts-helper.php:180, and 1 more place

filter

davo_google_icons_list

Filter Google Icons list.

Parameters of davo_google_icons_list
ParameterTypeDescription
$listarrayGoogle Icons list.
add_filter
add_filter( 'davo_google_icons_list', 'my_filter_callback', 10, 1 );

/**
 * @param array $list
 */
function my_filter_callback( $list ) {
	// Change $list as needed, then return it.
	return $list;
}

src/helpers/google-icons-helper.php:52

action

davo_home_url

Action: davo_home_url - Allows overriding of the home URL.

add_action
add_action( 'davo_home_url', 'my_action_callback', 10, 1 );

function my_action_callback( $arg1 ) {
	// Your code here.
}

src/helpers/url-helper.php:116

filter

davo_image_data

Filter: 'davo_image_data' - Filter image data.

Elements with keys not listed in the section will be discarded.

Parameters of davo_image_data
ParameterTypeDescription
$image_dataarray{ Array of image data @type int id Image's ID as an attachment. @type string alt Image's alt text. @type string path Image's path. @type int width Width of image. @type int height Height of image. @type int pixels Number of pixels in the image. @type string type Image's MIME type. @type string size Image's size. @type string url Image's URL. @type int filesize The file size in bytes, if already set. }
$attachment_idintAttachment ID.
add_filter
add_filter( 'davo_image_data', 'my_filter_callback', 10, 2 );

/**
 * @param array $image_data
 * @param int $attachment_id
 */
function my_filter_callback( $image_data, $attachment_id ) {
	// Change $image_data as needed, then return it.
	return $image_data;
}

src/helpers/image-helper.php:530

filter

davo_image_image_weight_limit

Filter: 'davo_image_image_weight_limit' - Determines what the maximum weight (in bytes) of an image is allowed to be, default is 2 MB.

Parameters of davo_image_image_weight_limit
ParameterTypeDescription
$max_bytesintThe maximum weight (in bytes) of an image.
add_filter
add_filter( 'davo_image_image_weight_limit', 'my_filter_callback', 10, 1 );

/**
 * @param int $max_bytes
 */
function my_filter_callback( $max_bytes ) {
	// Change $max_bytes as needed, then return it.
	return $max_bytes;
}

src/helpers/image-helper.php:554

filter

davo_image_sizes

Filter: 'davo_image_sizes' - Determines which image sizes we'll loop through to get an appropriate image.

Parameters of davo_image_sizes
ParameterTypeDescription
$sizesarray<string>The array of image sizes to loop through.
add_filter
add_filter( 'davo_image_sizes', 'my_filter_callback', 10, 1 );

/**
 * @param array<string> $sizes
 */
function my_filter_callback( $sizes ) {
	// Change $sizes as needed, then return it.
	return $sizes;
}

src/helpers/image-helper.php:732

filter

davo_locate_template

Filter: davo_locate_template - Modify the located template path.

Parameters of davo_locate_template
ParameterTypeDescription
$templatestringThe located template path.
$template_namestringThe name of the template file.
$default_pathstringThe default path to the template directory.
add_filter
add_filter( 'davo_locate_template', 'my_filter_callback', 10, 3 );

/**
 * @param string $template
 * @param string $template_name
 * @param string $default_path
 */
function my_filter_callback( $template, $template_name, $default_path ) {
	// Change $template as needed, then return it.
	return $template;
}

src/helpers/template-helper.php:78

action

davo_page_created

Fires after a Davo page is created.

Parameters of davo_page_created
ParameterTypeDescription
$page_idintThe new page's ID.
$page_dataarray<string, mixed>The data the page was created from.
add_action
add_action( 'davo_page_created', 'my_action_callback', 10, 2 );

/**
 * @param int $page_id
 * @param array<string, mixed> $page_data
 */
function my_action_callback( $page_id, $page_data ) {
	// Your code here.
}

src/helpers/page-helper.php:266

filter

davo_pre_analysis_post_content

Filter: 'davo_pre_analysis_post_content' - Allow filtering the content before analysis.

Parameters of davo_pre_analysis_post_content
ParameterTypeDescription
$post_contentstringThe Post content string.
$postWP_PostThe current post.
add_filter
add_filter( 'davo_pre_analysis_post_content', 'my_filter_callback', 10, 2 );

/**
 * @param string $post_content
 * @param WP_Post $post
 */
function my_filter_callback( $post_content, $post ) {
	// Change $post_content as needed, then return it.
	return $post_content;
}

src/helpers/content-images-helper.php:107

filter

davo_profile_current_slug

Filters the current profile slug for a user.

Same filter Account's template already calls — Profile_Initializer hooks into this to return the slug from the profile domain's own slug table. Default is '' if nothing hooks it.

Parameters of davo_profile_current_slug
ParameterTypeDescription
$slugstringDefault empty slug.
$user_idintWordPress user ID.
add_filter
add_filter( 'davo_profile_current_slug', 'my_filter_callback', 10, 2 );

/**
 * @param string $slug
 * @param int $user_id
 */
function my_filter_callback( $slug, $user_id ) {
	// Change $slug as needed, then return it.
	return $slug;
}

src/helpers/user-helper.php:198, and 1 more place

filter

davo_profile_resolve_user_by_slug

Filters the resolution of a profile slug back to a WP_User.

Return a WP_User to short-circuit the built-in user_nicename fallback below — needed if the Profile domain's slug table can ever diverge from user_nicename. Default is null, in which case the user_nicename fallback runs.

Parameters of davo_profile_resolve_user_by_slug
ParameterTypeDescription
$userWP_User|nullDefault null.
$slugstringThe username/slug segment from the URL.
add_filter
add_filter( 'davo_profile_resolve_user_by_slug', 'my_filter_callback', 10, 2 );

/**
 * @param WP_User|null $user
 * @param string $slug
 */
function my_filter_callback( $user, $slug ) {
	// Change $user as needed, then return it.
	return $user;
}

src/helpers/user-helper.php:227

filter

davo_template_path

Filter: davo_template_path - Modify the default template path.

Parameters of davo_template_path
ParameterTypeDescription
$pathstringThe default template path.
add_filter
add_filter( 'davo_template_path', 'my_filter_callback', 10, 1 );

/**
 * @param string $path
 */
function my_filter_callback( $path ) {
	// Change $path as needed, then return it.
	return $path;
}

src/helpers/template-helper.php:94

Note. Generated from the plugin source. Descriptions and parameters are the ones written in the code. The starter code uses the parameter names from those comments, or generic names where there are none, so check them against your use.

See it on your own site.

Davo is a WordPress theme and plugin by Exorex.

  • Runs on your own WordPress
  • Guided setup wizard
  • AI is off until you switch it on
  • Read the licence on the marketplace first