Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5530

catacaustic on "Manually changing post status via MySQL command"

$
0
0

It is. You just need to find where the update is being done and add the slug in there as well.

What you (probably) have there:

$query = "UPDATE ".$wpdb->posts." SET post_status = 'publish' WHERE id = ".$post->ID;

What you'd need to change it to:

UPDATE ".$wpdb->posts." SET post_status = 'publish', post_name = '".sanitize_title ($post->post_title)."' WHERE id = ".$post->ID;

That doesn't have aht error checking so I'm sure that there's more ot it then just that, but that's the basics of how it's done.


Viewing all articles
Browse latest Browse all 5530

Trending Articles