Skip to content

Instantly share code, notes, and snippets.

@Zenger
Created November 11, 2013 08:37
Show Gist options
  • Save Zenger/7409847 to your computer and use it in GitHub Desktop.
Save Zenger/7409847 to your computer and use it in GitHub Desktop.
A small plugin to show all saved custom fields names and values. Useful in debugging.
<?php
// Plugin Name: Show Custom Fields Data
// Description: This plugin adds a metabox and shows all the custom fields names and data
// Author: Zenger
// Author URI: http://github.com/Zenger/
// Version: 1.0
function scfd_add_meta_box()
{
foreach (get_post_types() as $post_type)
{
add_meta_box( "scfd", "Custom Fields Data", "scfd_show_scfd_data", $post_type, "normal", "low", $post_type );
}
}
add_action('add_meta_boxes', 'scfd_add_meta_box');
function scfd_show_scfd_data($post , $args = null)
{
echo "<pre>".print_r(get_post_meta($post->ID) , true)."</pre>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment