php 允许编辑者插入iframe和svg标记

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 允许编辑者插入iframe和svg标记相关的知识,希望对你有一定的参考价值。

<?php

/**
 * Allow editors to insert iframe and svg tags
 */
function filter_map_meta_cap( $caps, $cap, $user_id ) {
  if ( 'unfiltered_html' === $cap && user_can( $user_id, 'editor' ) ) {
    $caps = array( 'unfiltered_html' );
  }
  return $caps;
}
add_filter( 'map_meta_cap', 'filter_map_meta_cap', 1, 3 );

以上是关于php 允许编辑者插入iframe和svg标记的主要内容,如果未能解决你的问题,请参考以下文章