epiphyt / embed-privacy

Embed Privacy prevents loading of embedded external content and allows your site visitors to opt-in.
https://epiph.yt/en/embed-privacy/
GNU General Public License v2.0
19 stars 12 forks source link

ACF WYSIWYG Field Compatibility #175

Closed jhtjards closed 1 year ago

jhtjards commented 1 year ago

Bug/Problem

I've encountered an issue on one of my sites in conjunction with ACF Pro WYSIWYG Field, where the replacement of youtube oembed with the embed-privacy works, but no styles and scripts seem to be enqueued.

By adding add_filter( 'acf_the_content', [ $this, 'replace_embeds' ], 10, 2 ); to Line 273 in inc/class-embed-privacy.php I can re-enable the enqueue of embed-privacy's scripts, but the functionality of the sideloaded YT-Video-Thumbnail is lost.

The ACF Field is used with a custom post type

Steps to reproduce

Create a Custom Post Type, like:

// Register Custom Post Type
function veranstaltungen_post_type() {

    $labels = array(
        'name'                  => _x( 'Veranstaltungen', 'Post Type General Name', 'gezeitenkonzerte' ),
        'singular_name'         => _x( 'Veranstaltung', 'Post Type Singular Name', 'gezeitenkonzerte' ),
        'menu_name'             => __( 'Veranstaltungen', 'gezeitenkonzerte' ),
        'name_admin_bar'        => __( 'Veranstaltungen', 'gezeitenkonzerte' ),
        'archives'              => __( 'Veranstaltungsarchiv', 'gezeitenkonzerte' ),
        'attributes'            => __( 'Veranstaltungsattribute', 'gezeitenkonzerte' ),
        'parent_item_colon'     => __( 'Übergeordnete Veranstaltung', 'gezeitenkonzerte' ),
        'all_items'             => __( 'Alle Veranstaltungen', 'gezeitenkonzerte' ),
        'add_new_item'          => __( 'Veranstaltung hinzufügen', 'gezeitenkonzerte' ),
        'add_new'               => __( 'Veranstaltung Erstellen', 'gezeitenkonzerte' ),
        'new_item'              => __( 'Neue Veranstaltung', 'gezeitenkonzerte' ),
        'edit_item'             => __( 'Veranstaltung bearbeiten', 'gezeitenkonzerte' ),
        'update_item'           => __( 'Veranstaltung aktualisieren', 'gezeitenkonzerte' ),
        'view_item'             => __( 'Veranstaltung anzeigen', 'gezeitenkonzerte' ),
        'view_items'            => __( 'Veranstaltungen anzeigen', 'gezeitenkonzerte' ),
        'search_items'          => __( 'Veranstaltung suchen', 'gezeitenkonzerte' ),
        'not_found'             => __( 'Nicht gefunden', 'gezeitenkonzerte' ),
        'not_found_in_trash'    => __( 'Nicht im Papierkorb gefunden', 'gezeitenkonzerte' ),
        'featured_image'        => __( 'Beitragsbild', 'gezeitenkonzerte' ),
        'set_featured_image'    => __( 'Beitragsbild festlegen', 'gezeitenkonzerte' ),
        'remove_featured_image' => __( 'Beitragsbild entfernen', 'gezeitenkonzerte' ),
        'use_featured_image'    => __( 'Als Beitragsbild benutzen', 'gezeitenkonzerte' ),
        'insert_into_item'      => __( 'In Veranstaltung einfügen', 'gezeitenkonzerte' ),
        'uploaded_to_this_item' => __( 'Zu dieser Veranstaltung hochgeladen', 'gezeitenkonzerte' ),
        'items_list'            => __( 'Veranstaltungsliste', 'gezeitenkonzerte' ),
        'items_list_navigation' => __( 'Veranstaltungslisten Nav', 'gezeitenkonzerte' ),
        'filter_items_list'     => __( 'Veranstaltungsliste filtern', 'gezeitenkonzerte' ),
    );
    $rewrite = array(
        'slug'                  => 'veranstaltung',
        'with_front'            => false, /* Kein /gezeitenblog/ aus den permalink settings davor  */
        'pages'                 => true,
        'feeds'                 => true,
    );
    $args = array(
        'label'                 => __( 'Veranstaltung', 'gezeitenkonzerte' ),
        'description'           => __( 'Veranstaltungen Post Type', 'gezeitenkonzerte' ),
        'labels'                => $labels,
        'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions' ),
        'taxonomies'            => array( 'spielorte', 'genre', 'monat', 'kuenstler' ),
        'hierarchical'          => false,
        'public'                => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'menu_position'         => 5,
        'menu_icon'             => 'dashicons-tickets-alt',
        'show_in_admin_bar'     => true,
        'show_in_nav_menus'     => true,
        'can_export'            => true,
        'has_archive'           => 'kalender',
        'exclude_from_search'   => false,
        'publicly_queryable'    => true,
        'rewrite'               => $rewrite,
        'capability_type'       => 'post',
    );
    register_post_type( 'veranstaltungen', $args );

}
add_action( 'init', 'veranstaltungen_post_type', 0 );

