• 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)
Viewing 1 replies (of 1 total)

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