Skip to content

Actions and filters

Docs: 13 hooks.

Every hook here has a description in the source.

3 actions10 filters

filter

davo_cache_language_suffixes

Filters the language suffixes a documentation cache entry can exist under.

Parameters of davo_cache_language_suffixes
ParameterTypeDescription
$suffixesarray<int, string>Always includes the empty suffix.
add_filter
add_filter( 'davo_cache_language_suffixes', 'my_filter_callback', 10, 1 );

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

src/domains/docs/services/cache.php:208

action

davo_docs_article_cache_flushed

Fires after one article's cached navigation entries were dropped.

Parameters of davo_docs_article_cache_flushed
ParameterTypeDescription
$article_idintArticle post ID.
$collection_idsarray<int, int>Collections that list it.
add_action
add_action( 'davo_docs_article_cache_flushed', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param array<int, int> $collection_ids
 */
function my_action_callback( $article_id, $collection_ids ) {
	// Your code here.
}

src/domains/docs/services/navigation.php:373

filter

davo_docs_back_link

Filter the documentation header's link back to the main site.

Parameters of davo_docs_back_link
ParameterTypeDescription
$linkarray{show: bool, label: string, url: string}Link description.
add_filter
add_filter( 'davo_docs_back_link', 'my_filter_callback', 10, 1 );

/**
 * @param array{show: bool, label: string, url: string} $link
 */
function my_filter_callback( $link ) {
	// Change $link as needed, then return it.
	return $link;
}

src/domains/docs/services/config.php:282

action

davo_docs_cache_flushed

Fires after the documentation caches were invalidated.

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

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

src/domains/docs/services/cache.php:288

filter

davo_docs_front_page_base

Filters the URL path of the documentation front page. Defaults to docs; slashes at the ends are trimmed.

Parameters of davo_docs_front_page_base
ParameterTypeDescription
$basestringPath segment.

Returns string

add_filter
add_filter( 'davo_docs_front_page_base', 'my_filter_callback', 10, 1 );

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

src/domains/docs/helpers.php:324

filter

davo_docs_home

Filter the documentation homepage payload.

Parameters of davo_docs_home
ParameterTypeDescription
$homearray<string, mixed>Homepage payload.
$viewer_idintViewer's user ID (0 = guest).
add_filter
add_filter( 'davo_docs_home', 'my_filter_callback', 10, 2 );

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

src/domains/docs/services/home.php:133

filter

davo_docs_nav_scalable

Filter whether the documentation navigation runs in scalable mode.

Parameters of davo_docs_nav_scalable
ParameterTypeDescription
$scalableboolThe Builder's "Scalable navigation" setting.
add_filter
add_filter( 'davo_docs_nav_scalable', 'my_filter_callback', 10, 1 );

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

src/domains/docs/helpers.php:173

filter

davo_docs_navigation_tree

Filter the documentation navigation tree for a viewer scope.

Runs on every read (after the cached tree is retrieved), so it must be cheap. Applies to the full tree only: in scalable mode the sidebar is built from the skeleton and this filter does not run for it.

Parameters of davo_docs_navigation_tree
ParameterTypeDescription
$treearray{items: array<int, array<string, mixed>>, article_count: int}Navigation tree.
$scopestringViewer scope: 'guest', 'member' or 'staff'.
add_filter
add_filter( 'davo_docs_navigation_tree', 'my_filter_callback', 10, 2 );

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

src/domains/docs/services/navigation.php:128

filter

davo_docs_output_head_tags

Filter: davo_docs_output_head_tags( bool $output, array $view ).

A documentation page is not a WordPress post, so an SEO plugin has no title, description or canonical for it; these tags are the only correct ones and default to on. A site that supplies them some other way can switch this off.

Passed to callbacks: true$view

add_filter
add_filter( 'davo_docs_output_head_tags', 'my_filter_callback', 10, 2 );

function my_filter_callback( $arg1, $arg2 ) {
	// Change $arg1 as needed, then return it.
	return $arg1;
}

src/domains/docs/initializer.php:699

filter

davo_docs_page_payload

Filter the payload the client router receives for a page.

Parameters of davo_docs_page_payload
ParameterTypeDescription
$payloadarray<string, mixed>Page payload.
$viewarray<string, mixed>The view it was built from.
$viewer_idintViewer's user ID (0 = guest).
add_filter
add_filter( 'davo_docs_page_payload', 'my_filter_callback', 10, 3 );

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

src/domains/docs/repository.php:219

filter

davo_docs_public_config

Filter the public documentation configuration handed to the front end.

Parameters of davo_docs_public_config
ParameterTypeDescription
$configarray<string, mixed>Public configuration.
add_filter
add_filter( 'davo_docs_public_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/domains/docs/services/config.php:374

filter

davo_docs_search_per_page

Filters how many results the documentation search-results view shows per page.

Parameters of davo_docs_search_per_page
ParameterTypeDescription
$per_pageintResults per page.
add_filter
add_filter( 'davo_docs_search_per_page', 'my_filter_callback', 10, 1 );

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

src/domains/docs/services/search.php:84

action

davo_docs_settings_updated

Fires after Builder settings were saved.

Parameters of davo_docs_settings_updated
ParameterTypeDescription
$changedlist<string>Keys whose value changed.
$valuesarray<string, mixed>All settings after the update.
add_action
add_action( 'davo_docs_settings_updated', 'my_action_callback', 10, 2 );

/**
 * @param list<string> $changed
 * @param array<string, mixed> $values
 */
function my_action_callback( $changed, $values ) {
	// Your code here.
}

src/domains/docs/services/config.php:469, and 1 more place

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