Skip to content

Commit 8e0963a

Browse files
committed
fix: skip dashboard widget initialization if OPTIOMLE_HIDE_ADMIN_AREA constant defined
1 parent f637944 commit 8e0963a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

inc/dashboard_widget.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class Optml_Dashboard_Widget {
2020
* Initialize the dashboard widget.
2121
*/
2222
public function init() {
23+
if ( defined( 'OPTIOMLE_HIDE_ADMIN_AREA' ) && OPTIOMLE_HIDE_ADMIN_AREA ) {
24+
return;
25+
}
2326
add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widget' ] );
2427
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_widget' ] );
2528
}

0 commit comments

Comments
 (0)