Skip to content

Instantly share code, notes, and snippets.

@dermotmcguire
Created August 11, 2014 22:42
Show Gist options
  • Save dermotmcguire/1d47bd2c48a5aa6ccb86 to your computer and use it in GitHub Desktop.
Save dermotmcguire/1d47bd2c48a5aa6ccb86 to your computer and use it in GitHub Desktop.
Snippet: Wordpress: Show all custom fields associated with each post
// Show all custom fields associated with each post.
// From http://wpsnipp.com/index.php/functions-php/show-absolutely-custom-fields-post/
add_action( 'all_admin_notices', 'wpsnipp_show_all_custom_fields' );function wpsnipp_show_all_custom_fields() {    if ( isset( $_GET['post'] ) ) {        $post_id = absint( $_GET['post'] );        ?>        <div id="message" class="updated">            <h3>All post meta:</h3>            <xmp><?php print_r( get_post_meta( $post_id ) ); ?></xmp>        </div>        <?php    }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment