Allow Editors to Post iFrame embeds
-
We are running a large multisite and we have users who now want to embed Facebook videos on their pages.
I’d like to enable them to do this by pasting the iFrame with Custom HTML.
This works fine for admins, but for Editors, they are not able to post iFrame (content is stripped — likely due to unfiltered_html role only being accessible to Super Admins.
How can I give them this role? I’ve tried a plugin (Menu Editor Pro) and some code, but neither worked. Here’s the code I tried in functions.php:
function add_theme_caps() { // gets the author role $role = get_role( 'editor' ); // This only works, because it accesses the class instance. // would allow the author to edit others' posts for current theme only $role->add_cap( 'unfiltered_html' ); } add_action( 'admin_init', 'add_theme_caps');
We cannot do this with “Embed” blocks because Facebook has blocked oEmbed, and I cannot ask users to connect their Facebook pages, use app IDs, etc., that are required by other plugins.
- The topic ‘Allow Editors to Post iFrame embeds’ is closed to new replies.