public function getMiddlewarePriorityForMiddleware( $middleware ) {
		if ( is_array( $middleware ) ) {
			$middleware = $middleware[0];
		}

		$increasing_priority = array_reverse( $this->middleware_priority );
		$priority = array_search( $middleware, $increasing_priority );
		return $priority !== false ? (int) $priority : -1;
	}