Skip to content

Commit

Permalink
feat: add get_dev_mode()
Browse files Browse the repository at this point in the history
  • Loading branch information
j7-dev committed Jan 19, 2024
1 parent bc261b8 commit 5046bea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: WP Toolkit
* Plugin URI: https://cloud.luke.cafe/plugins/
* Description: 方便開發 WordPress 外掛的工具包。
* Version: 0.2.0
* Version: 0.2.1
* Requires at least: 5.7
* Requires PHP: 7.4
* Author: J7
Expand Down Expand Up @@ -39,7 +39,7 @@ public function __construct()
\register_deactivation_hook(__FILE__, [$this, 'deactivate']);


if (!Utils::DEV_MODE) {
if (!Utils::get_dev_mode()) {
\add_action('current_screen', [$this, 'remove_redux_banner'], 100);
\add_action('admin_menu', [$this, 'remove_redux_submenu'], 100);
}
Expand Down
6 changes: 5 additions & 1 deletion utils/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ abstract class Utils
const SNAKE = 'wp_toolkit';
const DEFAULT_IMAGE = 'http://1.gravatar.com/avatar/1c39955b5fe5ae1bf51a77642f052848?s=96&d=mm&r=g';
const GITHUB_REPO = 'https://github.com/j7-dev/wp-toolkit';
const DEV_MODE = true;

public static function get_dev_mode(): bool
{
return $_SERVER['HTTP_HOST'] === 'test.local';
}

public static function debug_log($log_line): void
{
Expand Down

0 comments on commit 5046bea

Please sign in to comment.