public function remove_subscriber( EventSubscriber $subscriber ) {

		foreach ( $subscriber->get_subscribed_events() as $event => $params ) {

			if ( is_string( $params ) ) {
				$this->add_listener( $event, $params );
			} elseif ( is_array( $params ) && isset( $params[0] ) ) {

				$method   = $params[0];
				$priority = isset( $params[1] ) ? $params[1] : self::PRIORITY;

				$this->remove_listener( $event, array( $subscriber, $method ), $priority );
			} else {
				throw new \InvalidArgumentException( 'Invalid return format from EventSubscriber.' );
			}
		}

		return $this;
	}
public function remove_subscriber( EventSubscriber $subscriber ) {

		foreach ( $subscriber->get_subscribed_events() as $event => $params ) {

			if ( is_string( $params ) ) {
				$this->add_listener( $event, $params );
			} elseif ( is_array( $params ) && isset( $params[0] ) ) {

				$method   = $params[0];
				$priority = isset( $params[1] ) ? $params[1] : self::PRIORITY;

				$this->remove_listener( $event, array( $subscriber, $method ), $priority );
			} else {
				throw new \InvalidArgumentException( 'Invalid return format from EventSubscriber.' );
			}
		}

		return $this;
	}
public function remove_subscriber ( EventSubscriber $ subscriber ) { foreach ( $ subscriber -> get_subscribed_events ( ) as $ event => $ params ) { if ( is_string ( $ params ) ) { $ this -> add_listener ( $ event , $ params ) ; } elseif ( is_array ( $ params ) && isset ( $ params [ 0 ] ) ) { $ method = $ params [ 0 ] ; $ priority = isset ( $ params [ 1 ] ) ? $ params [ 1 ] : self :: PRIORITY ; $ this -> remove_listener ( $ event , array ( $ subscriber , $ method ) , $ priority ) ; } else { throw new \ InvalidArgumentException ( 'Invalid return format from EventSubscriber.' ) ; } } return $ this ; }
Remove an event subscriber.

This iterates over all of the subscribers events, and removes them as listeners.

@since 1.0

@param EventSubscriber $subscriber

@return self
Remove an event subscriber .