Open jakubmisek opened 2 years ago
you are right, this needs some more explanation.
We are using this internally for our projects, although it deserves more information. Does something like this make sense?
WPDOTNET_HOTPLUG_ENABLE = 1
: plugins can be downloaded on the live website and PHP code will be compiled in-memory once the application starts, and whenever it changes during the application run.
WPDOTNET_HOTPLUG_ENABLE = 0
: any PHP code added after the application is compiled and published won't work; plugins and themes can't be downloaded on the live website. All the PHP code is compiled once during the dotnet build
.
To set this constant within ConfigureServices:
services.AddWordPress(options => {
options.Constants = new Dictionary<string, string>() {
{ "WPDOTNET_HOTPLUG_ENABLE", "0" },
};
});
Thank you @jakubmisek
Yes, this explanation is quite clear.
Apparently this feature does not work. This feature in both cases(means 0,1), it is possible to download and install the plugin and theme.
PeachPied.WordPress 5.8.2-preview12 .netcore 5
and do they work?
yes,
forexample I download and install Twenty Fifteen
theme, and set as my theme. (same for Elementor, but it seems some problem with Elementor in both WPDOTNET HOTPLUG Enabled or Disabled)
my StartUp code :
services.AddWordPress(options =>
{
options.DbHost = _appConfiguration["WordPress:Database:DbHost"];
options.DbPassword = _appConfiguration["WordPress:Database:DbPassword"];
options.DbUser = _appConfiguration["WordPress:Database:DbUser"];
options.DbName = _appConfiguration["WordPress:Database:DbName"];
options.Constants = new Dictionary<string, string>() {
{ "WPDOTNET_HOTPLUG_ENABLE", "0" },
};
});
@amira133 at https://github.com/peachpiecompiler/peachpie/issues/1020: