is_widget_hidden(); ?>
get_data(); ( new Odyssey_Assets() )->load_admin_scripts( 'jetpack_stats_widget', 'widget-loader.min', array( 'config_variable_name' => 'jetpackStatsOdysseyWidgetConfigData', 'config_data' => $config_data, 'enqueue_css' => false, ) ); } /** * Load the admin scripts when the widget is visible. */ public function maybe_load_admin_scripts() { if ( $this->is_widget_hidden() ) { return; } $this->load_admin_scripts(); } /** * Returns true if the widget is hidden for the current screen and current user. * * @return bool */ public function is_widget_hidden() { $hidden = get_hidden_meta_boxes( get_current_screen() ); return in_array( self::DASHBOARD_WIDGET_ID, $hidden, true ); } }