Video shortcode, option are not rendered

Question

I’m using some custom shortcodes without problem. I’m trying to create a custom video shortocode but wordpress always removes autoplay loop muted playsinline on rendering. Poster works perfectly. Do you have idea why ?

function video_custom() {
    extract( shortcode_atts( array(
        'option' => '',
        'poster' => '',  
        'src' => '',
        'type' => '',     
        ), $atts ) );
    
    return '<div class="d-flex justify-content-center"><video class="wp-video" '.$option.' poster="'.$poster.'"><source src="'.$src.'" type="video/'.$type.'" /></video></div>';
    }
    add_shortcode('video_custom', 'video_custom');

0
Barrista 1 month 2022-08-16T19:40:20-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse