lets do this
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
7
.idea/laravel-plugin.xml
generated
Normal file
7
.idea/laravel-plugin.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="LaravelPluginSettings">
|
||||
<option name="routerNamespace" value="" />
|
||||
<option name="mainLanguage" value="en" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/wp_staging_plugin_disabler.iml" filepath="$PROJECT_DIR$/.idea/wp_staging_plugin_disabler.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/php.xml
generated
Normal file
4
.idea/php.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.3" />
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/wp_staging_plugin_disabler.iml
generated
Normal file
8
.idea/wp_staging_plugin_disabler.iml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
28
wp-staging-plugin-disabler.php
Normal file
28
wp-staging-plugin-disabler.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Plugin Name: Wp Staging Plugin Disabler
|
||||
Plugin URI: https://cooini.com/services/dev/wordpress
|
||||
Description: This plugin will disable plugins that should be disabled in a staging environment
|
||||
Version: 1.0
|
||||
Author: sbyrd
|
||||
Author URI: https://cooini.com/
|
||||
License: MINE-all-mine
|
||||
*/
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
|
||||
$constant_requirements = ['WP_ENVIRONMENT_TYPE'=>'staging'];
|
||||
$plugins = ['fluent-smtp/fluent-smtp.php'];
|
||||
|
||||
//Loop through our constants requirements
|
||||
foreach($constant_requirements as $constant => $requirement)
|
||||
{
|
||||
if (constant($constant) === $requirement)
|
||||
{
|
||||
//Our constant requirement is meet. Plugins need to be disabled
|
||||
deactivate_plugins($plugins);
|
||||
break; // We only need one constant requirement to be meet
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user