最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

fatal error - Call to undefined function is_blog_installed(), after creating functions.php

programmeradmin7浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

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 question

I'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.

Closed. This question is off-topic. It is not currently accepting answers.

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 question

I'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.

Share Improve this question edited Jul 13, 2020 at 12:22 haxpanel asked Jul 13, 2020 at 11:25 haxpanelhaxpanel 15710 bronze badges 6
  • Where did you put your new functions.php? In a theme or a plugin? Or did you overwrite the functions.php in WordPress's wp-includes? (which is where is_blog_installed() should be defined) You should put the original back and find somewhere else to add your new code - you shouldn't be editing the core WordPress files. – Rup Commented Jul 13, 2020 at 12:09
  • Question's been updated. – haxpanel Commented Jul 13, 2020 at 12:22
  • What's /public/? How does it relate to /public.built/, which I assume is core ? I'm nervous that it is overwriting the core file somehow since it's in a folder called wp-includes - do files in /public/ override /public.built/ somehow? Perhaps you need to explicitly include ../public.built/wp-includes/functions.php at the top of your file? – Rup Commented Jul 13, 2020 at 12:26
  • That's the folder where files get copied from at deploy time. Please have a look at the Heroku-wp github project. I have tried to explicitly include functions.php but got an even worse server error. – haxpanel Commented Jul 13, 2020 at 12:33
  • OK, I'd misunderstood how they were combined. In that case I still think that public/wp-includes/functions.php is wrong because that file will end up overwriting the file from core when they're combined into public.built. Put your code in a PHP file in public/wp-content/plugins instead - the name doesn't matter - or make a folder there and and call it functions.php. – Rup Commented Jul 13, 2020 at 12:47
 |  Show 1 more comment

1 Answer 1

Reset to default 3

I'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!

发布评论

评论列表(0)

  1. 暂无评论