Skip to content

Instantly share code, notes, and snippets.

@ivandoric
Created April 23, 2014 13:26
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 ivandoric/11215147 to your computer and use it in GitHub Desktop.
Save ivandoric/11215147 to your computer and use it in GitHub Desktop.
wordpress: Hide editor but leave "Add Media" button on post type
<?php
function hide_editor_leave_media_button() {
global $current_screen;
if( $current_screen->post_type == 'ENTER_POST_TYPE_HERE' ) {
$css = '<style type="text/css">';
$css .= '#wp-content-editor-container, #post-status-info, .wp-switch-editor { display: none; }';
$css .= '</style>';
echo $css;
}
}
add_action('admin_footer', 'hide_editor_leave_media_button');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment