Skip to content

Instantly share code, notes, and snippets.

@devwax
Last active July 8, 2020 00:43
Show Gist options
  • Save devwax/569c3b13e6b620b0d5b897e9dd2051ab to your computer and use it in GitHub Desktop.
Save devwax/569c3b13e6b620b0d5b897e9dd2051ab to your computer and use it in GitHub Desktop.
Truncate taxonomy description in WP Admin
// Truncate taxonomy description in WP Admin
function wpse_term_description_attributes() { ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$( '.description.column-description' ).attr( 'style', 'white-space: nowrap; text-overflow:ellipsis; overflow: hidden; max-width:1px;' );
});
</script><?php
}
add_action( 'admin_head', 'wpse_term_description_attributes' );
// Reference: https://stackoverflow.com/questions/5239758/css-truncate-table-cells-but-fit-as-much-as-possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment