admin管理员组文章数量:1410682
Every time I read about making changes to wp-config.php
, the advice given is to make changes before this line:
/* That's all, stop editing! Happy publishing. */
Why?
What is special about that line? Surely the parser is smart enough to handle stuff that comes after it? There of course IS stuff that comes after it.
Every time I read about making changes to wp-config.php
, the advice given is to make changes before this line:
/* That's all, stop editing! Happy publishing. */
Why?
What is special about that line? Surely the parser is smart enough to handle stuff that comes after it? There of course IS stuff that comes after it.
Share Improve this question asked Dec 4, 2019 at 7:56 lonixlonix 3011 silver badge10 bronze badges1 Answer
Reset to default 1There's no "parser" that needs to be "smart". It's just a PHP file that runs as part of WordPress loading. The reason you need to put edits before that line is because the line that comes after it is this:
require_once( ABSPATH . 'wp-settings.php' );
And this line basically loads all of WordPress. So any definitions added to wp-config.php after that line will be useless because WordPress has already finished loading.
You could conceivably add code between the comment from your question and this line, but the existing lines that are already there are checking for the existence of the ABSPATH
constant, which means that if you wanted to redefine ABSPATH
yourself, you need to do that before the "That's all" line.
So instead of saying something silly like "Define ABSPATH before this line, but it's ok to make other changes after this line, just make sure not to make them after the last line", it just suggests making all edits above those lines.
There's no good reason to ignore this comment.
本文标签: configurationWhy edits to wpconfigphp must come before quotThat39s allquot comment
版权声明:本文标题:configuration - Why edits to wp-config.php must come before "That's all" comment 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744941442a2633512.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论