Import the following ACF JSON File:

[
    {
        "key": "group_5c018ce68e722",
        "title": "Veranstaltung",
        "fields": [
            {
                "key": "field_60c71a4e16351",
                "label": "Manuell: Ausverkauft",
                "name": "manuell_ausverkauft",
                "aria-label": "",
                "type": "true_false",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "message": "Veranstaltung als ausverkauft markieren",
                "default_value": 0,
                "ui": 0,
                "ui_on_text": "",
                "ui_off_text": ""
            },
            {
                "key": "field_5eca8f634cb18",
                "label": "Veranstaltungsstatus",
                "name": "veranstaltungsstatus",
                "aria-label": "",
                "type": "group",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "layout": "block",
                "sub_fields": [
                    {
                        "key": "field_5eca8f784cb19",
                        "label": "Status",
                        "name": "eventstatus",
                        "aria-label": "",
                        "type": "select",
                        "instructions": "Bitte unten auswählen",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "40",
                            "class": "",
                            "id": ""
                        },
                        "choices": {
                            "EventScheduled": "Normal (Wird wie geplant durchgeführt)",
                            "EventPostponed": "Verschoben, Datum wird noch bekanntgegeben",
                            "EventRescheduled": "Verschoben auf neues Datum, Verkauf offen",
                            "EventRescheduledSaleClosed": "Verschoben auf neues Datum, Verkauf geschlossen",
                            "EventMovedOnline": "Nur noch als Onlinekonzert \/ Videostream",
                            "EventCancelled": "Leider abgesagt"
                        },
                        "default_value": "EventScheduled",
                        "allow_null": 0,
                        "multiple": 0,
                        "ui": 0,
                        "return_format": "value",
                        "ajax": 0,
                        "placeholder": ""
                    },
                    {
                        "key": "field_5eca8fb84cb1a",
                        "label": "Ursprüngliches Datum + Uhrzeit Beginn",
                        "name": "previousStartDate",
                        "aria-label": "",
                        "type": "date_time_picker",
                        "instructions": "Das neue Datum + Uhrzeit bitte unten bei \"Details\" eintragen. Erzeugt \"Verlegt vom…\"-Text. Wichtig auch für Google.",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventRescheduled"
                                }
                            ],
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventRescheduledSaleClosed"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "60",
                            "class": "",
                            "id": ""
                        },
                        "display_format": "d.m.Y H:i",
                        "return_format": "Y-m-d H:i:s",
                        "first_day": 1
                    },
                    {
                        "key": "field_5eca8ff04cb1b",
                        "label": "Streaming URL (Youtube-Link)",
                        "name": "streaming_url",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "Sobald bekannt. Bindet den Player im Header ein.",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventMovedOnline"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "40",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    },
                    {
                        "key": "field_5ede35237cd1f",
                        "label": "Live-Stream",
                        "name": "livestream",
                        "aria-label": "",
                        "type": "true_false",
                        "instructions": "Wird das Konzert Live übertragen?",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventMovedOnline"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "20",
                            "class": "",
                            "id": ""
                        },
                        "message": "",
                        "default_value": 0,
                        "ui": 1,
                        "ui_on_text": "Live",
                        "ui_off_text": "Aufzeichnung"
                    },
                    {
                        "key": "field_5eca901f4cb1c",
                        "label": "Kurzer Hinweistext (Optional)",
                        "name": "status_note",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "Bei Videostream z.B. \"Die Aufzeichnung wird am xx.xx. hier veröffentlicht.\" oder \"Verfügbar bis zum...\"\r\nBei Verschoben zB. \"Diese Veranstaltung wird verschoben. Ein Ersatztermin wird in Kürze bekannt gegeben.\"",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventMovedOnline"
                                }
                            ],
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventPostponed"
                                }
                            ],
                            [
                                {
                                    "field": "field_5eca8f784cb19",
                                    "operator": "==",
                                    "value": "EventCancelled"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "Diese Veranstaltung wird verschoben. \r\nEin Ersatztermin wird in Kürze bekannt gegeben.",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 2,
                        "new_lines": ""
                    }
                ]
            },
            {
                "key": "field_5c019cfde26d1",
                "label": "Header",
                "name": "header",
                "aria-label": "",
                "type": "group",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "layout": "block",
                "sub_fields": [
                    {
                        "key": "field_5c018e27bce0e",
                        "label": "Veranstaltungstitel mit Umbrüchen (Optional)",
                        "name": "title",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "70",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 3,
                        "new_lines": "br"
                    },
                    {
                        "key": "field_5c580ee58f1fa",
                        "label": "Prolog \/ Epilog",
                        "name": "prolog",
                        "aria-label": "",
                        "type": "true_false",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "15",
                            "class": "",
                            "id": ""
                        },
                        "message": "Prolog- \/ Epilogkonzert",
                        "default_value": 0,
                        "ui": 0,
                        "ui_on_text": "",
                        "ui_off_text": ""
                    },
                    {
                        "key": "field_5d7544ceebf42",
                        "label": "Rundfunk-Sendetermin",
                        "name": "sendetermin",
                        "aria-label": "",
                        "type": "true_false",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "15",
                            "class": "",
                            "id": ""
                        },
                        "message": "Dieser Eintrag ist nur ein Sendetermin",
                        "default_value": 0,
                        "ui": 0,
                        "ui_on_text": "",
                        "ui_off_text": ""
                    },
                    {
                        "key": "field_5c018ceb1b76e",
                        "label": "Untertitel",
                        "name": "subtitle",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "!=",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "70",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 1,
                        "new_lines": "br"
                    },
                    {
                        "key": "field_5f0da18cc6157",
                        "label": "Textbox Ausrichtung",
                        "name": "ausrichtung",
                        "aria-label": "",
                        "type": "radio",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "30",
                            "class": "",
                            "id": ""
                        },
                        "choices": {
                            "left": "Links",
                            "right": "Rechts"
                        },
                        "allow_null": 0,
                        "other_choice": 0,
                        "default_value": "left",
                        "layout": "horizontal",
                        "return_format": "value",
                        "save_other_choice": 0
                    },
                    {
                        "key": "field_5c039f4ad1b51",
                        "label": "Header-Slider",
                        "name": "header-slider",
                        "aria-label": "",
                        "type": "clone",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "clone": [
                            "field_5c018e55bce0f"
                        ],
                        "display": "seamless",
                        "layout": "block",
                        "prefix_label": 0,
                        "prefix_name": 0
                    }
                ]
            },
            {
                "key": "field_5c01953ddcf0b",
                "label": "Text-Überschrift",
                "name": "headline",
                "aria-label": "",
                "type": "textarea",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "default_value": "",
                "placeholder": "",
                "maxlength": "",
                "rows": 3,
                "new_lines": ""
            },
            {
                "key": "field_5c019233cf38d",
                "label": "Beschreibung",
                "name": "beschreibung",
                "aria-label": "",
                "type": "wysiwyg",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "100",
                    "class": "",
                    "id": ""
                },
                "relevanssi_exclude": 0,
                "default_value": "",
                "tabs": "all",
                "toolbar": "full",
                "media_upload": 1,
                "delay": 0
            },
            {
                "key": "field_5c019248cf38e",
                "label": "Beschreibung Englisch (Optional)",
                "name": "beschreibung_en",
                "aria-label": "",
                "type": "wysiwyg",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "50",
                    "class": "",
                    "id": ""
                },
                "relevanssi_exclude": 0,
                "default_value": "",
                "tabs": "all",
                "toolbar": "full",
                "media_upload": 1,
                "delay": 1
            },
            {
                "key": "field_5c0242d775ec8",
                "label": "Beschreibung Platt (Optional)",
                "name": "beschreibung_frs",
                "aria-label": "",
                "type": "wysiwyg",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "50",
                    "class": "",
                    "id": ""
                },
                "relevanssi_exclude": 0,
                "default_value": "",
                "tabs": "all",
                "toolbar": "full",
                "media_upload": 1,
                "delay": 1
            },
            {
                "key": "field_5c019325cf38f",
                "label": "Programm",
                "name": "programm",
                "aria-label": "",
                "type": "group",
                "instructions": "",
                "required": 0,
                "conditional_logic": [
                    [
                        {
                            "field": "field_5d7544ceebf42",
                            "operator": "!=",
                            "value": "1"
                        }
                    ]
                ],
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "layout": "block",
                "sub_fields": [
                    {
                        "key": "field_5c0193a3cf390",
                        "label": "Ein- oder Zweispaltig?",
                        "name": "cols",
                        "aria-label": "",
                        "type": "radio",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "choices": {
                            "1": "Einspaltig",
                            "2": "Zweispaltig"
                        },
                        "allow_null": 0,
                        "other_choice": 0,
                        "default_value": "",
                        "layout": "vertical",
                        "return_format": "value",
                        "save_other_choice": 0
                    },
                    {
                        "key": "field_5c019421cf391",
                        "label": "Programm",
                        "name": "programm1",
                        "aria-label": "",
                        "type": "wysiwyg",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "50",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "tabs": "all",
                        "toolbar": "basic",
                        "media_upload": 0,
                        "delay": 1
                    },
                    {
                        "key": "field_5c019464cf392",
                        "label": "Programm",
                        "name": "programm2",
                        "aria-label": "",
                        "type": "wysiwyg",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5c0193a3cf390",
                                    "operator": "==",
                                    "value": "2"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "50",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "tabs": "all",
                        "toolbar": "basic",
                        "media_upload": 0,
                        "delay": 1
                    }
                ]
            },
            {
                "key": "field_5c019c37d2a0b",
                "label": "",
                "name": "",
                "aria-label": "",
                "type": "message",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "message": "<hr>",
                "new_lines": "",
                "esc_html": 0
            },
            {
                "key": "field_5c019623e31bb",
                "label": "Details",
                "name": "details",
                "aria-label": "",
                "type": "group",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "50",
                    "class": "",
                    "id": ""
                },
                "layout": "block",
                "sub_fields": [
                    {
                        "key": "field_5c019954fb028",
                        "label": "Datum\/Zeit Beginn",
                        "name": "datetime",
                        "aria-label": "",
                        "type": "date_time_picker",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "display_format": "d.m.Y H:i",
                        "return_format": "Y-m-d H:i:s",
                        "first_day": 1
                    },
                    {
                        "key": "field_5c5980db47ab8",
                        "label": "Datum\/Zeit Ende",
                        "name": "datetime_end",
                        "aria-label": "",
                        "type": "date_time_picker",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "display_format": "d.m.Y H:i",
                        "return_format": "Y-m-d H:i:s",
                        "first_day": 1
                    },
                    {
                        "key": "field_5c019a55fb02a",
                        "label": "Eintritt",
                        "name": "eintritt",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "!=",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "Eintritt:\r\n40,00 | 30,00 | 25,00\r\nStreifzug: + 8,00",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 4,
                        "new_lines": "br"
                    },
                    {
                        "key": "field_5c7f9ace941e9",
                        "label": "Reservix VA ID",
                        "name": "reservix_id",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "Wird benötigt für Ticketkauf und alle anderen Reservix API Funktionen",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "!=",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    },
                    {
                        "key": "field_5c019ac0fb02c",
                        "label": "Künstler Facebook Link",
                        "name": "kuenstler_facebook_link",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "!=",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    },
                    {
                        "key": "field_5c019ae6fb02d",
                        "label": "Logos der Förderer und Medienpartner",
                        "name": "foerderer-logos",
                        "aria-label": "",
                        "type": "repeater",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "collapsed": "",
                        "min": 0,
                        "max": 0,
                        "layout": "table",
                        "button_label": "Weiteres Logo Hinzufügen",
                        "sub_fields": [
                            {
                                "key": "field_5c019afefb02e",
                                "label": "Logo",
                                "name": "image",
                                "aria-label": "",
                                "type": "image",
                                "instructions": "",
                                "required": 0,
                                "conditional_logic": 0,
                                "wrapper": {
                                    "width": "",
                                    "class": "",
                                    "id": ""
                                },
                                "return_format": "id",
                                "preview_size": "thumbnail",
                                "library": "all",
                                "min_width": "",
                                "min_height": "",
                                "min_size": "",
                                "max_width": "",
                                "max_height": "",
                                "max_size": "",
                                "mime_types": "",
                                "parent_repeater": "field_5c019ae6fb02d"
                            },
                            {
                                "key": "field_5c62a4c91b7e5",
                                "label": "Größe anpassen",
                                "name": "max_width",
                                "aria-label": "",
                                "type": "select",
                                "instructions": "(Skaliert das Logo proportional)",
                                "required": 0,
                                "conditional_logic": 0,
                                "wrapper": {
                                    "width": "",
                                    "class": "",
                                    "id": ""
                                },
                                "choices": {
                                    "100%": "100%",
                                    "90%": "90%",
                                    "80%": "80%",
                                    "70%": "70%",
                                    "60%": "60%",
                                    "50%": "50%",
                                    "40%": "40%",
                                    "30%": "30%",
                                    "20%": "20%"
                                },
                                "default_value": [
                                    "100%"
                                ],
                                "allow_null": 0,
                                "multiple": 0,
                                "ui": 0,
                                "return_format": "value",
                                "ajax": 0,
                                "placeholder": "",
                                "parent_repeater": "field_5c019ae6fb02d"
                            }
                        ],
                        "rows_per_page": 20
                    },
                    {
                        "key": "field_5c6578cffdba1",
                        "label": "Förderer-Logos zentrieren",
                        "name": "foerderer_center",
                        "aria-label": "",
                        "type": "true_false",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "message": "",
                        "default_value": 0,
                        "ui": 1,
                        "ui_on_text": "",
                        "ui_off_text": ""
                    },
                    {
                        "key": "field_5d7551967a1eb",
                        "label": "Sendestation",
                        "name": "broadcaster",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "==",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    },
                    {
                        "key": "field_5d754f5bfd25e",
                        "label": "Livestream URL (optional)",
                        "name": "live_url",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "==",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    },
                    {
                        "key": "field_5d755145fd25f",
                        "label": "Mediathek URL (optional)",
                        "name": "mediathek_url",
                        "aria-label": "",
                        "type": "text",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": [
                            [
                                {
                                    "field": "field_5d7544ceebf42",
                                    "operator": "==",
                                    "value": "1"
                                }
                            ]
                        ],
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "placeholder": "",
                        "prepend": "",
                        "append": "",
                        "maxlength": ""
                    }
                ]
            },
            {
                "key": "field_5c019634e31bc",
                "label": "Streifzug",
                "name": "streifzug",
                "aria-label": "",
                "type": "group",
                "instructions": "",
                "required": 0,
                "conditional_logic": [
                    [
                        {
                            "field": "field_5d7544ceebf42",
                            "operator": "!=",
                            "value": "1"
                        }
                    ]
                ],
                "wrapper": {
                    "width": "50",
                    "class": "",
                    "id": ""
                },
                "layout": "block",
                "sub_fields": [
                    {
                        "key": "field_5c019646e31bd",
                        "label": "Überschrift",
                        "name": "headline",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "Streifzug vor Ort",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 2,
                        "new_lines": "br"
                    },
                    {
                        "key": "field_5c0196e2e31bf",
                        "label": "Titel",
                        "name": "titel",
                        "aria-label": "",
                        "type": "wysiwyg",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "tabs": "all",
                        "toolbar": "basic",
                        "media_upload": 0,
                        "delay": 1
                    },
                    {
                        "key": "field_5c019696e31be",
                        "label": "Text",
                        "name": "text",
                        "aria-label": "",
                        "type": "wysiwyg",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "",
                        "tabs": "all",
                        "toolbar": "full",
                        "media_upload": 1,
                        "delay": 1
                    },
                    {
                        "key": "field_5c019730e31c0",
                        "label": "Zeit von",
                        "name": "zeit_von",
                        "aria-label": "",
                        "type": "time_picker",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "50",
                            "class": "",
                            "id": ""
                        },
                        "display_format": "H:i",
                        "return_format": "H:i"
                    },
                    {
                        "key": "field_5c01978ee31c1",
                        "label": "Zeit bis",
                        "name": "zeit_bis",
                        "aria-label": "",
                        "type": "time_picker",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "50",
                            "class": "",
                            "id": ""
                        },
                        "display_format": "H:i",
                        "return_format": "H:i"
                    },
                    {
                        "key": "field_5c0197a8e31c2",
                        "label": "Treffpunkt (Ort)",
                        "name": "treffpunkt_ort",
                        "aria-label": "",
                        "type": "textarea",
                        "instructions": "",
                        "required": 0,
                        "conditional_logic": 0,
                        "wrapper": {
                            "width": "",
                            "class": "",
                            "id": ""
                        },
                        "default_value": "Treffpunkt:",
                        "placeholder": "",
                        "maxlength": "",
                        "rows": 4,
                        "new_lines": "br"
                    }
                ]
            },
            {
                "key": "field_5ede378f52cde",
                "label": "Ausklapp-Infos \/ FAQ",
                "name": "faq_va_section",
                "aria-label": "",
                "type": "clone",
                "instructions": "",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "clone": [
                    "field_5eda802054069",
                    "field_5eda80335406a",
                    "field_5eda808c5406d"
                ],
                "display": "group",
                "layout": "block",
                "prefix_label": 0,
                "prefix_name": 0
            },
            {
                "key": "field_5c6421d508915",
                "label": "Veranstaltungsempfehlungen",
                "name": "recommendations",
                "aria-label": "",
                "type": "post_object",
                "instructions": "\"Diese Konzerte könnten Sie auch interessieren\"",
                "required": 0,
                "conditional_logic": 0,
                "wrapper": {
                    "width": "",
                    "class": "",
                    "id": ""
                },
                "post_type": [
                    "veranstaltungen"
                ],
                "taxonomy": "",
                "allow_null": 1,
                "multiple": 1,
                "return_format": "id",
                "ui": 1
            }
        ],
        "location": [
            [
                {
                    "param": "post_type",
                    "operator": "==",
                    "value": "veranstaltungen"
                }
            ]
        ],
        "menu_order": 0,
        "position": "acf_after_title",
        "style": "seamless",
        "label_placement": "top",
        "instruction_placement": "label",
        "hide_on_screen": [
            "the_content",
            "excerpt",
            "discussion",
            "comments"
        ],
        "active": true,
        "description": "",
        "show_in_rest": 0
    }
]

Post a youtube Link into either "Beschreibung" or "Programm".

Version

1.7.2

Link

No response

Environment info

WP 6.2. Embed Privacy 1.7.2 ACF Pro 6.1.6 Classic Editor | Version 1.6.3

Custom Theme

Code of Conduct

MatzeKitt commented 1 year ago

Thank you for the information, I will check that!

MatzeKitt commented 1 year ago

One information is missing: How do you output the content in your theme? I want to make sure to be as close as possible in my testing environment.

jhtjards commented 1 year ago

Sure, but there's really nothing special there: In single-veranstaltungen.php I have the standard loop in which I use a template part called content-veranstaltungen.php

In content-veranstaltungen the field content of "beschreibung" is output via

<?php the_field( 'beschreibung' ); ?> 

The nested "programm" fields are output via:

<?php while ( have_rows( 'programm' ) ) : the_row(); ?>
    <?php if(get_sub_field( 'programm1' ) /*|| get_sub_field( 'programm2' )*/): ?>
    <h3>Programm</h3>
        <?php if( get_sub_field( 'cols' ) == '1' ): ?>
            <div>
                <?php the_sub_field( 'programm1' ); ?>
            </div>
        <?php else: ?>
            <div class="row">
                <div class="col-sm-6">
                    <?php the_sub_field( 'programm1' ); ?>
                </div>
                <div class="col-sm-6">
                    <?php the_sub_field( 'programm2' ); ?>
                </div>
            </div>
        <?php endif; ?>
    <?php endif; ?>
<?php endwhile; ?>
MatzeKitt commented 1 year ago

Unfortunately, I cannot reproduce the issue with this code. An embedded YouTube video gets replaced properly and all needed styles and scripts are loaded. Is it possible to receive access to a test environment including (S)FTP so that I can debug it there directly?

jhtjards commented 1 year ago

Hi, sorry for the wait while I've been on holiday. I've sent you an email with login credentials to my dev site to hey at epiph.yt.

I've stumbled upon one potentially interesting behaviour:

When I clear any cached oembed post meta, save and then enter the youtube url (& save again), the thumbnail is correctly shown. However when I save the post the second time, like after a normal post edit, the thumbnail disappears again.

MatzeKitt commented 1 year ago

Thank you, I’ve got your email and it’s on my list.