playsinline being stripped from
-
Hi guys,
I don’t know whether it’s Metabox doing this, or something else… but I’m wondering if you can help:As part of different post formats, my theme uses metaboxes to define certain items as part of the format:
$meta_boxes[] = array( 'id' => 'format_settings', 'title' => esc_html__( 'Post Format Settings', 'linx' ), 'pages' => array( 'post' ), 'context' => 'normal', 'priority' => 'high', 'autosave' => true, 'fields' => array( array( 'type' => 'heading', 'name' => esc_html__( 'Video Format', 'linx' ), 'id' => 'heading_id', ), array( 'name' => esc_html__( 'Video embed code', 'linx' ), 'id' => "{$prefix}pf_video_data", 'type' => 'textarea', 'cols' => 20, 'rows' => 4, ), array( 'type' => 'heading', 'name' => esc_html__( 'Gallery Format', 'linx' ), 'id' => 'heading_id', ), array( 'name' => esc_html__( 'Gallery images', 'linx' ), 'id' => "{$prefix}pf_gallery_data", 'type' => 'image_advanced', 'max_file_uploads' => 10, ), array( 'type' => 'heading', 'name' => esc_html__( 'Audio Format', 'linx' ), 'id' => 'heading_id', ), array( 'name' => esc_html__( 'Audio embed code', 'linx' ), 'id' => "{$prefix}pf_audio_data", 'type' => 'textarea', 'cols' => 20, 'rows' => 4, ), array( 'type' => 'heading', 'name' => esc_html__( 'Link Format', 'linx' ), 'id' => 'heading_id', ), array( 'name' => esc_html__( 'Link to', 'linx' ), 'id' => "{$prefix}pf_link_data", 'type' => 'text', ), ) ); return $meta_boxes; } add_filter( 'rwmb_meta_boxes', 'linx_register_meta_boxes' );
At the moment, I am trying to build out a video post, which has the following markup in the defined textarea:
<video preload="none" class="lazyload" muted="" loop="" data-autoplay="" playsinline="" -webkit-playsinline="" style="width:100%" src="https://cdn.willstocks.com/wp-content/uploads/2018/12/Mpow-Flame-2018-Special-Edition-Video-1.mp4"> </video>
However, the output (see here: https://willstocks.co.uk, scroll down to the MPOW post at the bottom) results in the
playsinline
and-webkit-playsinline
values being removed from the<video>
, which results in failure to autoplay on iOS devices.Can you see any reason for Meta Box stripping these two items? I’m not sure where else/why else these would be being removed
- The topic ‘playsinline being stripped from’ is closed to new replies.