*/ class Wp_Hide_Backed_Notices_Admin { private $plugin_name; private $version; private $option_name = 'manage_warnings_notice'; public function __construct($plugin_name, $version) { $this->plugin_name = $plugin_name; $this->version = $version; add_action('admin_menu', array($this, 'add_custom_menu_in_dashboard')); } public function add_custom_menu_in_dashboard() { add_menu_page( __('Hide Notices', 'wp-hide-backed-notices'), __('Hide Notices', 'wp-hide-backed-notices'), 'manage_options', 'manage_notices_settings', array($this, 'warning_notices_settings'), plugin_dir_url(__FILE__) . 'images/hide-dash-menu.png', 100 ); } public function warning_notices_settings() { if ( ! current_user_can( 'manage_options' ) ) { return; } $active_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'settings'; if (isset($_POST['save_notice_box']) && check_admin_referer('save_settings_nonce', 'save_settings_nonce_field')) { $input = isset($_POST['hide_notice']) ? $_POST['hide_notice'] : array(); $clean_data = array(); foreach ($input as $key => $value) { $clean_data[sanitize_text_field($key)] = sanitize_text_field($value); } update_option($this->option_name, $clean_data); echo '
' . esc_html__('Settings Saved.', 'wp-hide-backed-notices') . '