Skip to content

Actions and filters

Editor: 13 hooks.

Every hook here has a description in the source.

2 actions11 filters

filter

davo_editor_allowed_html

Filter the allowed HTML array used to sanitize exorex-editor-field content, for sites that need to support additional editor output.

Parameters of davo_editor_allowed_html
ParameterTypeDescription
$allowedarray<string, array<string, bool>>Allowed tags/attributes.
add_filter
add_filter( 'davo_editor_allowed_html', 'my_filter_callback', 10, 1 );

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

src/domains/editor/helpers.php:1300

filter

davo_editor_cleanup_time_budget

Filters the time budget, in seconds, for one run of the orphaned-upload cleanup. Defaults to 20 and is never less than 1. Anything left is picked up on the next run.

Parameters of davo_editor_cleanup_time_budget
ParameterTypeDescription
$secondsfloatTime budget in seconds.

Returns float

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

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

src/domains/editor/initializer.php:203

filter

davo_editor_embed_platforms

Filter the supported embed platform registry.

Parameters of davo_editor_embed_platforms
ParameterTypeDescription
$platformsarray<string, array{hosts: string[], normalize: callable}>Platform key => config.
add_filter
add_filter( 'davo_editor_embed_platforms', 'my_filter_callback', 10, 1 );

/**
 * @param array<string, array{hosts: string[], normalize: callable}> $platforms
 */
function my_filter_callback( $platforms ) {
	// Change $platforms as needed, then return it.
	return $platforms;
}

src/domains/editor/helpers.php:736

filter

davo_editor_find_upload_reference

Let domains that store content outside wp_posts report a reference to an upload.

Parameters of davo_editor_find_upload_reference
ParameterTypeDescription
$referencearray{type: string, id: int}|nullReference found so far, if any.
$stemstringStored relative path without extension.
add_filter
add_filter( 'davo_editor_find_upload_reference', 'my_filter_callback', 10, 2 );

/**
 * @param array{type: string, id: int}|null $reference
 * @param string $stem
 */
function my_filter_callback( $reference, $stem ) {
	// Change $reference as needed, then return it.
	return $reference;
}

src/domains/editor/uploads.php:717

filter

davo_editor_iframe_policy

Filters the policy applied to an embedded iframe: its permissions (allow) and sandbox attributes.

Parameters of davo_editor_iframe_policy
ParameterTypeDescription
$policyarray<string, string>The allow and sandbox values.
$hoststringThe embed's host name.

Returns array<string, string>

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

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

src/domains/editor/helpers.php:517

filter

davo_editor_migration_optional_providers

Filters the providers editor uploads should run after WHEN PRESENT in the same job, without requiring their presence.

Parameters of davo_editor_migration_optional_providers
ParameterTypeDescription
$provider_keysarray<int, string>Provider keys. Default none.
add_filter
add_filter( 'davo_editor_migration_optional_providers', 'my_filter_callback', 10, 1 );

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

src/domains/editor/migration-provider.php:155

filter

davo_editor_migration_required_providers

Filters the providers that must ALWAYS be imported before editor uploads, widening any export that includes them even when the added provider was never selected. A content domain that only wants its posts imported first WHEN ALSO SELECTED should hook davo_editor_migration_optional_providers instead.

Parameters of davo_editor_migration_required_providers
ParameterTypeDescription
$provider_keysarray<int, string>Provider keys. Default users.
add_filter
add_filter( 'davo_editor_migration_required_providers', 'my_filter_callback', 10, 1 );

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

src/domains/editor/migration-provider.php:134

filter

davo_editor_render_content

Filter editor-produced content immediately before it's sent in a REST response — the extension point for anything that would otherwise have been done via the_content (e.g. a site wanting to append a call-to-action, or run a specific third-party integration's own content filter) without reintroducing the whole classic-editor pipeline this function deliberately skips.

Parameters of davo_editor_render_content
ParameterTypeDescription
$contentstringStored, already-sanitized post_content.
$contextstringCaller-supplied label for which content this is (e.g. 'question', 'answer', 'article') — passed through unchanged so listeners can tell content types apart; this function itself treats every context identically.
add_filter
add_filter( 'davo_editor_render_content', 'my_filter_callback', 10, 2 );

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

src/domains/editor/helpers.php:357

filter

davo_editor_render_resanitize

Filters whether stored content is sanitized again when it is rendered. Defaults to true. Return false on sites that trust the stored data.

Parameters of davo_editor_render_resanitize
ParameterTypeDescription
$resanitizeboolWhether to sanitize on render.
$contextstringWhere the content is rendered.

Returns bool

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

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

src/domains/editor/helpers.php:327

action

davo_editor_upload_created

Fires after an editor media upload is successfully stored.

Parameters of davo_editor_upload_created
ParameterTypeDescription
$attachment_idintNew attachment post ID.
$user_idintUploading user ID.
$media_typestring'image' or 'video'.
add_action
add_action( 'davo_editor_upload_created', 'my_action_callback', 10, 3 );

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

src/domains/editor/uploads.php:481

filter

davo_editor_upload_daily_quota_bytes

Filters each member's daily editor upload quota in bytes. Defaults to the editor_uploads_daily_quota_mb setting (200 MB). Users who can already upload to the Media Library are exempt.

Parameters of davo_editor_upload_daily_quota_bytes
ParameterTypeDescription
$bytesintDaily quota in bytes.

Returns int

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

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

src/domains/editor/helpers.php:1557

action

davo_editor_upload_deleted

Fires after an editor upload is deleted.

Parameters of davo_editor_upload_deleted
ParameterTypeDescription
$attachment_idintDeleted attachment post ID.
$user_idintUser who performed the deletion.
add_action
add_action( 'davo_editor_upload_deleted', 'my_action_callback', 10, 2 );

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

src/domains/editor/uploads.php:550

filter

davo_editor_upload_max_pixels

Filters the largest image, in pixels, that the editor accepts for upload. Defaults to the editor_uploads_max_image_megapixels setting (40 megapixels).

Parameters of davo_editor_upload_max_pixels
ParameterTypeDescription
$pixelsintMaximum pixel count.

Returns int

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

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

src/domains/editor/helpers.php:1535

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