Support » Fixing WordPress » Theme Causes Fatal Error ("Call to undefined function wp_reset_vars()")

  • numonium

    (@numonium)


    There’s something in my theme (lots of custom-coded functions, but nothing in the WordPress core) that’s causing this message to appear when I go to {my domain}/wp-admin:

    Fatal error: Call to undefined function wp_reset_vars() in /var/www/html/wp-admin/post.php on line 17

    I tried including “wp-admin/includes/misc.php” before the call to wp_reset_vars(), but that just causes a redirect loop.

    If I delete or rename my theme folder, the error goes away. Once I try to activate or “live preview” it via WP Admin, it returns the same issue.

    What’s going on? Any help would be most appreciated!

    Thanks so much 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • I know it’s kinda late but I faced the same problem and didn’t find any resolution for most of the queries about this error here.

    So for propensity’s sake, this could be caused by include/require of a file that has the same name as another within your PHP include search path.

    The fix if this is the issue faced is to specify the full path of the actual file to be included instead of just the file name or relative path as is normally done.

    paulf100

    (@paulf100)

    I’ve just had the same issue trying to include a file called options.php in a plugin I’m writing. Xephan – your fix to include the full path worked perfectly – thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Theme Causes Fatal Error ("Call to undefined function wp_reset_vars()")’ is closed to new replies.