> */ function adfusion_get_allowed_ad_html_kses() { $allowed = wp_kses_allowed_html( 'post' ); $allowed['script'] = array( 'type' => true, 'src' => true, 'async' => true, 'defer' => true, 'crossorigin' => true, 'charset' => true, 'nonce' => true, ); $allowed['iframe'] = array( 'src' => true, 'width' => true, 'height' => true, 'style' => true, 'class' => true, 'loading' => true, 'title' => true, 'allow' => true, 'allowfullscreen' => true, 'frameborder' => true, 'scrolling' => true, 'sandbox' => true, ); $allowed['noscript'] = array(); if ( ! isset( $allowed['ins'] ) || ! is_array( $allowed['ins'] ) ) { $allowed['ins'] = array(); } $allowed['ins']['class'] = true; $allowed['ins']['style'] = true; $allowed['ins']['data-ad-client'] = true; $allowed['ins']['data-ad-slot'] = true; $allowed['ins']['data-ad-format'] = true; $allowed['ins']['data-ad-layout'] = true; $allowed['ins']['data-ad-layout-key'] = true; $allowed['ins']['data-full-width-responsive'] = true; $allowed['ins']['data-ad-region'] = true; $allowed['ins']['data-ad-test'] = true; if ( ! isset( $allowed['img'] ) || ! is_array( $allowed['img'] ) ) { $allowed['img'] = array(); } $allowed['img']['src'] = true; $allowed['img']['alt'] = true; $allowed['img']['class'] = true; $allowed['img']['style'] = true; $allowed['img']['loading'] = true; $allowed['img']['width'] = true; $allowed['img']['height'] = true; $allowed['img']['data-src'] = true; foreach ( array( 'div', 'a' ) as $tag ) { if ( ! isset( $allowed[ $tag ] ) || ! is_array( $allowed[ $tag ] ) ) { $allowed[ $tag ] = array(); } $allowed[ $tag ]['data-ad-id'] = true; $allowed[ $tag ]['data-adf-stat-token'] = true; $allowed[ $tag ]['data-ab-variant'] = true; $allowed[ $tag ]['data-primary-id'] = true; $allowed[ $tag ]['data-ad-master-id'] = true; } /** * Filter allowed HTML tags/attributes for ad output (wp_kses). * * @param array> $allowed Allowed tags. */ return apply_filters( 'adfusion_allowed_ad_html_kses', $allowed ); }