wpconfig_editor
extends WPConfigTransformer
in package
wpconfig editor class - uses WPConfigTransformer to edit wp-config.php using WP_Filesystem
Tags
Table of Contents
- ANCHOR_EOF = 'EOF'
- Append to end of file
- VERSION = '24.0903.1'
- __construct() : void
- constructor method
- add() : bool
- Adds a config to the wp-config.php file.
- exists() : bool
- Checks if a config exists in the wp-config.php file.
- get_value() : string|null
- Get the value of a config in the wp-config.php file.
- remove() : bool
- Removes a config from the wp-config.php file.
- update() : bool
- Updates an existing config in the wp-config.php file.
Constants
ANCHOR_EOF
Append to end of file
public
mixed
ANCHOR_EOF
= 'EOF'
VERSION
public
string
VERSION
= '24.0903.1'
version
Methods
__construct()
constructor method
public
__construct(string $wp_config_path) : void
Parameters
- $wp_config_path : string
-
Path to a wp-config.php file.
Return values
void —add()
Adds a config to the wp-config.php file.
public
add(string $type, string $name, string $value[, array<string|int, mixed> $options = array() ]) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
- $value : string
-
Config value.
- $options : array<string|int, mixed> = array()
-
(optional) Array of special behavior options.
Tags
Return values
bool —exists()
Checks if a config exists in the wp-config.php file.
public
exists(string $type, string $name) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Tags
Return values
bool —get_value()
Get the value of a config in the wp-config.php file.
public
get_value(string $type, string $name) : string|null
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Tags
Return values
string|null —remove()
Removes a config from the wp-config.php file.
public
remove(string $type, string $name) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
Return values
bool —update()
Updates an existing config in the wp-config.php file.
public
update(string $type, string $name, string $value[, array<string|int, mixed> $options = array() ]) : bool
Parameters
- $type : string
-
Config type (constant or variable).
- $name : string
-
Config name.
- $value : string
-
Config value.
- $options : array<string|int, mixed> = array()
-
(optional) Array of special behavior options.