HEX
Server: LiteSpeed
System: Linux pulsar191.sitesanctuary.org 5.14.0-284.30.1.el9.tuxcare.els9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jan 10 17:34:05 UTC 2025 x86_64
User: lgooir (1604)
PHP: 8.1.32
Disabled: exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/lgooir/.trash/rising-bamboo/inc/app/admin/class-dev-mode.php
<?php
/**
 * RisingBambooCore.
 *
 * @package RisingBambooCore
 */

namespace RisingBambooCore\App\Admin;

use RisingBambooCore\App\App;
use RisingBambooCore\Core\Singleton;
use RisingBambooCore\Helper\Setting;

/**
 * DevMode Class.
 */
class DevMode extends Singleton {

	/**
	 * Construct.
	 */
	public function __construct() {
		add_action('admin_bar_menu', [ $this, 'admin_bar_menu_dev_mode' ], 500);
	}

	/**
	 * Custom Admin menu bar.
	 *
	 * @return void
	 */
	public function admin_bar_menu_dev_mode(): void {
		if ( Setting::get_option('development_mode') ) {
			global $wp_admin_bar;
			$wp_admin_bar->add_node(
				[
					'parent' => 'top-secondary',
					'id'     => 'rbb-dev-mode',
					'title'  => '<div style="background-color: rgb(220 38 38); color: rgb(248 250 252); padding: 0 10px">' . __('RBb Debug mode !', App::get_domain()) . '</div>',
					'meta'   => [
						'class'    => 'admin-bar-rbb-dev',
						'tabindex' => -1,
					],
				]
			);
			$override_settings        = Setting::get_option('development_override_settings');
			$override_settings_status = '<i class="rbb-icon ' . ( $override_settings ? 'rbb-icon-check-3' : 'rbb-icon-close-1' ) . '"></i>';
			$wp_admin_bar->add_node(
				[
					'parent' => 'rbb-dev-mode',
					'id'     => 'rbb-dev-override-settings',
					'title'  => '<div>' . __('Override Settings ', App::get_domain()) . $override_settings_status . '</div>',
					'meta'   => [
						'class'    => 'admin-bar-rbb-dev-override-settings',
						'tabindex' => -1,
					],
				]
			);
		}
	}
}