| @@ -7,18 +7,22 @@ | ||
| 7 | 7 | * Author URI: http://projects.radgeek.com |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | class InspectPostMeta { |
| 11 | - public function __construct ($in_hook = true) { | |
| 12 | - add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 10, 2); | |
| 13 | - } /* InspectPostMeta::__construct () */ | |
| 11 | + function InspectPostMeta ($in_hook = true) { | |
| 12 | + if (!$in_hook) : | |
| 13 | + add_action('admin_menu', array($this, 'add_meta_box')); | |
| 14 | + else : | |
| 15 | + $this->add_meta_box(); | |
| 16 | + endif; | |
| 17 | + } | |
| 14 | 18 | |
| 15 | - function add_meta_boxes ($post_type, $post) { | |
| 19 | + function add_meta_box () { | |
| 16 | 20 | add_meta_box( |
| 17 | 21 | /*id=*/ 'inspect_post_guid_box', |
| 18 | 22 | /*title=*/ 'Post GUID and Meta Data', |
| 19 | 23 | /*callback=*/ array($this, 'meta_box'), |
| 20 | - /*page=*/ $post_type, | |
| 24 | + /*page=*/ 'post', | |
| 21 | 25 | /*context=*/ 'normal', |
| 22 | 26 | /*priority=*/ 'default' |
| 23 | 27 | ); |
| 24 | 28 | } |
| @@ -49,9 +53,9 @@ | ||
| 49 | 53 | $idx = 1; |
| 50 | 54 | foreach ($values as $value) : |
| 51 | 55 | print "<tr><th style='text-align: left' scope='row'>".esc_html($key); |
| 52 | 56 | if ($idx > 1) : |
| 53 | - print esc_html( sprintf( '[%d]', intval( $idx ) ) ); | |
| 57 | + print "[$idx]"; | |
| 54 | 58 | endif; |
| 55 | 59 | print ":</th> "; |
| 56 | 60 | print "<td><pre><code>".esc_html($value)."</code></pre>"; |
| 57 | 61 | print "</td></tr>\n"; |