Skip to content

Commit

Permalink
Abort activation if WP-Stateless is active.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawngee committed Sep 22, 2017
1 parent d4a7c25 commit ce4f495
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/media-upload.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

return [
"title" => "Direct Uploads",
"description" => "Provides an easy to use tool for uploading media directly to S3 or Google Cloud Storage.",
"description" => "Provides an easy to use tool for uploading media directly to Amazon S3, Minio or Google Cloud Storage.",
"class" => "ILAB\\MediaCloud\\Tools\\MediaUpload\\UploadTool",
"dependencies" => ["storage", "imgix"],
"env" => "ILAB_MEDIA_UPLOAD_ENABLED"
Expand Down
17 changes: 15 additions & 2 deletions ilab-media-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,27 @@

add_action( 'admin_notices', function () {
?>
<div class="notice notice-error is-dismissible">
<p><?php _e( 'ILAB Media Tools cannot be activated the same time as the <strong>Offload S3</strong>. Please deactive one before activating the other.', 'ilab-media-tools' ); ?></p>
<div class="notice notice-error">
<p><?php _e( 'Media Cloud cannot be activated the same time as the <strong>Offload S3</strong>. Please deactive one before activating the other.', 'ilab-media-tools' ); ?></p>
</div>
<?php
} );
return;
}

if (is_plugin_active('wp-stateless/wp-stateless-media.php')) {
deactivate_plugins( plugin_basename( __FILE__ ) );

add_action( 'admin_notices', function () {
?>
<div class="notice notice-error">
<p><?php _e( 'Media Cloud cannot be activated the same time as the <strong>WP-Stateless</strong>. Please deactive one before activating the other.', 'ilab-media-tools' ); ?></p>
</div>
<?php
} );
return;
}

// Directory defines
define('ILAB_TOOLS_DIR',dirname(__FILE__));
define('ILAB_CONFIG_DIR',ILAB_TOOLS_DIR.'/config');
Expand Down

0 comments on commit ce4f495

Please sign in to comment.