WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
Adding unfiltered_html to Author (2 posts)

  1. eberle13
    Member
    Posted 3 years ago #

    Greetings,

    I'm running Multisite, but as a test, I only activated the plugin on one of my blogs. I set the plugin to allow unfilted html and unfiltered uploads for Authors. I think logged in as a user with Author role. I edited a post that has youtube embed code in it. I hit save. The code is stripped out. Please help!

    Bobby

    http://wordpress.org/extend/plugins/user-role-editor/

  2. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    Hello,

    It seems that from some version WordPress developers decided to prohibit "unfiltered_html" globally and allow that for the superadmin in the multisite environment only.

    function map_meta_cap() at the capabilities.php always returns 'do_not_allow' for the 'unfiltered_html' if you are not the superadmin in the multi-site environment. So we can consider this capability as deprecated. Look on this code fragment if you are interested:
    ...

    case 'unfiltered_html':
    // Disallow unfiltered_html for all users, even admins and super admins.
    if ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) {
    	$caps[] = 'do_not_allow';
    	break;
    }
    // Fall through if not DISALLOW_UNFILTERED_HTML
    case 'delete_user':
    case 'delete_users':
    // If multisite these caps are allowed only for super admins.
    if ( is_multisite() && !is_super_admin( $user_id ) ) {
    $caps[] = 'do_not_allow';
    } else {
    if ( 'delete_user' == $cap )
    	$cap = 'delete_users';
    	$caps[] = $cap;
    }
    break;

    Thanks for the interesting question. I didn't know about such change in the WordPress functionality.

    Vladimir.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic