diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 6994be426..8157836cd 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -219,7 +219,7 @@ else - + @@ -318,7 +318,7 @@ if ( $authors && count( $authors ) > 1 ) : - + diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 844144b93..1d6e51dcb 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -99,6 +99,8 @@ function xfn_check($class, $value = '', $deprecated = '') { + +

@@ -274,6 +276,8 @@ function xfn_check($class, $value = '', $deprecated = '') {
+ + diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 6cde17498..cada0c0f8 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -133,6 +133,8 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )

+ +

@@ -224,6 +226,8 @@ if ( $authors && count( $authors ) > 1 ) : + + diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index a5c7693e5..16e38df6b 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -853,22 +853,30 @@ function wp_remember_old_slug() { * @param string $id String for use in the 'id' attribute of tags. * @param string $title Title of the meta box * @param string $callback Function that fills the box with the desired content. The function should echo its output. - * @param string $context The context in which the box should be displayed. edit_post, edit_page, edit_link, edit_post_advanced... + * @param string $page The type of edit page on which to show the box (post, page, link) + * @param string $context The context within the page where the boxes should show ('normal', 'advanced') */ -function add_meta_box($id, $title, $callback, $context) { +function add_meta_box($id, $title, $callback, $page, $context = 'advanced') { global $wp_meta_boxes; - $wp_meta_boxes[$context][] = array('id' => $id, 'title' => $title, 'callback' => $callback); + if ( !isset($wp_meta_boxes) ) + $wp_meta_boxes = array(); + if ( !isset($wp_meta_boxes[$page]) ) + $wp_meta_boxes[$page] = array(); + if ( !isset($wp_meta_boxes[$page][$context]) ) + $wp_meta_boxes[$page][$context] = array(); + + $wp_meta_boxes[$page][$context][] = array('id' => $id, 'title' => $title, 'callback' => $callback); } -function do_meta_boxes($context, $object) { +function do_meta_boxes($page, $context, $object) { global $wp_meta_boxes; - if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$context]) ) + if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) return; - foreach ( (array) $wp_meta_boxes[$context] as $box ) { - echo '
' . "\n"; + foreach ( (array) $wp_meta_boxes[$page][$context] as $box ) { + echo '
' . "\n"; echo "

{$box['title']}

\n"; echo '
' . "\n"; call_user_func($box['callback'], $object); @@ -877,4 +885,9 @@ function do_meta_boxes($context, $object) { } } +function test_box($post) { + echo "Hello $post->ID"; +} + +add_meta_box('test', 'Test', 'test_box', 'post'); ?>