WordPress Trick: How To Show Hidden Custom Fields

Often when I’m developing some WordPress code, I need to be able to debug by being able to see hidden custom fields (any custom field with an ID that’s prefixed with an underscore won’t show up on the edit screen). In order to do so, I use this little bit of code:

add_action( 'admin_head', 'showhiddencustomfields' );

function showhiddencustomfields() {
	echo "<style type='text/css'>#postcustom .hidden { display: table-row; }</style>\n";

You can drop it into a new plugin or if you’re lazy, your theme’s functions.php file.