My theme and Qtranslate plugin have a conflict and cause many issues on my website’s post titles. I cannot trace what causes the issue and I thought that I could handle the title saving myself instead.
I would like to be able to change post title that wordpress uses when saving a post from backend.
How can I do that?
You can hook into
wp_insert_post_data
and change things.Obviously you’re going to have to some checks and stuff so you don’t change every post title. That hook will also fire every time the post is saved (adding a new post, updating, trashing a post, etc) and for every post type.
$data
is an associative array with every column you’d find in the{$wpdb->prefix}_posts
table as keys. So if you just wanted to changed posts: