WordPress.org

Ready to get started?Download WordPress

Forums

Fatal Error coming from functions-post.php (5 posts)

  1. oncidium
    Member
    Posted 8 years ago #

    While updating a wp page today, I recieved this error:
    Fatal error: Call to undefined function: flush_rules() in .../blog/wp-includes/functions-post.php on line 199

    I looked at the functions-post file, and this is what seems to be causing the error:

    else if ($post_status == 'static') {
    $wp_rewrite->flush_rules();

    The page updated and saved to the database fine, so it doesn't make a huge use issue, but I'm not sure why that is happening.

  2. n8them8c
    Member
    Posted 8 years ago #

    Did you discover an answer? I am having the same problem since upgrading to WP 2.0.1. When updating a page, I get

    Fatal error: Call to undefined function: flush_rules() in .../wp-includes/functions-post.php on line 200.

    But line 200 has only some comments on it. Any clues?

  3. n8them8c
    Member
    Posted 8 years ago #

    I commented out "$wp_rewrite->flush_rules();" in my functions-post.php file and am now able to post and edit pages without a problem. I'm no php pro. Does anyone know what the flush_rules function does? Is it going to cause problems if I disable it? Thanks.

  4. bilcha
    Member
    Posted 8 years ago #

    I ran in to this as well and finally tracked it down today. Commenting out the flush_rules calls will work but it will break your ability to create permalinks for new pages.

    Problem seems to be a missing function in /wp-includes/classes.php.

    To fix it look for...


    $rules = apply_filters('rewrite_rules', $rules); // Deprecated

    return $rules;
    }

    around line 1417, below it add...

    function flush_rules() {
    generate_page_rewrite_rules();
    delete_option('rewrite_rules');
    $this->wp_rewrite_rules();
    if ( function_exists('save_mod_rewrite_rules') )
    save_mod_rewrite_rules();
    }

    What and where is easier seen here http://redalt.com/xref/trunk/nav.htm?wp-includes/classes.php.source.htm#l1417

  5. forksteel
    Member
    Posted 8 years ago #

    hey bilcha,

    tried this and this worked for me!
    one question though: you state here to use "generate_page_rewrite_rules();"
    but your trunk shows
    "generate_page_uri_index();"
    what's the difference? which should i use?

Topic Closed

This topic has been closed to new replies.

About this Topic