diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index c623225ef..3344841c7 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -225,18 +225,17 @@ endif; ?>
-
-
-
+
@@ -261,12 +260,13 @@ endif; ?>
-
-
-
+
@@ -274,32 +274,31 @@ endif; ?>
-
-
-
+
+
use them in your template'); ?>
-
-
+">
-
-
+function post_trackback_meta_box($post) {
+?>
()
pingbacks, no other action necessary.'); ?>
-
-
+}
+add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');
-
-
-
+function post_custom_meta_box($post) {
+?>
ID);
list_meta($metadata);
?>
@@ -310,64 +309,62 @@ list_meta($metadata);
use in your theme.'); ?>
-
-
+
+do_action('dbx_post_advanced');
-
+">
-
-
+function post_password_meta_box($post) {
+?>
-
-
-
-
-
+
+id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
+function post_author_meta_box($post) {
?>
-
-
-
$authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
-
-
-
+
-
-
+if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
+function post_revisions_meta_box($post) {
+ wp_list_post_revisions();
+}
+add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');
+endif;
-
+do_meta_boxes('post', 'advanced', $post);
-
+do_action('dbx_post_sidebar');
+?>
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 00e1ac8ee..7c750f191 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -1041,8 +1041,83 @@ function wp_remember_old_slug() {
* @param string $callback Function that fills the box with the desired content. The function should echo its output.
* @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')
+ * @param string $priority The priority within the context where the boxes should show ('high', 'low')
*/
-function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
+function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
+ global $wp_meta_boxes;
+
+
+ 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();
+
+ foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
+ if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) )
+ continue;
+ // If a core box was previously added or removed by a plugin, don't add.
+ if ( 'core' == $priority ) {
+ // If core box previously deleted, don't add
+ if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] )
+ return;
+ // If box was added with default priority, give it core priority to maintain sort order
+ if ( 'default' == $a_priority ) {
+ $wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];
+ unset($wp_meta_boxes[$page][$context]['default'][$id]);
+ }
+ return;
+ }
+ // If no priority given and id already present, use existing priority
+ if ( empty($priority) )
+ $priority = $a_priority;
+ // An id can be in only one priority
+ if ( $priority != $a_priority )
+ unset($wp_meta_boxes[$page][$context][$a_priority][$id]);
+ }
+
+ if ( empty($priority) )
+ $priority = low;
+
+ if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
+ $wp_meta_boxes[$page][$context][$priority] = array();
+
+ $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
+}
+
+function do_meta_boxes($page, $context, $object) {
+ global $wp_meta_boxes;
+
+ do_action('do_meta_boxes', $page, $context, $object);
+
+ if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
+ return;
+
+ foreach ( array('high', 'core', 'default', 'low') as $priority ) {
+ foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
+ if ( false === $box )
+ continue;
+ echo '' . "\n";
+ echo "
{$box['title']} \n";
+ echo '
' . "\n";
+ call_user_func($box['callback'], $object, $box);
+ echo "
\n";
+ echo "
\n";
+ }
+ }
+}
+
+/**
+ * remove_meta_box() - Remove a meta box from an edit form
+ *
+ * @since 2.6
+ *
+ * @param string $id String for use in the 'id' attribute of tags.
+ * @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 remove_meta_box($id, $page, $context) {
global $wp_meta_boxes;
if ( !isset($wp_meta_boxes) )
@@ -1052,23 +1127,8 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced') {
if ( !isset($wp_meta_boxes[$page][$context]) )
$wp_meta_boxes[$page][$context] = array();
- $wp_meta_boxes[$page][$context][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
-}
-
-function do_meta_boxes($page, $context, $object) {
- global $wp_meta_boxes;
-
- if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
- return;
-
- foreach ( (array) $wp_meta_boxes[$page][$context] as $box ) {
- echo '' . "\n";
- echo "
{$box['title']} \n";
- echo '
' . "\n";
- call_user_func($box['callback'], $object, $box);
- echo "
\n";
- echo "
\n";
- }
+ foreach ( array('high', 'core', 'default', 'low') as $priority )
+ $wp_meta_boxes[$page][$context][$priority][$id] = false;
}
?>
trackbacks and pingbacks.'); ?>
-