[Plugin: Post Expirator] Change Category instead of Change Status
I’ve been trying to edit Post Expirator to have it change the category instead of setting the status to Draft. I’ve had no luck. The changes I’ve tried cause a new revision every 1-2 minutes adding thousands of revisions but it never changes the category. Here’s what I’ve tried:
I changed line 72 from
wp_update_post(array(‘ID’ => $a->post_id, ‘post_status’ => ‘draft’));
$my_post = array();
$my_post[‘ID’] = ($a->post_id);
$my_post[‘post_category’] = array(96);
wp_update_post( $my_post );
I also tried:
$new_cats = array(96);
wp_update_post(array(‘ID’ => $a->post_id, ‘post_category’ => $new_cats));
The only time it works is if I set the post ID like:
$my_post[‘ID’] = 9958;
So, it makes me think I’m close but I’m not writing that line correctly.
Can anyone help? I’d really appreciate it. I’ve been banging my head against the wall with this.
- The topic ‘[Plugin: Post Expirator] Change Category instead of Change Status’ is closed to new replies.