X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/58f607a1de715c9bca69340a4d6fb9e1b9c2bed2..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-admin/includes/meta-boxes.php
diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
index 5358874c..cefa5a96 100644
--- a/wp-admin/includes/meta-boxes.php
+++ b/wp-admin/includes/meta-boxes.php
@@ -9,7 +9,7 @@
*
* @param object $post
*/
-function post_submit_meta_box($post) {
+function post_submit_meta_box($post, $args = array() ) {
global $action;
$post_type = $post->post_type;
@@ -22,38 +22,40 @@ function post_submit_meta_box($post) {
@@ -312,17 +417,14 @@ function post_categories_meta_box( $post, $box ) {
$name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']';
echo "
"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
?>
-
- cap->assign_terms) ) : ?>
-
-
cap->edit_terms) ) : ?>
labels->add_new_item; ?>
-
+
labels->parent_item_colon; ?>
- $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?>
-
+ $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?>
+
@@ -346,7 +448,6 @@ function post_categories_meta_box( $post, $box ) {
-
+
Learn more about manual excerpts.'); ?>
to_ping) ) .'" />';
+ $form_trackback = '
to_ping) ) .'" />';
if ('' != $post->pinged) {
$pings = '
'. __('Already pinged:') . '
';
$already_pinged = explode("\n", trim($post->pinged));
@@ -388,7 +488,6 @@ if ( ! empty($pings) )
echo $pings;
}
-
/**
* Display custom fields form fields.
*
@@ -402,14 +501,17 @@ function post_custom_meta_box($post) {
ID);
-list_meta($metadata);
+foreach ( $metadata as $key => $value ) {
+ if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )
+ unset( $metadata[ $key ] );
+}
+list_meta( $metadata );
meta_form(); ?>
use in your theme.'); ?>
comment_status, 'open'); ?> />
ping_status, 'open'); ?> /> trackbacks and pingbacks on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?>
+
get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
+ wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
+ ?>
+
+ $total ) {
- echo '
' . __('No comments yet.') . '
';
- return;
- }
+ $total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
+ $wp_list_table->display( true );
- wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
- add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
-?>
+ if ( 1 > $total ) {
+ echo '';
+ } else {
+ $hidden = get_hidden_meta_boxes( get_current_screen() );
+ if ( ! in_array('commentsdiv', $hidden) ) {
+ ?>
+
+
-
-
-
-
-
-
-
-
-
+
+
-
+
post_type ); // TODO: ROLE SYSTEM
- if ( $post->post_author && !in_array($post->post_author, $authors) )
- $authors[] = $post->post_author;
?>
-
$authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
+
'authors',
+ 'name' => 'post_author_override',
+ 'selected' => empty($post->ID) ? $user_ID : $post->post_author,
+ 'include_selected' => true
+ ) );
}
-
/**
* Display list of revisions.
*
@@ -518,11 +620,10 @@ function post_author_meta_box($post) {
*
* @param object $post
*/
-function post_revisions_meta_box($post) {
- wp_list_post_revisions();
+function post_revisions_meta_box( $post ) {
+ wp_list_post_revisions( $post );
}
-
// -- Page related Meta Boxes
/**
@@ -535,7 +636,18 @@ function post_revisions_meta_box($post) {
function page_attributes_meta_box($post) {
$post_type_object = get_post_type_object($post->post_type);
if ( $post_type_object->hierarchical ) {
- $pages = wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column'=> 'menu_order, post_title', 'echo' => 0));
+ $dropdown_args = array(
+ 'post_type' => $post->post_type,
+ 'exclude_tree' => $post->ID,
+ 'selected' => $post->post_parent,
+ 'name' => 'parent_id',
+ 'show_option_none' => __('(no parent)'),
+ 'sort_column' => 'menu_order, post_title',
+ 'echo' => 0,
+ );
+
+ $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
+ $pages = wp_dropdown_pages( $dropdown_args );
if ( ! empty($pages) ) {
?>
@@ -560,7 +672,6 @@ function page_attributes_meta_box($post) {
-
+