Forked from mbijon/wordpress-remove-media_buttons.php
Last active
May 10, 2017 09:36
-
-
Save FutureMedia/aa5d7d844dbf79f0c100c903425f6b4c to your computer and use it in GitHub Desktop.
Remove 'Add Media' (and toolbar) button from above WP editor, per post-type.
This file contains hidden or 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
// Removes the Post Editor Toolbar | |
// found here http://stackoverflow.com/questions/36865699/wordpress-how-to-hide-toolbar-in-post-editor | |
if( get_post_type() == 'product' && is_admin() ) { | |
add_filter( 'admin_footer', 'custom_edit_page_js', 99); | |
} | |
function custom_edit_page_js(){ | |
echo '<style type="text/css"> a#content-tmce, a#content-tmce:hover, #qt_content_fullscreen{ display:none; } </style>'; | |
echo '<script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#content-tmce").attr("onclick", null); }); </script>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment