Skip to content

Actions and filters

Videos: 23 hooks.

22 of the 23 have a description in the source.

15 actions8 filters

filter

davo_language_translate_string

The source has no description for this hook. It is called from Video_Sections_Service::translate_sections().

Passed to callbacks: $section[ $field ]self::STRINGS_CONTEXT"section.{$id}.{$field}"

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

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

src/domains/videos/services/sections.php:102, and 8 more places

action

davo_register_video_providers

Fires when video providers should register themselves.

Parameters of davo_register_video_providers
ParameterTypeDescription
$registryVideo_Provider_RegistryShared provider registry instance.
add_action
add_action( 'davo_register_video_providers', 'my_action_callback', 10, 1 );

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

src/domains/videos/initializer.php:370

action

davo_search_reindex_object

Request regeneration of a public video's search document.

Parameters of davo_search_reindex_object
ParameterTypeDescription
$object_typestringRegistered Search source key.
$idintVideo identity.
add_action
add_action( 'davo_search_reindex_object', 'my_action_callback', 10, 2 );

/**
 * @param string $object_type
 * @param int $id
 */
function my_action_callback( $object_type, $id ) {
	// Your code here.
}

src/domains/videos/search-integration.php:82, and 9 more places

action

davo_video_attachment_deleted

Fires after a deleted attachment was removed from the videos using it.

Parameters of davo_video_attachment_deleted
ParameterTypeDescription
$attachment_idintDeleted attachment ID.
$thumbnail_videosint[]Videos whose custom thumbnail was cleared.
$source_videosint[]Videos whose playable source was this file.
add_action
add_action( 'davo_video_attachment_deleted', 'my_action_callback', 10, 3 );

/**
 * @param int $attachment_id
 * @param int[] $thumbnail_videos
 * @param int[] $source_videos
 */
function my_action_callback( $attachment_id, $thumbnail_videos, $source_videos ) {
	// Your code here.
}

src/domains/videos/repository.php:1085

filter

davo_video_availability_batch_size

Filter how many queued availability checks one cron run performs.

Parameters of davo_video_availability_batch_size
ParameterTypeDescription
$batch_sizeintPairs to check per run.
add_filter
add_filter( 'davo_video_availability_batch_size', 'my_filter_callback', 10, 1 );

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

src/domains/videos/services/video-providers/registry.php:292

action

davo_video_created

Fires after a video is created.

Parameters of davo_video_created
ParameterTypeDescription
$idintNew video ID.
$rowarray<string, mixed>Inserted row data.
add_action
add_action( 'davo_video_created', 'my_action_callback', 10, 2 );

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

src/domains/videos/repository.php:451

action

davo_video_deleted

Fires after a video is deleted.

Parameters of davo_video_deleted
ParameterTypeDescription
$video_idintThe deleted video's ID.
$videoarray<string, mixed>The video as it was before deletion.
add_action
add_action( 'davo_video_deleted', 'my_action_callback', 10, 2 );

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

src/domains/videos/repository.php:643

action

davo_video_duplicated

Fires after a video is duplicated.

Parameters of davo_video_duplicated
ParameterTypeDescription
$video_idintThe new video's ID.
$sourcearray<string, mixed>The video that was copied.
add_action
add_action( 'davo_video_duplicated', 'my_action_callback', 10, 2 );

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

src/domains/videos/repository.php:707

action

davo_video_favorited

Fires after a video is added to a user's favorites.

Parameters of davo_video_favorited
ParameterTypeDescription
$user_idintUser who favorited the video.
$video_idintVideo ID.
add_action
add_action( 'davo_video_favorited', 'my_action_callback', 10, 2 );

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

src/domains/videos/favorites-repository.php:97

filter

davo_video_favorites_max

Filter the maximum number of favorite video IDs read per user.

Parameters of davo_video_favorites_max
ParameterTypeDescription
$limitintMaximum IDs.
$user_idintUser ID.
add_filter
add_filter( 'davo_video_favorites_max', 'my_filter_callback', 10, 2 );

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

src/domains/videos/favorites-repository.php:55

filter

davo_video_manage_capability

Filters the capability required to manage videos. Defaults to manage_options.

Parameters of davo_video_manage_capability
ParameterTypeDescription
$capabilitystringCapability name.

Returns string

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

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

src/domains/videos/routes.php:925, and 1 more place

action

davo_video_provider_registered

Fires after a video provider registers itself.

Parameters of davo_video_provider_registered
ParameterTypeDescription
$slugstringProvider slug.
$providerVideo_Provider_InterfaceProvider instance.
add_action
add_action( 'davo_video_provider_registered', 'my_action_callback', 10, 2 );

/**
 * @param string $slug
 * @param Video_Provider_Interface $provider
 */
function my_action_callback( $slug, $provider ) {
	// Your code here.
}

src/domains/videos/services/video-providers/registry.php:72

filter

davo_video_providers_disabled

Filter the list of disabled video provider slugs. Runs after the Options-backed list, so an integration can add to (or override) it without needing the admin UI.

Parameters of davo_video_providers_disabled
ParameterTypeDescription
$disabledarrayProvider slugs currently disabled.
add_filter
add_filter( 'davo_video_providers_disabled', 'my_filter_callback', 10, 1 );

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

src/domains/videos/services/video-providers/registry.php:167

action

davo_video_reordered

Fires after videos are reordered.

Parameters of davo_video_reordered
ParameterTypeDescription
$rowsarray<int, array<string, mixed>>The reordered rows, keyed by video ID.
add_action
add_action( 'davo_video_reordered', 'my_action_callback', 10, 1 );

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

src/domains/videos/repository.php:833

action

davo_video_section_created

Fires after a video section is created.

Parameters of davo_video_section_created
ParameterTypeDescription
$sectionarray<string, mixed>The new section as returned by the API.
add_action
add_action( 'davo_video_section_created', 'my_action_callback', 10, 1 );

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

src/domains/videos/services/sections.php:265

action

davo_video_type_created

Fires after a custom video type is created.

Parameters of davo_video_type_created
ParameterTypeDescription
$slugstringThe new type's slug.
$labelstringThe new type's label.
add_action
add_action( 'davo_video_type_created', 'my_action_callback', 10, 2 );

/**
 * @param string $slug
 * @param string $label
 */
function my_action_callback( $slug, $label ) {
	// Your code here.
}

src/domains/videos/services/types.php:177

filter

davo_video_types

Filters the registered video types. Custom types created in the admin are merged in afterwards.

Parameters of davo_video_types
ParameterTypeDescription
$typesarray<string, array{label: string}>Type slug => definition. Defaults to the built-in types.

Returns array<string, array{label: string}>

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

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

src/domains/videos/services/types.php:61

action

davo_video_unfavorited

Fires after a video is removed from a user's favorites.

Parameters of davo_video_unfavorited
ParameterTypeDescription
$user_idintUser who removed the favorite.
$video_idintVideo ID.
add_action
add_action( 'davo_video_unfavorited', 'my_action_callback', 10, 2 );

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

src/domains/videos/favorites-repository.php:137

action

davo_video_updated

Fires after a video is updated.

Parameters of davo_video_updated
ParameterTypeDescription
$idintVideo ID.
$updatearray<string, mixed>Updated columns.
add_action
add_action( 'davo_video_updated', 'my_action_callback', 10, 2 );

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

src/domains/videos/repository.php:612

filter

davo_video_view_fingerprint

Filter the raw visitor identity used to throttle view counts, before it is hashed.

Parameters of davo_video_view_fingerprint
ParameterTypeDescription
$rawstringIdentity string for the current visitor.
add_filter
add_filter( 'davo_video_view_fingerprint', 'my_filter_callback', 10, 1 );

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

src/domains/videos/helpers.php:296

filter

davo_video_view_throttle_seconds

Filter the per-visitor, per-video view throttle window.

Parameters of davo_video_view_throttle_seconds
ParameterTypeDescription
$windowintSeconds before the same visitor can add another view.
$video_idintVideo ID.
add_filter
add_filter( 'davo_video_view_throttle_seconds', 'my_filter_callback', 10, 2 );

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

src/domains/videos/repository.php:1004

action

davo_video_viewed

Fires after a video view is recorded. Deliberately lightweight — NOT written to the Activity Log directly (per the domain's own "don't record every view as an Activity event" decision); an integration that genuinely wants per-view Activity entries can hook this and opt in itself. Not fired for throttled repeats.

Parameters of davo_video_viewed
ParameterTypeDescription
$video_idintVideo ID.
add_action
add_action( 'davo_video_viewed', 'my_action_callback', 10, 1 );

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

src/domains/videos/repository.php:979

action

davo_videos_author_reassigned

Fires after a deleted user's videos were reassigned.

Parameters of davo_videos_author_reassigned
ParameterTypeDescription
$user_idintDeleted user ID.
$new_authorintNew author ID, or 0 for none.
$countintNumber of videos reassigned.
add_action
add_action( 'davo_videos_author_reassigned', 'my_action_callback', 10, 3 );

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

src/domains/videos/repository.php:1054

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