Changeset 17999
- Timestamp:
- 05/22/2011 11:25:28 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-background.php
r17886 r17999 339 339 'post_content' => $url, 340 340 'post_mime_type' => $type, 341 'guid' => $url 341 'guid' => $url, 342 'context' => 'custom-background' 342 343 ); 343 344 -
trunk/wp-admin/custom-header.php
r17814 r17999 645 645 'post_content' => $url, 646 646 'post_mime_type' => $type, 647 'guid' => $url); 647 'guid' => $url, 648 'context' => 'custom-header'); 648 649 649 650 // Save the data … … 738 739 'post_content' => $url, 739 740 'post_mime_type' => 'image/jpeg', 740 'guid' => $url 741 'guid' => $url, 742 'context' => 'custom-header' 741 743 ); 742 744 -
trunk/wp-admin/includes/import.php
r16608 r17999 81 81 'post_content' => $url, 82 82 'post_mime_type' => $type, 83 'guid' => $url 83 'guid' => $url, 84 'context' => 'import', 85 'post_status' => 'private' 84 86 ); 85 87 … … 87 89 $id = wp_insert_attachment( $object, $file ); 88 90 91 // schedule a cleanup for one day from now in case of failed import or missing wp_import_cleanup() call 92 wp_schedule_single_event( time() + 86400, 'importer_scheduled_cleanup', array( $id ) ); 93 89 94 return array( 'file' => $file, 'id' => $id ); 90 95 } -
trunk/wp-admin/includes/post.php
r17996 r17999 997 997 $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; 998 998 $q['post_type'] = 'attachment'; 999 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit'; 999 $post_type = get_post_type_object( 'attachment' ); 1000 $states = array( 'inherit' ); 1001 if ( current_user_can( $post_type->cap->read_private_posts ) ) 1002 $states[] = 'private'; 1003 1004 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; 1000 1005 $media_per_page = (int) get_user_option( 'upload_per_page' ); 1001 1006 if ( empty( $media_per_page ) || $media_per_page < 1 ) -
trunk/wp-includes/default-filters.php
r17994 r17999 258 258 add_action( 'after_wp_tiny_mce', 'wp_preload_dialogs', 10, 1 ); 259 259 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 260 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); 260 261 261 262 // Navigation menu actions -
trunk/wp-includes/post.php
r17889 r17999 558 558 return false; 559 559 560 // Unattached attachments are assumed to be published. 561 if ( ('attachment' == $post->post_type) && ('inherit' == $post->post_status) && ( 0 == $post->post_parent) ) 562 return 'publish'; 563 564 if ( ('attachment' == $post->post_type) && $post->post_parent && ($post->ID != $post->post_parent) ) 565 return get_post_status($post->post_parent); 560 if ( 'attachment' == $post->post_type ) { 561 if ( 'private' == $post->post_status ) 562 return 'private'; 563 564 // Unattached attachments are assumed to be published 565 if ( ( 'inherit' == $post->post_status ) && ( 0 == $post->post_parent) ) 566 return 'publish'; 567 568 // Inherit status from the parent 569 if ( $post->post_parent && ( $post->ID != $post->post_parent ) ) 570 return get_post_status($post->post_parent); 571 } 566 572 567 573 return $post->post_status; … … 3544 3550 global $wpdb, $user_ID; 3545 3551 3546 $defaults = array('post_status' => ' draft', 'post_type' => 'post', 'post_author' => $user_ID,3552 $defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID, 3547 3553 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 3548 3554 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 3549 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0 );3555 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => ''); 3550 3556 3551 3557 $object = wp_parse_args($object, $defaults); … … 3562 3568 3563 3569 $post_type = 'attachment'; 3564 $post_status = 'inherit'; 3570 3571 if ( ! in_array( $post_status, array( 'inherit', 'private' ) ) ) 3572 $post_status = 'inherit'; 3565 3573 3566 3574 // Make sure we set a valid category. … … 3664 3672 if ( isset($post_parent) && $post_parent < 0 ) 3665 3673 add_post_meta($post_ID, '_wp_attachment_temp_parent', $post_parent, true); 3674 3675 if ( ! empty( $context ) ) 3676 add_post_meta( $post_ID, '_wp_attachment_context', $context, true ); 3666 3677 3667 3678 if ( $update) {
Note: See TracChangeset
for help on using the changeset viewer.