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.

7 comments to WordPress Trick: How To Show Hidden Custom Fields

  1. Thx for the code. It was usefull for me.

  2. Except… I realize it had a more effective way. At the add new post window at the top right of the screen there is a screen options and there you activate the custom fields.

  3. [...] credits for this amazing trick goes to Viper007Bond. This post is provided by the color flyer printing experts, Next Day [...]

  4. [...] credits for this amazing trick goes to Viper007Bond. This post is provided by the color flyer printing experts, Next Day [...]

  5. [...] credits for this amazing trick goes to Viper007Bond. This post is provided by the color flyer printing experts, Next Day [...]

  6. [...] credits f&#959r th&#1110&#1109 &#1072m&#1072z&#1110ng trick goes t&#959 Viper007Bond. Th&#1110&#1109 post &#1110&#1109 provided b&#1091 th&#1077 color flyer printing experts, Next Day [...]

  7. dandy says:

    doesn’t work in wp 3.3.1

    Best Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

If you wish to post code, write it like [code]blah[/code] so it will display properly.