Detach post attachment

<?php

global $wpdb;
$attachment = 324; //Change to your desired id

$wpdb->get_results("UPDATE $wpdb->posts SET $wpdb->posts.post_parent = 0 WHERE $wpdb->posts.ID = $attachment");

?>

0 Comments

You must be logged in to post a comment.