Make WordPress Core

Changeset 11969 for trunk/xmlrpc.php


Ignore:
Timestamp:
09/24/2009 05:13:11 PM (17 years ago)
Author:
ryan
Message:

Use a post_parent of 0 instead of -1 to indicate unattached posts. Props c0nstruct. see #10521

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r11942 r11969  
    22832283
    22842284                // find any unattached files
    2285                 $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '-1' AND post_type = 'attachment'" );
     2285                $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
    22862286                if( is_array( $attachments ) ) {
    22872287                        foreach( $attachments as $file ) {
    … …  
    28902890                }
    28912891                // Construct the attachment array
    2892                 // attach to post_id -1
    2893                 $post_id = -1;
     2892                // attach to post_id 0
     2893                $post_id = 0;
    28942894                $attachment = array(
    28952895                        'post_title' => $name,
Note: See TracChangeset for help on using the changeset viewer.