WordPress.org

Ready to get started?Download WordPress

Forums

permalinks update function(); (2 posts)

  1. pixelcrash
    Member
    Posted 6 years ago #

    Hello! I made a new register page for students for a class to register to the class-wordpress-blog.

    After the register with their data I automatically add a new Page to the blog - a user Profile Page with their Text and their Picture.

    I am using permalinks so the profile page is stored as
    http://www.myClass.com/blog/firstname-lastname/

    This all works perfectly just as i want it to, except one small detail.

    The permalinks will only be updated after I log-in as an Administrator and press the update permalink structure button..

    So the question is - how to I update the permalink structure right away after a student register over my self-build form page?

    thanks for helping out here!

  2. pixelcrash
    Member
    Posted 6 years ago #

    I am glad to answer my question myself

    First thing you need to do is to include("wp-config.php");
    after that you can call the function $wp_rewrite->flush_rules(); which will update all the permalinks for me it works perfectly.

    have a good one

Topic Closed

This topic has been closed to new replies.

About this Topic