Well in your for loop, I think you’re missing the $postcount variable… also there’s a typo at $idss[$i] …. should be $ids[i] based on what you’ve shown.
for ($i = 0; $i < $postcount; $i++) {
wp_update_post(array('ID' => $ids[$i], 'post_status' => 'draft'));
}
That being said I’d just go with a foreach loop.
The mistake that you’re making is the 2nd line.
<?php
$post_ids = $wc_query->posts;
foreach($post_ids as $post => $post_id) {
echo $post_id;
}
?>
Assuming that results in a nice list of ID’s, then I’d do the following:
<?php
$post_ids = $wc_query->posts;
foreach($post_ids as $post => $post_id) {
echo $post_id;
$arrPost = array( 'ID' => $post_id, 'post_status' => 'draft' );
wp_update_post($arrPost);
}
?>
I’m afraid this is the best I can do without being able to access the files.
Remember var_dump()
is your friend!