_relocate_children

The timeline below displays how wordpress function _relocate_children has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.6

/**
 * This was once used to move child posts to a new parent.
 *
 * @since 2.3.0
 * @deprecated 3.9.0
 * @access private
 *
 * @param int $old_ID
 * @param int $new_ID
 */
function _relocate_children($old_ID, $new_ID)
{
    _deprecated_function(__FUNCTION__, '3.9.0');
}

WordPress Version: 4.4

/**
 * This was once used to move child posts to a new parent.
 *
 * @since 2.3.0
 * @deprecated 3.9.0
 * @access private
 *
 * @param int $old_ID
 * @param int $new_ID
 */
function _relocate_children($old_ID, $new_ID)
{
    _deprecated_function(__FUNCTION__, '3.9');
}

WordPress Version: 3.9

/**#@-*/
/**
 * This was once used to move child posts to a new parent.
 *
 * @since 2.3.0
 * @deprecated 3.9.0
 * @access private
 *
 * @param int $old_ID
 * @param int $new_ID
 */
function _relocate_children($old_ID, $new_ID)
{
    _deprecated_function(__FUNCTION__, '3.9');
}

WordPress Version: 3.7

/**
 * Move child posts to a new parent.
 *
 * @since 2.3.0
 * @access private
 *
 * @param unknown_type $old_ID
 * @param unknown_type $new_ID
 * @return unknown
 */
function _relocate_children($old_ID, $new_ID)
{
    global $wpdb;
    $old_ID = (int) $old_ID;
    $new_ID = (int) $new_ID;
    $children = $wpdb->get_col($wpdb->prepare("\n\t\tSELECT post_id\n\t\tFROM {$wpdb->postmeta}\n\t\tWHERE meta_key = '_wp_attachment_temp_parent'\n\t\tAND meta_value = %d", $old_ID));
    foreach ($children as $child_id) {
        $wpdb->update($wpdb->posts, array('post_parent' => $new_ID), array('ID' => $child_id));
        delete_post_meta($child_id, '_wp_attachment_temp_parent');
    }
}