I need a way to access to the wp-config.php file in WordPress, and add some values.
To be straight, I want to add this current values.
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
But I want to add them from my plugin. Are there any default WordPress functions, or something else for doing this.
Thanks beforehand.
The plugin Quick Cache adds
define('WP_CACHE', true);
when activated and removes it on deactivation. Here’s a simplified version of how it works.On activation, it replaces
<?php
with its code<?php define(etc)
:On deactivation, it searches for its code using a pattern that does not includes
<?php
(if I’m understanding it correctly) and removes it: