Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI'd like to place some custom code in functions.php
which I'm unable to do so. Why am I getting the following errors after the creation of (even an empty) functions.php
? I'm using WP 5.4.2 with Heroku-wp
?
Fatal error: Uncaught Error: Call to undefined function is_blog_installed() in /app/public.built/wp-includes/load.php:606 Stack trace: #0 /app/public.built/wp-settings.php(161): wp_not_installed() #1 /app/public.built/wp-config.php(255): require_once('/app/public.bui...') #2 /app/public.built/wp-load.php(37): require_once('/app/public.bui...') #3 /app/public.built/wp-blog-header.php(13): require_once('/app/public.bui...') #4 /app/public.built/index.php(17): require('/app/public.bui...') #5 {main} thrown in /app/public.built/wp-includes/load.php on line 606
Fatal error: Uncaught Error: Call to undefined function get_option() in /app/public.built/wp-includes/l10n.php:69 Stack trace: #0 /app/public.built/wp-includes/l10n.php(136): get_locale() #1 /app/public.built/wp-includes/l10n.php(756): determine_locale() #2 /app/public.built/wp-includes/class-wp-fatal-error-handler.php(41): load_default_textdomain() #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in /app/public.built/wp-includes/l10n.php on line 69
I'm editing public/wp-includes/functions.php
file, not the core one. It used to work.
Questions that are too localized (such as syntax errors, code with restricted access, hacked sites, hosting or support issues) are not in scope. See how do I ask a good question?
Closed 4 years ago.
Improve this questionI'd like to place some custom code in functions.php
which I'm unable to do so. Why am I getting the following errors after the creation of (even an empty) functions.php
? I'm using WP 5.4.2 with Heroku-wp
?
Fatal error: Uncaught Error: Call to undefined function is_blog_installed() in /app/public.built/wp-includes/load.php:606 Stack trace: #0 /app/public.built/wp-settings.php(161): wp_not_installed() #1 /app/public.built/wp-config.php(255): require_once('/app/public.bui...') #2 /app/public.built/wp-load.php(37): require_once('/app/public.bui...') #3 /app/public.built/wp-blog-header.php(13): require_once('/app/public.bui...') #4 /app/public.built/index.php(17): require('/app/public.bui...') #5 {main} thrown in /app/public.built/wp-includes/load.php on line 606
Fatal error: Uncaught Error: Call to undefined function get_option() in /app/public.built/wp-includes/l10n.php:69 Stack trace: #0 /app/public.built/wp-includes/l10n.php(136): get_locale() #1 /app/public.built/wp-includes/l10n.php(756): determine_locale() #2 /app/public.built/wp-includes/class-wp-fatal-error-handler.php(41): load_default_textdomain() #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in /app/public.built/wp-includes/l10n.php on line 69
I'm editing public/wp-includes/functions.php
file, not the core one. It used to work.
1 Answer
Reset to default 3I'm editing public/wp-includes/functions.php file, not the core one. It used to work.
Ths is your problem, never modify files in the wp-includes
folder under any circumstances!.
When tutorials and articles refer to functions.php
, they're referring to the functions file in the current theme. This file does not always exist but you can create it.
I would recommend you create a child theme, to avoid your changes being lost when that theme is updated. You can also create a plugin by placing a PHP file in the plugins
folder, and placing a command at the top with /** Plugin Name: haxpanel's plugin **/
at the top. This will appear in the plugins list in the Admin dashboard for activation.
Before you do any of this though, fix your WP install by undoing the changes you made to wp-includes
. Again, never modify the files of WordPress itself. The only time you should ever modify files in wp-admin
or wp-includes
is when you're helping develop new WordPress releases. For personal sites, client sites, commercial or enterprise development, it is unnecessary, and in a lot of cases dangerous to modify those folders. Do not touch!
functions.php
but got an even worse server error. – haxpanel Commented Jul 13, 2020 at 12:33