Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Let users apart from Superadmin insert raw code in text editor [WordPress Multisite]
//Let any user who can edit page insert unfiltered html in text editor
add_action( 'init', 'reply_unfiltered_html' );
function reply_unfiltered_html() {
$user = wp_get_current_user();
if ( current_user_can('edit_pages') )
kses_remove_filters();
}
//Let users with certain roles insert unfiltered html in text editor
add_action( 'init', 'reply_unfiltered_html_for_roles' );
function reply_unfiltered_html_for_roles() {
$user = wp_get_current_user();
if ( current_user_can('administrator') )
kses_remove_filters();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.