Skip to content

Actions and filters

Articles: 44 hooks.

Every hook here has a description in the source.

25 actions19 filters

action

davo_article_added_to_collection

Fires after an article is added to a collection.

Parameters of davo_article_added_to_collection
ParameterTypeDescription
$article_idintArticle post ID.
$collection_idintCollection ID.
add_action
add_action( 'davo_article_added_to_collection', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $collection_id
 */
function my_action_callback( $article_id, $collection_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:742

action

davo_article_archived

Fires after an article is archived.

Parameters of davo_article_archived
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who archived it.
add_action
add_action( 'davo_article_archived', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $user_id
 */
function my_action_callback( $article_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:422

action

davo_article_collection_created

Fires after an article collection is created.

Parameters of davo_article_collection_created
ParameterTypeDescription
$collection_idintThe new collection ID.
$user_idintUser who created it.
add_action
add_action( 'davo_article_collection_created', 'my_action_callback', 10, 2 );

/**
 * @param int $collection_id
 * @param int $user_id
 */
function my_action_callback( $collection_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:107

action

davo_article_collection_deleted

Fires after an article collection is deleted.

Parameters of davo_article_collection_deleted
ParameterTypeDescription
$collection_idintThe deleted collection ID.
$user_idintUser who deleted it.
add_action
add_action( 'davo_article_collection_deleted', 'my_action_callback', 10, 2 );

/**
 * @param int $collection_id
 * @param int $user_id
 */
function my_action_callback( $collection_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:269

filter

davo_article_collection_max_depth

Filter how many levels of nested collections are allowed.

Parameters of davo_article_collection_max_depth
ParameterTypeDescription
$max_depthintMaximum number of levels; the top level counts as 1.
add_filter
add_filter( 'davo_article_collection_max_depth', 'my_filter_callback', 10, 1 );

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

src/domains/articles/services/collections.php:569

action

davo_article_collection_moved

Fires after a collection has been moved and re-ordered.

Parameters of davo_article_collection_moved
ParameterTypeDescription
$collection_idintCollection that moved.
$old_parent_idint|nullIts previous parent, or null for the top level.
$new_parent_idint|nullIts new parent, or null for the top level.
add_action
add_action( 'davo_article_collection_moved', 'my_action_callback', 10, 3 );

/**
 * @param int $collection_id
 * @param int|null $old_parent_id
 * @param int|null $new_parent_id
 */
function my_action_callback( $collection_id, $old_parent_id, $new_parent_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:547

action

davo_article_collection_reordered

Fires after the articles inside a collection are reordered.

Parameters of davo_article_collection_reordered
ParameterTypeDescription
$collection_idintCollection ID.
add_action
add_action( 'davo_article_collection_reordered', 'my_action_callback', 10, 1 );

/**
 * @param int $collection_id
 */
function my_action_callback( $collection_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:860

action

davo_article_collection_updated

Fires after an article collection is updated.

Parameters of davo_article_collection_updated
ParameterTypeDescription
$collection_idintCollection ID.
$user_idintUser who updated it.
add_action
add_action( 'davo_article_collection_updated', 'my_action_callback', 10, 2 );

/**
 * @param int $collection_id
 * @param int $user_id
 */
function my_action_callback( $collection_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:204

action

davo_article_collections_reordered

Fires after the collections under one parent are reordered.

Parameters of davo_article_collections_reordered
ParameterTypeDescription
$parent_idintParent collection ID.
add_action
add_action( 'davo_article_collections_reordered', 'my_action_callback', 10, 1 );

/**
 * @param int $parent_id
 */
function my_action_callback( $parent_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:446, and 2 more places

action

davo_article_created

Fires after an article is created. When it is created already published, davo_article_published follows.

Parameters of davo_article_created
ParameterTypeDescription
$article_idintThe new article's post ID.
$author_idintThe author's user ID.
add_action
add_action( 'davo_article_created', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $author_id
 */
function my_action_callback( $article_id, $author_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:102

action

davo_article_deleted

Fires when an article is moved to the trash. It does not fire when an article is deleted permanently.

Parameters of davo_article_deleted
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who deleted the article.
add_action
add_action( 'davo_article_deleted', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $user_id
 */
function my_action_callback( $article_id, $user_id ) {
	// Your code here.
}

src/domains/articles/repository.php:418

action

davo_article_deprecated

Fires after an article is marked as deprecated.

Parameters of davo_article_deprecated
ParameterTypeDescription
$article_idintArticle post ID.
$replacement_idintThe replacement article ID, or 0 if there is none.
add_action
add_action( 'davo_article_deprecated', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $replacement_id
 */
function my_action_callback( $article_id, $replacement_id ) {
	// Your code here.
}

src/domains/articles/services/freshness.php:57

action

davo_article_feedback_poor

Fires when an article's helpful rate drops below the poor-feedback threshold (the articles_poor_feedback_threshold_percent setting, 40 by default). It fires once until the rate recovers.

Parameters of davo_article_feedback_poor
ParameterTypeDescription
$article_idintArticle post ID.
$ratefloatPercentage of votes that were helpful.
$totalintTotal number of votes.
add_action
add_action( 'davo_article_feedback_poor', 'my_action_callback', 10, 3 );

/**
 * @param int $article_id
 * @param float $rate
 * @param int $total
 */
function my_action_callback( $article_id, $rate, $total ) {
	// Your code here.
}

src/domains/articles/services/freshness.php:152

action

davo_article_first_published

Fires the first time an article is published. It does not fire again when the article is republished.

Parameters of davo_article_first_published
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who published it.
add_action
add_action( 'davo_article_first_published', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $user_id
 */
function my_action_callback( $article_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:305

filter

davo_article_max_title_length

Filters the maximum allowed article title length. Defaults to the articles_max_title_length setting (150).

Parameters of davo_article_max_title_length
ParameterTypeDescription
$lengthintMaximum length in characters.

Returns int

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

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

src/domains/articles/helpers.php:262

filter

davo_article_min_title_length

Filters the minimum allowed article title length. Defaults to the articles_min_title_length setting (5).

Parameters of davo_article_min_title_length
ParameterTypeDescription
$lengthintMinimum length in characters.

Returns int

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

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

src/domains/articles/helpers.php:245

action

davo_article_permanently_deleted

Fires just before an article is permanently deleted — a real wp_delete_post() (force-delete, or WordPress's own 30-day trash auto-purge), not the recoverable soft-trash that fires davo_article_deleted. Kept distinct so listeners that treat "no longer visible" and "gone forever" differently (e.g. Realtime) only ever fire on a removal that can't be undone by restoring from trash.

Parameters of davo_article_permanently_deleted
ParameterTypeDescription
$article_idintPost ID, still readable at this point.
$author_idintArticle author user ID.
add_action
add_action( 'davo_article_permanently_deleted', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $author_id
 */
function my_action_callback( $article_id, $author_id ) {
	// Your code here.
}

src/domains/articles/initializer.php:2335

action

davo_article_primary_collection_changed

Fires after an article's primary collection changes.

Parameters of davo_article_primary_collection_changed
ParameterTypeDescription
$article_idintArticle post ID.
$collection_idintThe new primary collection ID.
$previous_collection_idint|nullThe previous primary collection ID, or null if there was none.
add_action
add_action( 'davo_article_primary_collection_changed', 'my_action_callback', 10, 3 );

/**
 * @param int $article_id
 * @param int $collection_id
 * @param int|null $previous_collection_id
 */
function my_action_callback( $article_id, $collection_id, $previous_collection_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:645

action

davo_article_published

Fires when an article is published, whether created as published or published later.

Parameters of davo_article_published
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who published it.
add_action
add_action( 'davo_article_published', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $user_id
 */
function my_action_callback( $article_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:111, and 1 more place

action

davo_article_related

Fires after a related article is added by hand.

Parameters of davo_article_related
ParameterTypeDescription
$article_idintArticle post ID.
$related_article_idintThe related article's post ID.
add_action
add_action( 'davo_article_related', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $related_article_id
 */
function my_action_callback( $article_id, $related_article_id ) {
	// Your code here.
}

src/domains/articles/services/relations.php:61

filter

davo_article_related_limit

Filters the maximum number of related articles shown for an article. Defaults to the articles_related_limit setting (5).

Parameters of davo_article_related_limit
ParameterTypeDescription
$limitintMaximum related articles.

Returns int

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

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

src/domains/articles/helpers.php:296

action

davo_article_removed_from_collection

Fires after an article is removed from a collection.

Parameters of davo_article_removed_from_collection
ParameterTypeDescription
$article_idintArticle post ID.
$collection_idintCollection ID.
add_action
add_action( 'davo_article_removed_from_collection', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $collection_id
 */
function my_action_callback( $article_id, $collection_id ) {
	// Your code here.
}

src/domains/articles/services/collections.php:835

filter

davo_article_response

Filter an article's built REST response — the extension point other domains (Feedback, Attachments, Search) use to embed their own data without Articles knowing they exist.

Parameters of davo_article_response
ParameterTypeDescription
$responsearray<string, mixed>The response so far.
$postWP_PostArticle post.
$viewer_idintCurrent viewer's user ID (0 = guest).
$with_contentboolFalse for list and card responses, true for the full article. Extensions that add per-article queries should skip lists.
add_filter
add_filter( 'davo_article_response', 'my_filter_callback', 10, 4 );

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

src/domains/articles/helpers.php:1575

action

davo_article_restored

Fires after an archived or trashed article is restored to published.

Parameters of davo_article_restored
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who restored it.
add_action
add_action( 'davo_article_restored', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $user_id
 */
function my_action_callback( $article_id, $user_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:468

action

davo_article_scheduled

Fires after an article is scheduled for future publication.

Parameters of davo_article_scheduled
ParameterTypeDescription
$article_idintArticle post ID.
$user_idintUser who scheduled it.
$scheduled_atstringPublish time as a GMT MySQL datetime.
add_action
add_action( 'davo_article_scheduled', 'my_action_callback', 10, 3 );

/**
 * @param int $article_id
 * @param int $user_id
 * @param string $scheduled_at
 */
function my_action_callback( $article_id, $user_id, $scheduled_at ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:365

filter

davo_article_search_url

Filter the address an article's search result links to.

Parameters of davo_article_search_url
ParameterTypeDescription
$urlstringThe article's permalink.
$postWP_PostArticle post.
add_filter
add_filter( 'davo_article_search_url', 'my_filter_callback', 10, 2 );

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

src/domains/articles/initializer.php:1563

filter

davo_article_sidebar_resolved_widgets

Filter the final, resolved sidebar widget list for an article, after every registered resolver has already run.

Parameters of davo_article_sidebar_resolved_widgets
ParameterTypeDescription
$resolvedarray<int, array<string, mixed>>Ordered, resolved widget list.
$article_idintArticle post ID.
$viewer_idintCurrent viewer's user ID (0 = guest).
add_filter
add_filter( 'davo_article_sidebar_resolved_widgets', 'my_filter_callback', 10, 3 );

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

src/domains/articles/sidebar-registry.php:265

action

davo_article_sidebar_widget_registered

Fires after a third-party article sidebar widget is successfully registered.

Parameters of davo_article_sidebar_widget_registered
ParameterTypeDescription
$idstringNormalized widget ID.
$normalizedarray<string, mixed>Normalized widget definition.
add_action
add_action( 'davo_article_sidebar_widget_registered', 'my_action_callback', 10, 2 );

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

src/domains/articles/sidebar-registry.php:180

filter

davo_article_type_is_versioned

Filters whether an article type supports an explicit semantic version field.

Parameters of davo_article_type_is_versioned
ParameterTypeDescription
$is_versionedboolWhether the type is versioned. True for the built-in versioned types.
$typestringArticle type slug.

Returns bool

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

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

src/domains/articles/helpers.php:782

filter

davo_article_types

Filter the full set of article types available for selection.

Parameters of davo_article_types
ParameterTypeDescription
$labelsarray<string, string>Type slug => human label.
add_filter
add_filter( 'davo_article_types', 'my_filter_callback', 10, 1 );

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

src/domains/articles/helpers.php:357

action

davo_article_undeprecated

Fires after an article's deprecated mark is removed.

Parameters of davo_article_undeprecated
ParameterTypeDescription
$article_idintArticle post ID.
add_action
add_action( 'davo_article_undeprecated', 'my_action_callback', 10, 1 );

/**
 * @param int $article_id
 */
function my_action_callback( $article_id ) {
	// Your code here.
}

src/domains/articles/services/freshness.php:82

action

davo_article_unrelated

Fires after a related article is removed.

Parameters of davo_article_unrelated
ParameterTypeDescription
$article_idintArticle post ID.
$related_article_idintThe removed related article's post ID.
add_action
add_action( 'davo_article_unrelated', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $related_article_id
 */
function my_action_callback( $article_id, $related_article_id ) {
	// Your code here.
}

src/domains/articles/services/relations.php:83

action

davo_article_updated

Fires after an article is updated.

Parameters of davo_article_updated
ParameterTypeDescription
$article_idintArticle post ID.
$editor_idintUser who edited it.
add_action
add_action( 'davo_article_updated', 'my_action_callback', 10, 2 );

/**
 * @param int $article_id
 * @param int $editor_id
 */
function my_action_callback( $article_id, $editor_id ) {
	// Your code here.
}

src/domains/articles/services/publishing.php:218

filter

davo_articles_archive_seo_noindex

Filters whether the articles archive page is marked noindex. By default it is, from page 2 on and whenever a search, type, sort, category or tag filter is active.

Parameters of davo_articles_archive_seo_noindex
ParameterTypeDescription
$noindexboolWhether to mark the page noindex.
$paramsarrayThe archive's query parameters.

Returns bool

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

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

src/domains/articles/templates/archive-articles.php:144

filter

davo_articles_builder_statuses

Filter the article statuses the Documentation Builder lists.

Parameters of davo_articles_builder_statuses
ParameterTypeDescription
$statusesarray<int, string>Post statuses.
add_filter
add_filter( 'davo_articles_builder_statuses', 'my_filter_callback', 10, 1 );

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

src/domains/articles/services/documentation-builder.php:294

filter

davo_articles_enforce_path_uniqueness

Filters whether an article's slug and a sibling collection's slug may match.

Parameters of davo_articles_enforce_path_uniqueness
ParameterTypeDescription
$enforceboolTrue to keep them distinct. Default false.
add_filter
add_filter( 'davo_articles_enforce_path_uniqueness', 'my_filter_callback', 10, 1 );

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

src/domains/articles/services/collections.php:1269

filter

davo_articles_output_seo_tags

Filters whether Davo prints its own SEO tags on article pages. Defaults to false when a known SEO plugin is active.

Parameters of davo_articles_output_seo_tags
ParameterTypeDescription
$outputboolWhether to print the tags.

Returns bool

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

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

src/domains/articles/initializer.php:628, and 1 more place

filter

davo_articles_per_page

Filters how many articles are listed per page by default. Defaults to the articles_per_page setting (20).

Parameters of davo_articles_per_page
ParameterTypeDescription
$per_pageintArticles per page.

Returns int

add_filter
add_filter( 'davo_articles_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/articles/helpers.php:279

filter

davo_articles_section_feedback_hover_pin

Filter whether section feedback shows a pin and a tint on the block under the pointer while reading. Off by default: readers moving the mouse over text would see paragraphs highlight constantly. Review mode and text selection reach the same form either way.

Parameters of davo_articles_section_feedback_hover_pin
ParameterTypeDescription
$hover_pinboolWhether the hover pin is enabled.
add_filter
add_filter( 'davo_articles_section_feedback_hover_pin', 'my_filter_callback', 10, 1 );

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

src/domains/articles/templates/partials/article-view.php:107

filter

davo_author_presence

Filters an article author's presence for the article response, so a status dot can be shown without a second request. Null when the User Status domain is not active.

Parameters of davo_author_presence
ParameterTypeDescription
$presencemixedThe author's presence. Default null.
$author_idintThe author's user ID.
add_filter
add_filter( 'davo_author_presence', 'my_filter_callback', 10, 2 );

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

src/domains/articles/repository.php:884, and 3 more places

filter

davo_docs_create_reader_home

Filters the creation of the documentation reader home page. A listener creates the page and returns its ID or a WP_Error.

Parameters of davo_docs_create_reader_home
ParameterTypeDescription
$page_idint|\WP_Error|nullThe new page ID, or an error. Default null.

Returns int|\WP_Error|null

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

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

src/domains/articles/routes.php:1073

filter

davo_docs_reader_home_status

Filters the status of the documentation reader home page, which tells the admin whether the page exists.

Parameters of davo_docs_reader_home_status
ParameterTypeDescription
$statusarray<string, mixed>Status details. exists is false by default.

Returns array<string, mixed>

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

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

src/domains/articles/routes.php:1109

filter

davo_migrations_articles_term_meta_keys

Filters the term meta keys moved with Articles terms.

Only keys holding plain values belong here; a key that stores the ID of another object would point at the wrong object on the destination.

Parameters of davo_migrations_articles_term_meta_keys
ParameterTypeDescription
$keysarray<int, string>Term meta keys. Default the term icon key.
$taxonomystringTaxonomy slug.
add_filter
add_filter( 'davo_migrations_articles_term_meta_keys', 'my_filter_callback', 10, 2 );

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

src/domains/articles/terms-migration-provider.php:313

action

davo_register_article_sidebar_widgets

Register custom article sidebar widgets.

Fired once per request, on 'init', after Articles' own core widgets have already been registered and the registry locked against further core registrations. Use $registry->register() — never register_core_widget(), which will simply fail.

Parameters of davo_register_article_sidebar_widgets
ParameterTypeDescription
$registryArticles_Sidebar_RegistryShared sidebar widget registry.
add_action
add_action( 'davo_register_article_sidebar_widgets', 'my_action_callback', 10, 1 );

/**
 * @param Articles_Sidebar_Registry $registry
 */
function my_action_callback( $registry ) {
	// Your code here.
}

src/domains/articles/initializer.php:1269

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