1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46:
<?php
class Inbound_Debug_Scripts {
public function __construct() {
add_action('init', array(__CLASS__, 'inbound_output_meta_debug'));
}
public static function inbound_output_meta_debug() {
if (isset($_GET['debug']) && (isset($_GET['post']) && is_numeric($_GET['post']))) {
global $wpdb;
$data = array();
$wpdb->query("
SELECT `meta_key`, `meta_value`
FROM $wpdb->postmeta
WHERE `post_id` = " . intval($_GET['post']) . "
");
foreach ($wpdb->last_result as $k => $v) {
$data[$v->meta_key] = $v->meta_value;
};
if (isset($_GET['post'])) {
echo "<pre>";
print_r($data);
echo "</pre>";
}
}
}
}
new Inbound_Debug_Scripts;