-<?php if ( count($profileuser->caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser) ) { ?>
-<br class="clear" />
- <table width="99%" style="border: none;" cellspacing="2" cellpadding="3" class="editform">
- <tr>
- <th scope="row"><?php _e('Additional Capabilities') ?></th>
- <td><?php
- $output = '';
- foreach ( $profileuser->caps as $cap => $value ) {
- if ( !$wp_roles->is_role($cap) ) {
- if ( $output != '' )
- $output .= ', ';
- $output .= $value ? $cap : "Denied: {$cap}";
- }
- }
- echo $output;
- ?></td>
- </tr>
- </table>
-<?php } ?>
+<?php
+/**
+ * Filter whether to display additional capabilities for the user.
+ *
+ * The 'Additional Capabilities' section will only be enabled if
+ * the number of the user's capabilities exceeds their number of
+ * of roles.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $enable Whether to display the capabilities. Default true.
+ * @param WP_User $profileuser The current WP_User object.
+ */
+if ( count( $profileuser->caps ) > count( $profileuser->roles )
+ && apply_filters( 'additional_capabilities_display', true, $profileuser )
+) : ?>
+<h3><?php _e( 'Additional Capabilities' ); ?></h3>
+<table class="form-table">
+<tr>
+ <th scope="row"><?php _e( 'Capabilities' ); ?></th>
+ <td>
+<?php
+ $output = '';
+ foreach ( $profileuser->caps as $cap => $value ) {
+ if ( ! $wp_roles->is_role( $cap ) ) {
+ if ( '' != $output )
+ $output .= ', ';
+ $output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
+ }
+ }
+ echo $output;
+?>
+ </td>
+</tr>
+</table>
+<?php endif; ?>