Title: Prevent Duplicate Admin Notices
Last modified: February 18, 2017

---

# Prevent Duplicate Admin Notices

 *  [erictansh](https://wordpress.org/support/users/erictansh/)
 * (@erictansh)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/prevent-duplicate-admin-notices/)
 * The plugin is causing the admin notices to appear twice.
 * I commented out one line in /scb/AdminPage.php to fix it.
 *     ```
       	/**
       	 * Constructor.
       	 *
       	 * @param string|bool $file (optional)
       	 * @param object $options (optional) A scbOptions object.
       	 *
       	 * @return void
       	 */
       	public function __construct( $file = false, $options = null ) {
       		if ( is_a( $options, 'scbOptions' ) ) {
       			$this->options = $options;
       		}
   
       		$this->setup();
       		$this->check_args();
   
       		if ( isset( $this->option_name ) ) {
       			add_action( 'admin_init', array( $this, 'option_init' ) );
       			//add_action( 'admin_notices', 'settings_errors' ); Removing this line will fix the duplicate admin notices
       		}
   
       		add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
       		add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
   
       		if ( $file ) {
       			$this->file = $file;
       			$this->plugin_url = plugin_dir_url( $file );
   
       			if ( $this->args['action_link'] ) {
       				add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
       			}
       		}
       	}
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/prevent-duplicate-admin-notices/#post-8821569)
 * Maybe you can submit a PR to the framework itself? [https://github.com/scribu/wp-scb-framework](https://github.com/scribu/wp-scb-framework)

Viewing 1 replies (of 1 total)

The topic ‘Prevent Duplicate Admin Notices’ is closed to new replies.

 * ![](https://ps.w.org/wp-useronline/assets/icon.svg?rev=978026)
 * [WP-UserOnline](https://wordpress.org/plugins/wp-useronline/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-useronline/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-useronline/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-useronline/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-useronline/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-useronline/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/prevent-duplicate-admin-notices/#post-8821569)
 * Status: not a support question