X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/3f5685912e89eb3b0534acd85aa0946b1ca2bbe3..9c2096d803812dacbdf6cf8efe90053e39f00b96:/wp-admin/includes/meta-boxes.php?ds=sidebyside diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index d5e9cb7e..ddb3e9d4 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -13,7 +13,8 @@ function post_submit_meta_box($post) { global $action; $post_type = $post->post_type; - $can_publish = current_user_can("publish_${post_type}s"); + $post_type_object = get_post_type_object($post_type); + $can_publish = current_user_can($post_type_object->cap->publish_posts); ?>
+
+labels->separate_items_with_commas ); ?>
+ +- - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?> - - -
-+ + + + $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> + + + +
+Learn more about manual excerpts.'); ?>
()
pingbacks, no other action necessary.'); ?>
+pingbacks, no other action necessary.'); ?>
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.'); ?>
@@ -375,12 +448,25 @@ function post_comment_status_meta_box($post) { ?> - - + $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); + $wp_list_table->display( true ); +?> + @@ -430,7 +510,7 @@ function post_comment_meta_box($post) { */ function post_slug_meta_box($post) { ?> - + id, true, $post->post_type ); // TODO: ROLE SYSTEM - if ( $post->post_author && !in_array($post->post_author, $authors) ) - $authors[] = $post->post_author; + global $user_ID; ?> - $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 + ) ); } @@ -474,25 +557,42 @@ function post_revisions_meta_box($post) { * * @param object $post */ -function page_attributes_meta_box($post){ +function page_attributes_meta_box($post) { + $post_type_object = get_post_type_object($post->post_type); + if ( $post_type_object->hierarchical ) { + $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) ) { ?> - - - $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?> - ++ + - + } // end empty pages check + } // end hierarchical check. + if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) { + $template = !empty($post->page_template) ? $post->page_template : false; + ?> +
- - - - +
+ +
post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?>