Created
August 18, 2017 11:26
-
-
Save anonymous/5be3dbc544d0b8048a33c683ce9734d0 to your computer and use it in GitHub Desktop.
WordPress plugin: Disables the visual editor for a specific post type (default: “post”)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined( 'ABSPATH' ) or die( 'No direct access here.' ); | |
/** | |
* Plugin Name: Remove Visual Editor from Post Type | |
* Description: Disables the visual editor for a specific post type (default: “post”). | |
* Author: Hans-Helge | |
* Author URI: https://webschale.de/ | |
* Plugin URI: https://webschale.de/2017/visual-editor-deaktivieren/ | |
* License: GNU General Public License v3 or later | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
add_filter ( 'user_can_richedit' , function ( $wp_rich_edit ) { | |
if ( get_post_type() === 'post' ) { | |
$wp_rich_edit = false; | |
} | |
return $wp_rich_edit; | |
}, 50 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment