Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created August 24, 2013 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hlashbrooke/6329261 to your computer and use it in GitHub Desktop.
Save hlashbrooke/6329261 to your computer and use it in GitHub Desktop.
Make your WordPress content editor use HTML by default - this example will ensure that only non-admin users see the HTML editor by default.
<?php
add_filter( 'wp_default_editor', 'set_html_content_editor' );
function set_html_content_editor( $tab ) {
if( ! current_user_can( 'administrator' ) ) {
$tab = 'html';
}
return $tab;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment