Skip to content

Commit

Permalink
add checks for wp_config.php
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Nov 2, 2019
1 parent 59baf60 commit e47243a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/WPBT/WPBT_Extras.php
Expand Up @@ -241,6 +241,10 @@ private function update_constants( $old, $new ) {
* @return void
*/
private function add_constants( $add ) {
if ( ! file_exists( self::$config_path ) ) {
return;
}

$config_transformer = new WPBT_WPConfigTransformer( self::$config_path );
$config_args = array(
'raw' => true,
Expand All @@ -261,6 +265,10 @@ private function add_constants( $add ) {
* @return void
*/
private function remove_constants( $remove ) {
if ( ! file_exists( self::$config_path ) ) {
return;
}

$config_transformer = new WPBT_WPConfigTransformer( self::$config_path );
foreach ( array_keys( $remove ) as $constant ) {
$feature_flag = strtoupper( 'wp_beta_tester_' . $constant );
Expand Down

0 comments on commit e47243a

Please sign in to comment.