包括 wp-config.local.php 文件

huangapple go评论65阅读模式
英文:

Including wp-config.local.php file

问题

我已经按照本地开发WordPress项目的设置说明进行了设置。

我想在wp-config.php中定义一些额外的常量,但根据https://ddev.readthedocs.io/en/latest/users/quickstart/#adding-configuration上的文档建议,在wp-config-ddev.php之后加载wp-config-local.php。

如果wp-config.php由ddev管理,那里的更改会在'ddev start'上被覆盖,那么建议的方法是如何包含wp-config-local.php以进行所需的更改?

我可以删除'#ddev-generated: Automatically generated WordPress settings file.'以允许更改wp-config.php文件,但这似乎与建议的方法不符。

英文:

I have followed the setup instruction for local development of a wordpress project.

I am wanting to define some additional constants in wp-config.php, but referring to the documentation at https://ddev.readthedocs.io/en/latest/users/quickstart/#adding-configuration, it suggests loading a wp-config-local.php after wp-config-ddev.php.

If the wp-config.php is managed by ddev, and changes there are overwritten on 'ddev start', what is the recommended way to include a wp-config-local.php to make my required changes?

I can remove the '#ddev-generated: Automatically generated WordPress settings file.' to enable changes to the wp-config.php file, but this doesn't seem to align with the suggested approach.

答案1

得分: 0

在这里的想法是查看WP配置文件,该文件不由DDEV管理,其中包括wp-config-ddev.php。在那个文件中,在包含wp-config-ddev.php之后,包含您的wp-config-local.php。根据您拥有的WP布局类型,有许多方法可以实现这一点...但是如果WordPress对您有用,那么wp-config-ddev.php会在某个地方被包含。找出在哪里,然后在它加载后立即加载您想要添加的配置。

英文:

The idea here is that you look at the WP config file that is not managed by DDEV, the one that includes the wp-config-ddev.php. In that file, after wp-config-ddev.php is included, include your wp-config-local.php. There are many ways to do this depending on the type of WP layout you have... but if WordPress is working for you, then wp-confid-ddev.php is being included somewhere. Figure out where, and right after it gets loaded, load the configuration you want to add.

huangapple
  • 本文由 发表于 2023年7月11日 09:36:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76658229.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定