Created
January 9, 2015 13:46
-
-
Save blainerobison/8f6f81a0ca84bbd82ff9 to your computer and use it in GitHub Desktop.
wp: Hide Taxonomy Description [WordPress]
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
/** | |
* Hook into Admin_footer on taxonomy edit screens | |
* | |
* @return void | |
*/ | |
function prefix_hide_term_metabox() { | |
global $current_screen; | |
$output = false; | |
switch ( $current_screen->id ) : | |
/** | |
* Hide description metabox on WooCommerce product brand taxonomy | |
*/ | |
case 'edit-product_brand': | |
$output = true; | |
break; | |
endswitch; | |
if ( $output ) : ?> | |
<script type="text/javascript"> | |
jQuery(document).ready( function($) { | |
$('#tag-description').closest('.form-field').remove(); | |
$('#description').closest('.form-field').remove(); | |
}); | |
</script> | |
<?php endif; | |
} | |
add_action( 'admin_footer-edit-tags.php', 'prefix_hide_term_metabox' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably the more authentic way is to enqueue scripts for this purpose. My code is -
And then, inside the "custom-admin-script.js", we need to place this piece of code -