WordPress.org

Forums

redirect on save_post action (4 posts)

  1. japanitrat
    Member
    Posted 8 years ago #

    hi,

    i need to check available meta-tags when somebody saves a post and if true redirecting him to another admin_menu page. so i set an action hook on "save_post", evaluating the metadata through get_post_meta and calling wp_redirect() in the end. but nothing happens, except the update-info on top of the edit-page.

    how to solve this?

  2. golddave
    Member
    Posted 7 years ago #

    Did you ever get an answer to this question?

  3. japanitrat
    Member
    Posted 7 years ago #

    no i didnt :(

  4. Simon Wheatley
    Code for the People
    Posted 7 years ago #

    Hi. wp_redirect uses HTTP headers to perform the redirection. This redirection technique will not work if any output (even whitespace) has already been sent, therefore check this isn't the case. If it is, you will need to find another redirect method, or call wp_redirect on a hook which actions before content is sent.

Topic Closed

This topic has been closed to new replies.

About this Topic