]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/meta-boxes.php
WordPress 3.3.2-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / meta-boxes.php
index 6d396ad77732ab95cb3d26cf7d26d7a6e55d9bad..ddb3e9d4f5286c1dd9b2205c2b9cfb730c44cc7c 100644 (file)
@@ -155,7 +155,7 @@ echo esc_html( $visibility_trans ); ?></span>
 </div><?php // /misc-pub-section ?>
 
 <?php
-// translators: Publish box date formt, see http://php.net/date
+// translators: Publish box date format, see http://php.net/date
 $datef = __( 'M j, Y @ G:i' );
 if ( 0 != $post->ID ) {
        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
@@ -425,7 +425,11 @@ function post_custom_meta_box($post) {
 <div id="ajax-response"></div>
 <?php
 $metadata = has_meta($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(); ?>
 </div>
 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
@@ -556,7 +560,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) ) {
 ?>
 <p><strong><?php _e('Parent') ?></strong></p>