how do i get the old and the new post title when it was changed (1 post)

  1. em_vau
    Posted 4 years ago #


    i am struggling at the moment with a little problem.

    I want to compare the old and the new title of a updated post.
    But how do i get the data?

    i tried it in the functions.php with the pre_update_post hook to get the old title and the save_title hook to get the new title of the post.
    After that i would like to compare this two values and if they are the same, don't do nothing, but when they are different, do a certain action:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    In my blog every item of my custom post type "aktive" creates a term in the category-taxonomy. When i edit the name of an "aktive"-item i want that the term which was created at the first time, also gets its name changed accordingly. But it doesnt do with the code above.

    Thankful for any advice.

Topic Closed

This topic has been closed to new replies.

About this Topic