1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Custom meta box test |
---|
4 | Author: mitcho |
---|
5 | Version: 0.1 |
---|
6 | */ |
---|
7 | |
---|
8 | function register_menu_box_test() { |
---|
9 | add_menu_page('Meta box test', 'Meta box test', 'manage_options', 'meta-box', 'menu_box_test_page'); |
---|
10 | add_meta_box('test_meta_box', 'Test meta box', 'test_meta_box', 'toplevel_page_meta-box', 'normal', 'core'); |
---|
11 | } |
---|
12 | add_action('admin_menu','register_menu_box_test'); |
---|
13 | |
---|
14 | function menu_box_test_page() { |
---|
15 | $screen = get_current_screen(); |
---|
16 | // var_dump($screen); |
---|
17 | echo "<div class='wrap'><div id='poststuff' class='metabox-holder has-right-sidebar'> |
---|
18 | <div id='post-body-content'>"; |
---|
19 | do_meta_boxes('toplevel_page_meta-box', 'normal', array()); |
---|
20 | echo "</div></div></div>"; |
---|
21 | } |
---|
22 | |
---|
23 | function test_meta_box() { |
---|
24 | echo "rar!"; |
---|
25 | } |
---|