acf/fields/oembed/allow_discovery filter-hookACF 6.8.3

Filters whether URL discovery is permitted on the AJAX oEmbed preview path.

Discovery is restricted by default to users with the edit_posts capability, limiting unauthenticated and subscriber-tier callers to WordPress's registered oEmbed provider allowlist. Saved values and admin save-time rendering are unaffected.

Usage

add_filter( 'acf/fields/oembed/allow_discovery', 'wp_kama_acf_fields_oembed_allow_discovery_filter', 10, 2 );

/**
 * Function for `acf/fields/oembed/allow_discovery` filter-hook.
 * 
 * @param bool  $allow_discovery Whether discovery is permitted.
 * @param array $field           The oEmbed field array.
 *
 * @return bool
 */
function wp_kama_acf_fields_oembed_allow_discovery_filter( $allow_discovery, $field ){
	// filter...
	return $allow_discovery;
}
$allow_discovery(true|false)
Whether discovery is permitted.
Default: true for users with edit_posts, false otherwise
$field(array)
The oEmbed field array.

Changelog

Since 6.8.3 Introduced.

Where the hook is called

acf_field_oembed::get_ajax_query()
acf/fields/oembed/allow_discovery
acf/includes/fields/class-acf-field-oembed.php 189
$allow_discovery = (bool) apply_filters( 'acf/fields/oembed/allow_discovery', current_user_can( 'edit_posts' ), $field );

Where the hook is used in Advanced Custom Fields PRO

Usage not found.