WordPress.org

Support

Support » Plugins and Hacks » Hacks » redirecting to new page after publishing the post

redirecting to new page after publishing the post

  • hi everyone,

    i have no idea how can i redirect to some page after publishing the post.
    Basically what i am trying to do is. i have created a plugin to make multiple post when selecting to multiple category. it actually created different multiple post when selected to multiple category and now after created the multiple post i want to list those post with ability to edit the custom meta of the post.

    her e is the code m using

    add_action('publish_post', 'id_publish_hook');
    
    function id_publish_hook($post_ID) {
    // running some query her
    
    // trigeting the function
    wp_custom_listby_kds($count);
    }
    function wp_custom_listby_kds($no){
    //here i want to created a page and redirect to that admin page with the value $no
    }

    any help will be appreciate thanks in advance

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    One normally would use wp_redirect() to go to another page, but like the PHP variant, it has a rather restrictive requirement that it be called before any page data (even header info) is sent to the client. I don’t know if it will work from the publish_post action or not, but it’s the first thing to try.

    If it does not work, I’m not sure what’s next, other than it would probably involve some sort of javascript solution.

Viewing 1 replies (of 1 total)
  • The topic ‘redirecting to new page after publishing the post’ is closed to new replies.
Skip to toolbar