Created
November 11, 2013 08:37
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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