afb/embed-popup/embed_html

Available on Embed Popup display format. Filters the oEmbed HTML resolved from the URL field, just before it’s injected into the popup’s iframe container. Use this to rewrite the iframe markup — adding loading attributes, swapping the provider’s domain (e.g., privacy-friendly variants), injecting extra query parameters, or sanitizing the markup.

Parameters

apply_filters( 'afb/embed-popup/embed_html', $embed_html, $field, $attr );Code language: PHP (php)
  • $embed_html (string) — The resolved oEmbed HTML.
  • $field (array) — The ACF field array.
  • $attr (array) — The block attributes array.

Modifiers

TagApplies to
afb/embed-popup/embed_htmlAll ACF fields.
afb/embed-popup/embed_html/type={$type}All fields of a specific field type.
afb/embed-popup/embed_html/name={$name}All fields with a specific field name.
afb/embed-popup/embed_html/key={$key}A single field, matched by field key.

Example

// Force the privacy-enhanced YouTube domain on every Embed Popup.
add_filter( 'afb/embed-popup/embed_html', function( $html ) {
    return str_replace( 'youtube.com/embed/', 'youtube-nocookie.com/embed/', $html );
} );Code language: PHP (php)