Make WordPress Core

Ticket #17704: meta-box-test.php

File meta-box-test.php, 716 bytes (added by mitchoyoshitaka, 14 years ago)

Test plugin to create page with custom meta boxes

Line 
1<?php
2/*
3Plugin Name: Custom meta box test
4Author: mitcho
5Version: 0.1
6*/
7
8function 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}
12add_action('admin_menu','register_menu_box_test');
13
14function 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
23function test_meta_box() {
24        echo "rar!";
25}